| |
|
| java.lang.Object org.griphyn.cPlanner.partitioner.LabelBag
LabelBag | public class LabelBag implements Bag(Code) | | 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.
author: Karan Vahi version: $Revision: 50 $ |
Field Summary | |
public static String | LABEL_KEY The default key that is associated with label. | final public static String | PARTITION_KEY The key that designates the partition to which a node belongs to. |
Constructor Summary | |
public | LabelBag() The default constructor. |
Method Summary | |
public boolean | add(Object key, Object value) Adds an object to the underlying bag corresponding to a particular key. | public boolean | containsKey(Object key) Returns true if the namespace contains a mapping for the specified key. | public Object | get(Object key) Returns an objects corresponding to the key passed.
Parameters: key - the key corresponding to which the objects need to be returned. | public static void | setLabelKey(String key) Sets the label key that is to be associated with the bag. | public String | toString() Returns a textual description of the Bag. |
LABEL_KEY | public static String LABEL_KEY(Code) | | The default key that is associated with label.
|
PARTITION_KEY | final public static String PARTITION_KEY(Code) | | The key that designates the partition to which a node belongs to.
|
LabelBag | public LabelBag()(Code) | | The default constructor.
|
add | public boolean add(Object key, Object value)(Code) | | Adds an object to the underlying bag corresponding to a particular key.
Parameters: key - the key with which the value has to be associated. Parameters: value - the value to be associated with the key. |
containsKey | public boolean containsKey(Object key)(Code) | | 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. |
get | public Object get(Object key)(Code) | | Returns an objects corresponding to the key passed.
Parameters: key - the key corresponding to which the objects need to be returned. the object that is found corresponding to the key or null. |
setLabelKey | public static void setLabelKey(String key)(Code) | | Sets the label key that is to be associated with the bag.
|
toString | public String toString()(Code) | | Returns a textual description of the Bag.
String |
|
|
|