unsw.cse.mica.data
Class RemoteTypeManager

java.lang.Object
  extended by unsw.cse.mica.data.RemoteTypeManager
All Implemented Interfaces:
TypeManager

public class RemoteTypeManager
extends java.lang.Object
implements TypeManager


Field Summary
 
Fields inherited from interface unsw.cse.mica.data.TypeManager
TYPE_MOB
 
Constructor Summary
RemoteTypeManager()
           
 
Method Summary
 java.util.Set getAllTypeNames()
          Get a set containing the names of all the known types in this type manager
 java.util.Set getAncestors(java.lang.String typeName)
          Get a set containing the names of all ancestors of the given type.
 java.util.Set getChildren(java.lang.String typeName)
          Get a set containing the names of all children (immediate descendants) of the given type.
 java.util.Set getDescendants(java.lang.String typeName)
          Get a set containing the names of all descendants of the given type.
 java.util.Set getParents(java.lang.String typeName)
          Get a set containing the names of all parents (immediate ancestors) of the given type.
 java.lang.String getPersistence(java.lang.String typeName)
          Get the default persistence mode for this type.
 boolean hasType(java.lang.String typeName)
          Does the type manager know about the given type?
 boolean isATypeOf(Mob mob, java.lang.String typeName)
          Is the mob an instance of typeName? This is true if isATypeOf(mob.getType(), typeName) is true.
 boolean isATypeOf(java.lang.String typeName, java.lang.String parentName)
          Is one type a subtype of another? A type is a subtype of another if the types are the same or if is a descendant of it
 void setRemoteSource(AgentActions actions)
           
 java.lang.String toXML(java.lang.String initIndent, java.lang.String otherIndent)
          Create an XML representation of the type manager
 void update()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteTypeManager

public RemoteTypeManager()
Method Detail

setRemoteSource

public void setRemoteSource(AgentActions actions)

update

public void update()
            throws TransportException
Throws:
TransportException

hasType

public boolean hasType(java.lang.String typeName)
Description copied from interface: TypeManager
Does the type manager know about the given type?

Specified by:
hasType in interface TypeManager
Returns:
true if the type is known, false otherwise

getPersistence

public java.lang.String getPersistence(java.lang.String typeName)
Description copied from interface: TypeManager
Get the default persistence mode for this type.

Specified by:
getPersistence in interface TypeManager
Returns:
the default persistence mode for this type, or null if no default persistence is specified.

isATypeOf

public boolean isATypeOf(Mob mob,
                         java.lang.String typeName)
Description copied from interface: TypeManager
Is the mob an instance of typeName? This is true if isATypeOf(mob.getType(), typeName) is true.

Specified by:
isATypeOf in interface TypeManager
Returns:
true if the mob is an instance of the given type, false otherwise

isATypeOf

public boolean isATypeOf(java.lang.String typeName,
                         java.lang.String parentName)
Description copied from interface: TypeManager
Is one type a subtype of another? A type is a subtype of another if the types are the same or if is a descendant of it

Specified by:
isATypeOf in interface TypeManager
Returns:
true if typeName is a subtype of parentName, false otherwise

getAllTypeNames

public java.util.Set getAllTypeNames()
Description copied from interface: TypeManager
Get a set containing the names of all the known types in this type manager

Specified by:
getAllTypeNames in interface TypeManager
Returns:
a set containing all the known type names for this type manager

getParents

public java.util.Set getParents(java.lang.String typeName)
Description copied from interface: TypeManager
Get a set containing the names of all parents (immediate ancestors) of the given type.

Specified by:
getParents in interface TypeManager
Parameters:
typeName - the type for which the parents are requested
Returns:
a set containing the names of all the parents of the given type

getChildren

public java.util.Set getChildren(java.lang.String typeName)
Description copied from interface: TypeManager
Get a set containing the names of all children (immediate descendants) of the given type.

Specified by:
getChildren in interface TypeManager
Parameters:
typeName - the type for which the children are requested
Returns:
a set containing the names of all the children of the given type

getAncestors

public java.util.Set getAncestors(java.lang.String typeName)
Description copied from interface: TypeManager
Get a set containing the names of all ancestors of the given type.

Specified by:
getAncestors in interface TypeManager
Parameters:
typeName - the type for which the ancestors are requested
Returns:
a set containing the names of all the ancestors of the given type

getDescendants

public java.util.Set getDescendants(java.lang.String typeName)
Description copied from interface: TypeManager
Get a set containing the names of all descendants of the given type.

Specified by:
getDescendants in interface TypeManager
Parameters:
typeName - the type for which the descendants are requested
Returns:
a set containing the names of all the descendants of the given type

toXML

public java.lang.String toXML(java.lang.String initIndent,
                              java.lang.String otherIndent)
Description copied from interface: TypeManager
Create an XML representation of the type manager

Specified by:
toXML in interface TypeManager
Parameters:
initIndent - the per-line indent for the entire XML string (which may be multi-line)
otherIndent - additioanl indentation for nested elements
Returns:
a string that is an XML representation of the current state of the type manager