|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnars.entity.BudgetValue
nars.entity.Item
nars.entity.TermLink
public class TermLink
A link between a compound term and a component term
A TermLink links the current Term to a target Term, which is either a component of, or compound made from, the current term.
Neither of the two terms contain variable shared with other terms.
The index value(s) indicates the location of the component in the compound.
This class is mainly used in inference.RuleTable to dispatch premises to inference rules
| Field Summary | |
|---|---|
static short |
COMPONENT
At (&&, A, C), point to C |
static short |
COMPONENT_CONDITION
At <(&&, C, B) ==> A>, point to C |
static short |
COMPONENT_STATEMENT
At |
static short |
COMPOUND
At C, point to (&&, A, C) |
static short |
COMPOUND_CONDITION
At C, point to <(&&, C, B) ==> A> |
static short |
COMPOUND_STATEMENT
At C, point to |
protected short[] |
index
The index of the component in the component list of the compound, may have up to 4 levels |
static short |
SELF
At C, point to C; TaskLink only |
private Term |
target
The linked Term |
static short |
TRANSFORM
At C, point to <(*, C, B) --> A>; TaskLink only |
protected short |
type
The type of link, one of the above |
| Fields inherited from class nars.entity.Item |
|---|
key |
| Fields inherited from class nars.entity.BudgetValue |
|---|
durability, priority, quality |
| Constructor Summary | |
|---|---|
|
TermLink()
Default constructor |
protected |
TermLink(BudgetValue v)
Default Constructor need in TaskLink |
|
TermLink(Term t,
short p,
int... indices)
Constructor for TermLink template |
|
TermLink(Term t,
TermLink template,
BudgetValue v)
Constructor to make actual TermLink from a template |
| Method Summary | |
|---|---|
short |
getIndex(int i)
Get one index by level |
short[] |
getIndices()
Get all the indices |
Term |
getTarget()
Get the target of the link |
short |
getType()
Get the link type |
protected void |
setKey()
Set the key of the link |
java.lang.String |
toString()
Get a String representation of the link, with full accuracy |
java.lang.String |
toString2()
Get a String representation of the link, with 2-digit accuracy |
| Methods inherited from class nars.entity.Item |
|---|
getBudget, getKey |
| Methods inherited from class nars.entity.BudgetValue |
|---|
aboveThreshold, clone, decDurability, decPriority, decQuality, getDurability, getPriority, getQuality, incDurability, incPriority, incQuality, merge, setDurability, setPriority, setQuality, summary |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final short SELF
public static final short COMPONENT
public static final short COMPOUND
public static final short COMPONENT_STATEMENT
public static final short COMPOUND_STATEMENT
public static final short COMPONENT_CONDITION
public static final short COMPOUND_CONDITION
public static final short TRANSFORM
private Term target
protected short type
protected short[] index
| Constructor Detail |
|---|
public TermLink()
public TermLink(Term t,
short p,
int... indices)
called in CompoundTerm.prepareComponentLinks only
t - Target Termp - Link typeindices - Component indices in compound, may be 1 to 4protected TermLink(BudgetValue v)
v - Budget value of the link
public TermLink(Term t,
TermLink template,
BudgetValue v)
called in Concept.buildTermLinks only
t - Target Termtemplate - TermLink template previously preparedv - Budget value of the link| Method Detail |
|---|
protected void setKey()
public Term getTarget()
public short getType()
public short[] getIndices()
public short getIndex(int i)
i - The index level
public java.lang.String toString()
toString in class BudgetValuepublic java.lang.String toString2()
toString2 in class BudgetValue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||