@SafeVarargs public InjectStep(final Traversal.Admin traversal, final S... injections) { super(traversal); this.injections = injections; this.start = new ArrayIterator<>(this.injections); }
@Override public T next() { if (this.hasNext()) { this.current++; return this.array[this.current - 1]; } else { throw FastNoSuchElementException.instance(); } }
private final Iterator<E> handleArrays(final Object array) { if (array instanceof Object[]) { return new ArrayIterator<>((E[]) array); } else { int len = Array.getLength(array); final Object[] objectArray = new Object[len]; for (int i = 0; i < len; i++) objectArray[i] = Array.get(array, i); return new ArrayIterator<>((E[]) objectArray); } } }
@Override public T next() { if (this.hasNext()) { this.current++; return this.array[this.current - 1]; } else { throw FastNoSuchElementException.instance(); } }
@Override public InjectStep<S> clone() { final InjectStep<S> clone = (InjectStep<S>) super.clone(); clone.start = new ArrayIterator<>(clone.injections); return clone; }
@Override public void reset() { super.reset(); this.start = new ArrayIterator<>(this.injections); }
public static Iterator asIterator(final Object o) { final Iterator itty; if (o instanceof Iterable) itty = ((Iterable) o).iterator(); else if (o instanceof Iterator) itty = (Iterator) o; else if (o instanceof Object[]) itty = new ArrayIterator<>((Object[]) o); else if (o instanceof Stream) itty = ((Stream) o).iterator(); else if (o instanceof Map) itty = ((Map) o).entrySet().iterator(); else if (o instanceof Throwable) itty = of(((Throwable) o).getMessage()); else itty = of(o); return itty; }
private final Iterator<E> handleArrays(final Object array) { if (array instanceof Object[]) { return new ArrayIterator<>((E[]) array); } else { int len = Array.getLength(array); final Object[] objectArray = new Object[len]; for (int i = 0; i < len; i++) objectArray[i] = Array.get(array, i); return new ArrayIterator<>((E[]) objectArray); } } }
@SafeVarargs public InjectStep(final Traversal.Admin traversal, final S... injections) { super(traversal); this.injections = injections; this.start = new ArrayIterator<>(this.injections); }
@Override public InjectStep<S> clone() { final InjectStep<S> clone = (InjectStep<S>) super.clone(); clone.start = new ArrayIterator<>(clone.injections); return clone; }
@Override public void reset() { super.reset(); this.start = new ArrayIterator<>(this.injections); }
public static Iterator asIterator(final Object o) { final Iterator itty; if (o instanceof Iterable) itty = ((Iterable) o).iterator(); else if (o instanceof Iterator) itty = (Iterator) o; else if (o instanceof Object[]) itty = new ArrayIterator<>((Object[]) o); else if (o instanceof Stream) itty = ((Stream) o).iterator(); else if (o instanceof Map) itty = ((Map) o).entrySet().iterator(); else if (o instanceof Throwable) itty = of(((Throwable) o).getMessage()); else itty = of(o); return itty; }