public class SortedSet<E> extends AbstractSet<E> implements SortedSet<E>, SCOCollection<SortedSet<E>,E>, Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
protected SortedSet<E> |
delegate
The internal "delegate".
|
protected AbstractMemberMetaData |
ownerMmd |
protected ObjectProvider |
ownerOP |
Constructor and Description |
---|
SortedSet(ObjectProvider ownerOP,
AbstractMemberMetaData mmd)
Constructor, using the ObjectProvider of the "owner" and the field name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E element)
Method to add an element to the SortedSet.
|
boolean |
addAll(Collection elements)
Method to add a collection to the SortedSet.
|
void |
attachCopy(SortedSet value)
Method to return an attached copy of the passed (detached) value.
|
void |
clear()
Method to clear the SortedSet
|
Object |
clone()
Creates and returns a copy of this object.
|
Comparator |
comparator()
Accessor for the comparator.
|
boolean |
contains(Object element)
Accessor for whether an element is contained in this Set.
|
boolean |
containsAll(Collection c)
Accessor for whether a collection is contained in this Set.
|
SortedSet |
detachCopy(FetchPlanState state)
Method to return a detached copy of the container.
|
boolean |
equals(Object o)
Equality operator.
|
E |
first()
Accessor for the first element in the sorted set.
|
void |
forEach(java.util.function.Consumer action) |
String |
getFieldName()
Accessor for the field name.
|
Object |
getOwner()
Accessor for the owner object.
|
SortedSet<E> |
getValue()
Accessor for the unwrapped value that we are wrapping.
|
int |
hashCode()
Hashcode operator.
|
SortedSet<E> |
headSet(E toElement)
Method to retrieve the head elements up to the specified element.
|
void |
initialise()
Method to initialise the SCO for use, and allowing the SCO to be loaded from the datastore (when we have a backing store).
|
void |
initialise(SortedSet c)
Method to initialise the SCO for use with the provided initial value.
|
void |
initialise(SortedSet<E> newValue,
Object oldValue)
Method to initialise the SCO for use, where replacing an old value with a new value such as when calling a setter field
passing in a new value.
|
protected void |
initialiseDelegate()
Convenience method to set up the delegate respecting any comparator specified in MetaData.
|
boolean |
isEmpty()
Accessor for whether the SortedSet is empty.
|
boolean |
isLoaded()
Method to return if the SCO has its contents loaded.
|
Iterator |
iterator()
Accessor for an iterator for the Set.
|
E |
last()
Accessor for the last element in the sorted set.
|
void |
load()
Method to effect the load of the data in the SCO.
|
void |
makeDirty()
Utility to mark the object as dirty
|
java.util.stream.Stream |
parallelStream() |
boolean |
remove(Object element)
Method to remove an element from the List
|
boolean |
remove(Object element,
boolean allowCascadeDelete)
Method to remove an element from the List
|
boolean |
removeAll(Collection elements)
Method to remove all elements from the collection from the SortedSet.
|
boolean |
removeIf(java.util.function.Predicate filter) |
boolean |
retainAll(Collection c)
Method to retain a Collection of elements (and remove all others).
|
void |
setValue(SortedSet<E> value)
Method to change the delegate value this wraps (to save recreating the wrapper).
|
int |
size()
Accessor for the size of the SortedSet.
|
Spliterator |
spliterator() |
java.util.stream.Stream |
stream() |
SortedSet<E> |
subSet(E fromElement,
E toElement)
Method to retrieve the subset of elements between the specified elements.
|
SortedSet<E> |
tailSet(E fromElement)
Method to retrieve the set of elements after the specified element.
|
Object[] |
toArray()
Method to return the list as an array.
|
Object[] |
toArray(Object[] a)
Method to return the list as an array.
|
void |
unsetOwner()
Method to unset the owner and field information.
|
void |
updateEmbeddedElement(E element,
int fieldNumber,
Object value,
boolean makeDirty)
Method to update an embedded element in this collection.
|
protected Object |
writeReplace()
The writeReplace method is called when ObjectOutputStream is preparing
to write the object to the stream.
|
toString
protected transient ObjectProvider ownerOP
protected transient AbstractMemberMetaData ownerMmd
public SortedSet(ObjectProvider ownerOP, AbstractMemberMetaData mmd)
ownerOP
- The owner ObjectProvidermmd
- Metadata for the memberpublic void initialise(SortedSet<E> newValue, Object oldValue)
SCO
initialise
in interface SCO<SortedSet<E>>
newValue
- New value (to wrap)oldValue
- Old value (to use in deciding what needs deleting etc)public void initialise(SortedSet c)
SCO
initialise
in interface SCO<SortedSet<E>>
c
- the object from which to copy the value.public void initialise()
SCO
initialise
in interface SCO<SortedSet<E>>
protected void initialiseDelegate()
public void setValue(SortedSet<E> value)
SCOContainer
setValue
in interface SCOContainer<SortedSet<E>>
value
- The new valuepublic void load()
load
in interface SCOContainer<SortedSet<E>>
public boolean isLoaded()
isLoaded
in interface SCOContainer<SortedSet<E>>
public void updateEmbeddedElement(E element, int fieldNumber, Object value, boolean makeDirty)
updateEmbeddedElement
in interface SCOCollection<SortedSet<E>,E>
element
- The elementfieldNumber
- Number of field in the elementvalue
- New value for this fieldmakeDirty
- Whether to make the SCO field dirty.public String getFieldName()
getFieldName
in interface SCO<SortedSet<E>>
public Object getOwner()
public void unsetOwner()
unsetOwner
in interface SCO<SortedSet<E>>
public void makeDirty()
public SortedSet detachCopy(FetchPlanState state)
detachCopy
in interface SCO<SortedSet<E>>
state
- State for detachment processpublic void attachCopy(SortedSet value)
attachCopy
in interface SCO<SortedSet<E>>
value
- The new (collection) valuepublic Object clone()
public Comparator comparator()
comparator
in interface SortedSet<E>
public boolean contains(Object element)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractCollection<E>
element
- The elementpublic boolean containsAll(Collection c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
containsAll
in class AbstractCollection<E>
c
- The collectionpublic boolean equals(Object o)
equals
in interface Collection<E>
equals
in interface Set<E>
equals
in class AbstractSet<E>
o
- The object to compare against.public E first()
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in interface Set<E>
hashCode
in class AbstractSet<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
isEmpty
in class AbstractCollection<E>
public Iterator iterator()
public SortedSet<E> headSet(E toElement)
public SortedSet<E> subSet(E fromElement, E toElement)
public SortedSet<E> tailSet(E fromElement)
public E last()
public int size()
size
in interface Collection<E>
size
in interface Set<E>
size
in class AbstractCollection<E>
public Object[] toArray()
toArray
in interface Collection<E>
toArray
in interface Set<E>
toArray
in class AbstractCollection<E>
public Object[] toArray(Object[] a)
toArray
in interface Collection<E>
toArray
in interface Set<E>
toArray
in class AbstractCollection<E>
a
- The runtime types of the array being defined by this parampublic boolean add(E element)
add
in interface Collection<E>
add
in interface Set<E>
add
in class AbstractCollection<E>
element
- The new elementpublic boolean addAll(Collection elements)
addAll
in interface Collection<E>
addAll
in interface Set<E>
addAll
in class AbstractCollection<E>
elements
- The collectionpublic void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractCollection<E>
public boolean remove(Object element)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractCollection<E>
element
- The Element to removepublic boolean remove(Object element, boolean allowCascadeDelete)
remove
in interface SCOCollection<SortedSet<E>,E>
element
- The Element to removeallowCascadeDelete
- Whether to allow cascade deletepublic boolean removeAll(Collection elements)
removeAll
in interface Collection<E>
removeAll
in interface Set<E>
removeAll
in class AbstractSet<E>
elements
- The collection of elements to removepublic boolean retainAll(Collection c)
retainAll
in interface Collection<E>
retainAll
in interface Set<E>
retainAll
in class AbstractCollection<E>
c
- The collection to retainprotected Object writeReplace() throws ObjectStreamException
ObjectStreamException
- if an error occurspublic java.util.stream.Stream stream()
stream
in interface Collection<E>
public java.util.stream.Stream parallelStream()
parallelStream
in interface Collection<E>
public void forEach(java.util.function.Consumer action)
public Spliterator spliterator()
spliterator
in interface Iterable<E>
spliterator
in interface Collection<E>
spliterator
in interface Set<E>
spliterator
in interface SortedSet<E>
public boolean removeIf(java.util.function.Predicate filter)
removeIf
in interface Collection<E>
Copyright © 2018. All rights reserved.