Class TypedHashSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<E>
enterprises.iwakura.sigewine.utils.collections.TypedHashSet<E>
- Type Parameters:
E- The type of elements in this set
- All Implemented Interfaces:
TypedCollection<E>,Serializable,Cloneable,Iterable<E>,Collection<E>,Set<E>
A concrete implementation of
TypedCollection that uses a HashSet as the underlying data structure.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTypedHashSet(Class<E> type) Constructor that initializes the set with the specified type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTypedObject(Object object) Adds an object to the set, ensuring it matches the specified type.Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, newHashSet, remove, size, spliterator, toArray, toArrayMethods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, removeAll, retainAllMethods inherited from interface enterprises.iwakura.sigewine.utils.collections.TypedCollection
getType
-
Constructor Details
-
TypedHashSet
Constructor that initializes the set with the specified type.- Parameters:
type- The class type of the elements in this set.
-
-
Method Details
-
addTypedObject
Adds an object to the set, ensuring it matches the specified type.- Specified by:
addTypedObjectin interfaceTypedCollection<E>- Parameters:
object- The object to add to the set.- Throws:
IllegalArgumentException- if the object is not of the correct type.
-