congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
IterableLike$PrimitiveArrayIterator
Code IndexAdd Tabnine to your IDE (free)

How to use
IterableLike$PrimitiveArrayIterator
in
org.jdbi.v3.core.internal

Best Java code snippets using org.jdbi.v3.core.internal.IterableLike$PrimitiveArrayIterator (Showing top 4 results out of 315)

origin: jdbi/jdbi

/**
 * Given an iterable object (which may be a iterator, iterable, primitive
 * or reference array), return an iterator over its (possibly boxed) elements.
 *
 * @param iterable the iterable-like
 * @return an iterator of the given array's elements
 */
@SuppressWarnings("unchecked")
public static Iterator<Object> of(Object iterable) {
  if (iterable == null) {
    throw new IllegalArgumentException("can't iterate null");
  }
  if (iterable instanceof Iterator<?>) {
    return (Iterator<Object>) iterable;
  } else if (iterable instanceof Iterable<?>) {
    return ((Iterable<Object>) iterable).iterator();
  }
  Class<?> klass = iterable.getClass();
  if (!klass.isArray()) {
    throw new IllegalArgumentException(getTypeWarning(klass));
  }
  if (klass.getComponentType().isPrimitive()) {
    return new PrimitiveArrayIterator(iterable);
  }
  return Arrays.asList((Object[]) iterable).iterator();
}
origin: jdbi/jdbi

@Override
public Object next() {
  if (hasNext()) {
    return Array.get(arr, index++);
  } else {
    throw new NoSuchElementException("only " + size + " elements available");
  }
}
origin: org.jdbi/jdbi3

/**
 * Given an iterable object (which may be a iterator, iterable, primitive
 * or reference array), return an iterator over its (possibly boxed) elements.
 *
 * @return an iterator of the given array's elements
 */
@SuppressWarnings("unchecked")
public static Iterator<Object> of(Object iterable)
{
  if (iterable == null) {
    throw new IllegalArgumentException("can't iterate null");
  }
  if (iterable instanceof Iterator<?>) {
    return (Iterator<Object>) iterable;
  }
  else if (iterable instanceof Iterable<?>) {
    return ((Iterable<Object>) iterable).iterator();
  }
  Class<? extends Object> klass = iterable.getClass();
  if(!klass.isArray()) {
    throw new IllegalArgumentException(getTypeWarning(klass));
  }
  if (klass.getComponentType().isPrimitive()) {
    return new PrimitiveArrayIterator(iterable);
  }
  return Arrays.asList((Object[])iterable).iterator();
}
origin: org.jdbi/jdbi3

@Override
public Object next()
{
  if (hasNext())
  {
    return Array.get(arr, index++);
  } else
  {
    throw new NoSuchElementException("only " + size + " elements available");
  }
}
org.jdbi.v3.core.internalIterableLike$PrimitiveArrayIterator

Most used methods

  • <init>
  • hasNext

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • getContentResolver (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JOptionPane (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • IsNull (org.hamcrest.core)
    Is the value null?
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now