ist.palcom.hgraph
Class AbstractHandler

java.lang.Object
  extended by ist.palcom.hgraph.AbstractHandler
All Implemented Interfaces:
Handler
Direct Known Subclasses:
CompassCallbackHandler, CompassHandler, FuncHandler, HgraphBrowserHgraphProxyHandler, HgraphBrowserInHandler, HgraphBrowserOutHandler, HgraphManagerQueryHandler, HgraphManagerReturnHandler, HgraphProxyHandler, LiveViewHandler, MirrorInHandler, MirrorOutHandler, NodeHandler, NodeHgraphProxyHandler, PrintHandler, SwingEngineHandler, ValueHandler, VizManagerCallbackHandler

public abstract class AbstractHandler
extends java.lang.Object
implements Handler

AbstractHandler implements the basics of the Handler interface, such as getname, and tostring


Field Summary
static int DEFAULT_NUM_LOGS
           
 
Constructor Summary
AbstractHandler(int numLogs, java.lang.String name, java.lang.String description)
           
AbstractHandler(java.lang.String name, java.lang.String description)
          Constructs a Handler with a name, a description and a list of signatures
 
Method Summary
 java.lang.String getDescription()
           
 Value[] getLast(int num)
           
 java.util.Iterator getLogIterator()
           
 java.lang.String getName()
           
 void handle(HgraphEvent event)
          The handle method is invoked by the HgraphNode in which the handler is installed.
protected  void log(long time, HgraphEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ist.palcom.hgraph.Handler
getSignatures
 

Field Detail

DEFAULT_NUM_LOGS

public static final int DEFAULT_NUM_LOGS
See Also:
Constant Field Values
Constructor Detail

AbstractHandler

public AbstractHandler(java.lang.String name,
                       java.lang.String description)
Constructs a Handler with a name, a description and a list of signatures

Parameters:
name -
description -

AbstractHandler

public AbstractHandler(int numLogs,
                       java.lang.String name,
                       java.lang.String description)
Method Detail

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Handler
Returns:
A description of the purpose of the handler in prose. It should as a minimum describe the commands the handler is able to handle and the effects of it handling those
See Also:
Handler

getName

public java.lang.String getName()
Specified by:
getName in interface Handler
Returns:
The name of the handler.
See Also:
Handler

handle

public void handle(HgraphEvent event)
Description copied from interface: Handler
The handle method is invoked by the HgraphNode in which the handler is installed. This happens once the node receives an event for which it is the designatee. The handler may freely switch on the command string of the event and act accordingly

Specified by:
handle in interface Handler
See Also:
Handler

log

protected void log(long time,
                   HgraphEvent event)

getLast

public Value[] getLast(int num)
Specified by:
getLast in interface Handler

getLogIterator

public java.util.Iterator getLogIterator()
Specified by:
getLogIterator in interface Handler