@Override public boolean evaluate(E element) { RelationType type; if (key instanceof String) { type = ((InternalElement) element).tx().getRelationType((String) key); if (type == null) return satisfiesCondition(null); } else { type = (RelationType) key; } Preconditions.checkNotNull(type); if (type.isPropertyKey()) { Iterator<Object> iter = ElementHelper.getValues(element,(PropertyKey)type).iterator(); if (iter.hasNext()) { while (iter.hasNext()) { if (satisfiesCondition(iter.next())) return true; } return false; } return satisfiesCondition(null); } else { assert ((InternalRelationType)type).multiplicity().isUnique(Direction.OUT); return satisfiesCondition((TitanVertex)element.value(type.name())); } }
@Override public boolean evaluate(E element) { RelationType type; if (key instanceof String) { type = ((InternalElement) element).tx().getRelationType((String) key); if (type == null) return satisfiesCondition(null); } else { type = (RelationType) key; } Preconditions.checkNotNull(type); if (type.isPropertyKey()) { Iterator<Object> iter = ElementHelper.getValues(element,(PropertyKey)type).iterator(); if (iter.hasNext()) { while (iter.hasNext()) { if (satisfiesCondition(iter.next())) return true; } return false; } return satisfiesCondition(null); } else { assert ((InternalRelationType)type).getMultiplicity().isUnique(Direction.OUT); return satisfiesCondition(((TitanRelation) element).getProperty((EdgeLabel) type)); } }
@Override public boolean evaluate(E element) { RelationType type; if (key instanceof String) { type = ((InternalElement) element).tx().getRelationType((String) key); if (type == null) return satisfiesCondition(null); } else { type = (RelationType) key; } Preconditions.checkNotNull(type); if (type.isPropertyKey()) { Iterator<Object> iter = ElementHelper.getValues(element,(PropertyKey)type).iterator(); if (iter.hasNext()) { while (iter.hasNext()) { if (satisfiesCondition(iter.next())) return true; } return false; } return satisfiesCondition(null); } else { assert ((InternalRelationType)type).multiplicity().isUnique(Direction.OUT); return satisfiesCondition((TitanVertex)element.value(type.name())); } }