net.spy.db.savables
Class SavableHashSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet
              extended by net.spy.db.savables.SavableHashSet
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.Set, Savable

public class SavableHashSet
extends java.util.HashSet
implements Savable

A subclass of HashSet that implements Savable. The save() method does nothing (and should not be called), but all of the objects in the Set will be returned from getPostSavables().

Author:
Dustin Sallings
See Also:
Serialized Form

Constructor Summary
SavableHashSet()
          Get an instance of SavableHashSet.
SavableHashSet(java.util.Collection col)
          Get an instance of SavableHashSet populated with the given Collection of objects.
SavableHashSet(int initCap)
          Get an instance of SavableHashSet with the given initial capacity.
SavableHashSet(int initialCapacity, float loadFactor)
          Get an instance of SavableHashSet with the given initial capacity and load factors.
 
Method Summary
 java.util.Collection getPostSavables(SaveContext context)
          Get a Collection of all of the SavableNodes this SavableNode is holding that will need to be saved after this Savable.
 java.util.Collection getPreSavables(SaveContext context)
          Get a Collection of all of the SavableNodes this SavableNode is holding that will need to be saved before this Savable.
 boolean isModified()
          Has this object been modified?
 boolean isNew()
          Is this a new object?
 void save(java.sql.Connection conn, SaveContext context)
          Do nothing.
 
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
 

Constructor Detail

SavableHashSet

public SavableHashSet()
Get an instance of SavableHashSet.


SavableHashSet

public SavableHashSet(java.util.Collection col)
Get an instance of SavableHashSet populated with the given Collection of objects.


SavableHashSet

public SavableHashSet(int initCap)
Get an instance of SavableHashSet with the given initial capacity.


SavableHashSet

public SavableHashSet(int initialCapacity,
                      float loadFactor)
Get an instance of SavableHashSet with the given initial capacity and load factors.

Method Detail

isNew

public boolean isNew()
Description copied from interface: Savable
Is this a new object?

Specified by:
isNew in interface Savable
Returns:
false

isModified

public boolean isModified()
Description copied from interface: Savable
Has this object been modified?

Specified by:
isModified in interface Savable
Returns:
false

save

public void save(java.sql.Connection conn,
                 SaveContext context)
          throws SaveException,
                 java.sql.SQLException
Do nothing.

Specified by:
save in interface Savable
Parameters:
conn - the connection to use for saving
context - SaveContext being used in this Saver session
Throws:
SaveException
java.sql.SQLException

getPreSavables

public java.util.Collection getPreSavables(SaveContext context)
Description copied from interface: Savable
Get a Collection of all of the SavableNodes this SavableNode is holding that will need to be saved before this Savable.

Specified by:
getPreSavables in interface Savable
Parameters:
context - SaveContext being used in this Saver session
Returns:
null

getPostSavables

public java.util.Collection getPostSavables(SaveContext context)
Description copied from interface: Savable
Get a Collection of all of the SavableNodes this SavableNode is holding that will need to be saved after this Savable.

Specified by:
getPostSavables in interface Savable
Parameters:
context - SaveContext being used in this Saver session
Returns:
this


Copyright © 1995-2005 SPY Internetworking. All Rights Reserved.