org.gridlab.gat.advert
Class MetaData

java.lang.Object
  extended by org.gridlab.gat.advert.MetaData
All Implemented Interfaces:
Serializable

public class MetaData
extends Object
implements Serializable

This class describes meta data that can be attached to an Advertisable object. MetaData consists of a number of key value tuples, where both the keys and the values are strings.

Author:
rob
See Also:
Serialized Form

Constructor Summary
MetaData()
           
 
Method Summary
 String get(String key)
          Gets the value associated to the provided key.
 String getData(int i)
          Gets the value associated to the key retrieved by getKey(i).
 String getKey(int i)
          Gets the i-th key of the MetaData.
 boolean match(MetaData query)
          Match two MetaData objects.
 void put(String key, String value)
          Put an entry in the MetaData object.
 String remove(String key)
          Removes an entry specified by the provided key.
 int size()
          Returns the number of entries in the MetaData.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaData

public MetaData()
Method Detail

put

public void put(String key,
                String value)
Put an entry in the MetaData object.

Parameters:
key - the key that corresponds to the given value
value - the value that corresponds to the given key

get

public String get(String key)
Gets the value associated to the provided key.

Parameters:
key - the key for which the associated value should be retrieved
Returns:
the associated value

remove

public String remove(String key)
Removes an entry specified by the provided key.

Parameters:
key - the key for which the entry should be removed
Returns:
the associated value of the provided key

getKey

public String getKey(int i)
Gets the i-th key of the MetaData.

Parameters:
i - the position of the key
Returns:
the key at position i

getData

public String getData(int i)
Gets the value associated to the key retrieved by getKey(i).

Parameters:
i - the position of the value
Returns:
the value associated with the key at position i

size

public int size()
Returns the number of entries in the MetaData.

Returns:
the number of entries in the MetaData

match

public boolean match(MetaData query)
Match two MetaData objects. Used internally by the GAT. GAT users should not call this method.

Parameters:
query - the MetaData object to compare to.
Returns:
true: the two objects match. false: otherwise.