congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Iterate.toArray
Code IndexAdd Tabnine to your IDE (free)

How to use
toArray
method
in
com.gs.collections.impl.utility.Iterate

Best Java code snippets using com.gs.collections.impl.utility.Iterate.toArray (Showing top 20 results out of 315)

origin: goldmansachs/gs-collections

@Override
public Object[] toArray()
{
  return Iterate.toArray(this.adapted);
}
origin: goldmansachs/gs-collections

public <T> ImmutableSortedSet<T> withAll(Iterable<? extends T> items)
{
  if (items instanceof ImmutableSortedSet<?>)
  {
    return (ImmutableSortedSet<T>) items;
  }
  return this.of((T[]) Iterate.toArray(items));
}
origin: goldmansachs/gs-collections

public <T> ImmutableSortedBag<T> withAll(Iterable<? extends T> items)
{
  if (items instanceof ImmutableSortedBag<?>)
  {
    return (ImmutableSortedBag<T>) items;
  }
  return this.of((T[]) Iterate.toArray(items));
}
origin: goldmansachs/gs-collections

public static <E> ImmutableArrayStack<E> newStack(Iterable<? extends E> iterable)
{
  return new ImmutableArrayStack<E>((E[]) Iterate.toArray(iterable));
}
origin: goldmansachs/gs-collections

  public <T> ImmutableSet<T> withAll(HashingStrategy<? super T> hashingStrategy, Iterable<? extends T> items)
  {
    return this.with(hashingStrategy, (T[]) Iterate.toArray(items));
  }
}
origin: goldmansachs/gs-collections

  public <T> FixedSizeList<T> withAll(Iterable<? extends T> items)
  {
    return this.of((T[]) Iterate.toArray(items));
  }
}
origin: goldmansachs/gs-collections

public <T> ImmutableSortedBag<T> withAll(Comparator<? super T> comparator, Iterable<? extends T> items)
{
  return this.of(comparator, (T[]) Iterate.toArray(items));
}
origin: goldmansachs/gs-collections

public static <E> FastList<E> newList(Iterable<? extends E> source)
{
  return FastList.newListWith((E[]) Iterate.toArray(source));
}
origin: goldmansachs/gs-collections

public static <E> ImmutableArrayList<E> newList(Iterable<? extends E> iterable)
{
  return new ImmutableArrayList<E>((E[]) Iterate.toArray(iterable));
}
origin: goldmansachs/gs-collections

public <T> ImmutableSortedSet<T> withAll(Comparator<? super T> comparator, Iterable<? extends T> items)
{
  return this.of(comparator, (T[]) Iterate.toArray(items));
}
origin: goldmansachs/gs-collections

public static <E> ArrayAdapter<E> newArray(Iterable<? extends E> source)
{
  return new ArrayAdapter<E>((E[]) Iterate.toArray(source));
}
origin: goldmansachs/gs-collections

public static <E> ArrayAdapter<E> newArrayWithItem(Iterable<? extends E> iterable, E itemToAdd)
{
  int oldSize = Iterate.sizeOf(iterable);
  E[] array = (E[]) new Object[oldSize + 1];
  Iterate.toArray(iterable, array);
  array[oldSize] = itemToAdd;
  return new ArrayAdapter<E>(array);
}
origin: goldmansachs/gs-collections

public static <E> HashBag<E> newBag(Iterable<? extends E> source)
{
  if (source instanceof Bag)
  {
    return HashBag.newBag((Bag<E>) source);
  }
  return HashBag.newBagWith((E[]) Iterate.toArray(source));
}
origin: goldmansachs/gs-collections

  public <T> ImmutableSet<T> withAll(Iterable<? extends T> items)
  {
    if (items instanceof ImmutableSet<?>)
    {
      return (ImmutableSet<T>) items;
    }

    if (Iterate.isEmpty(items))
    {
      return this.with();
    }
    return this.with((T[]) Iterate.toArray(items));
  }
}
origin: goldmansachs/gs-collections

  public <T> ImmutableList<T> withAll(Iterable<? extends T> items)
  {
    if (items instanceof ImmutableList<?>)
    {
      return (ImmutableList<T>) items;
    }
    if (items instanceof List && items instanceof RandomAccess)
    {
      return this.withList((List<T>) items);
    }
    if (Iterate.isEmpty(items))
    {
      return this.empty();
    }
    return this.of((T[]) Iterate.toArray(items));
  }
}
origin: goldmansachs/gs-collections

ArrayAdapter.adapt((T[]) Iterate.toArray(iterable)),
procedureFactory,
combiner,
origin: goldmansachs/gs-collections

ArrayAdapter.adapt((T[]) Iterate.toArray(iterable)),
procedureFactory,
combiner,
origin: goldmansachs/gs-collections

(T[]) Iterate.toArray(iterable),
procedureFactory,
combiner,
origin: goldmansachs/gs-collections

(T[]) Iterate.toArray(iterable),
procedureFactory,
combiner,
origin: goldmansachs/gs-collections

  public <T> ImmutableBag<T> withAll(Iterable<? extends T> items)
  {
    if (items instanceof ImmutableBag<?>)
    {
      return (ImmutableBag<T>) items;
    }
    if (items instanceof Bag<?>)
    {
      Bag<T> bag = (Bag<T>) items;
      if (bag.isEmpty())
      {
        return this.with();
      }
      if (bag.size() == 1)
      {
        return this.with(bag.getFirst());
      }
      if (bag.sizeDistinct() < ImmutableArrayBag.MAXIMUM_USEFUL_ARRAY_BAG_SIZE)
      {
        return ImmutableArrayBag.copyFrom(bag);
      }
      return new ImmutableHashBag<T>(bag);
    }
    return this.of((T[]) Iterate.toArray(items));
  }
}
com.gs.collections.impl.utilityIteratetoArray

Javadoc

Converts the specified iterable to an array.

Popular methods of Iterate

  • sizeOf
    Returns the size of an iterable. In the case of Collections and RichIterables, the method size is ca
  • notEmpty
    A null-safe check on a collection to see if it is notEmpty. A null collection results in a false.
  • collect
    Same as the #collect(Iterable,Function) method with two parameters, except that the results are gath
  • contains
    Returns true if the iterable contains the value. In the case of Collections and RichIterables, the m
  • count
    Returns the total number of elements that evaluate to true for the specified predicate. Example usin
  • forEach
    The procedure is evaluated for each element of the iterable. Example using a Java 8 lambda expressio
  • forEachWithIndex
    Iterates over a collection passing each element and the current relative int index to the specified
  • isEmpty
    A null-safe check on a collection to see if it isEmpty. A null collection results in a true.
  • reject
    Same as the reject method with one parameter but uses the specified target collection for the result
  • select
    Same as the select method with two parameters but uses the specified target collection Example using
  • addAllIterable
    Add all elements from the source Iterable to the target collection, returns true if any element was
  • addAllTo
    Add all elements from the source Iterable to the target collection, return the target collection.
  • addAllIterable,
  • addAllTo,
  • addToMap,
  • allSatisfy,
  • allSatisfyWith,
  • anySatisfy,
  • anySatisfyWith,
  • appendString,
  • collectBoolean

Popular in Java

  • Creating JSON documents from java classes using gson
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • startActivity (Activity)
  • Kernel (java.awt.image)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • 21 Best IntelliJ Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now