com.caucho.amber.collection
Class SetImpl<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by com.caucho.amber.collection.SetImpl<E>
All Implemented Interfaces:
AmberCollection, java.lang.Iterable<E>, java.util.Collection<E>, java.util.Set<E>

public class SetImpl<E>
extends java.util.AbstractSet<E>
implements AmberCollection

Represents a lazy collection.


Constructor Summary
SetImpl(AmberConnection aConn, java.lang.String query)
           
SetImpl(AmberQuery query)
           
 
Method Summary
 boolean addAll(java.util.Collection<? extends E> collection)
          Adds all items to this collection.
 void clear()
          Clears the collection.
 void detach()
          Detaches the collection.
 E get(int index)
          Returns an iterator of the items.
 AmberQuery getQuery()
          Returns the query.
 AmberConnection getSession()
          Returns the session.
protected  boolean isValid()
           
 java.util.Iterator iterator()
          Returns an iterator of the items.
 void setSession(AmberConnection aConn)
          Sets the session.
 void setSession(AmberConnection aConn)
          Sets the session.
 int size()
          Returns the number of items in the collection.
 void update()
          Updates the collection.
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
add, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
 

Constructor Detail

SetImpl

public SetImpl(AmberConnection aConn,
               java.lang.String query)

SetImpl

public SetImpl(AmberQuery query)
Method Detail

setSession

public void setSession(AmberConnection aConn)
Sets the session.


setSession

public void setSession(AmberConnection aConn)
Sets the session.


getSession

public AmberConnection getSession()
Returns the session.


getQuery

public AmberQuery getQuery()
Returns the query.


size

public int size()
Returns the number of items in the collection.

Specified by:
size in interface java.util.Collection<E>
Specified by:
size in interface java.util.Set<E>
Specified by:
size in class java.util.AbstractCollection<E>

iterator

public java.util.Iterator iterator()
Returns an iterator of the items.

Specified by:
iterator in interface java.lang.Iterable<E>
Specified by:
iterator in interface java.util.Collection<E>
Specified by:
iterator in interface java.util.Set<E>
Specified by:
iterator in class java.util.AbstractCollection<E>

get

public E get(int index)
Returns an iterator of the items.


addAll

public boolean addAll(java.util.Collection<? extends E> collection)
Adds all items to this collection.

Specified by:
addAll in interface java.util.Collection<E>
Specified by:
addAll in interface java.util.Set<E>
Overrides:
addAll in class java.util.AbstractCollection<E>

clear

public void clear()
Clears the collection.

Specified by:
clear in interface java.util.Collection<E>
Specified by:
clear in interface java.util.Set<E>
Overrides:
clear in class java.util.AbstractCollection<E>

update

public void update()
Updates the collection.

Specified by:
update in interface AmberCollection

detach

public void detach()
Detaches the collection.


isValid

protected boolean isValid()