org.freehep.util.io
Class Action

java.lang.Object
  extended by org.freehep.util.io.Action
Direct Known Subclasses:
Action.Unknown

public abstract class Action
extends Object

Generic Action, to be used with the TagIn/OutputStreams. An action can have an ActionCode, a length as well as parameters.

Version:
$Id: Action.java 8584 2006-08-10 23:06:37Z duns $
Author:
Mark Donszelmann, Charles Loomis

Nested Class Summary
static class Action.Unknown
          Used for not recognized actions.
 
Constructor Summary
protected Action(int code)
           
 
Method Summary
 int getCode()
           
 String getName()
           
abstract  Action read(int actionCode, TaggedInputStream input, int length)
          Read an action from the input, with given actioncode and length
 String toString()
           
abstract  void write(int actionCode, TaggedOutputStream output)
          Write an action to output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Action

protected Action(int code)
Method Detail

read

public abstract Action read(int actionCode,
                            TaggedInputStream input,
                            int length)
                     throws IOException
Read an action from the input, with given actioncode and length

Parameters:
actionCode - decoded actionCode
input - input to read from
length - length to read
Returns:
action corresponding to actionCode
Throws:
IOException - if read fails

write

public abstract void write(int actionCode,
                           TaggedOutputStream output)
                    throws IOException
Write an action to output

Parameters:
actionCode - actionCode to use for this action
output - output to write to
Throws:
IOException - if write fails

getCode

public int getCode()
Returns:
actionCode

getName

public String getName()
Returns:
name of the action

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2000-2007 FreeHEP. All Rights Reserved.