本文整理匯總了Java中nars.io.Symbols.INTERSECTION_EXT_OPERATORc方法的典型用法代碼示例。如果您正苦於以下問題:Java Symbols.INTERSECTION_EXT_OPERATORc方法的具體用法?Java Symbols.INTERSECTION_EXT_OPERATORc怎麽用?Java Symbols.INTERSECTION_EXT_OPERATORc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類nars.io.Symbols
的用法示例。
在下文中一共展示了Symbols.INTERSECTION_EXT_OPERATORc方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isOperator
import nars.io.Symbols; //導入方法依賴的package包/類
/**
* Check CompoundTerm operator symbol
*
* @return if the given String is an operator symbol
* @param s The String to be checked
*/
public static boolean isOperator(final String op) {
final int length = op.length();
if (length == 1) {
final char c = op.charAt(0);
switch (c) {
case Symbols.SET_EXT_OPENER:
case Symbols.SET_INT_OPENER:
case Symbols.INTERSECTION_EXT_OPERATORc:
case Symbols.INTERSECTION_INT_OPERATORc:
case Symbols.DIFFERENCE_EXT_OPERATORc:
case Symbols.DIFFERENCE_INT_OPERATORc:
case Symbols.PRODUCT_OPERATORc:
case Symbols.IMAGE_EXT_OPERATORc:
case Symbols.IMAGE_INT_OPERATORc:
return true;
}
}
else if (length == 2) {
//since these symbols are the same character repeated, we only need to compare the first character
final char c1 = op.charAt(0);
final char c2 = op.charAt(1);
if (c1 == c2) {
switch (c1) {
case Symbols.NEGATION_OPERATORc:
case Symbols.DISJUNCTION_OPERATORc:
case Symbols.CONJUNCTION_OPERATORc:
return true;
}
}
}
return false;
}
示例2: isOperator
import nars.io.Symbols; //導入方法依賴的package包/類
/**
* Check CompoundTerm operator symbol
*
* @return if the given String is an operator symbol
* @param s The String to be checked
*/
public static boolean isOperator(final String op) {
final int length = op.length();
if (length == 1) {
final char c = op.charAt(0);
switch (c) {
case Symbols.SET_EXT_OPENER:
case Symbols.SET_INT_OPENER:
case Symbols.INTERSECTION_EXT_OPERATORc:
case Symbols.INTERSECTION_INT_OPERATORc:
case Symbols.DIFFERENCE_EXT_OPERATORc:
case Symbols.DIFFERENCE_INT_OPERATORc:
case Symbols.PRODUCT_OPERATORc:
case Symbols.IMAGE_EXT_OPERATORc:
case Symbols.IMAGE_INT_OPERATORc:
return true;
}
}
else if (length == 2) {
//since these symbols are the same character repeated, we only need to compare the first character
final char c1 = op.charAt(0);
final char c2 = op.charAt(1);
if (c1 == c2) {
switch (c1) {
case Symbols.NEGATION_OPERATORc:
case Symbols.DISJUNCTION_OPERATORc:
case Symbols.CONJUNCTION_OPERATORc:
return true;
}
} else if ((op.equals(Symbols.SEQUENCE_OPERATOR)) || (op.equals(Symbols.PARALLEL_OPERATOR))) {
return true;
}
}
return false;
}
示例3: make
import nars.io.Symbols; //導入方法依賴的package包/類
/**
* Try to make a compound term from an operator and a list of components
* <p>
* Called from StringParser
*
* @param op Term operator
* @param arg Component list
* @param memory Reference to the memory
* @return A compound term or null
*/
public static Term make(final String op, final ArrayList<Term> arg, final Memory memory) {
final int length = op.length();
if (length == 1) {
final char c = op.charAt(0);
switch (c) {
case Symbols.SET_EXT_OPENER:
return SetExt.make(arg, memory);
case Symbols.SET_INT_OPENER:
return SetInt.make(arg, memory);
case Symbols.INTERSECTION_EXT_OPERATORc:
return IntersectionExt.make(arg, memory);
case Symbols.INTERSECTION_INT_OPERATORc:
return IntersectionInt.make(arg, memory);
case Symbols.DIFFERENCE_EXT_OPERATORc:
return DifferenceExt.make(arg, memory);
case Symbols.DIFFERENCE_INT_OPERATORc:
return DifferenceInt.make(arg, memory);
case Symbols.PRODUCT_OPERATORc:
return Product.make(arg, memory);
case Symbols.IMAGE_EXT_OPERATORc:
return ImageExt.make(arg, memory);
case Symbols.IMAGE_INT_OPERATORc:
return ImageInt.make(arg, memory);
}
}
else if (length == 2) {
//since these symbols are the same character repeated, we only need to compare the first character
final char c1 = op.charAt(0);
final char c2 = op.charAt(1);
if (c1 == c2) {
switch (c1) {
case Symbols.NEGATION_OPERATORc:
return Negation.make(arg, memory);
case Symbols.DISJUNCTION_OPERATORc:
return Disjunction.make(arg, memory);
case Symbols.CONJUNCTION_OPERATORc:
return Conjunction.make(arg, memory);
}
}
}
throw new RuntimeException("Unknown Term operator: " + op);
}
示例4: make
import nars.io.Symbols; //導入方法依賴的package包/類
/**
* Try to make a compound term from an operator and a list of components
* <p>
* Called from StringParser
*
* @param op Term operator
* @param arg Component list
* @param memory Reference to the memory
* @return A compound term or null
*/
public static Term make(final String op, final ArrayList<Term> arg, final Memory memory) {
final int length = op.length();
if (length == 1) {
final char c = op.charAt(0);
switch (c) {
case Symbols.SET_EXT_OPENER:
return SetExt.make(arg, memory);
case Symbols.SET_INT_OPENER:
return SetInt.make(arg, memory);
case Symbols.INTERSECTION_EXT_OPERATORc:
return IntersectionExt.make(arg, memory);
case Symbols.INTERSECTION_INT_OPERATORc:
return IntersectionInt.make(arg, memory);
case Symbols.DIFFERENCE_EXT_OPERATORc:
return DifferenceExt.make(arg, memory);
case Symbols.DIFFERENCE_INT_OPERATORc:
return DifferenceInt.make(arg, memory);
case Symbols.PRODUCT_OPERATORc:
return Product.make(arg, memory);
case Symbols.IMAGE_EXT_OPERATORc:
return ImageExt.make(arg, memory);
case Symbols.IMAGE_INT_OPERATORc:
return ImageInt.make(arg, memory);
}
}
else if (length == 2) {
//since these symbols are the same character repeated, we only need to compare the first character
final char c1 = op.charAt(0);
final char c2 = op.charAt(1);
if (c1 == c2) {
switch (c1) {
case Symbols.NEGATION_OPERATORc:
return Negation.make(arg, memory);
case Symbols.DISJUNCTION_OPERATORc:
return Disjunction.make(arg, memory);
case Symbols.CONJUNCTION_OPERATORc:
return Conjunction.make(arg, memory);
}
} else if (op.equals(Symbols.SEQUENCE_OPERATOR)) {
return Conjunction.make(arg, ORDER_FORWARD, memory);
} else if (op.equals(Symbols.PARALLEL_OPERATOR)) {
return Conjunction.make(arg, ORDER_CONCURRENT, memory);
}
}
throw new RuntimeException("Unknown Term operator: " + op);
}