Class NoCachingNoUpdating.DisposableArray<T>

java.lang.Object
com.landawn.abacus.util.NoCachingNoUpdating.DisposableArray<T>
Type Parameters:
T -
All Implemented Interfaces:
NoCachingNoUpdating, Cloneable
Direct Known Subclasses:
NoCachingNoUpdating.DisposableObjArray
Enclosing interface:
NoCachingNoUpdating

@Beta @SequentialOnly @Stateful public static class NoCachingNoUpdating.DisposableArray<T> extends Object implements NoCachingNoUpdating, Cloneable
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 array itself.
  • Method Details

    • create

      public static <T> NoCachingNoUpdating.DisposableArray<T> create(Class<T> componentType, int len)
    • wrap

      public static <T> NoCachingNoUpdating.DisposableArray<T> wrap(T[] a)
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • get

      public T get(int index)
      Parameters:
      index -
      Returns:
    • length

      public int length()
      Returns:
    • toArray

      public <A> A[] toArray(A[] target)
      Type Parameters:
      A -
      Parameters:
      target -
      Returns:
    • clone

      public T[] clone()
      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
      Parameters:
      action -
      Throws:
      E extends Exception
    • apply

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

      public <E extends Exception> void accept(Throwables.Consumer<? super T[],E> action) throws E
      Parameters:
      action -
      Throws:
      E extends Exception
    • 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: