Tabnine Logo
CollectionsExt.toCollection
Code IndexAdd Tabnine to your IDE (free)

How to use
toCollection
method
in
org.apache.sis.internal.util.CollectionsExt

Best Java code snippets using org.apache.sis.internal.util.CollectionsExt.toCollection (Showing top 4 results out of 315)

origin: apache/sis

final boolean isEmptyMetadata = isEmpty;    // Save the value in case it is overwritten by recursive invocations.
boolean isEmptyValue = true;
final Collection<?> values = CollectionsExt.toCollection(value);
for (final Iterator<?> it = values.iterator(); it.hasNext();) {
  final Object element = it.next();
origin: org.apache.sis.core/sis-metadata

final Collection<?> values = CollectionsExt.toCollection(value);
for (final Iterator<?> it = values.iterator(); it.hasNext();) {
  final Object element = it.next();
origin: apache/sis

table.setCellAlignment(TableAppender.ALIGN_LEFT);
final Format format = getFormat(valueClass);                            // Null if valueClass is null.
final Iterator<?> it = CollectionsExt.toCollection(value).iterator();
String separator = "";
int length = 0;
origin: org.apache.sis.core/sis-feature

table.setCellAlignment(TableAppender.ALIGN_LEFT);
final Format format = getFormat(valueClass);                            // Null if valueClass is null.
final Iterator<?> it = CollectionsExt.toCollection(value).iterator();
String separator = "";
int length = 0;
org.apache.sis.internal.utilCollectionsExttoCollection

Javadoc

Returns the given value as a collection. Special cases:
  • If the value is null, then this method returns an Collections#emptyList().
  • If the value is an instance of Collection, then it is returned unchanged.
  • If the value is an array of objects, then it is returned Arrays#asList(Object[]).
  • If the value is an array of primitive type, then it is returned as a list of their wrapper class.
  • If the value is an instance of Iterable, Iterator or Enumeration, copies the values in a new list.
  • Otherwise the value is returned as a Collections#singletonList(Object).

Note that in the Iterator and Enumeration cases, the given value object is not valid anymore after this method call since it has been used for the iteration.

If the returned object needs to be a list, then this method can be chained with #toList(Collection) as below:

java

Popular methods of CollectionsExt

  • singletonOrEmpty
    Returns the given value as a singleton if non-null, or returns an empty set otherwise.
  • unmodifiableOrCopy
    Returns a unmodifiable version of the given set. This method is different than the standard Collecti
  • addToMultiValuesMap
    Adds a value in a pseudo multi-values map. The multi-values map is simulated by a map of lists. The
  • compact
    Returns a more compact representation of the given set. This method is similar to #unmodifiableOrCop
  • first
    Returns the first element of the given iterable, or null if none. This method does not emit warning
  • immutableSet
    Returns the specified array as an immutable set, or null if the array is null. If the given array co
  • toArray
    Returns the elements of the given collection as an array. This method can be used when the valueClas
  • nonNull
    Returns the given set, or Collections#EMPTY_SET if the given set is null.
  • createSetForType
    Creates an initially empty set for elements of the given type. This method will creates specialized
  • emptySortedSet
    Returns a SortedSet which is always empty and accepts no element.Note: This method exists only on th
  • filter
    Returns an iterator over the elements of the given iterator where the predicate returns true. The it
  • identityEquals
    Returns true if the next elements returned by the given iterators are the same. This method compares
  • filter,
  • identityEquals,
  • modifiableCopy,
  • nonNullArraySet,
  • removeFromMultiValuesMap,
  • toCaseInsensitiveNameMap,
  • empty,
  • emptyQueue,
  • nonEmpty

Popular in Java

  • Running tasks concurrently on multiple threads
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Path (java.nio.file)
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • SortedSet (java.util)
    SortedSet is a Set which iterates over its elements in a sorted order. The order is determined eithe
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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