elge.memory
Class Memory

java.lang.Object
  |
  +--elge.memory.Memory

public class Memory
extends Object

Memory is a simple object holder with an interface to easily acces the learned objects.

You can extends this class to make variation of memory, like memory that can lost some knowleadge in a time.. and so on...

Author:
Pavol Žibrita

Field Summary
protected  Vector knownObjects
          The learned objects till now
 
Constructor Summary
Memory()
          Creates a new instance of Memory
 
Method Summary
 boolean doIKnow(Object o)
          Checks if the object is known.
 void forget(Object o)
          Remove the object from memory..
 Vector getKnownObjects()
          Returns the known objects by this memory.
 void learn(Object o)
          Just add a new object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

knownObjects

protected Vector knownObjects
The learned objects till now

Constructor Detail

Memory

public Memory()
Creates a new instance of Memory

Method Detail

doIKnow

public boolean doIKnow(Object o)
Checks if the object is known.

Parameters:
o - object to search
Returns:
true if the obejct is present in memory

learn

public void learn(Object o)
Just add a new object

Parameters:
o - the object to learn

forget

public void forget(Object o)
Remove the object from memory..

Parameters:
o - what object to remove

getKnownObjects

public Vector getKnownObjects()
Returns the known objects by this memory.

Returns:
Vector of known objects