Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 37 for saturatedCast (0.14 sec)

  1. android/guava/src/com/google/common/collect/AbstractMapBasedMultiset.java

        return backingMap.size();
      }
    
      @Override
      public final Iterator<E> iterator() {
        return Multisets.iteratorImpl(this);
      }
    
      @Override
      public final int size() {
        return Ints.saturatedCast(size);
      }
    
      /**
       * @serialData the number of distinct elements, the first element, its count, the second element,
       *     its count, and so on
       */
      @GwtIncompatible // java.io.ObjectOutputStream
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Mar 06 16:06:58 UTC 2023
    - 8.2K bytes
    - Viewed (0)
  2. guava/src/com/google/common/graph/AbstractBaseGraph.java

          @Override
          public UnmodifiableIterator<EndpointPair<N>> iterator() {
            return EndpointPairIterator.of(AbstractBaseGraph.this);
          }
    
          @Override
          public int size() {
            return Ints.saturatedCast(edgeCount());
          }
    
          @Override
          public boolean remove(@CheckForNull Object o) {
            throw new UnsupportedOperationException();
          }
    
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Jan 22 17:29:38 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  3. guava/src/com/google/common/collect/ImmutableRangeSet.java

              total += ContiguousSet.create(range, domain).size();
              if (total >= Integer.MAX_VALUE) {
                break;
              }
            }
            result = size = Ints.saturatedCast(total);
          }
          return result.intValue();
        }
    
        @Override
        public UnmodifiableIterator<C> iterator() {
          return new AbstractIterator<C>() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 27K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/primitives/SignedBytes.java

       * @return the same value cast to {@code byte} if it is in the range of the {@code byte} type,
       *     {@link Byte#MAX_VALUE} if it is too large, or {@link Byte#MIN_VALUE} if it is too small
       */
      public static byte saturatedCast(long value) {
        if (value > Byte.MAX_VALUE) {
          return Byte.MAX_VALUE;
        }
        if (value < Byte.MIN_VALUE) {
          return Byte.MIN_VALUE;
        }
        return (byte) value;
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Oct 17 13:00:28 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  5. guava/src/com/google/common/collect/AbstractMapBasedMultiset.java

        size = 0L;
      }
    
      @Override
      int distinctElements() {
        return backingMap.size();
      }
    
      // Optimizations - Query Operations
    
      @Override
      public int size() {
        return Ints.saturatedCast(size);
      }
    
      @Override
      public Iterator<E> iterator() {
        return new MapBasedMultisetIterator();
      }
    
      /*
       * Not subclassing AbstractMultiset$MultisetIterator because next() needs to
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 16:15:19 UTC 2024
    - 10.4K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/collect/TreeMultiset.java

              + aggregateAboveRange(aggr, node.left);
        }
      }
    
      @Override
      public int size() {
        return Ints.saturatedCast(aggregateForEntries(Aggregate.SIZE));
      }
    
      @Override
      int distinctElements() {
        return Ints.saturatedCast(aggregateForEntries(Aggregate.DISTINCT));
      }
    
      static int distinctElements(@CheckForNull AvlNode<?> node) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 34.1K bytes
    - Viewed (0)
  7. guava/src/com/google/common/collect/TreeMultiset.java

              + aggregateAboveRange(aggr, node.left);
        }
      }
    
      @Override
      public int size() {
        return Ints.saturatedCast(aggregateForEntries(Aggregate.SIZE));
      }
    
      @Override
      int distinctElements() {
        return Ints.saturatedCast(aggregateForEntries(Aggregate.DISTINCT));
      }
    
      static int distinctElements(@CheckForNull AvlNode<?> node) {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 34.5K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/primitives/UnsignedInts.java

       * @return {@code 2^32 - 1} if {@code value >= 2^32}, {@code 0} if {@code value <= 0}, and {@code
       *     value} cast to {@code int} otherwise
       * @since 21.0
       */
      public static int saturatedCast(long value) {
        if (value <= 0) {
          return 0;
        } else if (value >= (1L << 32)) {
          return -1;
        } else {
          return (int) value;
        }
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 21:17:54 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  9. guava/src/com/google/common/primitives/UnsignedInts.java

       * @return {@code 2^32 - 1} if {@code value >= 2^32}, {@code 0} if {@code value <= 0}, and {@code
       *     value} cast to {@code int} otherwise
       * @since 21.0
       */
      public static int saturatedCast(long value) {
        if (value <= 0) {
          return 0;
        } else if (value >= (1L << 32)) {
          return -1;
        } else {
          return (int) value;
        }
      }
    
      /**
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 30 21:17:54 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/primitives/ImmutableLongArray.java

          Spliterator.OfLong spliterator = stream.spliterator();
          long size = spliterator.getExactSizeIfKnown();
          if (size > 0) { // known *and* nonempty
            ensureRoomFor(Ints.saturatedCast(size));
          }
          spliterator.forEachRemaining((LongConsumer) this::add);
          return this;
        }
    
        /**
         * Appends {@code values}, in order, to the end of the values the built {@link
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 25 18:05:56 UTC 2024
    - 22.3K bytes
    - Viewed (0)
Back to top