|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsears.search.data.LoopIterator
public class LoopIterator
Manages ListOfRow structure with loop iteration
Constructor Summary | |
---|---|
LoopIterator(ListOfRow aListOfRow)
Instantiate a new object |
Method Summary | |
---|---|
int |
getCurrentElement()
SAFE METHOD, do not change iteration state |
int |
getFirstElement()
SAFE METHOD, do not change iteration state |
int |
getIndexOfTheCurrentElement()
SAFE METHOD, do not change iteration state |
int |
getLastElement()
SAFE METHOD, do not change iteration state |
int |
getNextElement()
Returns the next positive element of the list |
int |
getPreviousElement()
Returns the previous positive element of the list |
int |
getTheNearestElementAfter(int row)
|
int |
getTheNearestElementBefore(int row)
Gets the nearest element before means: gets the first smaller element before the element before the one given on parameters if this element is not in the list, else it is return |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoopIterator(ListOfRow aListOfRow)
aListOfRow
- the list on which iterate
java.lang.NullPointerException
- if aListOfRow is nullMethod Detail |
---|
public int getTheNearestElementBefore(int row)
Gets the nearest element before means:
gets the first smaller element before the element before the one given
on parameters
if this element is not in the list, else it is return
Method's algorithm uses is the dichotomic search
row
- the element
java.lang.IllegalArgumentException
- if row is out of the bounds of the elements contained in the listpublic int getTheNearestElementAfter(int row)
row
- the row
java.lang.IllegalArgumentException
- if row is out of the bounds of the elements contained in the listpublic int getNextElement()
public int getPreviousElement()
public int getCurrentElement()
public int getFirstElement()
public int getLastElement()
public int getIndexOfTheCurrentElement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |