sub_arctic.input
Class input_policy

java.lang.Object
  |
  +--sub_arctic.input.input_policy
Direct Known Subclasses:
focus_policy_class, positional_policy_class

public abstract class input_policy
extends java.lang.Object

Abstract base class for all input policies. An input policy is an object which uses a set of agents to deliver an event according to a particular policy (such as the positional policy that delivers events based on their position). This class provides the basic API along with implementation of an agent list and related manipulation methods.


Field Summary
protected  java.util.Vector _agent_list
          The agent list for this policy.
 
Constructor Summary
input_policy()
          Simple constructor
 
Method Summary
 void add_agent_after(dispatch_agent add, dispatch_agent after)
          Add an agent to the agent list after the one given.
 void add_agent_before(dispatch_agent add, dispatch_agent before)
          Add an agent to the agent list before the one given.
 dispatch_agent agent(int indx)
          Return the agent at a given index in the agent list.
abstract  boolean dispatch_event(event evt)
          Attempt to dispatch an event under this policy.
 int num_agents()
          The number of agents in the policies agent list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_agent_list

protected java.util.Vector _agent_list
The agent list for this policy. This contains dispatch_agent objects.
Constructor Detail

input_policy

public input_policy()
Simple constructor
Method Detail

num_agents

public int num_agents()
The number of agents in the policies agent list.

agent

public dispatch_agent agent(int indx)
Return the agent at a given index in the agent list.
Parameters:
int - indx the index of the agent we want.

add_agent_after

public void add_agent_after(dispatch_agent add,
                            dispatch_agent after)
Add an agent to the agent list after the one given. If after is coded as null, then the agent is placed at the end of the agent list.
Parameters:
dispatch_agent - add the agent to add to the list.
dispatch_agent - after the agent to place it after (or null to indicate that it should go at the end of the list).

add_agent_before

public void add_agent_before(dispatch_agent add,
                             dispatch_agent before)
Add an agent to the agent list before the one given. If before is coded as null, then the agent is placed at the beginning of the agent list.
Parameters:
dispatch_agent - add the agent to add to the list.
dispatch_agent - after the agent to place it before (or null to indicate that it should go at the beginning of the list).

dispatch_event

public abstract boolean dispatch_event(event evt)
Attempt to dispatch an event under this policy.
Parameters:
event - evt the event to dispatch.
Returns:
boolean indicating whether the event was dispatched and consumed.