Interface Bag
-
- All Known Implementing Classes:
DataReuseEngine.BooleanBag
,HeftBag
,LabelBag
,PegasusBag
public interface Bag
An interface to define a BAG of objects. The bag can be then associated with other data structures, like Graph Nodes.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
add(java.lang.Object key, java.lang.Object value)
Adds an object to the underlying bag corresponding to a particular key.boolean
containsKey(java.lang.Object key)
Returns true if the namespace contains a mapping for the specified key.java.lang.Object
get(java.lang.Object key)
Returns an objects corresponding to the key passed.
-
-
-
Method Detail
-
get
java.lang.Object get(java.lang.Object key)
Returns an objects corresponding to the key passed.- Parameters:
key
- the key corresponding to which the objects need to be returned.- Returns:
- the object that is found corresponding to the key or null.
-
add
boolean add(java.lang.Object key, java.lang.Object value)
Adds an object to the underlying bag corresponding to a particular key.- Parameters:
key
- the key with which the value has to be associated.value
- the value to be associated with the key.- Returns:
- boolean indicating if insertion was successful.
-
containsKey
boolean containsKey(java.lang.Object key)
Returns true if the namespace contains a mapping for the specified key. More formally, returns true if and only if this map contains at a mapping for a key k such that (key==null ? k==null : key.equals(k)). (There can be at most one such mapping.)- Parameters:
key
- The key that you want to search for in the bag.
-
-