org.alicebot.server.core.node
Interface Nodemapper

All Known Implementing Classes:
Nodemaster

public interface Nodemapper

A Nodemapper maps the branches in a Graphmaster structure.

Author:
Richard Wallace, Noel Bush

Method Summary
 boolean containsKey(java.lang.String key)
          Tells whether the Nodemapper contains the given key.
 java.lang.Object get(java.lang.String key)
          Gets an object from the Nodemapper.
 int getHeight()
          Returns the height of the Nodemapper.
 Nodemapper getParent()
          Returns the parent of the Nodemapper
 java.util.Set keySet()
          Returns the key set for the Nodemapper.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Puts an object into the Nodemapper.
 void remove(java.lang.Object value)
          Removes a node from the Nodemapper.
 void setParent(Nodemapper parent)
          Sets the parent of the Nodemapper
 void setTop()
          Sets the height of this Nodemapper to "top", i.e.
 int size()
          Returns the size of the Nodemapper
 

Method Detail

put

java.lang.Object put(java.lang.String key,
                     java.lang.Object value)
Puts an object into the Nodemapper.

Parameters:
key - the key with which the object should be stored / will be retrieved
value - the object to be stored

get

java.lang.Object get(java.lang.String key)
Gets an object from the Nodemapper.

Parameters:
key - the key to use in retrieving the object
Returns:
the object with that key (if found)

remove

void remove(java.lang.Object value)
Removes a node from the Nodemapper.

Parameters:
value - the value to remove

keySet

java.util.Set keySet()
Returns the key set for the Nodemapper.

Returns:
the Set of keys

containsKey

boolean containsKey(java.lang.String key)
Tells whether the Nodemapper contains the given key.

Parameters:
key - the key to look for
Returns:
boolean indicating whether the Nodemapper contains the key

size

int size()
Returns the size of the Nodemapper

Returns:
the size of the Nodemapper

setParent

void setParent(Nodemapper parent)
Sets the parent of the Nodemapper

Parameters:
parent - the parent of the Nodemapper

getParent

Nodemapper getParent()
Returns the parent of the Nodemapper

Returns:
the parent of the Nodemapper

getHeight

int getHeight()
Returns the height of the Nodemapper. The height is the minimum number of words needed to reach a leaf node from here.

Returns:
the height of the Nodemapper

setTop

void setTop()
Sets the height of this Nodemapper to "top", i.e. 0 (zero), causing each ancestor n to have a minimum height of n, unless the ancestor is the root node. Not sure if this is correct.