|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.iperg.part.core.IpEvent
public class IpEvent
IpEvent
is the base class of all platform events.
Events are identified primarily by their type (a string), which
must be given when instantiating the IpEvent
class. The class does not define a set of possible event types, and
any string may thus be used when creating an event:
IpEvent event = new IpEvent("aType");
All events have a destination, which is identified by an
IpIdentifier
instance. The destination is typically
some kind of object to which the event should be delivered. When
IpEvent
is instantiated using new
, the
destination identifier is set to null
.
Constructor Summary | |
---|---|
protected |
IpEvent()
Create a new (empty) event. |
|
IpEvent(java.lang.String type)
Create a new event of the given type. |
Method Summary | |
---|---|
IpIdentifier |
getDestination()
Get the identifier of the object to which this event is destined. |
java.lang.String |
getType()
Get the event type |
protected void |
read(IpInputStream stream)
Read the event state from an input stream. |
protected void |
setDestination(IpIdentifier destId)
Set the identifier of the object for which the event is destined. |
protected void |
write(IpOutputStream stream)
Write the event state into an output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IpEvent(java.lang.String type)
type
- The event typeprotected IpEvent()
Method Detail |
---|
public java.lang.String getType()
public IpIdentifier getDestination()
protected void setDestination(IpIdentifier destId)
destId
- The identifier of the destination objectprotected void write(IpOutputStream stream) throws java.io.IOException
IpEvent
must call
IpEvent.write
if they add a write method. A class
specific write method must therefore look like this:
public void write(IpOutputStream stream) throws IOException { // write class specific state information ... // then let IpEvent write its state super.write(stream); // call IpEvent.write }
stream
- The output stream into which the event state
should be written
java.io.IOException
- if an io exception occured while writing
the event to the streamprotected void read(IpInputStream stream) throws java.io.IOException
IpEvent
must call
IpEvent.read
if they add a read method. A class
specific read method must therefore look like this:
public void read(IpInputStream stream) throws IOException { // read class specific state information ... // then let IpEvent read its state super.read(stream); // call IpEvent.read }
stream
- The input stream from which the event should be
read
java.io.IOException
- if an io exception occured while reading
the event from the stream
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |