|
Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--lolo.Scan
|
+--lolo.Mux
A Mux mulitplexes two or more Scan instances.
Scan, Serialized Form| Inner classes inherited from class lolo.Scan |
Scan.Action, Scan.State |
| Field Summary | |
protected boolean[] |
done
Array displaying active Scan objects. |
protected int |
max
Indexes into scans. |
protected int |
next
Indexes into scans. |
protected Scan[] |
scans
Collects all managed Scan instances. |
protected Scan.State |
stateObject
A State object which is used for nextChar(). |
protected Scan |
winner
At the end of one round winner holds the winning Scan object. |
| Fields inherited from class lolo.Scan |
action, ignore |
| Constructor Summary | |
Mux(Scan s1,
Scan s2)
Creates a Mux object. |
|
| Method Summary | |
void |
action(char[] buffer,
int off,
int len)
Calls action() for the winning Scan object. |
void |
add(Scan scan)
Adds a Scan object. |
boolean |
equals(java.lang.Object obj)
Indicate whether some other object is "equal to" this one. |
int |
hashCode()
Returns a hash code value for the object. |
Scan.State |
nextChar(char ch)
Called by a Scanner for every new character. |
void |
reset()
Resets all managed Scan instance. |
Scan |
setAction(Scan.Action action)
This method just throws a RuntimeException because no action for a Mux is allowed. |
java.lang.String |
toString()
Returns a string representation. |
Scan |
winner()
Returns the winning Scan object. |
| Methods inherited from class lolo.Scan |
getAction, getIgnore, setIgnore |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected final Scan.State stateObject
protected Scan[] scans
protected int max
protected int next
protected transient Scan winner
protected boolean[] done
| Constructor Detail |
public Mux(Scan s1,
Scan s2)
throws java.lang.IllegalArgumentException
s1 - a Scan object.s2 - a Scan object.java.lang.IllegalArgumentException - if one argument is null.| Method Detail |
public void add(Scan scan)
throws java.lang.IllegalArgumentException
scan - a Scan object.java.lang.IllegalArgumentException - if scan argument is null.public void reset()
reset in class Scanpublic Scan.State nextChar(char ch)
ScannextChar in class Scanlolo.ScanScan.State,
Scanner
public void action(char[] buffer,
int off,
int len)
action in class Scanlolo.Scanbuffer - the character buffer holding the characters of the symbol.off - offset into the buffer.len - number of characters for the symbol.Scan.actionpublic Scan winner()
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class Scanpublic boolean equals(java.lang.Object obj)
equals in class Scanobj - the reference object with which to compare.public Scan setAction(Scan.Action action)
setAction in class Scanjava.lang.RuntimeException - no action for a Mux is allowed.
|
Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||