FileDocCategorySizeDatePackage
PersistentSortedMap.javaAPI DocHibernate 3.2.54280Mon Aug 01 11:29:34 BST 2005org.hibernate.collection

PersistentSortedMap

public class PersistentSortedMap extends PersistentMap implements SortedMap
A persistent wrapper for a java.util.SortedMap. Underlying collection is a TreeMap.
see
java.util.TreeMap
author
e

Fields Summary
protected Comparator
comparator
Constructors Summary
public PersistentSortedMap(org.hibernate.engine.SessionImplementor session)

		super(session);
	
public PersistentSortedMap(org.hibernate.engine.SessionImplementor session, SortedMap map)

		super(session, map);
		comparator = map.comparator();
	
public PersistentSortedMap()

Methods Summary
public java.util.Comparatorcomparator()

see
PersistentSortedMap#comparator()

		return comparator;
	
public java.lang.ObjectfirstKey()

see
PersistentSortedMap#firstKey()

		read();
		return ( (SortedMap) map ).firstKey();
	
public java.util.SortedMapheadMap(java.lang.Object toKey)

see
PersistentSortedMap#headMap(Object)

		read();
		SortedMap m;
		m = ( (SortedMap) map ).headMap(toKey);
		return new SortedSubMap(m);
	
public java.lang.ObjectlastKey()

see
PersistentSortedMap#lastKey()

		read();
		return ( (SortedMap) map ).lastKey();
	
public voidsetComparator(java.util.Comparator comparator)

		this.comparator = comparator;
	
protected java.io.Serializablesnapshot(org.hibernate.persister.collection.BasicCollectionPersister persister, org.hibernate.EntityMode entityMode)

		TreeMap clonedMap = new TreeMap(comparator);
		Iterator iter = map.entrySet().iterator();
		while ( iter.hasNext() ) {
			Map.Entry e = (Map.Entry) iter.next();
			clonedMap.put( e.getKey(), persister.getElementType().deepCopy( e.getValue(), entityMode, persister.getFactory() ) );
		}
		return clonedMap;
	
public java.util.SortedMapsubMap(java.lang.Object fromKey, java.lang.Object toKey)

see
PersistentSortedMap#subMap(Object, Object)

		read();
		SortedMap m = ( (SortedMap) map ).subMap(fromKey, toKey);
		return new SortedSubMap(m);
	
public java.util.SortedMaptailMap(java.lang.Object fromKey)

see
PersistentSortedMap#tailMap(Object)

		read();
		SortedMap m;
		m = ( (SortedMap) map ).tailMap(fromKey);
		return new SortedSubMap(m);