at.jku.risc.stout.urauc.data
public class Hedge extends Printable implements Cloneable, Comparable<Hedge>
Modifier and Type | Field and Description |
---|---|
static Hedge |
nullHedge |
static String |
PRINT_PARAM_END |
static String |
PRINT_PARAM_SEPARATOR |
static String |
PRINT_PARAM_START |
Constructor and Description |
---|
Hedge()
Create an empty hedge
|
Hedge(boolean commutative)
Create an empty hedge
|
Hedge(int capacity)
Create an empty hedge with the given initial capacity.
|
Hedge(int capacity,
boolean commutative)
Create an empty hedge with the given initial capacity.
|
Hedge(List<TermNode> sequence)
Create a hedge with the specified sequence of TermNodes in
it.
|
Hedge(List<TermNode> sequence,
boolean commutative) |
Hedge(TermAtom... atoms)
|
Hedge(TermNode... tNodes)
Create a hedge with the specified TermNodes in it.
|
Modifier and Type | Method and Description |
---|---|
void |
add(TermAtom atom) |
void |
add(TermNode t) |
void |
addAll(Hedge other) |
void |
addAll(TermAtom... atoms) |
void |
addAll(TermNode... tNodes) |
Hedge |
apply(Map<Variable,TermNode> sigma) |
Hedge |
clone() |
int |
compareTo(Hedge other) |
boolean |
equals(Object o) |
TermNode |
get(int i) |
TermAtom |
get(int[] position,
int idx) |
Hedge |
getHoleHedge() |
int |
getHoleIdx() |
List<TermNode> |
getSequence() |
int |
hashCode() |
void |
initPosition(int[] parentIndex) |
boolean |
isCommutative() |
boolean |
isEmpty() |
boolean |
isHole() |
void |
makeAssociative(Set<TermAtom> associativeSymbols,
TermAtom associativeParent) |
void |
makeCommutative(Set<TermAtom> commutativeSymbols,
boolean commutative) |
boolean |
nextCommutativeArrangement() |
void |
normalizeVarNames(Map<String,String> renaming) |
void |
print(Writer out) |
void |
print(Writer out,
boolean parenthesis) |
int |
replace(int idx,
Hedge toHedge)
Attention: Breaks the position indexes!
Replaces the TermNode at the given position by the given sequence. |
int |
replace(int idx,
TermNode toTerm)
|
boolean |
replaceHole(Hedge plugIn)
Replaces the hole in this hedge with the given other hedge.Returns true
if a hole has been found.
|
void |
setCommutative(boolean commutative) |
void |
setIgnoreLeaves(Map<TermAtom,Integer> symDiff) |
void |
setTo(TermNode singleNode) |
int |
size() |
void |
sortCommutative(boolean sortAll) |
Hedge |
subHedge(int fromIndex)
Returns a view of the tail of this hedge starting at the specified
fromIndex, inclusive.
|
Hedge |
subHedge(int fromIndex,
int toIndex)
Returns a view of the portion of this hedge between the specified
fromIndex, inclusive, and toIndex, exclusive.
|
Hedge |
substitute(Variable x,
Hedge h) |
Hedge |
substitute(Variable x,
TermNode t) |
TermAtomList |
top() |
TermAtomList |
word()
Returns the word representation of this hedge
|
void |
word(TermAtomList atomList)
Adds the word representation of this hedge at the end of the list
|
public static final Hedge nullHedge
public static String PRINT_PARAM_END
public static String PRINT_PARAM_SEPARATOR
public static String PRINT_PARAM_START
public Hedge()
public Hedge(boolean commutative)
public Hedge(int capacity)
public Hedge(int capacity, boolean commutative)
public Hedge(List<TermNode> sequence)
public Hedge(TermAtom... atoms)
public void add(TermAtom atom)
public void add(TermNode t)
public void addAll(Hedge other)
public void addAll(TermAtom... atoms)
public void addAll(TermNode... tNodes)
public int compareTo(Hedge other)
compareTo
in interface Comparable<Hedge>
public TermNode get(int i)
public TermAtom get(int[] position, int idx)
public Hedge getHoleHedge()
public int getHoleIdx()
public void initPosition(int[] parentIndex)
public boolean isCommutative()
public boolean isEmpty()
public boolean isHole()
public void makeAssociative(Set<TermAtom> associativeSymbols, TermAtom associativeParent)
public boolean nextCommutativeArrangement()
public void print(Writer out) throws IOException
print
in class Printable
IOException
public void print(Writer out, boolean parenthesis) throws IOException
IOException
public int replace(int idx, Hedge toHedge)
initPosition(int[])
public int replace(int idx, TermNode toTerm)
public boolean replaceHole(Hedge plugIn)
public void setCommutative(boolean commutative)
public void setTo(TermNode singleNode)
public int size()
public void sortCommutative(boolean sortAll)
public Hedge subHedge(int fromIndex)
subHedge(int, int)
public Hedge subHedge(int fromIndex, int toIndex)
List.subList(int, int)
public TermAtomList top()
public TermAtomList word()
public void word(TermAtomList atomList)