Tabnine Logo
Collections.unmodifiableSortedSet
Code IndexAdd Tabnine to your IDE (free)

How to use
unmodifiableSortedSet
method
in
java.util.Collections

Best Java code snippets using java.util.Collections.unmodifiableSortedSet (Showing top 20 results out of 2,196)

origin: google/guava

UnmodifiableNavigableSet(NavigableSet<E> delegate) {
 this.delegate = checkNotNull(delegate);
 this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate);
}
origin: google/guava

/**
 * Returns an unmodifiable view of the specified collection, preserving the interface for
 * instances of {@code SortedSet}, {@code Set}, {@code List} and {@code Collection}, in that order
 * of preference.
 *
 * @param collection the collection for which to return an unmodifiable view
 * @return an unmodifiable view of the collection
 */
private static <V> Collection<V> unmodifiableValueCollection(Collection<V> collection) {
 if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<V>) collection);
 } else if (collection instanceof Set) {
  return Collections.unmodifiableSet((Set<V>) collection);
 } else if (collection instanceof List) {
  return Collections.unmodifiableList((List<V>) collection);
 }
 return Collections.unmodifiableCollection(collection);
}
origin: google/j2objc

UnmodifiableNavigableSet(NavigableSet<E> delegate) {
 this.delegate = checkNotNull(delegate);
 this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate);
}
origin: google/guava

@Override
<E> SortedSet<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 }
}
origin: google/guava

@Override
<E> Collection<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 } else {
  return Collections.unmodifiableSet((Set<E>) collection);
 }
}
origin: google/guava

@Override
<E> Collection<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 } else if (collection instanceof Set) {
  return Collections.unmodifiableSet((Set<E>) collection);
 } else if (collection instanceof List) {
  return Collections.unmodifiableList((List<E>) collection);
 } else {
  return Collections.unmodifiableCollection(collection);
 }
}
origin: alibaba/jstorm

/**
 * Returns a set of the names of all the metrics in the registry.
 *
 * @return the names of all the metrics
 */
public SortedSet<String> getMetricNames() {
  return Collections.unmodifiableSortedSet(new TreeSet<String>(metrics.keySet()));
}
origin: prestodb/presto

/**
 * Returns an unmodifiable view of the specified collection, preserving the interface for
 * instances of {@code SortedSet}, {@code Set}, {@code List} and {@code Collection}, in that order
 * of preference.
 *
 * @param collection the collection for which to return an unmodifiable view
 * @return an unmodifiable view of the collection
 */
private static <V> Collection<V> unmodifiableValueCollection(Collection<V> collection) {
 if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<V>) collection);
 } else if (collection instanceof Set) {
  return Collections.unmodifiableSet((Set<V>) collection);
 } else if (collection instanceof List) {
  return Collections.unmodifiableList((List<V>) collection);
 }
 return Collections.unmodifiableCollection(collection);
}
origin: prestodb/presto

@Override
<E> SortedSet<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 }
}
origin: prestodb/presto

@Override
<E> Collection<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 } else {
  return Collections.unmodifiableSet((Set<E>) collection);
 }
}
origin: prestodb/presto

UnmodifiableNavigableSet(NavigableSet<E> delegate) {
 this.delegate = checkNotNull(delegate);
 this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate);
}
origin: prestodb/presto

@Override
<E> Collection<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 } else if (collection instanceof Set) {
  return Collections.unmodifiableSet((Set<E>) collection);
 } else if (collection instanceof List) {
  return Collections.unmodifiableList((List<E>) collection);
 } else {
  return Collections.unmodifiableCollection(collection);
 }
}
origin: google/j2objc

@Override
<E> Collection<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 } else {
  return Collections.unmodifiableSet((Set<E>) collection);
 }
}
origin: google/j2objc

@Override
<E> SortedSet<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 }
}
origin: google/j2objc

@Override
<E> Collection<E> unmodifiableCollectionSubclass(Collection<E> collection) {
 if (collection instanceof NavigableSet) {
  return Sets.unmodifiableNavigableSet((NavigableSet<E>) collection);
 } else if (collection instanceof SortedSet) {
  return Collections.unmodifiableSortedSet((SortedSet<E>) collection);
 } else if (collection instanceof Set) {
  return Collections.unmodifiableSet((Set<E>) collection);
 } else if (collection instanceof List) {
  return Collections.unmodifiableList((List<E>) collection);
 } else {
  return Collections.unmodifiableCollection(collection);
 }
}
origin: google/guava

@Override
public SortedSet<V> get(K key) {
 return Collections.unmodifiableSortedSet(delegate().get(key));
}
origin: google/guava

@Override
public SortedSet<R> rowKeySet() {
 return Collections.unmodifiableSortedSet(delegate().rowKeySet());
}
origin: prestodb/presto

/**
 * ZoneInfoProvider searches the given directory for compiled data files.
 *
 * @throws IOException if directory or map file cannot be read
 */
public ZoneInfoProvider(File fileDir) throws IOException {
  if (fileDir == null) {
    throw new IllegalArgumentException("No file directory provided");
  }
  if (!fileDir.exists()) {
    throw new IOException("File directory doesn't exist: " + fileDir);
  }
  if (!fileDir.isDirectory()) {
    throw new IOException("File doesn't refer to a directory: " + fileDir);
  }
  iFileDir = fileDir;
  iResourcePath = null;
  iLoader = null;
  iZoneInfoMap = loadZoneInfoMap(openResource("ZoneInfoMap"));
  iZoneInfoKeys = Collections.unmodifiableSortedSet(new TreeSet<String>(iZoneInfoMap.keySet()));
}
origin: prestodb/presto

@Override
public SortedSet<R> rowKeySet() {
 return Collections.unmodifiableSortedSet(delegate().rowKeySet());
}
origin: prestodb/presto

@Override
public SortedSet<V> get(K key) {
 return Collections.unmodifiableSortedSet(delegate().get(key));
}
java.utilCollectionsunmodifiableSortedSet

Javadoc

Returns a wrapper on the specified sorted set which throws an UnsupportedOperationException whenever an attempt is made to modify the sorted set.

Popular methods of Collections

  • emptyList
    Returns the empty list (immutable). This list is serializable.This example illustrates the type-safe
  • sort
  • singletonList
    Returns an immutable list containing only the specified object. The returned list is serializable.
  • unmodifiableList
    Returns an unmodifiable view of the specified list. This method allows modules to provide users with
  • emptyMap
    Returns the empty map (immutable). This map is serializable.This example illustrates the type-safe w
  • emptySet
    Returns the empty set (immutable). This set is serializable. Unlike the like-named field, this metho
  • unmodifiableMap
    Returns an unmodifiable view of the specified map. This method allows modules to provide users with
  • singleton
    Returns an immutable set containing only the specified object. The returned set is serializable.
  • unmodifiableSet
    Returns an unmodifiable view of the specified set. This method allows modules to provide users with
  • singletonMap
    Returns an immutable map, mapping only the specified key to the specified value. The returned map is
  • addAll
    Adds all of the specified elements to the specified collection. Elements to be added may be specifie
  • reverse
    Reverses the order of the elements in the specified list. This method runs in linear time.
  • addAll,
  • reverse,
  • unmodifiableCollection,
  • shuffle,
  • enumeration,
  • list,
  • synchronizedMap,
  • synchronizedList,
  • reverseOrder,
  • emptyIterator

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • 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