@Override public MutableValue duplicate() { MutableValueBool v = new MutableValueBool(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueDate v = new MutableValueDate(); v.value = this.value; v.exists = this.exists; return v; } }
@Override public MutableValue duplicate() { MutableValueFloat v = new MutableValueFloat(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueInt v = new MutableValueInt(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueLong v = new MutableValueLong(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueDouble v = new MutableValueDouble(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueStr v = new MutableValueStr(); v.value.copyBytes(value); v.exists = this.exists; return v; }
@Override public boolean equals(Object other) { return (getClass() == other.getClass()) && this.equalsSameType(other); }
@Override public int compareTo(MutableValue other) { Class<? extends MutableValue> c1 = this.getClass(); Class<? extends MutableValue> c2 = other.getClass(); if (c1 != c2) { int c = c1.hashCode() - c2.hashCode(); if (c == 0) { c = c1.getCanonicalName().compareTo(c2.getCanonicalName()); } return c; } return compareSameType(other); }
/** * Associate <code>key</code> with <code>value</code> and return a new copy * of the hash table. The current hash table is not modified. */ public CopyOnWriteHashMap<K, V> copyAndPut(K key, V value) { if (key == null) { throw new IllegalArgumentException("null keys are not supported"); } if (value == null) { throw new IllegalArgumentException("null values are not supported"); } final int hash = key.hashCode(); final MutableValueInt newValue = new MutableValueInt(); final InnerNode<K, V> newRoot = root.put(key, hash, TOTAL_HASH_BITS, value, newValue); final int newSize = size + newValue.value; return new CopyOnWriteHashMap<>(newRoot, newSize); }
@Override public MutableValue duplicate() { MutableValueFloat v = new MutableValueFloat(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueBool v = new MutableValueBool(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueLong v = new MutableValueLong(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueDouble v = new MutableValueDouble(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueInt v = new MutableValueInt(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueFloat v = new MutableValueFloat(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueInt v = new MutableValueInt(); v.value = this.value; v.exists = this.exists; return v; }
@Override public MutableValue duplicate() { MutableValueFloat v = new MutableValueFloat(); v.value = this.value; v.exists = this.exists; return v; }