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

## Class TraverserSet<S>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractSet<Traverser.Admin<S>>
    - - org.apache.tinkerpop.gremlin.process.traversal.traverser.util.TraverserSet<S>

- All Implemented Interfaces:
    Serializable, Iterable<Traverser.Admin<S>>, Collection<Traverser.Admin<S>>, Queue<Traverser.Admin<S>>, Set<Traverser.Admin<S>>
  Direct Known Subclasses:
    IndexedTraverserSet

      public class TraverserSet<S>
      extends AbstractSet<Traverser.Admin<S>>
      implements Set<Traverser.Admin<S>>, Queue<Traverser.Admin<S>>, Serializable

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TraverserSet()`
    `TraverserSet(Traverser.Admin<S> traverser)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `add(Traverser.Admin<S> traverser)`
    `long` | `bulkSize()`
    `void` | `clear()`
    `boolean` | `contains(Object traverser)`
    `Traverser.Admin<S>` | `element()`
    `Traverser.Admin<S>` | `get(Traverser.Admin<S> traverser)`
    `boolean` | `isEmpty()`
    `Iterator<Traverser.Admin<S>>` | `iterator()`
    `boolean` | `offer(Traverser.Admin<S> traverser)`
    `Traverser.Admin<S>` | `peek()`
    `Traverser.Admin<S>` | `poll()`
    `Traverser.Admin<S>` | `remove()`
    `boolean` | `remove(Object traverser)`
    `void` | `shuffle(Random random)`
    `int` | `size()`
    `void` | `sort(Comparator<Traverser<S>> comparator)`
    `Spliterator<Traverser.Admin<S>>` | `spliterator()`
    `String` | `toString()`

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

      `equals, hashCode, removeAll`

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

      `addAll, 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

      `addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray`

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

      `parallelStream, removeIf, stream`

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

      `forEach`

- - ### Constructor Detail

    - #### TraverserSet

          public TraverserSet()

    - #### TraverserSet

          public TraverserSet(Traverser.Admin<S> traverser)

  - ### Method Detail

    - #### iterator

          public Iterator<Traverser.Admin<S>> iterator()

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

    - #### get

          public Traverser.Admin<S> get(Traverser.Admin<S> traverser)

    - #### size

          public int size()

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

    - #### bulkSize

          public long bulkSize()

    - #### isEmpty

          public boolean isEmpty()

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

    - #### contains

          public boolean contains(Object traverser)

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

    - #### add

          public boolean add(Traverser.Admin<S> traverser)

      Specified by:
        `add` in interface `Collection<Traverser.Admin<S>>`
      Specified by:
        `add` in interface `Queue<Traverser.Admin<S>>`
      Specified by:
        `add` in interface `Set<Traverser.Admin<S>>`
      Overrides:
        `add` in class `AbstractCollection<Traverser.Admin<S>>`

    - #### offer

          public boolean offer(Traverser.Admin<S> traverser)

      Specified by:
        `offer` in interface `Queue<Traverser.Admin<S>>`

    - #### remove

          public Traverser.Admin<S> remove()

      Specified by:
        `remove` in interface `Queue<Traverser.Admin<S>>`

    - #### poll

          public Traverser.Admin<S> poll()

      Specified by:
        `poll` in interface `Queue<Traverser.Admin<S>>`

    - #### element

          public Traverser.Admin<S> element()

      Specified by:
        `element` in interface `Queue<Traverser.Admin<S>>`

    - #### peek

          public Traverser.Admin<S> peek()

      Specified by:
        `peek` in interface `Queue<Traverser.Admin<S>>`

    - #### remove

          public boolean remove(Object traverser)

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

    - #### clear

          public void clear()

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

    - #### spliterator

          public Spliterator<Traverser.Admin<S>> spliterator()

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

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractCollection<Traverser.Admin<S>>`

    - #### sort

          public void sort(Comparator<Traverser<S>> comparator)

    - #### shuffle

          public void shuffle(Random random)

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