public static System.Predicate <T> HasRelType <T>(int relTypeId) where T : SchemaDescriptorSupplier { return(supplier => { SchemaDescriptor schema = supplier.schema(); return Schema.entityType() == EntityType.RELATIONSHIP && ArrayUtils.contains(Schema.EntityTokenIds, relTypeId); }); }
public static System.Predicate <T> HasLabel <T>(int labelId) where T : SchemaDescriptorSupplier { return(supplier => { SchemaDescriptor schema = supplier.schema(); return Schema.entityType() == EntityType.NODE && ArrayUtils.contains(Schema.EntityTokenIds, labelId); }); }
internal static long[] SortAndDeduplicate(long[] labels) { if (ArrayUtils.isNotEmpty(labels)) { sort(labels); return(PrimitiveLongCollections.deduplicate(labels)); } return(labels); }
public override bool IsAffected(long[] entityTokenIds) { foreach (int id in _entityTokens) { if (ArrayUtils.contains(entityTokenIds, id)) { return(true); } } return(false); }
internal static void ValidateQuery(IndexCapability capability, IndexOrder indexOrder, IndexQuery[] predicates) { if (indexOrder != IndexOrder.NONE) { ValueCategory valueCategory = predicates[0].ValueGroup().category(); IndexOrder[] orderCapability = capability.OrderCapability(valueCategory); if (!ArrayUtil.contains(orderCapability, indexOrder)) { orderCapability = ArrayUtils.add(orderCapability, IndexOrder.NONE); throw new System.NotSupportedException(format("Tried to query index with unsupported order %s. Supported orders for query %s are %s.", indexOrder, Arrays.ToString(predicates), Arrays.ToString(orderCapability))); } } }
public override bool IsAffected(long[] entityTokenIds) { return(ArrayUtils.contains(entityTokenIds, _relTypeId)); }
private bool CorrectType() { return(_types == null || ArrayUtils.contains(_types, Cursor.type())); }
public static bool HasRelType(SchemaDescriptorSupplier supplier, int relTypeId) { SchemaDescriptor schema = supplier.Schema(); return(Schema.entityType() == EntityType.RELATIONSHIP && ArrayUtils.contains(Schema.EntityTokenIds, relTypeId)); }
public static bool HasLabel(SchemaDescriptorSupplier supplier, int labelId) { SchemaDescriptor schema = supplier.Schema(); return(Schema.entityType() == EntityType.NODE && ArrayUtils.contains(Schema.EntityTokenIds, labelId)); }