Top Description Inners Fields Constructors Methods
org.hibernate.collection

public Class PersistentSortedSet

extends PersistentSet
implements SortedSet
Class Inheritance
All Implemented Interfaces
java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection
Imports
java.io.Serializable, java.util.Comparator, .Iterator, .SortedSet, .TreeMap, org.hibernate.EntityMode, .HibernateException, org.hibernate.engine.SessionImplementor, org.hibernate.persister.collection.BasicCollectionPersister

A persistent wrapper for a java.util.SortedSet. Underlying collection is a TreeSet.
Author
e
See Also
java.util.TreeSet

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
PersistentSortedSet.SubSetProxy

wrapper for subSets to propagate write to its backing set

Field Summary

Modifier and TypeField and Description
protected Comparator<T>
Inherited from org.hibernate.collection.PersistentSet:
settempList

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public Comparator<T>
comparator()

Implements java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.
public Object
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.
public SortedSet<E>
headSet(Object
high endpoint (exclusive) of the returned set
toElement
)

Implements java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement.
public Object
last()

Implements java.util.SortedSet.last.

Returns the last (highest) element currently in this set.
public void
setComparator(Comparator<T> comparator)

protected Serializable
public SortedSet<E>
subSet(Object
low endpoint (inclusive) of the returned set
fromElement
,
Object
high endpoint (exclusive) of the returned set
toElement
)

Implements java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive.
public SortedSet<E>
tailSet(Object
low endpoint (inclusive) of the returned set
fromElement
)

Implements java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement.
Inherited from org.hibernate.collection.PersistentSet:
addaddAllbeforeInitializebeginReadclearcontainscontainsAlldisassembleemptyendReadentriesentryExistsequalsequalsSnapshotgetDeletesgetElementgetIndexgetOrphansgetSnapshotgetSnapshotElementhashCodeinitializeFromCacheisEmptyisRowUpdatePossibleisSnapshotEmptyisWrapperiteratorneedsInsertingneedsUpdatingreadFromremoveremoveAllretainAllsizetoArraytoArraytoString

Field Detail

comparatorback to summary
protected Comparator<T> comparator

Constructor Detail

PersistentSortedSetback to summary
public PersistentSortedSet(SessionImplementor session)
PersistentSortedSetback to summary
public PersistentSortedSet(SessionImplementor session, SortedSet<E> set)
PersistentSortedSetback to summary
public PersistentSortedSet()

Method Detail

comparatorback to summary
public Comparator<T> comparator()

Implements java.util.SortedSet.comparator.

Doc from java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.

Returns:Comparator<T>

the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements

See Also
PersistentSortedSet#comparator()
firstback to summary
public Object first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.

Returns:Object

the first (lowest) element currently in this set

See Also
PersistentSortedSet#first()
headSetback to summary
public SortedSet<E> headSet(Object toElement)

Implements java.util.SortedSet.headSet.

Doc from java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
toElement:Object

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are strictly less than toElement

See Also
PersistentSortedSet#headSet(Object)
lastback to summary
public Object last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

Returns the last (highest) element currently in this set.

Returns:Object

the last (highest) element currently in this set

See Also
PersistentSortedSet#last()
setComparatorback to summary
public void setComparator(Comparator<T> comparator)
snapshotback to summary
protected Serializable snapshot(BasicCollectionPersister persister, EntityMode entityMode) throws HibernateException
subSetback to summary
public SortedSet<E> subSet(Object fromElement, Object toElement)

Implements java.util.SortedSet.subSet.

Doc from java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromElement:Object

low endpoint (inclusive) of the returned set

toElement:Object

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive

See Also
PersistentSortedSet#subSet(Object, Object)
tailSetback to summary
public SortedSet<E> tailSet(Object fromElement)

Implements java.util.SortedSet.tailSet.

Doc from java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromElement:Object

low endpoint (inclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are greater than or equal to fromElement

See Also
PersistentSortedSet#tailSet(Object)
org.hibernate.collection back to summary

pack-priv Class PersistentSortedSet.SubSetProxy

extends SetProxy
implements SortedSet
Class Inheritance
All Implemented Interfaces
java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection

wrapper for subSets to propagate write to its backing set

Field Summary

Inherited from org.hibernate.collection.AbstractPersistentCollection.SetProxy:
set

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Comparator<T>
comparator()

Implements java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.
public Object
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.
public SortedSet<E>
headSet(Object
high endpoint (exclusive) of the returned set
toValue
)

Implements java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement.
public Object
last()

Implements java.util.SortedSet.last.

Returns the last (highest) element currently in this set.
public SortedSet<E>
subSet(Object
low endpoint (inclusive) of the returned set
fromValue
,
Object
high endpoint (exclusive) of the returned set
toValue
)

Implements java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive.
public SortedSet<E>
tailSet(Object
low endpoint (inclusive) of the returned set
fromValue
)

Implements java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement.
Inherited from org.hibernate.collection.AbstractPersistentCollection.SetProxy:
addaddAllclearcontainscontainsAllisEmptyiteratorremoveremoveAllretainAllsizetoArraytoArray

Constructor Detail

SubSetProxyback to summary
pack-priv SubSetProxy(SortedSet<E> s)

Method Detail

comparatorback to summary
public Comparator<T> comparator()

Implements java.util.SortedSet.comparator.

Doc from java.util.SortedSet.comparator.

Returns the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements.

Returns:Comparator<T>

the comparator used to order the elements in this set, or null if this set uses the natural ordering of its elements

firstback to summary
public Object first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.

Returns:Object

the first (lowest) element currently in this set

headSetback to summary
public SortedSet<E> headSet(Object toValue)

Implements java.util.SortedSet.headSet.

Doc from java.util.SortedSet.headSet.

Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
toValue:Object

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are strictly less than toElement

lastback to summary
public Object last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

Returns the last (highest) element currently in this set.

Returns:Object

the last (highest) element currently in this set

subSetback to summary
public SortedSet<E> subSet(Object fromValue, Object toValue)

Implements java.util.SortedSet.subSet.

Doc from java.util.SortedSet.subSet.

Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromValue:Object

low endpoint (inclusive) of the returned set

toValue:Object

high endpoint (exclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive

tailSetback to summary
public SortedSet<E> tailSet(Object fromValue)

Implements java.util.SortedSet.tailSet.

Doc from java.util.SortedSet.tailSet.

Returns a view of the portion of this set whose elements are greater than or equal to fromElement. The returned set is backed by this set, so changes in the returned set are reflected in this set, and vice-versa. The returned set supports all optional set operations that this set supports.

The returned set will throw an IllegalArgumentException on an attempt to insert an element outside its range.

Parameters
fromValue:Object

low endpoint (inclusive) of the returned set

Returns:SortedSet<E>

a view of the portion of this set whose elements are greater than or equal to fromElement