edu.umich.eecs.tac.props
Class AbstractKeyedEntry<T>

java.lang.Object
  extended by edu.umich.eecs.tac.props.AbstractKeyedEntry<T>
Type Parameters:
T - key type
All Implemented Interfaces:
KeyedEntry<T>, java.io.Serializable, se.sics.isl.transport.Transportable
Direct Known Subclasses:
AbstractStringEntry, AbstractTransportableEntry

public abstract class AbstractKeyedEntry<T>
extends java.lang.Object
implements KeyedEntry<T>

This class provides a skeletal implementation of the KeyedEntry interface.

Author:
Patrick Jordan
See Also:
Serialized Form

Constructor Summary
AbstractKeyedEntry()
           
 
Method Summary
 T getKey()
          Returns the key for the entry.
 java.lang.String getTransportName()
          Returns the simple name of the implementing class.
 void read(se.sics.isl.transport.TransportReader reader)
          Reads the state from the TransportReader.
protected abstract  void readEntry(se.sics.isl.transport.TransportReader reader)
          Reads the entry state from the TransportReader.
protected abstract  void readKey(se.sics.isl.transport.TransportReader reader)
          Reads the entry key from the TransportReader.
 void setKey(T key)
          Sets the key for the entry.
 void write(se.sics.isl.transport.TransportWriter writer)
          Writes the state to the TransportWriter.
protected abstract  void writeEntry(se.sics.isl.transport.TransportWriter writer)
          Writes the entry state to the TransportWriter.
protected abstract  void writeKey(se.sics.isl.transport.TransportWriter writer)
          Writes the entry key to the TransportWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractKeyedEntry

public AbstractKeyedEntry()
Method Detail

getKey

public final T getKey()
Returns the key for the entry.

Specified by:
getKey in interface KeyedEntry<T>
Returns:
the key for the entry.

setKey

public final void setKey(T key)
Sets the key for the entry.

Parameters:
key - the key for the entry.

getTransportName

public final java.lang.String getTransportName()
Returns the simple name of the implementing class.

Specified by:
getTransportName in interface se.sics.isl.transport.Transportable
Returns:
the simple name of the implementing class.

read

public final void read(se.sics.isl.transport.TransportReader reader)
                throws java.text.ParseException
Reads the state from the TransportReader. The readEntry(se.sics.isl.transport.TransportReader) method will be called first and then the readKey(se.sics.isl.transport.TransportReader).

Specified by:
read in interface se.sics.isl.transport.Transportable
Parameters:
reader - the reader to read the state in from.
Throws:
java.text.ParseException - if a parse exception occurs

write

public final void write(se.sics.isl.transport.TransportWriter writer)
Writes the state to the TransportWriter. The writeEntry(se.sics.isl.transport.TransportWriter) method will be called first and then the writeKey(se.sics.isl.transport.TransportWriter).

Specified by:
write in interface se.sics.isl.transport.Transportable
Parameters:
writer - the writer to write the state to

readEntry

protected abstract void readEntry(se.sics.isl.transport.TransportReader reader)
                           throws java.text.ParseException
Reads the entry state from the TransportReader. The attributes should be read in first, then the nodes.

Parameters:
reader - the reader to read the state in from.
Throws:
java.text.ParseException - if a parse exception occurs

readKey

protected abstract void readKey(se.sics.isl.transport.TransportReader reader)
                         throws java.text.ParseException
Reads the entry key from the TransportReader. This method requirs that the key be in node form.

Parameters:
reader - the reader to read the key in from.
Throws:
java.text.ParseException - if a parse exception occurs

writeEntry

protected abstract void writeEntry(se.sics.isl.transport.TransportWriter writer)
Writes the entry state to the TransportWriter. The attributes should be written in first, then the nodes.

Parameters:
writer - the writer to write the entry state to

writeKey

protected abstract void writeKey(se.sics.isl.transport.TransportWriter writer)
Writes the entry key to the TransportWriter. The key must be written in node form.

Parameters:
writer - the writer to write the key to


Copyright © 2007-2009 Association for Trading Agent Research. All Rights Reserved.