|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.abstracthorizon.mercury.imap.util.SimpleSequence
public class SimpleSequence
A class representing simple implementation of Sequence. It has min and max, and maintains current pointer.
Field Summary | |
---|---|
protected int |
max
Default minimum value |
protected int |
min
Default maximum value |
protected int |
ptr
Current pointer |
Constructor Summary | |
---|---|
SimpleSequence()
Constructor |
Method Summary | |
---|---|
int |
compareTo(Sequence o)
Compares two sequences |
boolean |
equals(Object o)
Returns true if two sequences are equal |
void |
first()
Resets internal iterator |
int |
getMax()
Maximum element in the sequence |
int |
getMin()
Minimum element in the sequence |
int |
hashCode()
Returns sum of min and max |
boolean |
more()
Returns true if there are more elements in internal interator |
int |
next()
Returns next element from the internal interator |
void |
setLowerLimit(int lower)
Sets the lower limit |
void |
setMax(int max)
Sets maximum element in the sequence |
void |
setMin(int min)
Sets minimum element in the sequence |
void |
setUpperLimit(int upper)
Sets upper limit |
String |
toString()
Returns sequence as string |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int min
protected int max
protected int ptr
Constructor Detail |
---|
public SimpleSequence()
Method Detail |
---|
public int getMin()
getMin
in interface Sequence
public void setMin(int min)
min
- minimum element in the sequencepublic int getMax()
getMax
in interface Sequence
public void setMax(int max)
max
- maximum element in the sequencepublic void setLowerLimit(int lower)
setLowerLimit
in interface Sequence
lower
- lower limitpublic void setUpperLimit(int upper)
setUpperLimit
in interface Sequence
upper
- upper limitpublic void first()
first
in interface Sequence
public boolean more()
true
if there are more elements in internal interator
more
in interface Sequence
true
if there are more elements in internal interatorpublic int next()
next
in interface Sequence
public boolean equals(Object o)
true
if two sequences are equal
equals
in class Object
o
- other sequence
true
if two sequences are equalpublic int hashCode()
hashCode
in class Object
public int compareTo(Sequence o)
compareTo
in interface Comparable<Sequence>
o
- other sequence
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |