UnmodifiableNavigableSet(NavigableSet<E> delegate) { this.delegate = checkNotNull(delegate); this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate); }
/** * 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); }
UnmodifiableNavigableSet(NavigableSet<E> delegate) { this.delegate = checkNotNull(delegate); this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate); }
@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); } }
@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); } }
@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); } }
/** * 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())); }
/** * 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); }
@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); } }
@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); } }
UnmodifiableNavigableSet(NavigableSet<E> delegate) { this.delegate = checkNotNull(delegate); this.unmodifiableDelegate = Collections.unmodifiableSortedSet(delegate); }
@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); } }
@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); } }
@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); } }
@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); } }
@Override public SortedSet<V> get(K key) { return Collections.unmodifiableSortedSet(delegate().get(key)); }
@Override public SortedSet<R> rowKeySet() { return Collections.unmodifiableSortedSet(delegate().rowKeySet()); }
/** * 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())); }
@Override public SortedSet<R> rowKeySet() { return Collections.unmodifiableSortedSet(delegate().rowKeySet()); }
@Override public SortedSet<V> get(K key) { return Collections.unmodifiableSortedSet(delegate().get(key)); }