@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ImmutableOpenMap that = (ImmutableOpenMap) o; if (!map.equals(that.map)) return false; return true; }
/** * {@inheritDoc} */ @Override public VType getOrDefault(KType key, VType defaultValue) { if (((key) == null)) { return hasEmptyKey ? (VType) values[mask + 1] : defaultValue; } else { final KType[] keys = (KType[]) this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return (VType) values[slot]; } slot = (slot + 1) & mask; } return defaultValue; } }
/** * {@inheritDoc} */ @Override public boolean containsKey(KType key) { if (((key) == null)) { return hasEmptyKey; } else { final KType[] keys = (KType[]) this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return true; } slot = (slot + 1) & mask; } return false; } }
/** * {@inheritDoc} */ @Override public VType get(KType key) { if (((key) == null)) { return hasEmptyKey ? (VType) values[mask + 1] : null; } else { final KType[] keys = (KType[]) this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return (VType) values[slot]; } slot = (slot + 1) & mask; } return null; } }
/** * {@inheritDoc} */ @Override public int indexOf(KType key) { final int mask = this.mask; if (((key) == null)) { return hasEmptyKey ? mask + 1 : ~(mask + 1); } else { final KType[] keys = (KType[]) this.keys; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return slot; } slot = (slot + 1) & mask; } return ~slot; } }
/** * {@inheritDoc} */ @Override public VType remove(KType key) { final int mask = this.mask; if (((key) == null)) { hasEmptyKey = false; VType previousValue = (VType) values[mask + 1]; values[mask + 1] = null; return previousValue; } else { final KType[] keys = (KType[]) this.keys; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { final VType previousValue = (VType) values[slot]; shiftConflictingKeys(slot); return previousValue; } slot = (slot + 1) & mask; } return null; } }
if (this.equals(existing, key)) { final VType previousValue = (VType) values[slot]; values[slot] = value;
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ImmutableOpenMap that = (ImmutableOpenMap) o; if (!map.equals(that.map)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ImmutableOpenMap that = (ImmutableOpenMap) o; if (!map.equals(that.map)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ImmutableOpenMap that = (ImmutableOpenMap) o; if (!map.equals(that.map)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ImmutableOpenMap that = (ImmutableOpenMap) o; if (!map.equals(that.map)) return false; return true; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ImmutableOpenMap that = (ImmutableOpenMap) o; if (!map.equals(that.map)) { return false; } return true; }
/** * {@inheritDoc} */ @Override public VType getOrDefault(KType key, VType defaultValue) { if (((key) == null)) { return hasEmptyKey ? (VType) values[mask + 1] : defaultValue; } else { final KType[] keys = (KType[]) this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return (VType) values[slot]; } slot = (slot + 1) & mask; } return defaultValue; } }
/** * {@inheritDoc} */ @Override public VType get(KType key) { if (((key) == null)) { return hasEmptyKey ? (VType) values[mask + 1] : null; } else { final KType[] keys = (KType[]) this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return (VType) values[slot]; } slot = (slot + 1) & mask; } return null; } }
/** * {@inheritDoc} */ @Override public int indexOf(KType key) { final int mask = this.mask; if (((key) == null)) { return hasEmptyKey ? mask + 1 : ~(mask + 1); } else { final KType[] keys = (KType[]) this.keys; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return slot; } slot = (slot + 1) & mask; } return ~slot; } }
/** * {@inheritDoc} */ @Override public boolean containsKey(KType key) { if (((key) == null)) { return hasEmptyKey; } else { final KType[] keys = (KType[]) this.keys; final int mask = this.mask; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { return true; } slot = (slot + 1) & mask; } return false; } }
/** * {@inheritDoc} */ @Override public VType remove(KType key) { final int mask = this.mask; if (((key) == null)) { hasEmptyKey = false; VType previousValue = (VType) values[mask + 1]; values[mask + 1] = null; return previousValue; } else { final KType[] keys = (KType[]) this.keys; int slot = hashKey(key) & mask; KType existing; while (!((existing = keys[slot]) == null)) { if (this.equals(existing, key)) { final VType previousValue = (VType) values[slot]; shiftConflictingKeys(slot); return previousValue; } slot = (slot + 1) & mask; } return null; } }
if (this.equals(existing, key)) { final VType previousValue = (VType) values[slot]; values[slot] = value;