Top Description Inners Fields Constructors Methods
org.hibernate.collection.spi

public Class PersistentSortedSet<E>

extends PersistentSet<E>
implements SortedSet<E>
Class Inheritance
All Implemented Interfaces
java.util.SortedSet, java.util.SequencedSet, java.util.Set, java.util.Collection, java.lang.Iterable, java.util.SequencedCollection
Annotations
@Incubating
Imports
java.io.Serializable, java.util.Comparator, .SortedSet, .TreeMap, org.hibernate.HibernateException, .Incubating, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.persister.collection.BasicCollectionPersister

A persistent wrapper for a java.util.SortedSet. Underlying collection is a TreeSet.

API Note

Incubating in terms of making this non-internal. These contracts will be getting cleaned up in following releases.

Author
Doug Currie

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<? super E>
Inherited from org.hibernate.collection.spi.PersistentSet:
set

Constructor Summary

AccessConstructor and Description
public
PersistentSortedSet()

Constructs a PersistentSortedSet.

public
PersistentSortedSet(SharedSessionContractImplementor
The session
session
,
Comparator<E>
The sort comparator
comparator
)

Constructs a PersistentSortedSet

public
PersistentSortedSet(SharedSessionContractImplementor
The session
session
,
SortedSet<E>
The underlying set data
set
)

Constructs a PersistentSortedSet

Method Summary

Modifier and TypeMethod and Description
public Comparator<? super E>
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 E
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.
public SortedSet<E>
headSet(E
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 E
last()

Implements java.util.SortedSet.last.

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

protected Serializable
snapshot(BasicCollectionPersister persister)

Deprecated as a consequence of BasicCollectionPersister being deprecated.
public SortedSet<E>
subSet(E
low endpoint (inclusive) of the returned set
fromElement
,
E
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(E
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.spi.PersistentSet:
addaddAllclearcontainscontainsAlldisassembleemptyentriesentryExistsequalsequalsSnapshotgetDeletesgetElementgetIndexgetOrphansgetSnapshotgetSnapshotElementhashCodeinitializeEmptyCollectioninitializeFromCacheinjectLoadedStateisEmptyisRowUpdatePossibleisSnapshotEmptyisWrapperiteratorneedsInsertingneedsUpdatingremoveremoveAllretainAllsizetoArraytoArraytoString

Field Detail

comparatorback to summary
protected Comparator<? super E> comparator

Constructor Detail

PersistentSortedSetback to summary
public PersistentSortedSet()

Constructs a PersistentSortedSet. This form needed for SOAP libraries, etc

Annotations
@SuppressWarnings:UnusedDeclaration
PersistentSortedSetback to summary
public PersistentSortedSet(SharedSessionContractImplementor session, Comparator<E> comparator)

Constructs a PersistentSortedSet

Parameters
session:SharedSessionContractImplementor

The session

comparator:Comparator<E>

The sort comparator

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

Constructs a PersistentSortedSet

Parameters
session:SharedSessionContractImplementor

The session

set:SortedSet<E>

The underlying set data

Method Detail

comparatorback to summary
public Comparator<? super E> 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<? super E>

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

Annotations
@Override
firstback to summary
public E first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

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

Returns:E

the first (lowest) element currently in this set

Annotations
@Override
headSetback to summary
public SortedSet<E> headSet(E 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:E

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

Annotations
@Override
lastback to summary
public E last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

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

Returns:E

the last (highest) element currently in this set

Annotations
@Override
setComparatorback to summary
public void setComparator(Comparator<? super E> comparator)
snapshotback to summary
protected Serializable snapshot(BasicCollectionPersister persister) throws HibernateException

Deprecated

as a consequence of BasicCollectionPersister being deprecated. See corresponding docs for further information.

Annotations
@SuppressWarnings:UnusedParameters
subSetback to summary
public SortedSet<E> subSet(E fromElement, E 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:E

low endpoint (inclusive) of the returned set

toElement:E

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

Annotations
@Override
tailSetback to summary
public SortedSet<E> tailSet(E 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:E

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

Annotations
@Override
org.hibernate.collection.spi back to summary

pack-priv Class PersistentSortedSet.SubSetProxy

extends AbstractPersistentCollection<E>.SetProxy<E>
implements SortedSet<E>
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.spi.AbstractPersistentCollection.SetProxy:
set

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Comparator<? super E>
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 E
first()

Implements java.util.SortedSet.first.

Returns the first (lowest) element currently in this set.
public SortedSet<E>
headSet(E
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 E
last()

Implements java.util.SortedSet.last.

Returns the last (highest) element currently in this set.
public SortedSet<E>
subSet(E
low endpoint (inclusive) of the returned set
fromValue
,
E
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(E
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.spi.AbstractPersistentCollection.SetProxy:
addaddAllclearcontainscontainsAllisEmptyiteratorremoveremoveAllretainAllsizetoArraytoArray

Constructor Detail

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

Method Detail

comparatorback to summary
public Comparator<? super E> 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<? super E>

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

Annotations
@Override
firstback to summary
public E first()

Implements java.util.SortedSet.first.

Doc from java.util.SortedSet.first.

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

Returns:E

the first (lowest) element currently in this set

Annotations
@Override
headSetback to summary
public SortedSet<E> headSet(E 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:E

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

Annotations
@Override
lastback to summary
public E last()

Implements java.util.SortedSet.last.

Doc from java.util.SortedSet.last.

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

Returns:E

the last (highest) element currently in this set

Annotations
@Override
subSetback to summary
public SortedSet<E> subSet(E fromValue, E 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:E

low endpoint (inclusive) of the returned set

toValue:E

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

Annotations
@Override
tailSetback to summary
public SortedSet<E> tailSet(E 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:E

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

Annotations
@Override