org.griphyn.cPlanner.partitioner
Interface Bag

All Known Implementing Classes:
LabelBag

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: 50 $
Author:
Karan Vahi

Method Summary
 boolean add(Object key, Object value)
          Adds an object to the underlying bag corresponding to a particular key.
 boolean containsKey(Object key)
          Returns true if the namespace contains a mapping for the specified key.
 Object get(Object key)
          Returns an objects corresponding to the key passed.
 

Method Detail

get

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.
Returns:
the object that is found corresponding to the key or null.

add

boolean add(Object key,
            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(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.


Copyright © 2007 The University of Southern California. All Rights Reserved.