public class LinkedVector extends LinkedChild
LinkedVector
is used to store a vector of LinkedChild
ren which all
maintain links between each other and the parent LinkedVector
.LinkedChild
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Vector |
children
The linked vector is simply represented as a vector of children.
|
Constructor and Description |
---|
LinkedVector()
Initializes the vector.
|
LinkedVector(int s,
int e)
Constructor that sets the character offsets of this vector.
|
LinkedVector(LinkedChild c)
Constructor for when only a single child from anywhere in this vector is available.
|
LinkedVector(LinkedChild c,
int s,
int e)
Constructor for when only a single child from anywhere in this vector is available.
|
LinkedVector(LinkedVector p)
Useful when the information that this child represents is parsed forwards.
|
LinkedVector(LinkedVector p,
int s,
int e)
Useful when the information that this child represents is parsed forwards.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(LinkedChild c)
Adds the specified child to the end of the vector, informing the child of its parent and
index and linking the child to its only neighbor (which was previously the last child in the
vector).
|
Object |
clone()
Returns a clone of this object that is deep in the sense that all of the children objects are
cloned.
|
LinkedChild |
get(int i)
Retrieves the child at the specified index in the vector.
|
boolean |
insert(LinkedChild c,
int i)
Inserts the specified child into the specified index.
|
LinkedChild |
remove(int i)
Removes the child at the specified index.
|
int |
size()
Returns the size of the vector.
|
protected Vector children
public LinkedVector()
public LinkedVector(LinkedChild c)
previous
and next
links are filled in by every
child.c
- Any child in this vector.public LinkedVector(LinkedVector p)
p
- The previous child in the parent vector.public LinkedVector(int s, int e)
s
- The offset at which this sentence starts.e
- The offset at which this sentence ends.public LinkedVector(LinkedChild c, int s, int e)
previous
and next
links are filled in by every
child.c
- Any child in this vector.s
- The offset at which this sentence starts.e
- The offset at which this sentence ends.public LinkedVector(LinkedVector p, int s, int e)
p
- The previous child in the parent vector.s
- The offset at which this sentence starts.e
- The offset at which this sentence ends.public boolean add(LinkedChild c)
c
- The child to add.public LinkedChild remove(int i)
i
- The index of the child to remove.null
if there was no child at that index.public boolean insert(LinkedChild c, int i)
c
- The child to insert.i
- The index at which to insert the child.true
if and only if the insert was successful.public LinkedChild get(int i)
i
- The index from which to retrieve a child.null
if there was no child at that
index.public int size()
public Object clone()
clone
in class LinkedChild
Copyright © 2016. All rights reserved.