org.apache.tinkerpop.gremlin.process.traversal.step.util

## Class BulkSet<S>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractSet<S>
    - - org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet<S>

- All Implemented Interfaces:
    Serializable, Iterable<S>, Collection<S>, Set<S>

      public final class BulkSet<S>
      extends AbstractSet<S>
      implements Set<S>, Serializable

  BulkSet is a weighted set (i.e. a multi-set). Objects are added along with a bulk counter the denotes how many times the object was added to the set. Given that count-based compression (vs. enumeration) can yield large sets, methods exist that are long-based (2^64).
  Author:
    Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BulkSet()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(S s)`
    `boolean` | `add(S s, long bulk)`
    `boolean` | `addAll(Collection<? extends S> collection)`
    `Map<S,Long>` | `asBulk()`
    `void` | `clear()`
    `boolean` | `contains(Object s)`
    `boolean` | `equals(Object object)`
    `void` | `forEach(BiConsumer<S,Long> consumer)`
    `long` | `get(S s)`
    `int` | `hashCode()`
    `boolean` | `isEmpty()`
    `Iterator<S>` | `iterator()`
    `long` | `longSize()`
    `boolean` | `remove(Object s)`
    `boolean` | `removeAll(Collection<?> collection)`
    `int` | `size()`
    `Spliterator<S>` | `spliterator()`
    `String` | `toString()`
    `int` | `uniqueSize()`

    - ### Methods inherited from class java.util.AbstractCollection

      `containsAll, retainAll, toArray, toArray`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Set

      `containsAll, retainAll, toArray, toArray`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### BulkSet

          public BulkSet()

  - ### Method Detail

    - #### size

          public int size()

      Specified by:
        `size` in interface `Collection<S>`
      Specified by:
        `size` in interface `Set<S>`
      Specified by:
        `size` in class `AbstractCollection<S>`

    - #### uniqueSize

          public int uniqueSize()

    - #### longSize

          public long longSize()

    - #### isEmpty

          public boolean isEmpty()

      Specified by:
        `isEmpty` in interface `Collection<S>`
      Specified by:
        `isEmpty` in interface `Set<S>`
      Overrides:
        `isEmpty` in class `AbstractCollection<S>`

    - #### contains

          public boolean contains(Object s)

      Specified by:
        `contains` in interface `Collection<S>`
      Specified by:
        `contains` in interface `Set<S>`
      Overrides:
        `contains` in class `AbstractCollection<S>`

    - #### add

          public boolean add(S s)

      Specified by:
        `add` in interface `Collection<S>`
      Specified by:
        `add` in interface `Set<S>`
      Overrides:
        `add` in class `AbstractCollection<S>`

    - #### addAll

          public boolean addAll(Collection<? extends S> collection)

      Specified by:
        `addAll` in interface `Collection<S>`
      Specified by:
        `addAll` in interface `Set<S>`
      Overrides:
        `addAll` in class `AbstractCollection<S>`

    - #### forEach

          public void forEach(BiConsumer<S,Long> consumer)

    - #### asBulk

          public Map<S,Long> asBulk()

    - #### add

          public boolean add(S s,
                             long bulk)

    - #### get

          public long get(S s)

    - #### remove

          public boolean remove(Object s)

      Specified by:
        `remove` in interface `Collection<S>`
      Specified by:
        `remove` in interface `Set<S>`
      Overrides:
        `remove` in class `AbstractCollection<S>`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `Collection<S>`
      Specified by:
        `clear` in interface `Set<S>`
      Overrides:
        `clear` in class `AbstractCollection<S>`

    - #### spliterator

          public Spliterator<S> spliterator()

      Specified by:
        `spliterator` in interface `Iterable<S>`
      Specified by:
        `spliterator` in interface `Collection<S>`
      Specified by:
        `spliterator` in interface `Set<S>`

    - #### removeAll

          public boolean removeAll(Collection<?> collection)

      Specified by:
        `removeAll` in interface `Collection<S>`
      Specified by:
        `removeAll` in interface `Set<S>`
      Overrides:
        `removeAll` in class `AbstractSet<S>`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Collection<S>`
      Specified by:
        `hashCode` in interface `Set<S>`
      Overrides:
        `hashCode` in class `AbstractSet<S>`

    - #### equals

          public boolean equals(Object object)

      Specified by:
        `equals` in interface `Collection<S>`
      Specified by:
        `equals` in interface `Set<S>`
      Overrides:
        `equals` in class `AbstractSet<S>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractCollection<S>`

    - #### iterator

          public Iterator<S> iterator()

      Specified by:
        `iterator` in interface `Iterable<S>`
      Specified by:
        `iterator` in interface `Collection<S>`
      Specified by:
        `iterator` in interface `Set<S>`
      Specified by:
        `iterator` in class `AbstractCollection<S>`

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.