
io.deephaven.hash.KeyedIntObjectHashSet Maven / Gradle / Ivy
/*
Copyright (C) 2021 Deephaven Data Labs (https://deephaven.io).
This program is free software: you can redistribute it and/or modify it under the terms of the
GNU Lesser General Public License as published by the Free Software Foundation, either version 3
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
*/
package io.deephaven.hash;
import java.util.Set;
public class KeyedIntObjectHashSet extends KeyedIntObjectHash implements Set {
/**
* Creates a new KeyedObjectHash
instance with the default capacity and load factor.
*/
public KeyedIntObjectHashSet(KeyedIntObjectKey keyDef) {
super(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, keyDef);
}
/**
* Creates a new KeyedIntObjectHashSet
instance with a prime capacity equal to or
* greater than initialCapacity and with the default load factor.
*
* @param initialCapacity an int
value
*/
public KeyedIntObjectHashSet(int initialCapacity, KeyedIntObjectKey keyDef) {
super(initialCapacity, DEFAULT_LOAD_FACTOR, keyDef);
}
/**
* Creates a new KeyedIntObjectHashSet
instance with a prime capacity equal to or
* greater than initialCapacity and with the specified load factor.
*
* @param initialCapacity an int
value
* @param loadFactor a float
value
*/
public KeyedIntObjectHashSet(int initialCapacity, float loadFactor, KeyedIntObjectKey keyDef) {
super(initialCapacity, loadFactor, keyDef);
}
/**
* Determines if this set is equal to another set.
*
* @param other the other object (presumably a Set)
* @return true if the objects are equal
*/
public boolean equals(Object other) {
return super.setEquals(other);
}
/**
* Returns a hash code for the set as a whole.
*
* @return the hash code.
*/
public int hashCode() {
return super.setHashCode();
}
/**
* Removes an object from the set
*
* @param o
* @return true, if the object was in the set.
*/
public boolean remove(Object o) {
return super.removeValue((V) o);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy