Пример #1
0
        public override bool?TernaryEquals(AnyValue other)
        {
            if (other == null || other == NO_VALUE)
            {
                return(null);
            }
            else if (!(other is MapValue))
            {
                return(false);
            }
            MapValue otherMap = ( MapValue )other;
            int      size     = size();

            if (size != otherMap.Size())
            {
                return(false);
            }
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            string[] thisKeys = StreamSupport.stream(KeySet().spliterator(), false).toArray(string[] ::new);
            Arrays.sort(thisKeys, string.compareTo);
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
            string[] thatKeys = StreamSupport.stream(otherMap.Keys.spliterator(), false).toArray(string[] ::new);
            Arrays.sort(thatKeys, string.compareTo);
            for (int i = 0; i < size; i++)
            {
                if (thisKeys[i].CompareTo(thatKeys[i]) != 0)
                {
                    return(false);
                }
            }
            bool?equalityResult = true;

            for (int i = 0; i < size; i++)
            {
                string key = thisKeys[i];
                bool?  s   = Get(key).ternaryEquals(otherMap.Get(key));
                if (s == null)
                {
                    equalityResult = null;
                }
                else if (!s.Value)
                {
                    return(false);
                }
            }
            return(equalityResult);
        }
Пример #2
0
        public override int CompareTo(VirtualValue other, IComparer <AnyValue> comparator)
        {
            if (!(other is MapValue))
            {
                throw new System.ArgumentException("Cannot compare different virtual values");
            }
            MapValue otherMap = ( MapValue )other;
            int      size     = size();
            int      compare  = Integer.compare(size, otherMap.Size());

            if (compare == 0)
            {
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                string[] thisKeys = StreamSupport.stream(KeySet().spliterator(), false).toArray(string[] ::new);
                Arrays.sort(thisKeys, string.compareTo);
//JAVA TO C# CONVERTER TODO TASK: Method reference constructor syntax is not converted by Java to C# Converter:
                string[] thatKeys = StreamSupport.stream(otherMap.Keys.spliterator(), false).toArray(string[] ::new);
                Arrays.sort(thatKeys, string.compareTo);
                for (int i = 0; i < size; i++)
                {
                    compare = thisKeys[i].CompareTo(thatKeys[i]);
                    if (compare != 0)
                    {
                        return(compare);
                    }
                }

                for (int i = 0; i < size; i++)
                {
                    string key = thisKeys[i];
                    compare = comparator.Compare(Get(key), otherMap.Get(key));
                    if (compare != 0)
                    {
                        return(compare);
                    }
                }
            }
            return(compare);
        }
Пример #3
0
 public virtual MapValue UpdatedWith(MapValue other)
 {
     return(new CombinedMapValue(this, other));
 }
Пример #4
0
 internal MappedMapValue(MapValue map, System.Func <string, AnyValue, AnyValue> mapFunction)
 {
     this.Map         = map;
     this.MapFunction = mapFunction;
 }
Пример #5
0
 internal FilteringMapValue(MapValue map, System.Func <string, AnyValue, bool> filter)
 {
     this.Map    = map;
     this.Filter = filter;
 }
Пример #6
0
			  internal DirectRelationshipValue( long id, NodeValue startNode, NodeValue endNode, TextValue type, MapValue properties ) : base( id )
			  {
					Debug.Assert( properties != null );

					this.StartNodeConflict = startNode;
					this.EndNodeConflict = endNode;
					this.TypeConflict = type;
					this.PropertiesConflict = properties;
			  }
Пример #7
0
 public static RelationshipValue RelationshipValue(long id, NodeValue startNode, NodeValue endNode, TextValue type, MapValue properties)
 {
     return(new RelationshipValue.DirectRelationshipValue(id, startNode, endNode, type, properties));
 }
Пример #8
0
 public static NodeValue NodeValue(long id, TextArray labels, MapValue properties)
 {
     return(new NodeValue.DirectNodeValue(id, labels, properties));
 }