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


Java SimpleAttribute.getValue方法代码示例

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


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

示例1: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, HybridTimestamp> attribute, O object, QueryOptions
        queryOptions) {
    Query<O> actualQuery = query == null ? queryFunction.apply(object) : query;
    Optional<Boolean> terminatedQuery = terminatedQuery(object, actualQuery, queryOptions);
    if (terminatedQuery.isPresent()) {
        return terminatedQuery.get();
    }
    HybridTimestamp value = attribute.getValue(object, queryOptions);
    IndexedCollection<O> collection = (IndexedCollection<O>) getCollection(queryOptions);
    try (ResultSet<O> resultSet = collection.retrieve(and(
            actualQuery,
            greaterThan(timestampAttribute, value)))) {
        return matches(resultSet, actualQuery, object, queryOptions);
    }
}
 
开发者ID:eventsourcing,项目名称:es4j,代码行数:17,代码来源:IsLatestEntity.java

示例2: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    A attributeValue = attribute.getValue(object, queryOptions);
    if (lowerInclusive && upperInclusive) {
        if (lowerValue.compareTo(attributeValue) <= 0 && upperValue.compareTo(attributeValue) >= 0) {
            return true;
        }
    }
    else if (lowerInclusive) {
        if (lowerValue.compareTo(attributeValue) <= 0 && upperValue.compareTo(attributeValue) > 0) {
            return true;
        }
    }
    else if (upperInclusive) {
        if (lowerValue.compareTo(attributeValue) < 0 && upperValue.compareTo(attributeValue) >= 0) {
            return true;
        }
    }
    else {
        if (lowerValue.compareTo(attributeValue) < 0 && upperValue.compareTo(attributeValue) > 0) {
            return true;
        }
    }
    return false;
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:26,代码来源:Between.java

示例3: testSerialization

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Test
public void testSerialization() {
    SQLiteIdentityIndex<Integer, Car> index = new SQLiteIdentityIndex<Integer, Car>(
            Car.CAR_ID
    );

    SimpleAttribute<Car, byte[]> serializingAttribute = index.new SerializingAttribute(Car.class, byte[].class);
    SimpleAttribute<byte[], Car> deserializingAttribute = index.new DeserializingAttribute(byte[].class, Car.class);

    Car c1 = CarFactory.createCar(1);
    byte[] s1 = serializingAttribute.getValue(c1, noQueryOptions());
    Car c2 = deserializingAttribute.getValue(s1, noQueryOptions());
    byte[] s2 = serializingAttribute.getValue(c2, noQueryOptions());
    Assert.assertEquals(c1, c2);
    Assert.assertArrayEquals(s1, s2);
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:17,代码来源:SQLiteIdentityIndexTest.java

示例4: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    A attributeValue = attribute.getValue(object, queryOptions);
    if (valueInclusive) {
        return value.compareTo(attributeValue) >= 0;
    }
    else {
        return value.compareTo(attributeValue) > 0;
    }
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:11,代码来源:LessThan.java

示例5: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    A attributeValue = attribute.getValue(object, queryOptions);
    if (valueInclusive) {
        return value.compareTo(attributeValue) <= 0;
    }
    else {
        return value.compareTo(attributeValue) < 0;
    }
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:11,代码来源:GreaterThan.java

示例6: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    A localValue = attribute.getValue(object, queryOptions);
    return foreignRestrictions == null
            ? foreignCollectionContains(foreignCollection, equal(foreignKeyAttribute, localValue))
            : foreignCollectionContains(foreignCollection, and(equal(foreignKeyAttribute, localValue), foreignRestrictions));
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:8,代码来源:ExistsIn.java

示例7: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    A attributeValue = attribute.getValue(object, queryOptions);
    return attributeValue.intersects(value);
}
 
开发者ID:strato-cumulus,项目名称:cqspatial,代码行数:6,代码来源:Intersects.java

示例8: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    CharSequence attributeValue = attribute.getValue(object, queryOptions);
    // Same as string contains, except we swap the arguments...
    return StringContains.containsFragment(value, attributeValue);
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:7,代码来源:StringIsContainedIn.java

示例9: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    CharSequence attributeValue = attribute.getValue(object, queryOptions);
    return containsFragment(attributeValue, value);
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:6,代码来源:StringContains.java

示例10: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    return attribute.getValue(object, queryOptions) != null;
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:5,代码来源:Has.java

示例11: matchesSimpleAttribute

import com.googlecode.cqengine.attribute.SimpleAttribute; //导入方法依赖的package包/类
@Override
protected boolean matchesSimpleAttribute(SimpleAttribute<O, A> attribute, O object, QueryOptions queryOptions) {
    A attributeValue = attribute.getValue(object, queryOptions);
    return matchesValue(attributeValue, queryOptions);
}
 
开发者ID:npgall,项目名称:cqengine,代码行数:6,代码来源:StringEndsWith.java


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