Documentation of 'org.jgrapht.util.ArrayUnenforcedSet' Java class
ArrayUnenforcedSet
org.jgrapht.util

Class ArrayUnenforcedSet<E>

  • Type Parameters:
    E - the element type
    All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<E>, java.util.Collection<E>, java.util.List<E>, java.util.RandomAccess, java.util.Set<E>


    public class ArrayUnenforcedSet<E>
    extends java.util.ArrayList<E>
    implements java.util.Set<E>
    Helper for efficiently representing small sets whose elements are known to be unique by construction, implying we don't need to enforce the uniqueness property in the data structure itself. Use with caution.

    Note that for equals/hashCode, the class implements the Set behavior (unordered), not the list behavior (ordered); the fact that it subclasses ArrayList should be considered an implementation detail.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ArrayUnenforcedSet()
      Constructs a new empty set
      ArrayUnenforcedSet(java.util.Collection<? extends E> c)
      Constructs a set containing the elements of the specified collection.
      ArrayUnenforcedSet(int n)
      Constructs an empty set with the specified initial capacity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o) 
      int hashCode() 
      • Methods inherited from class java.util.ArrayList

        add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
      • Methods inherited from class java.util.AbstractCollection

        containsAll, toString
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Set

        add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArray
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        containsAll
    • Constructor Detail

      • ArrayUnenforcedSet

        public ArrayUnenforcedSet()
        Constructs a new empty set
      • ArrayUnenforcedSet

        public ArrayUnenforcedSet(java.util.Collection<? extends E> c)
        Constructs a set containing the elements of the specified collection.
        Parameters:
        c - the collection whose elements are to be placed into this set
        Throws:
        java.lang.NullPointerException - if the specified collection is null
      • ArrayUnenforcedSet

        public ArrayUnenforcedSet(int n)
        Constructs an empty set with the specified initial capacity.
        Parameters:
        n - the initial capacity of the set
        Throws:
        java.lang.IllegalArgumentException - if the specified initial capacity is negative
    • Method Detail

      • equals

        public boolean equals(java.lang.Object o)
        Specified by:
        equals in interface java.util.Collection<E>
        Specified by:
        equals in interface java.util.List<E>
        Specified by:
        equals in interface java.util.Set<E>
        Overrides:
        equals in class java.util.AbstractList<E>
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection<E>
        Specified by:
        hashCode in interface java.util.List<E>
        Specified by:
        hashCode in interface java.util.Set<E>
        Overrides:
        hashCode in class java.util.AbstractList<E>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.