Javolution 6.0.0 java
javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl Class Reference
Inheritance diagram for javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl:
[legend]
Collaboration diagram for javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl:
[legend]

Public Member Functions

boolean hasNext ()
 
next ()
 
void remove ()
 

Private Attributes

boolean ahead
 
final Equality<? super E > cmp = comparator()
 
next
 
final Iterator< E > targetIterator = target().iterator()
 

Detailed Description

Peeking ahead iterator.

Definition at line 23 of file SubSortedSetImpl.java.

Member Function Documentation

◆ hasNext()

boolean javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.hasNext ( )

Definition at line 31 of file SubSortedSetImpl.java.

31  {
32  if (ahead) return true;
33  while (targetIterator.hasNext()) {
34  next = targetIterator.next();
35  if ((from != null) && (cmp.compare(next, from) < 0)) continue;
36  if ((to != null) && (cmp.compare(next, to) >= 0)) break;
37  ahead = true;
38  return true;
39  }
40  return false;
41  }

References javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.ahead, javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.cmp, javolution.util.function.Equality< T >.compare(), javolution.util.internal.set.sorted.SubSortedSetImpl< E >.from, javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.next, javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.targetIterator, and javolution.util.internal.set.sorted.SubSortedSetImpl< E >.to.

Referenced by javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.next().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ next()

Definition at line 44 of file SubSortedSetImpl.java.

44  {
45  hasNext(); // Moves ahead.
46  ahead = false;
47  return next;
48  }

References javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.ahead, javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.hasNext(), and javolution.util.internal.set.sorted.SubSortedSetImpl< E >.IteratorImpl.next.

Here is the call graph for this function:

◆ remove()

Member Data Documentation

◆ ahead

◆ cmp

◆ next

◆ targetIterator


The documentation for this class was generated from the following file:
javolution.util.internal.set.sorted.SubSortedSetImpl.to
final E to
Definition: SubSortedSetImpl.java:58
javolution.util.internal.set.sorted.SubSortedSetImpl.IteratorImpl.cmp
final Equality<? super E > cmp
Definition: SubSortedSetImpl.java:26
javolution.util.internal.set.sorted.SubSortedSetImpl.IteratorImpl.targetIterator
final Iterator< E > targetIterator
Definition: SubSortedSetImpl.java:28
javolution.util.internal.set.sorted.SubSortedSetImpl.IteratorImpl.hasNext
boolean hasNext()
Definition: SubSortedSetImpl.java:31
javolution.util.internal.set.sorted.SubSortedSetImpl.from
final E from
Definition: SubSortedSetImpl.java:57
javolution.util.function.Equality.compare
int compare(T left, T right)
javolution.util.internal.set.sorted.SubSortedSetImpl.IteratorImpl.ahead
boolean ahead
Definition: SubSortedSetImpl.java:25
javolution.util.internal.set.sorted.SubSortedSetImpl.IteratorImpl.next
E next
Definition: SubSortedSetImpl.java:27