示例#1
0
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: public static <VALUE extends org.neo4j.values.storable.Value> RangePredicate<?> range(int propertyKeyId, VALUE from, boolean fromInclusive, VALUE to, boolean toInclusive)
        public static RangePredicate <object> Range <VALUE>(int propertyKeyId, VALUE from, bool fromInclusive, VALUE to, bool toInclusive) where VALUE : Org.Neo4j.Values.Storable.Value
        {
            if (from == null && to == null)
            {
                throw new System.ArgumentException("Cannot create RangePredicate without at least one bound");
            }

            ValueGroup valueGroup = from != null?from.valueGroup() : to.valueGroup();

            switch (valueGroup.innerEnumValue)
            {
            case ValueGroup.InnerEnum.NUMBER:
                return(new NumberRangePredicate(propertyKeyId, ( NumberValue )from, fromInclusive, ( NumberValue )to, toInclusive));

            case ValueGroup.InnerEnum.TEXT:
                return(new TextRangePredicate(propertyKeyId, ( TextValue )from, fromInclusive, ( TextValue )to, toInclusive));

            case ValueGroup.InnerEnum.GEOMETRY:
                PointValue pFrom = ( PointValue )from;
                PointValue pTo   = ( PointValue )to;
                CoordinateReferenceSystem crs = pFrom != null ? pFrom.CoordinateReferenceSystem : pTo.CoordinateReferenceSystem;
                return(new GeometryRangePredicate(propertyKeyId, crs, pFrom, fromInclusive, pTo, toInclusive));

            default:
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: return new RangePredicate<>(propertyKeyId, valueGroup, from, fromInclusive, to, toInclusive);
                return(new RangePredicate <object>(propertyKeyId, valueGroup, from, fromInclusive, to, toInclusive));
            }
        }
示例#2
0
        public override IndexSlot SelectSlot <V>(V[] values, System.Func <V, ValueGroup> groupOf)
        {
            if (values.Length > 1)
            {
                return(LUCENE);
            }

            ValueGroup singleGroup = groupOf(values[0]);

            switch (singleGroup.category())
            {
            case NUMBER:
                return(NUMBER);

            case GEOMETRY:
                return(SPATIAL);

            case TEMPORAL:
                return(TEMPORAL);

            case UNKNOWN:
                return(null);

            default:
                return(LUCENE);
            }
        }
示例#3
0
 public override void InitValueAsHighest(ValueGroup valueGroups)
 {
     EpochSecondUTC    = long.MaxValue;
     NanoOfSecond      = int.MaxValue;
     ZoneId            = short.MaxValue;
     ZoneOffsetSeconds = int.MaxValue;
 }
示例#4
0
 public override void InitValueAsHighest(ValueGroup valueGroups)
 {
     TotalAvgSeconds = long.MaxValue;
     NanosOfSecond   = int.MaxValue;
     Months          = long.MaxValue;
     Days            = long.MaxValue;
 }
示例#5
0
 internal RangePredicate(int propertyKeyId, ValueGroup valueGroup, T from, bool fromInclusive, T to, bool toInclusive) : base(propertyKeyId)
 {
     this.ValueGroupConflict = valueGroup;
     this.From = from;
     this.FromInclusiveConflict = fromInclusive;
     this.To = to;
     this.ToInclusiveConflict = toInclusive;
 }
示例#6
0
 internal override void InitValueAsHighest(ValueGroup valueGroups)
 {
     // These coordinates will generate the largest value on the spacial curve
     double[] limit = new double[Crs.Dimension];
     Arrays.fill(limit, double.NegativeInfinity);
     limit[0] = double.PositiveInfinity;
     WritePoint(Crs, limit);
 }
示例#7
0
        /// <summary>
        /// Create IndexQuery for retrieving all indexed entries of the given value group.
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: public static RangePredicate<?> range(int propertyKeyId, org.neo4j.values.storable.ValueGroup valueGroup)
        public static RangePredicate <object> Range(int propertyKeyId, ValueGroup valueGroup)
        {
            if (valueGroup == ValueGroup.GEOMETRY)
            {
                throw new System.ArgumentException("Cannot create GeometryRangePredicate without a specified CRS");
            }
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: return new RangePredicate<>(propertyKeyId, valueGroup, null, true, null, true);
            return(new RangePredicate <object>(propertyKeyId, valueGroup, null, true, null, true));
        }
 internal override void InitValueAsHighest(int stateSlot, ValueGroup valueGroup)
 {
     InitValueAsHighest(valueGroup);
 }
示例#9
0
 public override void InitValueAsHighest(ValueGroup valueGroups)
 {
     NanosOfDayUTC     = long.MaxValue;
     ZoneOffsetSeconds = int.MaxValue;
 }
示例#10
0
 internal override void InitValueAsHighest(ValueGroup valueGroups)
 {
     EpochDay = long.MaxValue;
 }
示例#11
0
 internal override void InitValueAsLowest(ValueGroup valueGroups)
 {
     writeFloatingPoint(double.NegativeInfinity);
 }
示例#12
0
 internal override void InitValueAsLowest(ValueGroup valueGroups)
 {
     EpochDay = long.MinValue;
 }
示例#13
0
 public override void InitValueAsHighest(ValueGroup valueGroups)
 {
     EpochSecond  = long.MaxValue;
     NanoOfSecond = int.MaxValue;
 }
示例#14
0
 public override void InitValueAsLowest(ValueGroup valueGroups)
 {
     EpochSecond  = long.MinValue;
     NanoOfSecond = int.MinValue;
 }
 internal abstract void InitValueAsHighest(ValueGroup valueGroups);
示例#16
0
 internal override void InitValueAsLowest(ValueGroup valueGroups)
 {
     double[] limit = new double[Crs.Dimension];
     Arrays.fill(limit, double.NegativeInfinity);
     WritePoint(Crs, limit);
 }
示例#17
0
 internal override void InitValueAsHighest(ValueGroup valueGroups)
 {
     writeFloatingPoint(double.PositiveInfinity);
 }