Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.util
Class TreeMap.TreeIterator  view TreeMap.TreeIterator download TreeMap.TreeIterator.java

java.lang.Object
  extended byjava.util.TreeMap.TreeIterator
All Implemented Interfaces:
Iterator
Enclosing class:
TreeMap

private final class TreeMap.TreeIterator
extends java.lang.Object
implements Iterator

Iterate over TreeMap's entries. This implementation is parameterized to give a sequential view of keys, values, or entries.


Field Summary
private  int knownMod
          The number of modifications to the backing Map that we know about.
private  TreeMap.Node last
          The last Entry returned by a next() call.
private  TreeMap.Node max
          The last node visible to this iterator.
private  TreeMap.Node next
          The next entry that should be returned by next().
private  int type
          The type of this Iterator: AbstractMap.KEYS 55 , AbstractMap.VALUES 55 , or AbstractMap.ENTRIES 55 .
 
Constructor Summary
(package private) TreeMap.TreeIterator(int type)
          Construct a new TreeIterator with the supplied type.
(package private) TreeMap.TreeIterator(int type, TreeMap.Node first, TreeMap.Node max)
          Construct a new TreeIterator with the supplied type.
 
Method Summary
 boolean hasNext()
          Returns true if the Iterator has more elements.
 java.lang.Object next()
          Returns the next element in the Iterator's sequential view.
 void remove()
          Removes from the backing TreeMap the last element which was fetched with the next() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

private final int type
The type of this Iterator: AbstractMap.KEYS 55 , AbstractMap.VALUES 55 , or AbstractMap.ENTRIES 55 .


knownMod

private int knownMod
The number of modifications to the backing Map that we know about.


last

private TreeMap.Node last
The last Entry returned by a next() call.


next

private TreeMap.Node next
The next entry that should be returned by next().


max

private final TreeMap.Node max
The last node visible to this iterator. This is used when iterating on a SubMap.

Constructor Detail

TreeMap.TreeIterator

TreeMap.TreeIterator(int type)
Construct a new TreeIterator with the supplied type.


TreeMap.TreeIterator

TreeMap.TreeIterator(int type,
                     TreeMap.Node first,
                     TreeMap.Node max)
Construct a new TreeIterator with the supplied type. Iteration will be from "first" (inclusive) to "max" (exclusive).

Method Detail

hasNext

public boolean hasNext()
Returns true if the Iterator has more elements.

Specified by:
hasNext in interface Iterator

next

public java.lang.Object next()
Returns the next element in the Iterator's sequential view.

Specified by:
next in interface Iterator

remove

public void remove()
Removes from the backing TreeMap the last element which was fetched with the next() method.

Specified by:
remove in interface Iterator