public class SyntacticTermList extends java.util.LinkedList<SyntacticTerm> implements SyntacticTerm
Red |
Red (shaver) |
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedList<SyntacticPort> |
_inputs
List of exposed input ports of constituent terms.
|
protected java.util.LinkedList<SyntacticPort> |
_outputs
List of exposed output ports of constituent terms.
|
protected SyntacticRank |
_rank
Rank of list as a term.
|
Constructor and Description |
---|
SyntacticTermList()
Constructs an empty term list with no rank information.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_refreshPorts()
Refresh the port lists scanning through the terms.
|
protected void |
_refreshRank()
Recalculate the rank of the list as a term.
|
void |
add(int index,
SyntacticTerm term)
Insert a Syntactic Term in the column.
|
boolean |
add(SyntacticTerm term)
Add a Syntactic Term to the column.
|
boolean |
addAll(java.util.Collection<? extends SyntacticTerm> terms)
Add collection of SyntacticTerms to the list by calling
the add function.
|
void |
clear()
Clear list along with port lists.
|
java.lang.String |
generateCode()
Generate code for the term.
|
java.util.List<SyntacticPort> |
getInputs()
Get all of the output ports for a column.
|
int |
getOrder()
Get the sort order of the term.
|
java.util.List<SyntacticPort> |
getOutputs()
Get all of the output ports for a column.
|
boolean |
hasCode()
Decide whether the term has code to generate.
|
java.lang.Integer |
inputIndex(SyntacticPort port)
Get the index of the syntactic input port in the column.
|
java.lang.Integer |
outputIndex(SyntacticPort port)
Get the index of the syntactic output port in the column.
|
SyntacticRank |
rank()
Get the rank of the list.
|
SyntacticTerm |
remove(int index)
Remove a term at a given index.
|
boolean |
remove(java.lang.Object ot)
Remove a Syntactic Term from column.
|
boolean |
removeAll(java.util.Collection<?> terms)
Remove collection of SyntacticTerms to the list by calling
the remove function.
|
SyntacticTerm |
set(int index,
SyntacticTerm term)
Overwrite a Syntactic Term in the column.
|
int |
sizeInputs()
Get the number of inputs to the elements of
the list exposed to the outside.
|
int |
sizeOutputs()
Get the number of outputs to the elements of
the list exposed to the outside.
|
addAll, addFirst, addLast, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size, spliterator, toArray, toArray
equals, hashCode, listIterator, removeRange, subList
finalize, getClass, notify, notifyAll, wait, wait, wait
protected java.util.LinkedList<SyntacticPort> _inputs
protected java.util.LinkedList<SyntacticPort> _outputs
protected SyntacticRank _rank
public SyntacticTermList()
public boolean add(SyntacticTerm term)
This method overrides the LinkedList add().
add
in interface java.util.Collection<SyntacticTerm>
add
in interface java.util.Deque<SyntacticTerm>
add
in interface java.util.List<SyntacticTerm>
add
in interface java.util.Queue<SyntacticTerm>
add
in class java.util.LinkedList<SyntacticTerm>
term
- Term to add to the composition.public boolean addAll(java.util.Collection<? extends SyntacticTerm> terms)
addAll
in interface java.util.Collection<SyntacticTerm>
addAll
in interface java.util.List<SyntacticTerm>
addAll
in class java.util.LinkedList<SyntacticTerm>
terms
- Terms is a collection of SyntacticTerms.public boolean removeAll(java.util.Collection<?> terms)
removeAll
in interface java.util.Collection<SyntacticTerm>
removeAll
in interface java.util.List<SyntacticTerm>
removeAll
in class java.util.AbstractCollection<SyntacticTerm>
terms
- Terms is a collection of SyntacticTerms.public void add(int index, SyntacticTerm term)
This method overrides the LinkedList add().
add
in interface java.util.List<SyntacticTerm>
add
in class java.util.LinkedList<SyntacticTerm>
index
- Index at which to add the term.term
- Term to add to the composition.public boolean remove(java.lang.Object ot)
This method overrides the LinkedList remove.
remove
in interface java.util.Collection<SyntacticTerm>
remove
in interface java.util.Deque<SyntacticTerm>
remove
in interface java.util.List<SyntacticTerm>
remove
in class java.util.LinkedList<SyntacticTerm>
ot
- Term to be removed from the composition.public void clear()
clear
in interface java.util.Collection<SyntacticTerm>
clear
in interface java.util.List<SyntacticTerm>
clear
in class java.util.LinkedList<SyntacticTerm>
public SyntacticTerm set(int index, SyntacticTerm term)
set
in interface java.util.List<SyntacticTerm>
set
in class java.util.LinkedList<SyntacticTerm>
index
- Index at which to overwrite the term.term
- Term with which the term at the given index is replaced.public SyntacticTerm remove(int index)
remove
in interface java.util.List<SyntacticTerm>
remove
in class java.util.LinkedList<SyntacticTerm>
index
- Index at which to remove the term.public java.util.List<SyntacticPort> getInputs()
getInputs
in interface SyntacticTerm
public java.util.List<SyntacticPort> getOutputs()
getOutputs
in interface SyntacticTerm
public int sizeInputs()
sizeInputs
in interface SyntacticTerm
public int sizeOutputs()
sizeOutputs
in interface SyntacticTerm
public SyntacticRank rank()
rank
in interface SyntacticTerm
public java.lang.Integer inputIndex(SyntacticPort port)
inputIndex
in interface SyntacticTerm
port
- Port to find the index of.public java.lang.Integer outputIndex(SyntacticPort port)
outputIndex
in interface SyntacticTerm
port
- Port to find the index of.public java.lang.String generateCode()
generateCode
in interface SyntacticTerm
public int getOrder()
getOrder
in interface SyntacticTerm
public boolean hasCode()
hasCode
in interface SyntacticTerm
protected void _refreshPorts()
protected void _refreshRank()