org.pandora.sense.context
Class Context

java.lang.Object
  extended by org.pandora.sense.BasicSense
      extended by org.pandora.sense.context.Context
All Implemented Interfaces:
Sense

public class Context
extends BasicSense

Allows a vertices to be explicitly selected. Allows thought to associate the current context with the selection. Similar to vision or touch focusing on an object.


Field Summary
static int CONTEXT_SIZE
           
 
Fields inherited from class org.pandora.sense.BasicSense
DEFAULT_SPEAKER, RETRY
 
Constructor Summary
Context()
           
 
Method Summary
 void clear()
          Clear the current context.
 java.util.List<Vertex> getContextStack()
           
 Selector getSelector()
          Return the selector used to access the current selection.
 void input(java.lang.Object input)
          Process the input.
 void output(Vertex output)
          Set the vertex as the current selection.
 void push(Vertex vertex)
          Add the vertex to the context.
 Vertex search(Vertex varible)
          Return the first element on the stack matching the variable.
 void setSelector(Selector selector)
          Set the selector used to access the current selection.
 Vertex top()
          Return the top of the context stack.
 java.lang.String toString()
           
 
Methods inherited from class org.pandora.sense.BasicSense
awake, getEmotionalState, getLanguageState, getName, getPandora, getPrimitive, getShortTermMemory, initialize, input, isEnabled, log, log, log, setEmotionalState, setIsEnabled, setLanguageState, setName, setPandora, shutdown
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTEXT_SIZE

public static int CONTEXT_SIZE
Constructor Detail

Context

public Context()
Method Detail

getContextStack

public java.util.List<Vertex> getContextStack()

top

public Vertex top()
Return the top of the context stack.


clear

public void clear()
Clear the current context.


search

public Vertex search(Vertex varible)
Return the first element on the stack matching the variable.


push

public void push(Vertex vertex)
Add the vertex to the context.


getSelector

public Selector getSelector()
Return the selector used to access the current selection.


setSelector

public void setSelector(Selector selector)
Set the selector used to access the current selection.


input

public void input(java.lang.Object input)
Process the input. Add the vertex to active memory

Specified by:
input in interface Sense
Overrides:
input in class BasicSense

output

public void output(Vertex output)
Set the vertex as the current selection.

Specified by:
output in interface Sense
Overrides:
output in class BasicSense

toString

public java.lang.String toString()
Overrides:
toString in class BasicSense