public class Stack<E> extends Stack<E> implements BackedSCO
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowNulls |
protected ListStore<E> |
backingStore |
protected boolean |
isCacheLoaded |
protected boolean |
useCache |
capacityIncrement, elementCount, elementData
modCount
Constructor and Description |
---|
Stack(ObjectProvider op,
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 Stack
|
void |
add(int index,
E element)
Method to add an element to a position in the Stack
|
boolean |
addAll(Collection elements)
Method to add a Collection to the Stack
|
boolean |
addAll(int index,
Collection elements)
Method to add a Collection to a position in the Stack
|
void |
addElement(E element)
Method to add an element to the Stack
|
void |
clear()
Method to clear the Stack
|
Object |
clone()
Clone operator to return a copy of this object.
|
boolean |
contains(Object element)
Method to return if the list contains this element.
|
boolean |
empty()
Accessor for whether the Stack is empty.
|
boolean |
equals(Object o)
Equality operator.
|
E |
get(int index)
Method to retrieve an element no.
|
Store |
getBackingStore() |
Stack |
getValue()
Accessor for the unwrapped value that we are wrapping.
|
int |
indexOf(Object element)
Method to the position of an element.
|
void |
initialise()
Method to initialise the SCO for use.
|
void |
initialise(Stack c)
Method to initialise the SCO from an existing value.
|
void |
initialise(Stack 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.
|
boolean |
isEmpty()
Accessor for whether the Stack is empty.
|
boolean |
isLoaded()
Method to return if the SCO has its contents loaded.
|
Iterator<E> |
iterator()
Method to retrieve an iterator for the list.
|
int |
lastIndexOf(Object element)
Method to retrieve the last position of the element.
|
ListIterator<E> |
listIterator()
Method to retrieve a List iterator for the list.
|
ListIterator<E> |
listIterator(int index)
Method to retrieve a List iterator for the list from the index.
|
void |
load()
Method to effect the load of the data in the SCO.
|
protected void |
loadFromStore()
Method to load all elements from the "backing store" where appropriate.
|
java.util.stream.Stream |
parallelStream() |
E |
peek()
Method to retrieve the element at the top of the stack.
|
E |
pop()
Method to remove the top element in the stack and return it.
|
E |
push(E element)
Method to push an element onto the stack and return it.
|
E |
remove(int index)
Method to remove an element from the Stack
|
boolean |
remove(Object element)
Method to remove an element from the Stack
|
boolean |
remove(Object element,
boolean allowCascadeDelete)
Method to remove an element from the collection, and observe the flag for whether to allow cascade delete.
|
boolean |
removeAll(Collection elements)
Method to remove a Collection of objects from the Stack
|
void |
removeAllElements()
Method to remove all elements from the Stack.
|
boolean |
removeElement(Object element)
Method to remove an element from the Stack
|
void |
removeElementAt(int index)
Method to remove an element from the Stack
|
boolean |
retainAll(Collection c)
Method to retain a Collection of elements (and remove all others).
|
E |
set(int index,
E element)
Method to set the element at a position in the Stack
|
E |
set(int index,
E element,
boolean allowDependentField)
Wrapper addition that allows turning off of the dependent-field checks
when doing the position setting.
|
void |
setElementAt(E element,
int index)
Method to set the element at a position in the Stack
|
int |
size()
Accessor for the size of the Stack.
|
Spliterator |
spliterator() |
java.util.stream.Stream |
stream() |
List<E> |
subList(int from,
int to)
Accessor for the subList of elements between from and to of the List
|
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.
|
attachCopy, detachCopy, ensureCapacity, forEach, getFieldName, getOwner, hashCode, makeDirty, removeIf, replaceAll, setValue, sort, trimToSize
capacity, containsAll, copyInto, elementAt, elements, firstElement, indexOf, insertElementAt, lastElement, lastIndexOf, removeRange, setSize, toString
protected transient boolean allowNulls
protected transient boolean useCache
protected transient boolean isCacheLoaded
public Stack(ObjectProvider op, AbstractMemberMetaData mmd)
op
- The owner ObjectProvidermmd
- Metadata for the memberpublic void initialise(Stack newValue, Object oldValue)
SCO
initialise
in interface SCO<Stack<E>>
initialise
in class Stack<E>
newValue
- New value (to wrap)oldValue
- Old value (to use in deciding what needs deleting etc)public void initialise(Stack c)
initialise
in interface SCO<Stack<E>>
initialise
in class Stack<E>
c
- The object to set frompublic void initialise()
initialise
in interface SCO<Stack<E>>
initialise
in class Stack<E>
public Stack getValue()
public void load()
public boolean isLoaded()
protected void loadFromStore()
public Store getBackingStore()
getBackingStore
in interface BackedSCO
public void updateEmbeddedElement(E element, int fieldNumber, Object value, boolean makeDirty)
updateEmbeddedElement
in interface SCOCollection<Stack<E>,E>
updateEmbeddedElement
in class Stack<E>
element
- The elementfieldNumber
- Number of field in the elementvalue
- New value for this fieldmakeDirty
- Whether to make the SCO field dirty.public void unsetOwner()
unsetOwner
in interface SCO<Stack<E>>
unsetOwner
in class Stack<E>
public Object clone()
Mutable second-class Objects are required to provide a public clone method in order to allow for copying persistable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
public boolean contains(Object element)
public boolean empty()
public boolean equals(Object o)
public E get(int index)
public int indexOf(Object element)
public boolean isEmpty()
public ListIterator<E> listIterator()
listIterator
in interface List<E>
listIterator
in class Stack<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
listIterator
in class Stack<E>
index
- The start pointpublic int lastIndexOf(Object element)
lastIndexOf
in interface List<E>
lastIndexOf
in class Stack<E>
element
- The elementpublic E peek()
public int size()
public List<E> subList(int from, int to)
public Object[] toArray()
public void add(int index, E element)
public boolean add(E element)
public void addElement(E element)
addElement
in class Stack<E>
element
- The new elementpublic boolean addAll(Collection elements)
public boolean addAll(int index, Collection elements)
public void clear()
public E pop()
public boolean remove(Object element)
public boolean remove(Object element, boolean allowCascadeDelete)
public boolean removeAll(Collection elements)
public boolean removeElement(Object element)
removeElement
in class Stack<E>
element
- The elementpublic E remove(int index)
public void removeElementAt(int index)
removeElementAt
in class Stack<E>
index
- The element position.public void removeAllElements()
removeAllElements
in class Stack<E>
public boolean retainAll(Collection c)
public E set(int index, E element, boolean allowDependentField)
public void setElementAt(E element, int index)
setElementAt
in class Stack<E>
element
- The new elementindex
- The positionprotected Object writeReplace() throws ObjectStreamException
writeReplace
in class Stack<E>
ObjectStreamException
- if an error occurspublic Spliterator spliterator()
spliterator
in interface Iterable<E>
spliterator
in interface Collection<E>
spliterator
in interface List<E>
spliterator
in class Stack<E>
public java.util.stream.Stream stream()
public java.util.stream.Stream parallelStream()
parallelStream
in interface Collection<E>
parallelStream
in class Stack<E>
Copyright © 2018. All rights reserved.