本文整理匯總了Java中nars.io.Symbols.TO_COMPONENT_2屬性的典型用法代碼示例。如果您正苦於以下問題:Java Symbols.TO_COMPONENT_2屬性的具體用法?Java Symbols.TO_COMPONENT_2怎麽用?Java Symbols.TO_COMPONENT_2使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類nars.io.Symbols
的用法示例。
在下文中一共展示了Symbols.TO_COMPONENT_2屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setKey
/**
* Set the key of the link
*/
protected void setKey() {
String at1, at2;
if ((type % 2) == 1) { // to component
at1 = Symbols.TO_COMPONENT_1;
at2 = Symbols.TO_COMPONENT_2;
} else { // to compound
at1 = Symbols.TO_COMPOUND_1;
at2 = Symbols.TO_COMPOUND_2;
}
String in = "T" + type;
if (index != null) {
for (int i = 0; i < index.length; i++) {
in += "-" + (index[i] + 1);
}
}
key = at1 + in + at2;
if (target != null) {
key += target;
}
}
示例2: setKey
/**
* Set the key of the link
*/
protected final void setKey() {
final String at1, at2;
if ((type % 2) == 1) { // to component
at1 = Symbols.TO_COMPONENT_1;
at2 = Symbols.TO_COMPONENT_2;
} else { // to compound
at1 = Symbols.TO_COMPOUND_1;
at2 = Symbols.TO_COMPOUND_2;
}
final StringBuffer sb = new StringBuffer(16).append(at1).append('T').append(type);
if (index != null) {
for (int i = 0; i < index.length; i++) {
sb.append('-').append((index[i] + 1));
}
}
sb.append(at2);
if (target != null) {
sb.append(target);
}
key = sb.toString();
}