本文整理汇总了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);
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}