Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de)

lolo.scans
Class SetMN

java.lang.Object
  |
  +--lolo.Scan
        |
        +--lolo.scans.Scan
              |
              +--lolo.scans.Set
                    |
                    +--lolo.scans.SetMN
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Int

public class SetMN
extends Set

A recognizer class to scan for many characters from a set of characters.

Author:
Bernd Kühl (bernd@informatik.uni-osnabrueck.de)
See Also:
Serialized Form

Inner classes inherited from class lolo.Scan
Scan.Action, Scan.State
 
Field Summary
protected  int jog
          Counts the current number of recognized characters.
protected  int m
          The lower limit.
protected  int n
          The upper limit.
 
Fields inherited from class lolo.scans.Set
inside, set
 
Fields inherited from class lolo.scans.Scan
reset, stateObject
 
Fields inherited from class lolo.Scan
action, ignore
 
Constructor Summary
SetMN(java.lang.String set, boolean inside, int m, int n)
          Constructs a recognizer which scans at least m and at most n characters.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other object is "equal to" this one.
 int hashCode()
          Returns a hash code value for this object.
 Scan.State nextChar(char ch)
          Called by a Scanner for every new character.
 void reset()
          Resets this instance.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class lolo.Scan
action, getAction, getIgnore, setAction, setIgnore
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m

protected final int m
The lower limit.

n

protected final int n
The upper limit.

jog

protected transient int jog
Counts the current number of recognized characters.
Constructor Detail

SetMN

public SetMN(java.lang.String set,
             boolean inside,
             int m,
             int n)
      throws java.lang.IllegalArgumentException
Constructs a recognizer which scans at least m and at most n characters. If inside is true the characters have to be inside set, else they have to be oustide of set.
Parameters:
set - the set of characters.
inside - marks if the symbol characters have to be inside or outside set.
m - the minimal number of characters.
n - the maximum number of characters.
Method Detail

reset

public void reset()
Description copied from class: Scan
Resets this instance.
Overrides:
reset in class Set

nextChar

public Scan.State nextChar(char ch)
Description copied from class: Scan
Called by a Scanner for every new character.
Overrides:
nextChar in class Set
Following copied from class: lolo.Scan
Returns:
a State object to signal whether more characters are wanted and whether a symbol is found.
See Also:
Scan.State, Scanner

equals

public boolean equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one.
Overrides:
equals in class Set
Returns:
whether some other object is "equal to" this one.

hashCode

public int hashCode()
Returns a hash code value for this object.
Overrides:
hashCode in class Set
Returns:
a hash code value for this object.

toString

public java.lang.String toString()
Returns a string representation of the object.
Overrides:
toString in class Set
Returns:
a string representation of the object.

Send bugs or comments to Bernd Kühl (bernd@informatik.uni-osnabrueck.de)