当前位置: 首页>>代码示例>>Java>>正文


Java Symbols.SET_EXT_OPENER属性代码示例

本文整理汇总了Java中nars.io.Symbols.SET_EXT_OPENER属性的典型用法代码示例。如果您正苦于以下问题:Java Symbols.SET_EXT_OPENER属性的具体用法?Java Symbols.SET_EXT_OPENER怎么用?Java Symbols.SET_EXT_OPENER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在nars.io.Symbols的用法示例。


在下文中一共展示了Symbols.SET_EXT_OPENER属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isOperator

/**
 * 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;
}
 
开发者ID:automenta,项目名称:opennars,代码行数:39,代码来源:CompoundTerm.java

示例2: isOperator

/**
 * 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;
}
 
开发者ID:opennars,项目名称:pei,代码行数:41,代码来源:CompoundTerm.java

示例3: make

/**
 * 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(String op, ArrayList<Term> arg, Memory memory) {
    if (op.length() == 1) {
        if (op.charAt(0) == Symbols.SET_EXT_OPENER) {
            return SetExt.make(arg, memory);
        }
        if (op.charAt(0) == Symbols.SET_INT_OPENER) {
            return SetInt.make(arg, memory);
        }
        if (op.equals(Symbols.INTERSECTION_EXT_OPERATOR)) {
            return IntersectionExt.make(arg, memory);
        }
        if (op.equals(Symbols.INTERSECTION_INT_OPERATOR)) {
            return IntersectionInt.make(arg, memory);
        }
        if (op.equals(Symbols.DIFFERENCE_EXT_OPERATOR)) {
            return DifferenceExt.make(arg, memory);
        }
        if (op.equals(Symbols.DIFFERENCE_INT_OPERATOR)) {
            return DifferenceInt.make(arg, memory);
        }
        if (op.equals(Symbols.PRODUCT_OPERATOR)) {
            return Product.make(arg, memory);
        }
        if (op.equals(Symbols.IMAGE_EXT_OPERATOR)) {
            return ImageExt.make(arg, memory);
        }
        if (op.equals(Symbols.IMAGE_INT_OPERATOR)) {
            return ImageInt.make(arg, memory);
        }
    }
    if (op.length() == 2) {
        if (op.equals(Symbols.NEGATION_OPERATOR)) {
            return Negation.make(arg, memory);
        }
        if (op.equals(Symbols.DISJUNCTION_OPERATOR)) {
            return Disjunction.make(arg, memory);
        }
        if (op.equals(Symbols.CONJUNCTION_OPERATOR)) {
            return Conjunction.make(arg, memory);
        }
    }
    return null;
}
 
开发者ID:automenta,项目名称:opennars,代码行数:52,代码来源:CompoundTerm.java

示例4: make

/**
 * 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);
}
 
开发者ID:automenta,项目名称:opennars,代码行数:52,代码来源:CompoundTerm.java

示例5: make

/**
 * 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);
}
 
开发者ID:opennars,项目名称:pei,代码行数:56,代码来源:CompoundTerm.java

示例6: operator

/**
 * Get the operator of the term.
 * @return the operator of the term
 */
public String operator() {
    return "" + Symbols.SET_EXT_OPENER;
}
 
开发者ID:automenta,项目名称:opennars,代码行数:7,代码来源:SetExt.java


注:本文中的nars.io.Symbols.SET_EXT_OPENER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。