laser.regularlanguage.regularexpression
Class Exponent

java.lang.Object
  extended by laser.regularlanguage.regularexpression.Exponent
All Implemented Interfaces:
java.lang.Cloneable, REConstants

public class Exponent
extends java.lang.Object
implements java.lang.Cloneable, REConstants

The exponent of an Exponent node in the Regular Expression Parse Tree. It is of the bounded form "low - high" (meaning raise to a power greater than or equal to low and less than or equal to high) or the unbounded form "low - " (meaning raise to a power that is greater than or equal to low).

Author:
Jamieson M. Cobleigh (laser-software@cs.umass.edu)

Field Summary
static int UNBOUNDED_HIGH
          The unbounded high value
 
Fields inherited from interface laser.regularlanguage.regularexpression.REConstants
CHOICE, COMMA, COMMENT_PREFIX, CONCATENATION, DOT, EMPTY, EPSILON, EXPONENT, KLEENE_PLUS, KLEENE_STAR, LBRACE, LBRACKET, LPAREN, NOT, OPTION, RANGE, RBRACE, RBRACKET, RPAREN
 
Constructor Summary
Exponent(int low)
          Creates a new unbounded Exponent
Exponent(int low, int high)
          Creates a new bounded Exponent
 
Method Summary
 Exponent clone()
          Returns a (deep) clone of this Exponent.
 boolean equals(java.lang.Object obj2)
          Returns true if this Object and the given Object are equal and false otherwise.
 int getHigh()
          Gets the high value of the range.
 int getLow()
          Gets the low value of the range
 boolean isBounded()
          Returns true if this Exponent is bounded and false if it is unbounded.
 java.lang.String toString()
          Gets a String representation of the exponent
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNBOUNDED_HIGH

public static final int UNBOUNDED_HIGH
The unbounded high value

See Also:
Constant Field Values
Constructor Detail

Exponent

public Exponent(int low)
Creates a new unbounded Exponent

Parameters:
low - the low value of the range (greater than or equal to 0)

Exponent

public Exponent(int low,
                int high)
Creates a new bounded Exponent

Parameters:
low - the low value of the range (greater than or equal to 0)
high - the high value of the range (greater than or equal to low)
Method Detail

isBounded

public boolean isBounded()
Returns true if this Exponent is bounded and false if it is unbounded.

Returns:
True if bounded and false if unbounded

getLow

public final int getLow()
Gets the low value of the range

Returns:
the low value of the range

getHigh

public final int getHigh()
Gets the high value of the range.

Returns:
the high value of the range
Throws:
java.lang.UnsupportedOperationException - if the exponent is unbounded

clone

public Exponent clone()
Returns a (deep) clone of this Exponent.

Overrides:
clone in class java.lang.Object
Returns:
A (deep) clone of this Object

toString

public java.lang.String toString()
Gets a String representation of the exponent

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the exponent

equals

public boolean equals(java.lang.Object obj2)
Returns true if this Object and the given Object are equal and false otherwise.

Overrides:
equals in class java.lang.Object
Parameters:
obj2 - The second Object
Returns:
True if this Object and the given Object are equal and false otherwise