Class LabelBag
- java.lang.Object
-
- edu.isi.pegasus.planner.partitioner.graph.LabelBag
-
- All Implemented Interfaces:
Bag
public class LabelBag extends java.lang.Object implements Bag
A bag implementation that just holds a particular value for the label key. This bag implements just contains one object, and a null value is associated by default with the label.- Version:
- $Revision$
- Author:
- Karan Vahi
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
LABEL_KEY
The default key that is associated with label.private java.lang.Object
mPartitionID
The value for the partition key.private java.lang.Object
mValue
The value for the Label.static java.lang.String
PARTITION_KEY
The key that designates the partition to which a node belongs to.
-
Constructor Summary
Constructors Constructor Description LabelBag()
The default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.static void
setLabelKey(java.lang.String key)
Sets the label key that is to be associated with the bag.java.lang.String
toString()
Returns a textual description of the Bag.
-
-
-
Field Detail
-
LABEL_KEY
public static java.lang.String LABEL_KEY
The default key that is associated with label.
-
PARTITION_KEY
public static final java.lang.String PARTITION_KEY
The key that designates the partition to which a node belongs to.- See Also:
- Constant Field Values
-
mValue
private java.lang.Object mValue
The value for the Label.
-
mPartitionID
private java.lang.Object mPartitionID
The value for the partition key.
-
-
Method Detail
-
setLabelKey
public static void setLabelKey(java.lang.String key)
Sets the label key that is to be associated with the bag.
-
get
public java.lang.Object get(java.lang.Object key)
Returns an objects corresponding to the key passed.
-
add
public boolean add(java.lang.Object key, java.lang.Object value)
Adds an object to the underlying bag corresponding to a particular key.
-
containsKey
public 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.)- Specified by:
containsKey
in interfaceBag
- Parameters:
key
- The key that you want to search for in the bag.
-
toString
public java.lang.String toString()
Returns a textual description of the Bag.- Overrides:
toString
in classjava.lang.Object
- Returns:
- String
-
-