Class NoCachingNoUpdating.DisposableDeque<T>

java.lang.Object
com.landawn.abacus.util.NoCachingNoUpdating.DisposableDeque<T>
Type Parameters:
T -
All Implemented Interfaces:
NoCachingNoUpdating
Enclosing interface:
NoCachingNoUpdating

@Beta @SequentialOnly @Stateful public static class NoCachingNoUpdating.DisposableDeque<T> extends Object implements NoCachingNoUpdating
One-off Object. No caching/saving in memory, No updating. To cache/save/update the Object, call clone()/copy().
Depends on context, it should be okay to cache/save the elements from the array, but never save or cache the Queue itself.
  • Method Details

    • create

      public static <T> NoCachingNoUpdating.DisposableDeque<T> create(int len)
      Type Parameters:
      T -
      Parameters:
      len -
      Returns:
    • wrap

      public static <T> NoCachingNoUpdating.DisposableDeque<T> wrap(Deque<T> deque)
      Type Parameters:
      T -
      Parameters:
      deque -
      Returns:
    • size

      public int size()
      Returns:
    • getFirst

      public T getFirst()
      Gets the first.
      Returns:
    • getLast

      public T getLast()
      Gets the last.
      Returns:
    • toArray

      public <A> A[] toArray(A[] a)
      Type Parameters:
      A -
      Parameters:
      a -
      Returns:
    • toList

      public List<T> toList()
      Returns:
    • toSet

      public Set<T> toSet()
      Returns:
    • toCollection

      public <C extends Collection<T>> C toCollection(IntFunction<? extends C> supplier)
      Type Parameters:
      C -
      Parameters:
      supplier -
      Returns:
    • forEach

      public <E extends Exception> void forEach(Throwables.Consumer<? super T,E> action) throws E
      Type Parameters:
      E -
      Parameters:
      action -
      Throws:
      E
    • apply

      public <R, E extends Exception> R apply(Throwables.Function<? super Deque<T>,? extends R,E> func) throws E
      Type Parameters:
      R -
      E -
      Parameters:
      func -
      Returns:
      Throws:
      E
    • accept

      public <E extends Exception> void accept(Throwables.Consumer<? super Deque<T>,E> action) throws E
      Type Parameters:
      E -
      Parameters:
      action -
      Throws:
      E
    • join

      public String join(String delimiter)
      Parameters:
      delimiter -
      Returns:
    • join

      public String join(String delimiter, String prefix, String suffix)
      Parameters:
      delimiter -
      prefix -
      suffix -
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: