net.ontopia.utils
Class IteratorCollection<T>

java.lang.Object
  extended by net.ontopia.utils.IteratorCollection<T>
All Implemented Interfaces:
Iterable<T>, Collection<T>

public class IteratorCollection<T>
extends Object
implements Collection<T>

INTERNAL: A wrapper class for presenting a collection view on iterators. The wrapped iterator will be lazily traversed.


Field Summary
protected  Collection<T> coll
           
protected  int iter_size
           
protected  Iterator<T> iterator
           
protected  int max_size
           
protected  boolean resolved
           
 
Constructor Summary
IteratorCollection(Iterator<T> iterator)
           
IteratorCollection(Iterator<T> iterator, int size)
           
IteratorCollection(Iterator<T> iterator, int size, int max_size)
           
 
Method Summary
 boolean add(T o)
           
 boolean addAll(Collection c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 boolean equals(Object o)
           
 int hashCode()
           
 boolean isEmpty()
           
 Iterator<T> iterator()
           
protected  T nextObject()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
protected  void resolve()
           
 boolean retainAll(Collection c)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterator

protected Iterator<T> iterator

coll

protected Collection<T> coll

resolved

protected boolean resolved

iter_size

protected int iter_size

max_size

protected int max_size
Constructor Detail

IteratorCollection

public IteratorCollection(Iterator<T> iterator)

IteratorCollection

public IteratorCollection(Iterator<T> iterator,
                          int size)

IteratorCollection

public IteratorCollection(Iterator<T> iterator,
                          int size,
                          int max_size)
Method Detail

nextObject

protected T nextObject()

resolve

protected void resolve()

clear

public void clear()
Specified by:
clear in interface Collection<T>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<T>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<T>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>
Specified by:
iterator in interface Collection<T>

size

public int size()
Specified by:
size in interface Collection<T>

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection<T>
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection<T>
Overrides:
equals in class Object

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<T>

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection<T>

add

public boolean add(T o)
Specified by:
add in interface Collection<T>

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection<T>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<T>

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection<T>

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection<T>


Copyright © 2000-2012 Ontopia.