Tabnine Logo
IntIterable.iterator
Code IndexAdd Tabnine to your IDE (free)

How to use
iterator
method
in
com.almworks.integers.IntIterable

Best Java code snippets using com.almworks.integers.IntIterable.iterator (Showing top 5 results out of 315)

origin: com.almworks.integers/integers-wrappers

public static <T> IntObjHppcOpenHashMap<T> createFrom(IntIterable keys, Iterable<T> values) {
 int keysSize = (keys instanceof IntSizedIterable) ? ((IntSizedIterable) keys).size() : 0;
 int valuesSize = (values instanceof Collection) ? ((Collection) keys).size() : 0;
 float loadFactor = IntIntOpenHashMap.DEFAULT_LOAD_FACTOR;
 int initialCapacity = (int)(Math.max(keysSize, valuesSize) / loadFactor) + 1;
 IntObjHppcOpenHashMap map = new IntObjHppcOpenHashMap(initialCapacity);
 IntIterator keysIt = keys.iterator();
 Iterator valuesIt = values.iterator();
 map.putAll(IntObjIterators.pair(keysIt, valuesIt));
 if (keysIt.hasNext() || valuesIt.hasNext()) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 }
 return map;
}
origin: com.almworks.integers/integers-wrappers

public static IntIntHppcOpenHashMap createFrom(IntIterable keys, IntIterable values) {
 int keysSize = IntCollections.sizeOfIterable(keys, 0);
 int valuesSize = IntCollections.sizeOfIterable(values, 0);
 if (keysSize != valuesSize) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 } else {
  keysSize = Math.max(keysSize, valuesSize);
 }
 float loadFactor = IntIntOpenHashMap.DEFAULT_LOAD_FACTOR;
 int initialCapacity = (int)(keysSize / loadFactor) + 1;
 IntIntHppcOpenHashMap map = new IntIntHppcOpenHashMap(initialCapacity);
 IntIterator keysIt = keys.iterator();
 IntIterator valuesIt = values.iterator();
 map.putAll(IntIntIterators.pair(keysIt, valuesIt));
 if (keysIt.hasNext() || valuesIt.hasNext()) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 }
 return map;
}
origin: com.almworks.integers/integers

@Override
public void putAllKeys(LongIterable keys, IntIterable values) {
 final IntIterator it = values.iterator();
 myMap.putAllKeys(keys, new Iterable<Integer>() {
  @Override
  public Iterator<Integer> iterator() {
   return new Iterator<Integer>() {
    @Override
    public boolean hasNext() {
     return it.hasNext();
    }
    @Override
    public Integer next() {
     return it.nextValue();
    }
    @Override
    public void remove() {
     throw new UnsupportedOperationException();
    }
   };
  }
 });
}
origin: com.almworks.integers/integers-wrappers

public static IntLongHppcOpenHashMap createFrom(IntIterable keys, LongIterable values) {
 int keysSize = IntCollections.sizeOfIterable(keys, 0);
 int valuesSize = LongCollections.sizeOfIterable(values, 0);
 if (keysSize != valuesSize) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 } else {
  keysSize = Math.max(keysSize, valuesSize);
 }
 float loadFactor = IntLongOpenHashMap.DEFAULT_LOAD_FACTOR;
 int initialCapacity = (int)(keysSize / loadFactor) + 1;
 IntLongHppcOpenHashMap map = new IntLongHppcOpenHashMap(initialCapacity);
 IntIterator keysIt = keys.iterator();
 LongIterator valuesIt = values.iterator();
 map.putAll(IntLongIterators.pair(keysIt, valuesIt));
 if (keysIt.hasNext() || valuesIt.hasNext()) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 }
 return map;
}
origin: com.almworks.integers/integers-wrappers

public static LongIntHppcOpenHashMap createFrom(LongIterable keys, IntIterable values) {
 int keysSize = LongCollections.sizeOfIterable(keys, 0);
 int valuesSize = IntCollections.sizeOfIterable(values, 0);
 if (keysSize != valuesSize) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 } else {
  keysSize = Math.max(keysSize, valuesSize);
 }
 float loadFactor = LongIntOpenHashMap.DEFAULT_LOAD_FACTOR;
 int initialCapacity = (int)(keysSize / loadFactor) + 1;
 LongIntHppcOpenHashMap map = new LongIntHppcOpenHashMap(initialCapacity);
 LongIterator keysIt = keys.iterator();
 IntIterator valuesIt = values.iterator();
 map.putAll(LongIntIterators.pair(keysIt, valuesIt));
 if (keysIt.hasNext() || valuesIt.hasNext()) {
  throw new IllegalArgumentException("keys.size() != values.size()");
 }
 return map;
}
com.almworks.integersIntIterableiterator

Popular methods of IntIterable

    Popular in Java

    • Making http requests using okhttp
    • onCreateOptionsMenu (Activity)
    • requestLocationUpdates (LocationManager)
    • onRequestPermissionsResult (Fragment)
    • SecureRandom (java.security)
      This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
    • Comparator (java.util)
      A Comparator is used to compare two objects to determine their ordering with respect to each other.
    • List (java.util)
      An ordered collection (also known as a sequence). The user of this interface has precise control ove
    • Executors (java.util.concurrent)
      Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
    • BoxLayout (javax.swing)
    • JButton (javax.swing)
    • Best plugins for Eclipse
    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