com.googlecode.sarasvati.hib
Class HibTokenSet

java.lang.Object
  extended by com.googlecode.sarasvati.hib.HibTokenSet
All Implemented Interfaces:
TokenSet

public class HibTokenSet
extends Object
implements TokenSet


Constructor Summary
HibTokenSet(HibGraphProcess process, String name, int maxMemberIndex)
           
 
Method Summary
 boolean equals(Object obj)
           
 Set<ArcToken> getActiveArcTokens(Engine engine)
          Returns the list of active (non-completed) arc tokens which are members of this token set.
 Set<NodeToken> getActiveNodeTokens(Engine engine)
          Returns the list of active (non-completed) node tokens which are members of this token set.
 Set<ArcTokenSetMember> getArcTokenSetMembers()
           
 Map<String,String> getAttrMap()
           
 Env getEnv()
          A token set provides an environment into which attributes can be stored.
 Long getId()
           
 int getMaxMemberIndex()
          Returns the maximum member index that a member of this token set may have.
 Set<HibTokenSetMemberAttribute> getMemberAttributes()
           
 TokenSetMemberEnv getMemberEnv()
          In addition to provide an environment which is shared across all members of the token set (see TokenSet.getEnv()), the token set also provides an environment which allows setting attributes per member index.
 String getName()
          Returns the name given to this token set.
 Set<NodeTokenSetMember> getNodeTokenSetMembers()
           
 HibGraphProcess getProcess()
          Returns the process that this token set belongs to.
 int hashCode()
           
 boolean isComplete()
          Returns true if the token set has been join on and contains no more active tokens, and false otherwise.
 void markComplete(Engine engine)
          Marks this token set as being complete, in the sense that a token set join has been performed on the token set.
 void reactivateForBacktrack(Engine engine)
          If a node or arc token in a previously completed token set is backtracked into, the token set should be marked as incomplete again.
 void setArcTokenSetMembers(Set<ArcTokenSetMember> arcTokenSetMembers)
           
 void setAttrMap(Map<String,String> attrMap)
           
 void setComplete(boolean complete)
           
 void setId(Long id)
           
 void setMaxMemberIndex(int maxMemberIndex)
           
 void setMemberAttributes(Set<HibTokenSetMemberAttribute> memberAttributes)
           
 void setName(String name)
           
 void setNodeTokenSetMembers(Set<NodeTokenSetMember> nodeTokenSetMembers)
           
 void setProcess(HibGraphProcess process)
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibTokenSet

public HibTokenSet(HibGraphProcess process,
                   String name,
                   int maxMemberIndex)
Method Detail

getId

public Long getId()

setId

public void setId(Long id)

getName

public String getName()
Description copied from interface: TokenSet
Returns the name given to this token set.

Specified by:
getName in interface TokenSet
Returns:
The name given to this token set.

setName

public void setName(String name)

getProcess

public HibGraphProcess getProcess()
Description copied from interface: TokenSet
Returns the process that this token set belongs to.

Specified by:
getProcess in interface TokenSet
Returns:
The process that this token set belongs to.

setProcess

public void setProcess(HibGraphProcess process)

getMaxMemberIndex

public int getMaxMemberIndex()
Description copied from interface: TokenSet
Returns the maximum member index that a member of this token set may have.

Specified by:
getMaxMemberIndex in interface TokenSet
Returns:
the maximum member index that a member of this token set may have

setMaxMemberIndex

public void setMaxMemberIndex(int maxMemberIndex)

getAttrMap

public Map<String,String> getAttrMap()

setAttrMap

public void setAttrMap(Map<String,String> attrMap)

getArcTokenSetMembers

public Set<ArcTokenSetMember> getArcTokenSetMembers()

setArcTokenSetMembers

public void setArcTokenSetMembers(Set<ArcTokenSetMember> arcTokenSetMembers)

getNodeTokenSetMembers

public Set<NodeTokenSetMember> getNodeTokenSetMembers()

setNodeTokenSetMembers

public void setNodeTokenSetMembers(Set<NodeTokenSetMember> nodeTokenSetMembers)

getEnv

public Env getEnv()
Description copied from interface: TokenSet
A token set provides an environment into which attributes can be stored. This environment is shared across all tokens which are members of the environment.

Specified by:
getEnv in interface TokenSet
Returns:
The token set environment

getMemberEnv

public TokenSetMemberEnv getMemberEnv()
Description copied from interface: TokenSet
In addition to provide an environment which is shared across all members of the token set (see TokenSet.getEnv()), the token set also provides an environment which allows setting attributes per member index.

The member environment also allows setting attributes per index via list.

Specified by:
getMemberEnv in interface TokenSet
Returns:
The token set member environment.

getMemberAttributes

public Set<HibTokenSetMemberAttribute> getMemberAttributes()

setMemberAttributes

public void setMemberAttributes(Set<HibTokenSetMemberAttribute> memberAttributes)

getActiveArcTokens

public Set<ArcToken> getActiveArcTokens(Engine engine)
Description copied from interface: TokenSet
Returns the list of active (non-completed) arc tokens which are members of this token set.

Specified by:
getActiveArcTokens in interface TokenSet
Parameters:
engine - The engine executing the current process. May be required in order to load the token list.
Returns:
the collection of active (non-completed) arc tokens which are members of this token set.

getActiveNodeTokens

public Set<NodeToken> getActiveNodeTokens(Engine engine)
Description copied from interface: TokenSet
Returns the list of active (non-completed) node tokens which are members of this token set.

Specified by:
getActiveNodeTokens in interface TokenSet
Parameters:
engine - The engine executing the current process. May be required in order to load the token list.
Returns:
the list of active (non-completed) node tokens which are members of this token set.

isComplete

public boolean isComplete()
Description copied from interface: TokenSet
Returns true if the token set has been join on and contains no more active tokens, and false otherwise.

Specified by:
isComplete in interface TokenSet
Returns:
True if the token set has been join on and contains no more active tokens, and false otherwise.

setComplete

public void setComplete(boolean complete)

markComplete

public void markComplete(Engine engine)
Description copied from interface: TokenSet
Marks this token set as being complete, in the sense that a token set join has been performed on the token set.

Specified by:
markComplete in interface TokenSet

reactivateForBacktrack

public void reactivateForBacktrack(Engine engine)
Description copied from interface: TokenSet
If a node or arc token in a previously completed token set is backtracked into, the token set should be marked as incomplete again.

Specified by:
reactivateForBacktrack in interface TokenSet
Parameters:
engine - The engine currently executing

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object