se.sics.tasim.props
Class SimpleContent
java.lang.Object
se.sics.tasim.props.SimpleContent
- All Implemented Interfaces:
- java.io.Serializable, se.sics.isl.transport.Transportable
- Direct Known Subclasses:
- AdminContent, ServerConfig, SimulationStatus, StartInfo
public abstract class SimpleContent
- extends java.lang.Object
- implements se.sics.isl.transport.Transportable, java.io.Serializable
SimpleContent is an abstract base class for
parameterized messages. It provides functionality for setting and
getting named attributes.
Warning: serialized objects of this class might not be
compatible with future versions. Only use serialization of this
class for temporary storage or RMI using the same version of the
class.
- See Also:
- Serialized Form
|
Method Summary |
java.lang.String |
getAttribute(java.lang.String name)
|
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String defaultValue)
|
float |
getAttributeAsFloat(java.lang.String name,
float defaultValue)
|
int |
getAttributeAsInt(java.lang.String name,
int defaultValue)
|
long |
getAttributeAsLong(java.lang.String name,
long defaultValue)
|
boolean |
isLocked()
|
void |
lock()
|
protected java.lang.StringBuffer |
params(java.lang.StringBuffer buf)
|
void |
read(se.sics.isl.transport.TransportReader reader)
Reads the state for this transportable from the specified reader. |
void |
removeAttribute(java.lang.String name)
|
void |
setAttribute(java.lang.String name,
float value)
|
void |
setAttribute(java.lang.String name,
int value)
|
void |
setAttribute(java.lang.String name,
long value)
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
|
void |
write(se.sics.isl.transport.TransportWriter writer)
Writes the state for this transportable to the specified writer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface se.sics.isl.transport.Transportable |
getTransportName |
SimpleContent
protected SimpleContent()
getAttribute
public java.lang.String getAttribute(java.lang.String name)
getAttribute
public java.lang.String getAttribute(java.lang.String name,
java.lang.String defaultValue)
getAttributeAsInt
public int getAttributeAsInt(java.lang.String name,
int defaultValue)
getAttributeAsLong
public long getAttributeAsLong(java.lang.String name,
long defaultValue)
getAttributeAsFloat
public float getAttributeAsFloat(java.lang.String name,
float defaultValue)
setAttribute
public void setAttribute(java.lang.String name,
java.lang.String value)
setAttribute
public void setAttribute(java.lang.String name,
int value)
setAttribute
public void setAttribute(java.lang.String name,
long value)
setAttribute
public void setAttribute(java.lang.String name,
float value)
removeAttribute
public void removeAttribute(java.lang.String name)
isLocked
public boolean isLocked()
lock
public void lock()
params
protected java.lang.StringBuffer params(java.lang.StringBuffer buf)
read
public void read(se.sics.isl.transport.TransportReader reader)
throws java.text.ParseException
- Description copied from interface:
se.sics.isl.transport.Transportable
- Reads the state for this transportable from the specified reader.
- Specified by:
read in interface se.sics.isl.transport.Transportable
- Parameters:
reader - the reader to read data from
- Throws:
java.text.ParseException - if a parse error occurs
write
public void write(se.sics.isl.transport.TransportWriter writer)
- Description copied from interface:
se.sics.isl.transport.Transportable
- Writes the state for this transportable to the specified writer.
- Specified by:
write in interface se.sics.isl.transport.Transportable
- Parameters:
writer - the writer to write data to