|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdanbikel.switchboard.NumberedObject
public class NumberedObject
A class to bundle an object with an integer that represents the order in which the object was discovered in its input file or stream (the object's number), as well as a flag to indicate whether the object has been processed. Objects of this type are used by the switchboard.
Switchboard
,
Serialized FormConstructor Summary | |
---|---|
NumberedObject(int number,
boolean processed,
Object obj)
Constructs a new NumberedObject object with the
specified object, processed flag and object number. |
Method Summary | |
---|---|
int |
compareTo(Object obj)
This allows ordering of objects by their number. |
boolean |
equals(Object obj)
|
Object |
get()
Returns the underlying object. |
int |
number()
Returns the number of the underlying object. |
boolean |
processed()
Returns whether the underlying object has been processed. |
void |
set(Object obj)
Sets the underlying object to be the specified object. |
void |
setProcessed()
Sets the processed flag to true . |
void |
setProcessed(boolean processed)
Sets the processed flag, indicating whether this object was successfully processed. |
String |
toString()
Returns a string of the form (number processed objectStr), where processed is the output of String.valueOf(boolean) when passed the processed
flag of this object
objectStr is the result of calling the underlying object's
toString method
This is the format that is written by the TextObjectWriter
objects created by the TextObjectWriterFactory . |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NumberedObject(int number, boolean processed, Object obj)
NumberedObject
object with the
specified object, processed flag and object number.
Method Detail |
---|
public int number()
public Object get()
public boolean processed()
public void set(Object obj)
public void setProcessed(boolean processed)
public void setProcessed()
true
.
public int compareTo(Object obj)
compareTo
in interface Comparable
NumberedObject
, 0 if
they have the same number (should not typically happen) or a
positive integer if the underlying object's number is greater
than that of the specified NumberedObject
ClassCastException
- if the specified object is not an instace of
NumberedObject
public boolean equals(Object obj)
equals
in class Object
public String toString()
String.valueOf(boolean)
when passed the processed
flag of this object
toString
method
TextObjectWriter
objects created by the TextObjectWriterFactory
.
toString
in class Object
TextObjectWriter
,
Switchboard
,
Switchboard.Switchboard(...)
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |