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

PersistentSortedSet

public class PersistentSortedSet extends PersistentSet implements SortedSet
A persistent wrapper for a java.util.SortedSet. Underlying collection is a TreeSet.
see
java.util.TreeSet
author
e

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

		super(session);
	
public PersistentSortedSet(org.hibernate.engine.SessionImplementor session, SortedSet set)

		super(session, set);
		comparator = set.comparator();
	
public PersistentSortedSet()

Methods Summary
public java.util.Comparatorcomparator()

see
PersistentSortedSet#comparator()

		return comparator;
	
public java.lang.Objectfirst()

see
PersistentSortedSet#first()

		read();
		return ( (SortedSet) set ).first();
	
public java.util.SortedSetheadSet(java.lang.Object toElement)

see
PersistentSortedSet#headSet(Object)

		read();
		SortedSet s = ( (SortedSet) set ).headSet(toElement);
		return new SubSetProxy(s);
	
public java.lang.Objectlast()

see
PersistentSortedSet#last()

		read();
		return ( (SortedSet) set ).last();
	
public voidsetComparator(java.util.Comparator comparator)

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

		//if (set==null) return new Set(session);
		TreeMap clonedSet = new TreeMap(comparator);
		Iterator iter = set.iterator();
		while ( iter.hasNext() ) {
			Object copy = persister.getElementType().deepCopy( iter.next(), entityMode, persister.getFactory() );
			clonedSet.put(copy, copy);
		}
		return clonedSet;
	
public java.util.SortedSetsubSet(java.lang.Object fromElement, java.lang.Object toElement)

see
PersistentSortedSet#subSet(Object,Object)

		read();
		SortedSet s;
		s = ( (SortedSet) set ).subSet(fromElement, toElement);
		return new SubSetProxy(s);
	
public java.util.SortedSettailSet(java.lang.Object fromElement)

see
PersistentSortedSet#tailSet(Object)

		read();
		SortedSet s = ( (SortedSet) set ).tailSet(fromElement);
		return new SubSetProxy(s);