net.spy.db.savables
Class SavableHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by net.spy.db.savables.SavableHashMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map, Savable

public class SavableHashMap
extends java.util.HashMap
implements Savable

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

Author:
Dustin Sallings
See Also:
Serialized Form

Constructor Summary
SavableHashMap()
          Get an instance of SavableHashMap.
SavableHashMap(int initCap)
          Get an instance of SavableHashMap with the given initial capacity.
SavableHashMap(int initialCapacity, float loadFactor)
          Get an instance of SavableHashMap with the given initial capacity and load factors.
SavableHashMap(java.util.Map map)
          Get an instance of SavableHashMap populated with the given Map of objects.
 
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.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

SavableHashMap

public SavableHashMap()
Get an instance of SavableHashMap.


SavableHashMap

public SavableHashMap(java.util.Map map)
Get an instance of SavableHashMap populated with the given Map of objects.


SavableHashMap

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


SavableHashMap

public SavableHashMap(int initialCapacity,
                      float loadFactor)
Get an instance of SavableHashMap 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:
values()


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