|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Leaf<E>>
com.accountingenhancements.treearray.LeafNode<E>
public class LeafNode<E>
An ArrayList of Leaf
elements.
Each BranchNode
contains a LeafNode
that contains the Leaf
entries.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
LeafNode()
Creates a new instance of LeafNode |
|
LeafNode(int initialCapacity)
|
Method Summary | |
---|---|
E |
addAndReturnElement(E o)
Appends the specified element to the end of this list. |
Leaf<E> |
addAndReturnLeaf(Leaf<E> o)
Appends the specified leaf to the end of this list. |
LeafNode |
addAndReturnLeafNode(E o)
Appends the specified element to the end of this list. |
LeafNode |
addAndReturnLeafNode(Leaf<E> o)
Appends the specified leaf to the end of this list. |
boolean |
addLeaf(E o)
Appends the specified element to the end of this list (Creates Leaf for the object). |
void |
addLeaf(int index,
E element)
Inserts the specified element at the specified position in this list (Creates Leaf for the object). |
void |
addLeaf(int index,
Leaf<E> element)
Inserts the specified leaf at the specified position in this list (Creates Leaf for the object). |
boolean |
addLeaf(Leaf<E> leaf)
Appends the specified leaf to the end of this list (Creates Leaf for the object). |
boolean |
containsElement(E element)
|
E |
getLeafElement(int index)
|
int |
indexOfElement(E element)
Find index of specified element |
int |
lastIndexOfElement(E element)
Find the last index of specified element |
E |
setLeaf(int index,
E o)
Replace the element inside a leaf at the specified position in this list. |
java.lang.Object[] |
toArrayElements()
Leaf node elements to an array |
E[] |
toArrayElements(E[] result)
Leaf node elements to an array |
Methods inherited from class java.util.ArrayList |
---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public LeafNode()
public LeafNode(int initialCapacity)
Method Detail |
---|
public Leaf<E> addAndReturnLeaf(Leaf<E> o)
o
- leaft to be appended to this list.
public LeafNode addAndReturnLeafNode(Leaf<E> o)
o
- leaf to be appended to this list.
public E addAndReturnElement(E o)
o
- element to be appended to this list.
public LeafNode addAndReturnLeafNode(E o)
o
- element to be appended to this list.
public E setLeaf(int index, E o)
index
- - index of element to replaceo
- - element to be stored at the specified position.
InedxOutOfBoundsException
- - if index out of range (index < 0 || index >= size())
.public boolean addLeaf(E o)
Leaf
for the object).
o
- element to be appended to this list.
public E getLeafElement(int index)
index
- the index of the Leaf within the LeafNode
public void addLeaf(int index, E element)
Leaf
for the object). Shifts the
element currently at that position (if any) and
any subsequent elements to the right (adds one to their indices).
index
- index at which the specified element is to be inserted.element
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index < 0 || index > size()).public boolean addLeaf(Leaf<E> leaf)
Leaf
for the object).
leaf
- element to be appended to this list.
public boolean containsElement(E element)
element
- for which the ArrayList is being searched.
public int indexOfElement(E element)
element
- for which to search
public int lastIndexOfElement(E element)
element
- for which to search
public java.lang.Object[] toArrayElements()
public E[] toArrayElements(E[] result)
public void addLeaf(int index, Leaf<E> element)
Leaf
for the object). Shifts the
element currently at that position (if any) and
any subsequent elements to the right (adds one to their indices).
index
- index at which the specified element is to be inserted.element
- element to be inserted.
java.lang.IndexOutOfBoundsException
- if index is out of range
(index < 0 || index > size()).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |