Package com.yahoo.config
Class NodeVector<NODE>
- java.lang.Object
-
- com.yahoo.config.NodeVector<NODE>
-
- All Implemented Interfaces:
java.lang.Iterable<NODE>
,java.util.Collection<NODE>
,java.util.List<NODE>
- Direct Known Subclasses:
InnerNodeVector
,LeafNodeVector
public abstract class NodeVector<NODE> extends java.lang.Object implements java.util.List<NODE>
A NodeVector represents an array declared with '[]' in a config definition file. It is a List that stores nodes with a given type. A given default node must be given, and this node will be cloned as the NodeVector size are increased.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeVector.ReadOnlyException
-
Constructor Summary
Constructors Constructor Description NodeVector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, NODE element)
boolean
add(NODE o)
boolean
addAll(int index, java.util.Collection<? extends NODE> c)
boolean
addAll(java.util.Collection<? extends NODE> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object o)
NODE
get(int index)
int
hashCode()
int
indexOf(java.lang.Object o)
boolean
isEmpty()
java.util.Iterator<NODE>
iterator()
int
lastIndexOf(java.lang.Object o)
int
length()
Returns the number of elements in this NodeVector.java.util.ListIterator<NODE>
listIterator()
java.util.ListIterator<NODE>
listIterator(int index)
NODE
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
NODE
set(int index, NODE element)
int
size()
java.util.List<NODE>
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
-
-
Field Detail
-
vector
protected final java.util.ArrayList<NODE> vector
-
-
Method Detail
-
length
public int length()
Returns the number of elements in this NodeVector. Alias for size().- Returns:
- the number of elements in this NodeVector.
-
add
public boolean add(NODE o)
-
addAll
public boolean addAll(java.util.Collection<? extends NODE> c)
-
addAll
public boolean addAll(int index, java.util.Collection<? extends NODE> c)
- Specified by:
addAll
in interfacejava.util.List<NODE>
-
clear
public void clear()
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List<NODE>
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<NODE> iterator()
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List<NODE>
-
listIterator
public java.util.ListIterator<NODE> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<NODE>
-
listIterator
public java.util.ListIterator<NODE> listIterator(int index)
- Specified by:
listIterator
in interfacejava.util.List<NODE>
-
size
public int size()
-
subList
public java.util.List<NODE> subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfacejava.util.List<NODE>
-
toArray
public java.lang.Object[] toArray()
-
-