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

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

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

origin: org.apache.sis.core/sis-utility

/**
 * Returns an empty collection of the given type, or {@code null} if the given type is unknown to this method.
 *
 * @param  type  the desired collection type.
 * @return an empty collection of the given type, or {@code null} if the type is unknown.
 *
 * @since 0.8
 */
public static Collection<?> empty(final Class<?> type) {
  if (type.isAssignableFrom(List.class)) {                    // Most common case first.
    return Collections.EMPTY_LIST;
  } else if (type.isAssignableFrom(Set.class)) {
    return Collections.EMPTY_SET;
  } if (type.isAssignableFrom(SortedSet.class)) {
    return emptySortedSet();
  } else if (type.isAssignableFrom(Queue.class)) {
    return emptyQueue();
  } else {
    return null;
  }
}
origin: org.apache.sis.core/sis-metadata

if (SortedSet.class.isAssignableFrom(returnType)) {
  if (collection.isEmpty()) {
    collection = CollectionsExt.emptySortedSet();
  } else {
    collection = Collections.unmodifiableSortedSet(new TreeSet<>(collection));
origin: org.apache.sis.core/sis-utility

if (type == List     .class) return (T) Collections.EMPTY_LIST;
if (type == Queue    .class) return (T) CollectionsExt.emptyQueue();
if (type == SortedSet.class) return (T) CollectionsExt.emptySortedSet();
if (type.isAssignableFrom(Set.class)) {
  return (T) Collections.EMPTY_SET;
org.apache.sis.internal.utilCollectionsExtemptySortedSet

Javadoc

Returns a SortedSet which is always empty and accepts no element.
Note: This method exists only on the JDK7 branch, not on the JDK8 branch, since an equivalent method has been added to the JDK.

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
  • 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
  • modifiableCopy
    Copies the content of the given map to a new unsynchronized, modifiable, in-memory map. The implemen
  • identityEquals,
  • modifiableCopy,
  • nonNullArraySet,
  • removeFromMultiValuesMap,
  • toCaseInsensitiveNameMap,
  • toCollection,
  • empty,
  • emptyQueue,
  • nonEmpty

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • notifyDataSetChanged (ArrayAdapter)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top 12 Jupyter Notebook extensions
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