Serializable
, TLink<Term>
public class TermLink extends Item<TermLink> implements TLink<Term>, Serializable
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
Item.ItemPriorityComparator<E extends Item>, Item.StringKeyItem
Modifier and Type | Field | Description |
---|---|---|
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 <C --> A>, point to C
|
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 <C --> A>
|
protected int |
hash |
|
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
|
Term |
target |
The linked Term
|
static short |
TEMPORAL |
At C, point to B, potentially without common subterm term
|
static short |
TRANSFORM |
At C, point to <(*, C, B) --> A>; TaskLink only
|
short |
type |
The type of link, one of the above
|
Constructor | Description |
---|---|
TermLink(short type,
Term target,
int i0) |
|
TermLink(short type,
Term target,
int i0,
int i1) |
|
TermLink(short type,
Term target,
int i0,
int i1,
int i2) |
|
TermLink(short type,
Term target,
int i0,
int i1,
int i2,
int i3) |
|
TermLink(Term target,
short type,
short... indices) |
Constructor for TermLink template
|
TermLink(Term t,
TermLink template,
BudgetValue v) |
Constructor to make actual TermLink from a template
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
|
short |
getIndex(int i) |
Get one index by level
|
Term |
getTarget() |
|
Term |
getTerm() |
|
int |
hashCode() |
|
protected int |
init() |
|
TermLink |
name() |
Get the current key
|
CharSequence |
newKeyPrefix() |
|
String |
toString() |
Return a String representation of the Item
|
decDurability, decPriority, getBudget, getDurability, getPriority, getPrioritySum, getQuality, incDurability, incPriority, merge, setDurability, setPriority, setQuality, toStringExternal, toStringExternal2, toStringLong
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPriority
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
public static final short TEMPORAL
public final Term target
public final short type
public final short[] index
protected final int hash
public TermLink(Term target, short type, short... indices)
called in CompoundTerm.prepareComponentLinks only
target
- Target Termtype
- Link typeindices
- Component indices in compound, may be 1 to 4public TermLink(Term t, TermLink template, BudgetValue v)
called in Concept.buildTermLinks only
t
- Target Termtemplate
- TermLink template previously preparedv
- Budget value of the linkpublic TermLink(short type, Term target, int i0)
public TermLink(short type, Term target, int i0, int i1)
public TermLink(short type, Term target, int i0, int i1, int i2)
public TermLink(short type, Term target, int i0, int i1, int i2, int i3)
protected int init()
public String toString()
Item
public CharSequence newKeyPrefix()
public final short getIndex(int i)
public Term getTerm()
Copyright © 2020 OpenNARS. All rights reserved.