org.granite.client.persistence.collection
Class PersistentSortedMap<K,V>

java.lang.Object
  extended by org.granite.client.persistence.collection.AbstractPersistentCollection<C>
      extended by org.granite.client.persistence.collection.AbstractPersistentMapCollection<K,V,SortedMap<K,V>>
          extended by org.granite.client.persistence.collection.PersistentSortedMap<K,V>
All Implemented Interfaces:
Externalizable, Serializable, Map<K,V>, SortedMap<K,V>, PersistentCollection, PersistentSortedCollection<K>

public class PersistentSortedMap<K,V>
extends AbstractPersistentMapCollection<K,V,SortedMap<K,V>>
implements SortedMap<K,V>, PersistentSortedCollection<K>

Author:
Franck WOLFF
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Nested classes/interfaces inherited from interface org.granite.client.persistence.collection.PersistentCollection
PersistentCollection.ChangeListener, PersistentCollection.InitializationCallback, PersistentCollection.InitializationListener
 
Constructor Summary
PersistentSortedMap()
           
PersistentSortedMap(boolean initialized)
           
PersistentSortedMap(SortedMap<K,V> collection)
           
PersistentSortedMap(SortedMap<K,V> collection, boolean clone)
           
 
Method Summary
 PersistentSortedMap<K,V> clone(boolean uninitialize)
           
 Comparator<? super K> comparator()
           
protected  PersistentCollectionSnapshot createSnapshot(Object io, boolean forReading)
           
 void doInitialize()
           
 K firstKey()
           
 SortedMap<K,V> headMap(K toKey)
           
 K lastKey()
           
 SortedMap<K,V> subMap(K fromKey, K toKey)
           
 SortedMap<K,V> tailMap(K fromKey)
           
protected  void updateFromSnapshot(ObjectInput in, PersistentCollectionSnapshot snapshot)
           
 
Methods inherited from class org.granite.client.persistence.collection.AbstractPersistentMapCollection
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, put, putAll, remove, size, values
 
Methods inherited from class org.granite.client.persistence.collection.AbstractPersistentCollection
addListener, addListener, checkInitializedRead, checkInitializedWrite, clearDirty, dirty, getClassLoader, getCollection, getDetachedState, getLoader, init, initialize, initializing, isDirty, readExternal, removeListener, removeListener, setLoader, toString, uninitialize, wasInitialized, withInitialized, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.SortedMap
entrySet, keySet, values
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size
 
Methods inherited from interface org.granite.client.persistence.collection.PersistentCollection
addListener, addListener, clearDirty, dirty, getLoader, initialize, initializing, isDirty, removeListener, removeListener, setLoader, uninitialize, wasInitialized, withInitialized
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Constructor Detail

PersistentSortedMap

public PersistentSortedMap()

PersistentSortedMap

public PersistentSortedMap(boolean initialized)

PersistentSortedMap

public PersistentSortedMap(SortedMap<K,V> collection)

PersistentSortedMap

public PersistentSortedMap(SortedMap<K,V> collection,
                           boolean clone)
Method Detail

doInitialize

public void doInitialize()
Specified by:
doInitialize in class AbstractPersistentCollection<SortedMap<K,V>>

comparator

public Comparator<? super K> comparator()
Specified by:
comparator in interface SortedMap<K,V>
Specified by:
comparator in interface PersistentSortedCollection<K>

subMap

public SortedMap<K,V> subMap(K fromKey,
                             K toKey)
Specified by:
subMap in interface SortedMap<K,V>

headMap

public SortedMap<K,V> headMap(K toKey)
Specified by:
headMap in interface SortedMap<K,V>

tailMap

public SortedMap<K,V> tailMap(K fromKey)
Specified by:
tailMap in interface SortedMap<K,V>

firstKey

public K firstKey()
Specified by:
firstKey in interface SortedMap<K,V>

lastKey

public K lastKey()
Specified by:
lastKey in interface SortedMap<K,V>

createSnapshot

protected PersistentCollectionSnapshot createSnapshot(Object io,
                                                      boolean forReading)
Specified by:
createSnapshot in class AbstractPersistentCollection<SortedMap<K,V>>

updateFromSnapshot

protected void updateFromSnapshot(ObjectInput in,
                                  PersistentCollectionSnapshot snapshot)
Specified by:
updateFromSnapshot in class AbstractPersistentCollection<SortedMap<K,V>>

clone

public PersistentSortedMap<K,V> clone(boolean uninitialize)
Specified by:
clone in interface PersistentCollection
Overrides:
clone in class AbstractPersistentCollection<SortedMap<K,V>>