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


Java Cmp.LESS_THAN属性代码示例

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


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

示例1: convertInternal

/**
 * Convert Tinkerpop's comparison operators to Titan's
 *
 * @param p Any predicate
 * @return A TitanPredicate equivalent to the given predicate
 * @throws IllegalArgumentException if the given Predicate is unknown
 */
public static final TitanPredicate convertInternal(BiPredicate p) {
    if (p instanceof TitanPredicate) {
        return (TitanPredicate)p;
    } else if (p instanceof Compare) {
        Compare comp = (Compare)p;
        switch(comp) {
            case eq: return Cmp.EQUAL;
            case neq: return Cmp.NOT_EQUAL;
            case gt: return Cmp.GREATER_THAN;
            case gte: return Cmp.GREATER_THAN_EQUAL;
            case lt: return Cmp.LESS_THAN;
            case lte: return Cmp.LESS_THAN_EQUAL;
            default: throw new IllegalArgumentException("Unexpected comparator: " + comp);
        }
    } else if (p instanceof Contains) {
        Contains con = (Contains)p;
        switch (con) {
            case within: return Contain.IN;
            case without: return Contain.NOT_IN;
            default: throw new IllegalArgumentException("Unexpected container: " + con);

        }
    } else return null;
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:31,代码来源:TitanPredicate.java

示例2: asTitanCmp

public static final Cmp asTitanCmp(QueryPredicate.Compare predicate) {

      switch(predicate) {
        case EQUAL:              return Cmp.EQUAL;
        case NOT_EQUAL:          return Cmp.NOT_EQUAL;
        case GREATER_THAN:       return Cmp.GREATER_THAN;
        case GREATER_THAN_EQUAL: return Cmp.GREATER_THAN_EQUAL;
        case LESS_THAN:          return Cmp.LESS_THAN;
        case LESS_THAN_EQUAL:    return Cmp.LESS_THAN_EQUAL;
        // NOTE: this shouldn't happen, because we pattern match on all cases of a sealed enum
        default:                 return Cmp.EQUAL;
      }
    }
 
开发者ID:bio4j,项目名称:angulillos-titan,代码行数:13,代码来源:TitanConversions.java


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