當前位置: 首頁>>代碼示例>>Java>>正文


Java Symbols.INTERSECTION_EXT_OPERATORc方法代碼示例

本文整理匯總了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;
}
 
開發者ID:automenta,項目名稱:opennars,代碼行數:40,代碼來源:CompoundTerm.java

示例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;
}
 
開發者ID:opennars,項目名稱:pei,代碼行數:42,代碼來源:CompoundTerm.java

示例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);
}
 
開發者ID:automenta,項目名稱:opennars,代碼行數:53,代碼來源:CompoundTerm.java

示例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);
}
 
開發者ID:opennars,項目名稱:pei,代碼行數:57,代碼來源:CompoundTerm.java


注:本文中的nars.io.Symbols.INTERSECTION_EXT_OPERATORc方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。