예제 #1
0
 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);
     });
 }
예제 #2
0
 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);
     });
 }
예제 #3
0
 internal static long[] SortAndDeduplicate(long[] labels)
 {
     if (ArrayUtils.isNotEmpty(labels))
     {
         sort(labels);
         return(PrimitiveLongCollections.deduplicate(labels));
     }
     return(labels);
 }
예제 #4
0
 public override bool IsAffected(long[] entityTokenIds)
 {
     foreach (int id in _entityTokens)
     {
         if (ArrayUtils.contains(entityTokenIds, id))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #5
0
 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)));
         }
     }
 }
예제 #6
0
 public override bool IsAffected(long[] entityTokenIds)
 {
     return(ArrayUtils.contains(entityTokenIds, _relTypeId));
 }
 private bool CorrectType()
 {
     return(_types == null || ArrayUtils.contains(_types, Cursor.type()));
 }
예제 #8
0
        public static bool HasRelType(SchemaDescriptorSupplier supplier, int relTypeId)
        {
            SchemaDescriptor schema = supplier.Schema();

            return(Schema.entityType() == EntityType.RELATIONSHIP && ArrayUtils.contains(Schema.EntityTokenIds, relTypeId));
        }
예제 #9
0
        public static bool HasLabel(SchemaDescriptorSupplier supplier, int labelId)
        {
            SchemaDescriptor schema = supplier.Schema();

            return(Schema.entityType() == EntityType.NODE && ArrayUtils.contains(Schema.EntityTokenIds, labelId));
        }