cast.core.CASTWorkingMemory Class Reference

Inheritance diagram for cast.core.CASTWorkingMemory:

cast.core.CASTWorkingMemoryInterface

List of all members.

Public Member Functions

 CASTWorkingMemory ()
WorkingMemoryEntry[] getArrayByType (String _type, int _count)
Collection< WorkingMemoryEntrygetByType (String _type, int _count)
Collection< WorkingMemoryEntrygetByType (String _type)
String toString ()
boolean add (String _id, WorkingMemoryEntry _data)
boolean overwrite (String _id, WorkingMemoryEntry _data)
WorkingMemoryEntry remove (String _id)
WorkingMemoryEntry get (String _id)
ArrayList< String > getIDsByType (String _type, int _count)
int size ()
boolean contains (String _queryID)
boolean hasContained (String _queryID)
int getOverwriteCount (String _queryID)


Detailed Description

Class that actually operates as a working memory. May eventually implement this in C++ and import via the JNI to ease cross-language development.

Author:
nah

Definition at line 42 of file CASTWorkingMemory.java.


Constructor & Destructor Documentation

cast.core.CASTWorkingMemory.CASTWorkingMemory (  ) 

Create a new working memory object.

Definition at line 56 of file CASTWorkingMemory.java.


Member Function Documentation

boolean cast.core.CASTWorkingMemory.add ( String  _id,
WorkingMemoryEntry  _data 
) [virtual]

Adds item to working memory with given id. Does not overwrite data if id already exists.

Parameters:
_id The id of the entry.
_type The ontological type of the entry.
_data The data itself.
Returns:
Returns true if the item is added (i.e. not a duplicate id)

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 173 of file CASTWorkingMemory.java.

boolean cast.core.CASTWorkingMemory.contains ( String  _queryID  )  [virtual]

Whether the wm currently contains an entry with the given id.

Parameters:
_queryID 
Returns:

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 306 of file CASTWorkingMemory.java.

WorkingMemoryEntry cast.core.CASTWorkingMemory.get ( String  _id  )  [virtual]

Get the item with the given id.

Parameters:
_id The specified item or null if it does not exist.

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 234 of file CASTWorkingMemory.java.

WorkingMemoryEntry [] cast.core.CASTWorkingMemory.getArrayByType ( String  _type,
int  _count 
)

Get an array of memory items with the given type.

Parameters:
_type The type to check.
_count The number of entries to return. If 0 all matching entries are returned.
Returns:
An array of matching entries.

Definition at line 71 of file CASTWorkingMemory.java.

Collection<WorkingMemoryEntry> cast.core.CASTWorkingMemory.getByType ( String  _type  )  [virtual]

Get all working memory entries with given type.

Parameters:
_type The type to check.
Returns:
All matching items from working memory.

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 114 of file CASTWorkingMemory.java.

Collection<WorkingMemoryEntry> cast.core.CASTWorkingMemory.getByType ( String  _type,
int  _count 
) [virtual]

Get a collection of memory items with the given ontological type.

Parameters:
_type The type to check.
_count The number of entries to return. If 0 all matching entries are returned.
Returns:
A collection of matching entries.

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 84 of file CASTWorkingMemory.java.

ArrayList<String> cast.core.CASTWorkingMemory.getIDsByType ( String  _type,
int  _count 
) [virtual]

Gets the n most recent ids of entries with the given type.

Parameters:
_type The type to check.
_count The number of ids to return. If 0 all matching items are return.
Returns:
All matching items.

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 244 of file CASTWorkingMemory.java.

int cast.core.CASTWorkingMemory.getOverwriteCount ( String  _queryID  )  [virtual]

Parameters:
_queryID 
Returns:

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 328 of file CASTWorkingMemory.java.

boolean cast.core.CASTWorkingMemory.hasContained ( String  _queryID  )  [virtual]

* Whether the wm has ever contained an entry with the given id.

Parameters:
_queryID 
Returns:

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 316 of file CASTWorkingMemory.java.

boolean cast.core.CASTWorkingMemory.overwrite ( String  _id,
WorkingMemoryEntry  _data 
) [virtual]

Overwrites item with given id. Does not do anything if id does not exist.

Parameters:
_id The id of the entry.
_type The ontological type of the entry.
_data The data itself.
Returns:
Returns true if the id exists for overwriting

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 199 of file CASTWorkingMemory.java.

WorkingMemoryEntry cast.core.CASTWorkingMemory.remove ( String  _id  )  [virtual]

Removes the item with the given id.

Parameters:
_id The id of the entry.
Returns:
Returns true if the id is removed.

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 216 of file CASTWorkingMemory.java.

int cast.core.CASTWorkingMemory.size (  )  [virtual]

Get the current size of the working memory.

Returns:
The size of working memory.

Implements cast.core.CASTWorkingMemoryInterface.

Definition at line 297 of file CASTWorkingMemory.java.

String cast.core.CASTWorkingMemory.toString (  ) 

Returns a formatted representation of the object. If an ontology is set then the wm attempts to use this to format the contents of memory.

Returns:
The object as in string format.

Definition at line 125 of file CASTWorkingMemory.java.


The documentation for this class was generated from the following file:

Generated on Mon Jun 13 15:55:47 2011 for CAST Java by  doxygen 1.5.8