JFlex

Class Intervall

public final class Intervall extends Object

An intervall of characters with basic operations.
Field Summary
charend
charstart
Constructor Summary
Intervall(char start, char end)
Constuct a new intervall from start to end.
Intervall(Intervall other)
Copy constructor
Method Summary
booleancontains(char point)
Return true iff point is contained in this intervall.
booleancontains(Intervall other)
Return true iff this intervall completely contains the other one.
booleanequals(Object o)
Return true if o is an intervall with the same borders.
voidsetEnd(char end)
Set a new last character
voidsetStart(char start)
Set a new first character
StringtoString()
Get a String representation of this intervall.

Field Detail

end

public char end

start

public char start

Constructor Detail

Intervall

public Intervall(char start, char end)
Constuct a new intervall from start to end.

Parameters: start first character the intervall should contain end last character the intervall should contain

Intervall

public Intervall(Intervall other)
Copy constructor

Method Detail

contains

public boolean contains(char point)
Return true iff point is contained in this intervall.

Parameters: point the character to check

contains

public boolean contains(Intervall other)
Return true iff this intervall completely contains the other one.

Parameters: other the other intervall

equals

public boolean equals(Object o)
Return true if o is an intervall with the same borders.

Parameters: o the object to check equality with

setEnd

public void setEnd(char end)
Set a new last character

Parameters: end the new last character of this intervall

setStart

public void setStart(char start)
Set a new first character

Parameters: start the new first character of this intervall

toString

public String toString()
Get a String representation of this intervall.

Returns: a string "[start-end]" or "[start]" (if there is only one character in the intervall) where start and end are either a number (the character code) or something of the from 'a'.