Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for asImmutable (0.1 sec)

  1. guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/ImmutableEnumSet.java

     * to avoid code-size bloat.
     *
     * @author Hayward Chan
     */
    @ElementTypesAreNonnullByDefault
    final class ImmutableEnumSet<E> extends ForwardingImmutableSet<E> {
      static <E> ImmutableSet<E> asImmutable(Set<E> delegate) {
        switch (delegate.size()) {
          case 0:
            return ImmutableSet.of();
          case 1:
            return ImmutableSet.of(Iterables.getOnlyElement(delegate));
          default:
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Tue Jan 23 18:43:40 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/ImmutableEnumMap.java

    @SuppressWarnings("serial") // we're overriding default serialization
    @ElementTypesAreNonnullByDefault
    final class ImmutableEnumMap<K extends Enum<K>, V> extends IteratorBasedImmutableMap<K, V> {
      static <K extends Enum<K>, V> ImmutableMap<K, V> asImmutable(EnumMap<K, V> map) {
        switch (map.size()) {
          case 0:
            return ImmutableMap.of();
          case 1:
            Entry<K, V> entry = getOnlyElement(map.entrySet());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 3.7K bytes
    - Viewed (0)
  3. guava/src/com/google/common/collect/ImmutableEnumMap.java

    @SuppressWarnings("serial") // we're overriding default serialization
    @ElementTypesAreNonnullByDefault
    final class ImmutableEnumMap<K extends Enum<K>, V> extends IteratorBasedImmutableMap<K, V> {
      static <K extends Enum<K>, V> ImmutableMap<K, V> asImmutable(EnumMap<K, V> map) {
        switch (map.size()) {
          case 0:
            return ImmutableMap.of();
          case 1:
            Entry<K, V> entry = getOnlyElement(map.entrySet());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/collect/CollectCollectors.java

            return this;
          }
        }
    
        ImmutableSet<E> toImmutableSet() {
          if (set == null) {
            return ImmutableSet.of();
          }
          ImmutableSet<E> ret = ImmutableEnumSet.asImmutable(set);
          set = null; // subsequent manual manipulation of the accumulator mustn't affect ret
          return ret;
        }
      }
    
      @GwtIncompatible
      @SuppressWarnings({"rawtypes", "unchecked"})
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/Sets.java

            return ImmutableSet.of();
          } else {
            return ImmutableEnumSet.asImmutable(EnumSet.copyOf(collection));
          }
        } else {
          Iterator<E> itr = elements.iterator();
          if (itr.hasNext()) {
            EnumSet<E> enumSet = EnumSet.of(itr.next());
            Iterators.addAll(enumSet, itr);
            return ImmutableEnumSet.asImmutable(enumSet);
          } else {
            return ImmutableSet.of();
          }
        }
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 14:28:19 UTC 2024
    - 78.8K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/ImmutableMap.java

        EnumMap<K, V> copy = new EnumMap<>((EnumMap<K, ? extends V>) original);
        for (Entry<K, V> entry : copy.entrySet()) {
          checkEntryNotNull(entry.getKey(), entry.getValue());
        }
        return ImmutableEnumMap.asImmutable(copy);
      }
    
      static final Entry<?, ?>[] EMPTY_ENTRY_ARRAY = new Entry<?, ?>[0];
    
      abstract static class IteratorBasedImmutableMap<K, V> extends ImmutableMap<K, V> {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 44.6K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/Maps.java

          K key = entry.getKey();
          V value = entry.getValue();
          checkEntryNotNull(key, value);
          enumMap.put(key, value);
        }
        return ImmutableEnumMap.asImmutable(enumMap);
      }
    
      /**
       * Returns a {@link Collector} that accumulates elements into an {@code ImmutableMap} whose keys
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 161.6K bytes
    - Viewed (0)
  8. guava/src/com/google/common/collect/Maps.java

          K key = entry.getKey();
          V value = entry.getValue();
          checkEntryNotNull(key, value);
          enumMap.put(key, value);
        }
        return ImmutableEnumMap.asImmutable(enumMap);
      }
    
      /**
       * Returns a {@link Collector} that accumulates elements into an {@code ImmutableMap} whose keys
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Sat Oct 19 00:05:46 UTC 2024
    - 167.4K bytes
    - Viewed (0)
Back to top