com.caucho.env.dbpool
Class IdlePoolSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<ManagedConnection>
          extended by com.caucho.env.dbpool.IdlePoolSet
All Implemented Interfaces:
java.lang.Iterable<ManagedConnection>, java.util.Collection<ManagedConnection>, java.util.Set<ManagedConnection>

public class IdlePoolSet
extends java.util.AbstractSet<ManagedConnection>

Queue (fifo) ordered set, used by the JCA code so connections can be load balanced using a round-robin.


Method Summary
 boolean add(ManagedConnection o)
          Adds an element.
 void clear()
          Clears the set.
 boolean contains(java.lang.Object o)
          Returns true if the item is in the set.
 boolean containsAll(java.util.Collection<?> c)
          Returns true if the item is in the set.
 boolean equals(java.lang.Object o)
          Test for equality
 ManagedConnection first()
          Peeks the first item.
 int hashCode()
          Returns the hash code.
 boolean isEmpty()
          Returns true if empty.
 java.util.Iterator<ManagedConnection> iterator()
          Returns an iterator to the set.
 boolean remove(java.lang.Object o)
          Removes an element of the set.
 boolean removeAll(java.util.Collection<?> c)
          Removes an element of the set.
 boolean retainAll(java.util.Collection<?> c)
          Removes an element of the set.
 int size()
          Returns the number of elements in the set.
 java.lang.Object[] toArray()
          Returns an array of the elements in the set.
 ManagedConnection[] toArray(ManagedConnection[] values)
          Returns an array of the elements in the set.
 
Methods inherited from class java.util.AbstractCollection
addAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, toArray
 

Method Detail

size

public int size()
Returns the number of elements in the set.

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

isEmpty

public boolean isEmpty()
Returns true if empty.

Specified by:
isEmpty in interface java.util.Collection<ManagedConnection>
Specified by:
isEmpty in interface java.util.Set<ManagedConnection>
Overrides:
isEmpty in class java.util.AbstractCollection<ManagedConnection>

first

public ManagedConnection first()
Peeks the first item.


add

public boolean add(ManagedConnection o)
Adds an element.

Specified by:
add in interface java.util.Collection<ManagedConnection>
Specified by:
add in interface java.util.Set<ManagedConnection>
Overrides:
add in class java.util.AbstractCollection<ManagedConnection>

clear

public void clear()
Clears the set.

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

contains

public boolean contains(java.lang.Object o)
Returns true if the item is in the set.

Specified by:
contains in interface java.util.Collection<ManagedConnection>
Specified by:
contains in interface java.util.Set<ManagedConnection>
Overrides:
contains in class java.util.AbstractCollection<ManagedConnection>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Returns true if the item is in the set.

Specified by:
containsAll in interface java.util.Collection<ManagedConnection>
Specified by:
containsAll in interface java.util.Set<ManagedConnection>
Overrides:
containsAll in class java.util.AbstractCollection<ManagedConnection>

iterator

public java.util.Iterator<ManagedConnection> iterator()
Returns an iterator to the set.

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

remove

public boolean remove(java.lang.Object o)
Removes an element of the set.

Specified by:
remove in interface java.util.Collection<ManagedConnection>
Specified by:
remove in interface java.util.Set<ManagedConnection>
Overrides:
remove in class java.util.AbstractCollection<ManagedConnection>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Removes an element of the set.

Specified by:
removeAll in interface java.util.Collection<ManagedConnection>
Specified by:
removeAll in interface java.util.Set<ManagedConnection>
Overrides:
removeAll in class java.util.AbstractSet<ManagedConnection>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Removes an element of the set.

Specified by:
retainAll in interface java.util.Collection<ManagedConnection>
Specified by:
retainAll in interface java.util.Set<ManagedConnection>
Overrides:
retainAll in class java.util.AbstractCollection<ManagedConnection>

toArray

public java.lang.Object[] toArray()
Returns an array of the elements in the set.

Specified by:
toArray in interface java.util.Collection<ManagedConnection>
Specified by:
toArray in interface java.util.Set<ManagedConnection>
Overrides:
toArray in class java.util.AbstractCollection<ManagedConnection>

toArray

public ManagedConnection[] toArray(ManagedConnection[] values)
Returns an array of the elements in the set.


hashCode

public int hashCode()
Returns the hash code.

Specified by:
hashCode in interface java.util.Collection<ManagedConnection>
Specified by:
hashCode in interface java.util.Set<ManagedConnection>
Overrides:
hashCode in class java.util.AbstractSet<ManagedConnection>

equals

public boolean equals(java.lang.Object o)
Test for equality

Specified by:
equals in interface java.util.Collection<ManagedConnection>
Specified by:
equals in interface java.util.Set<ManagedConnection>
Overrides:
equals in class java.util.AbstractSet<ManagedConnection>