Package org.hibernate.collection.spi
Class PersistentSortedMap<K,E>
- java.lang.Object
-
- org.hibernate.collection.spi.AbstractPersistentCollection<E>
-
- org.hibernate.collection.spi.PersistentMap<K,E>
-
- org.hibernate.collection.spi.PersistentSortedMap<K,E>
-
- All Implemented Interfaces:
Serializable
,Map<K,E>
,SortedMap<K,E>
,LazyInitializable
,PersistentCollection<E>
@Incubating public class PersistentSortedMap<K,E> extends PersistentMap<K,E> implements SortedMap<K,E>
A persistent wrapper for aSortedMap
. Underlying collection is aTreeMap
.- See Also:
- Serialized Form
- API Note:
- Incubating in terms of making this non-internal. These contracts will be getting cleaned up in following releases.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.collection.spi.AbstractPersistentCollection
AbstractPersistentCollection.AbstractValueDelayedOperation, AbstractPersistentCollection.DelayedOperation<E>, AbstractPersistentCollection.IteratorProxy<E>, AbstractPersistentCollection.LazyInitializationWork<T>, AbstractPersistentCollection.ListIteratorProxy, AbstractPersistentCollection.ListProxy, AbstractPersistentCollection.SetProxy<E>, AbstractPersistentCollection.ValueDelayedOperation<E>
-
-
Field Summary
Fields Modifier and Type Field Description protected Comparator<? super K>
comparator
-
Fields inherited from class org.hibernate.collection.spi.PersistentMap
map
-
Fields inherited from class org.hibernate.collection.spi.AbstractPersistentCollection
elementRemoved, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description PersistentSortedMap()
Constructs a PersistentSortedMap.PersistentSortedMap(SharedSessionContractImplementor session, Comparator<K> comparator)
Constructs a PersistentSortedMap.PersistentSortedMap(SharedSessionContractImplementor session, SortedMap<K,E> map)
Constructs a PersistentSortedMap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparator<? super K>
comparator()
K
firstKey()
SortedMap<K,E>
headMap(K toKey)
K
lastKey()
void
setComparator(Comparator<? super K> comparator)
protected Serializable
snapshot(BasicCollectionPersister persister)
SortedMap<K,E>
subMap(K fromKey, K toKey)
SortedMap<K,E>
tailMap(K fromKey)
-
Methods inherited from class org.hibernate.collection.spi.PersistentMap
clear, containsKey, containsValue, disassemble, empty, entries, entryExists, entrySet, equals, equalsSnapshot, get, getDeletes, getElement, getIndex, getOrphans, getSnapshot, getSnapshotElement, hashCode, initializeEmptyCollection, initializeFromCache, injectLoadedState, isEmpty, isSnapshotEmpty, isWrapper, keySet, needsInserting, needsUpdating, put, putAll, remove, size, toString, values
-
Methods inherited from class org.hibernate.collection.spi.AbstractPersistentCollection
afterInitialize, afterRowInsert, beforeInitialize, beginRead, clearDirty, clearOperationQueue, dirty, elementByIndex, elementExists, endRead, forceInitialization, getCachedSize, getIdentifier, getKey, getOrphans, getOwner, getQueuedOrphans, getRole, getSession, getSize, getSnapshot, getStoredSnapshot, getValue, hasQueuedOperations, identityRemove, initialize, isClearQueueEnabled, isConnectedToSession, isDirectlyAccessible, isDirty, isElementRemoved, isInitialized, isInitializing, isInverseCollection, isInverseCollectionNoOrphanDelete, isInverseOneToManyOrNoOrphanDelete, isOperationQueueEnabled, isPutQueueEnabled, isRowUpdatePossible, isUnreferenced, needsRecreate, performQueuedOperations, postAction, preInsert, prepareForPossibleLoadingOutsideTransaction, queuedAdditionIterator, queueOperation, read, readElementByIndex, readElementExistence, readIndexExistence, readSize, replaceQueuedOperationValues, setCurrentSession, setDirectlyAccessible, setInitialized, setOwner, setSnapshot, unsetSession, wasInitialized, write
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
-
Methods inherited from interface org.hibernate.collection.spi.PersistentCollection
includeInInsert, includeInRecreate, isDirectlyProvidedCollection, isNewlyInstantiated, needsUpdating, render
-
-
-
-
Field Detail
-
comparator
protected Comparator<? super K> comparator
-
-
Constructor Detail
-
PersistentSortedMap
public PersistentSortedMap()
Constructs a PersistentSortedMap. This form needed for SOAP libraries, etc
-
PersistentSortedMap
public PersistentSortedMap(SharedSessionContractImplementor session, Comparator<K> comparator)
Constructs a PersistentSortedMap.- Parameters:
session
- The sessioncomparator
- The sort comparator
-
PersistentSortedMap
public PersistentSortedMap(SharedSessionContractImplementor session, SortedMap<K,E> map)
Constructs a PersistentSortedMap.- Parameters:
session
- The sessionmap
- The underlying map data
-
-
Method Detail
-
snapshot
protected Serializable snapshot(BasicCollectionPersister persister) throws HibernateException
- Throws:
HibernateException
-
setComparator
public void setComparator(Comparator<? super K> comparator)
-
comparator
public Comparator<? super K> comparator()
- Specified by:
comparator
in interfaceSortedMap<K,E>
-
-