org.starhope.appius.sql
Class SQLPeerList<T extends SQLPeerListElement>

java.lang.Object
  extended by org.starhope.appius.sql.SQLPeerList<T>
Type Parameters:
T - the type (implementing SQLPeerListElement) of the contents of this list
All Implemented Interfaces:
Iterable<T>, Collection<T>

public abstract class SQLPeerList<T extends SQLPeerListElement>
extends Object
implements Collection<T>

WRITEME: The documentation for this type (SQLPeerList) is incomplete. (brpocock@star-hope.org, Jan 12, 2010)

Author:
brpocock@star-hope.org

Field Summary
private  com.whirlycott.cache.Cache<Long,T> cache
          WRITEME: document this field (brpocock@star-hope.org, Jan 12, 2010) cache (SQLPeerList)
 
Constructor Summary
protected SQLPeerList(int cacheSize, String cacheName)
          WRITEME
 
Method Summary
 boolean add(T element)
          This is an overriding method.
 boolean addAll(Collection<? extends T> set)
          This is an overriding method.
 void clear()
          This is an overriding method.
 void clearCache()
          WRITEME: document this method (brpocock@star-hope.org, Jan 12, 2010)
 boolean contains(Object o)
          This is an overriding method.
 boolean containsAll(Collection<?> arg0)
          This is an overriding method.
private  T fetch(T element)
          Pull an element from the database, if it is on this list
 boolean isEmpty()
          This is an overriding method.
 Iterator<T> iterator()
          This is an overriding method.
 boolean remove(Object arg0)
          This is an overriding method.
 boolean removeAll(Collection<?> arg0)
          This is an overriding method.
 boolean retainAll(Collection<?> arg0)
          This is an overriding method.
 int size()
          This is an overriding method.
protected abstract  PreparedStatement sqlInsertStatment(Connection con)
           
protected abstract  PreparedStatement sqlSelectCount(Connection con)
           
 T[] toArray()
          This is an overriding method.
<S> S[]
toArray(S[] arg0)
          This is an overriding method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

cache

private final com.whirlycott.cache.Cache<Long,T extends SQLPeerListElement> cache
WRITEME: document this field (brpocock@star-hope.org, Jan 12, 2010) cache (SQLPeerList)

Constructor Detail

SQLPeerList

protected SQLPeerList(int cacheSize,
                      String cacheName)
WRITEME

Parameters:
cacheSize - WRITEME
cacheName - WRITEME
Method Detail

add

public boolean add(T element)
This is an overriding method.

Specified by:
add in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.add(java.lang.Object)

addAll

public boolean addAll(Collection<? extends T> set)
This is an overriding method.

Specified by:
addAll in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.addAll(java.util.Collection)

clear

public void clear()
This is an overriding method.

Specified by:
clear in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.clear()

clearCache

public void clearCache()
WRITEME: document this method (brpocock@star-hope.org, Jan 12, 2010)


contains

public boolean contains(Object o)
This is an overriding method.

Specified by:
contains in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.contains(java.lang.Object)

containsAll

public boolean containsAll(Collection<?> arg0)
This is an overriding method.

Specified by:
containsAll in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.containsAll(java.util.Collection)

fetch

private T fetch(T element)
Pull an element from the database, if it is on this list

Parameters:
element - WRITEME
Returns:
WRITEME

isEmpty

public boolean isEmpty()
This is an overriding method.

Specified by:
isEmpty in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.isEmpty()

iterator

public Iterator<T> iterator()
This is an overriding method.

Specified by:
iterator in interface Iterable<T extends SQLPeerListElement>
Specified by:
iterator in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.iterator()

remove

public boolean remove(Object arg0)
This is an overriding method.

Specified by:
remove in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.remove(java.lang.Object)

removeAll

public boolean removeAll(Collection<?> arg0)
This is an overriding method.

Specified by:
removeAll in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.removeAll(java.util.Collection)

retainAll

public boolean retainAll(Collection<?> arg0)
This is an overriding method.

Specified by:
retainAll in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.retainAll(java.util.Collection)

size

public int size()
This is an overriding method.

Specified by:
size in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.size()

sqlInsertStatment

protected abstract PreparedStatement sqlInsertStatment(Connection con)
Parameters:
con - a database connection
Returns:
a prepared statement to insert a given item into the list. The item will be added to the statement by setting its ID as the first parameter.

sqlSelectCount

protected abstract PreparedStatement sqlSelectCount(Connection con)
Parameters:
con - a database connection
Returns:
a string containing a query of the type SELECT COUNT(*) FROM [table] to get the size of this list

toArray

public T[] toArray()
This is an overriding method.

Specified by:
toArray in interface Collection<T extends SQLPeerListElement>
See Also:
Collection.toArray()

toArray

public <S> S[] toArray(S[] arg0)
This is an overriding method.

Specified by:
toArray in interface Collection<T extends SQLPeerListElement>
See Also:
java.util.Collection#toArray(S[])