Home
last modified time | relevance | path

Searched refs:iterable (Results 1 – 25 of 182) sorted by relevance

12345678

/external/guava/guava-gwt/src-super/com/google/common/collect/super/com/google/common/collect/
DIterables.java63 final Iterable<T> iterable) { in unmodifiableIterable() argument
64 checkNotNull(iterable); in unmodifiableIterable()
65 if (iterable instanceof UnmodifiableIterable || in unmodifiableIterable()
66 iterable instanceof ImmutableCollection) { in unmodifiableIterable()
67 return iterable; in unmodifiableIterable()
69 return new UnmodifiableIterable<T>(iterable); in unmodifiableIterable()
79 ImmutableCollection<E> iterable) { in unmodifiableIterable() argument
80 return checkNotNull(iterable); in unmodifiableIterable()
84 private final Iterable<T> iterable; field in Iterables.UnmodifiableIterable
86 private UnmodifiableIterable(Iterable<T> iterable) { in UnmodifiableIterable() argument
[all …]
DFluentIterable.java75 private final Iterable<E> iterable; field in FluentIterable
79 this.iterable = this; in FluentIterable()
82 FluentIterable(Iterable<E> iterable) { in FluentIterable() argument
83 this.iterable = checkNotNull(iterable); in FluentIterable()
90 public static <E> FluentIterable<E> from(final Iterable<E> iterable) { in from() argument
91 return (iterable instanceof FluentIterable) ? (FluentIterable<E>) iterable in from()
92 : new FluentIterable<E>(iterable) { in from()
95 return iterable.iterator(); in from()
109 public static <E> FluentIterable<E> from(FluentIterable<E> iterable) {
110 return checkNotNull(iterable);
[all …]
/external/guava/guava/src/com/google/common/collect/
DIterables.java65 final Iterable<T> iterable) { in unmodifiableIterable() argument
66 checkNotNull(iterable); in unmodifiableIterable()
67 if (iterable instanceof UnmodifiableIterable || in unmodifiableIterable()
68 iterable instanceof ImmutableCollection) { in unmodifiableIterable()
69 return iterable; in unmodifiableIterable()
71 return new UnmodifiableIterable<T>(iterable); in unmodifiableIterable()
81 ImmutableCollection<E> iterable) { in unmodifiableIterable() argument
82 return checkNotNull(iterable); in unmodifiableIterable()
86 private final Iterable<T> iterable; field in Iterables.UnmodifiableIterable
88 private UnmodifiableIterable(Iterable<T> iterable) { in UnmodifiableIterable() argument
[all …]
DFluentIterable.java76 private final Iterable<E> iterable; field in FluentIterable
80 this.iterable = this; in FluentIterable()
83 FluentIterable(Iterable<E> iterable) { in FluentIterable() argument
84 this.iterable = checkNotNull(iterable); in FluentIterable()
91 public static <E> FluentIterable<E> from(final Iterable<E> iterable) { in from() argument
92 return (iterable instanceof FluentIterable) ? (FluentIterable<E>) iterable in from()
93 : new FluentIterable<E>(iterable) { in from()
96 return iterable.iterator(); in from()
110 public static <E> FluentIterable<E> from(FluentIterable<E> iterable) {
111 return checkNotNull(iterable);
[all …]
DAllEqualOrdering.java41 public <E> List<E> sortedCopy(Iterable<E> iterable) { in sortedCopy() argument
42 return Lists.newArrayList(iterable); in sortedCopy()
46 public <E> ImmutableList<E> immutableSortedCopy(Iterable<E> iterable) { in immutableSortedCopy() argument
47 return ImmutableList.copyOf(iterable); in immutableSortedCopy()
DOrdering.java481 public <E extends T> E min(Iterable<E> iterable) { in min() argument
482 return min(iterable.iterator()); in min()
557 public <E extends T> E max(Iterable<E> iterable) { in max() argument
558 return max(iterable.iterator()); in max()
614 public <E extends T> List<E> leastOf(Iterable<E> iterable, int k) { in leastOf() argument
615 if (iterable instanceof Collection) { in leastOf()
616 Collection<E> collection = (Collection<E>) iterable; in leastOf()
631 return leastOf(iterable.iterator(), k); in leastOf()
772 public <E extends T> List<E> greatestOf(Iterable<E> iterable, int k) { in greatestOf() argument
775 return reverse().leastOf(iterable, k); in greatestOf()
[all …]
DReverseNaturalOrdering.java60 @Override public <E extends Comparable> E min(Iterable<E> iterable) { in min() argument
61 return NaturalOrdering.INSTANCE.max(iterable); in min()
76 @Override public <E extends Comparable> E max(Iterable<E> iterable) { in max() argument
77 return NaturalOrdering.INSTANCE.min(iterable); in max()
/external/smali/util/src/main/java/org/jf/util/
DImmutableConverter.java49 public ImmutableList<ImmutableItem> toList(@Nullable final Iterable<? extends Item> iterable) { in toList() argument
50 if (iterable == null) { in toList()
55 if (iterable instanceof ImmutableList) { in toList()
56 for (Item element: iterable) { in toList()
67 return (ImmutableList<ImmutableItem>)iterable; in toList()
70 final Iterator<? extends Item> iter = iterable.iterator(); in toList()
80 public ImmutableSet<ImmutableItem> toSet(@Nullable final Iterable<? extends Item> iterable) {
81 if (iterable == null) {
86 if (iterable instanceof ImmutableSet) {
87 for (Item element: iterable) {
[all …]
/external/guava/guava-testlib/test/com/google/common/collect/testing/
DMinimalIterableTest.java36 Iterable<String> iterable = MinimalIterable.<String>of(); in testOf_empty() local
37 Iterator<String> iterator = iterable.iterator(); in testOf_empty()
45 iterable.iterator(); in testOf_empty()
52 Iterable<String> iterable = MinimalIterable.of("a"); in testOf_one() local
53 Iterator<String> iterator = iterable.iterator(); in testOf_one()
63 iterable.iterator(); in testOf_one()
70 Iterable<String> iterable in testFrom_empty() local
72 Iterator<String> iterator = iterable.iterator(); in testFrom_empty()
80 iterable.iterator(); in testFrom_empty()
87 Iterable<String> iterable in testFrom_one() local
[all …]
/external/guava/guava-gwt/test-super/com/google/common/collect/super/com/google/common/collect/
DIterablesTest.java59 Iterable<String> iterable = Collections.emptySet(); in testSize0() local
60 assertEquals(0, Iterables.size(iterable)); in testSize0()
64 Iterable<String> iterable = Collections.singleton("a"); in testSize1Collection() local
65 assertEquals(1, Iterables.size(iterable)); in testSize1Collection()
69 Iterable<Integer> iterable = new Iterable<Integer>() { in testSize2NonCollection() local
75 assertEquals(2, Iterables.size(iterable)); in testSize2NonCollection()
89 private static Iterable<String> iterable(String... elements) { in iterable() method in IterablesTest
110 Iterable<String> set = iterable("a", null, "b");
115 Iterable<String> set = iterable("a", "b");
130 Iterable<String> set = iterable("a", null, "b");
[all …]
/external/guava/guava-tests/test/com/google/common/collect/
DIterablesTest.java65 Iterable<String> iterable = Collections.emptySet(); in testSize0() local
66 assertEquals(0, Iterables.size(iterable)); in testSize0()
70 Iterable<String> iterable = Collections.singleton("a"); in testSize1Collection() local
71 assertEquals(1, Iterables.size(iterable)); in testSize1Collection()
75 Iterable<Integer> iterable = new Iterable<Integer>() { in testSize2NonCollection() local
81 assertEquals(2, Iterables.size(iterable)); in testSize2NonCollection()
95 private static Iterable<String> iterable(String... elements) { in iterable() method in IterablesTest
116 Iterable<String> set = iterable("a", null, "b");
121 Iterable<String> set = iterable("a", "b");
136 Iterable<String> set = iterable("a", null, "b");
[all …]
DFluentIterableTest.java68 FluentIterable<Integer> iterable = FluentIterable.from(asList(1)); in testFrom_alreadyFluentIterable() local
69 assertSame(iterable, FluentIterable.from(iterable)); in testFrom_alreadyFluentIterable()
82 Iterable<Integer> iterable = new Iterable<Integer>() { in testSize2NonCollection() local
88 assertEquals(2, FluentIterable.from(iterable).size()); in testSize2NonCollection()
112 Iterable<String> iterable = iterable("a", null, "b"); in testContains_nullIterableYes() local
113 assertTrue(FluentIterable.from(iterable).contains(null)); in testContains_nullIterableYes()
117 Iterable<String> iterable = iterable("a", "b"); in testContains_nullIterableNo() local
118 assertFalse(FluentIterable.from(iterable).contains(null)); in testContains_nullIterableNo()
132 Iterable<String> set = iterable("a", null, "b"); in testContains_nonNullIterableYes()
137 Iterable<String> iterable = iterable("a", "b"); in testContains_nonNullIterableNo() local
[all …]
/external/mockito/src/test/java/org/mockitousage/bugs/
DInheritedGenericsPolimorphicCallTest.java36 MyIterable<String> iterable = Mockito.mock(MyIterable.class); field in InheritedGenericsPolimorphicCallTest
40 Mockito.when(iterable.iterator()).thenReturn(myIterator); in shouldStubbingWork()
41 Assert.assertNotNull(((Iterable<String>) iterable).iterator()); in shouldStubbingWork()
42 Assert.assertNotNull(iterable.iterator()); in shouldStubbingWork()
47 iterable.iterator(); in shouldVerificationWorks()
49 verify(iterable).iterator(); in shouldVerificationWorks()
50 verify((Iterable<String>) iterable).iterator(); in shouldVerificationWorks()
63 iterable = (MyIterable<String>) Proxy.newProxyInstance( in shouldWorkExactlyAsJavaProxyWould()
69 iterable.iterator(); in shouldWorkExactlyAsJavaProxyWould()
70 ((Iterable<String>) iterable).iterator(); in shouldWorkExactlyAsJavaProxyWould()
/external/python/cpython2/Doc/library/
Ditertools.rst54 :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v)
94 Make an iterator that returns elements from the first iterable until it is
95 exhausted, then proceeds to the next iterable, until all of the iterables are
106 .. classmethod:: chain.from_iterable(iterable)
109 single iterable argument that is evaluated lazily. Roughly equivalent to::
120 .. function:: combinations(iterable, r)
122 Return *r* length subsequences of elements from the input *iterable*.
125 input *iterable* is sorted, the combination tuples will be produced
134 def combinations(iterable, r):
137 pool = tuple(iterable)
[all …]
/external/python/cpython2/Lib/
Dheapq.py203 def nlargest(n, iterable): argument
210 it = iter(iterable)
221 def nsmallest(n, iterable): argument
228 it = iter(iterable)
399 def nsmallest(n, iterable, key=None): argument
406 it = iter(iterable)
416 size = len(iterable)
421 return sorted(iterable, key=key)[:n]
425 it = izip(iterable, count()) # decorate
430 in1, in2 = tee(iterable)
[all …]
Dsets.py341 def _update(self, iterable): argument
346 if isinstance(iterable, BaseSet):
347 data.update(iterable._data)
352 if type(iterable) in (list, tuple, xrange):
355 it = iter(iterable)
368 for element in iterable:
385 def __init__(self, iterable=None): argument
389 if iterable is not None:
390 self._update(iterable)
410 def __init__(self, iterable=None): argument
[all …]
Dcollections.py209 def fromkeys(cls, iterable, value=None): argument
215 for key in iterable:
522 def fromkeys(cls, iterable, v=None): argument
555 iterable = args[0] if args else None
556 if iterable is not None:
557 if isinstance(iterable, Mapping):
560 for elem, count in iterable.iteritems():
563 super(Counter, self).update(iterable) # fast path when counter is empty
566 for elem in iterable:
594 iterable = args[0] if args else None
[all …]
/external/mockito/src/main/java/org/mockito/internal/util/
DChecks.java20 public static <T extends Iterable<?>> T checkItemsNotNull(T iterable, String checkedIterable) { in checkItemsNotNull() argument
21 checkNotNull(iterable, checkedIterable); in checkItemsNotNull()
22 for (Object item : iterable) { in checkItemsNotNull()
25 return iterable; in checkItemsNotNull()
/external/v8/src/js/
Dweak-collection.js29 function WeakMapConstructor(iterable) { argument
36 if (!IS_NULL_OR_UNDEFINED(iterable)) {
41 for (var nextItem of iterable) {
118 function WeakSetConstructor(iterable) { argument
125 if (!IS_NULL_OR_UNDEFINED(iterable)) {
130 for (var value of iterable) {
Dpromise.js28 function PromiseAll(iterable) { argument
63 for (var value of iterable) {
92 function PromiseRace(iterable) { argument
109 for (var value of iterable) {
/external/fonttools/Lib/fontTools/misc/
Dpy23.py31 def strjoin(iterable): argument
32 return ''.join(iterable)
82 def bytesjoin(iterable): argument
83 return b''.join(tobytes(item) for item in iterable)
/external/python/cpython2/Lib/multiprocessing/
Dpool.py246 def map(self, func, iterable, chunksize=None): argument
251 return self.map_async(func, iterable, chunksize).get()
253 def imap(self, func, iterable, chunksize=1): argument
261 for i, x in enumerate(iterable)), result._set_length))
265 task_batches = Pool._get_tasks(func, iterable, chunksize)
271 def imap_unordered(self, func, iterable, chunksize=1): argument
279 for i, x in enumerate(iterable)), result._set_length))
283 task_batches = Pool._get_tasks(func, iterable, chunksize)
298 def map_async(self, func, iterable, chunksize=None, callback=None): argument
303 if not hasattr(iterable, '__len__'):
[all …]
/external/mockito/src/main/java/org/mockito/internal/util/collections/
DIterables.java35 public static <T> T firstOf(Iterable<T> iterable) { in firstOf() argument
36 Iterator<T> iterator = iterable.iterator(); in firstOf()
38 … throw new IllegalArgumentException("Cannot provide 1st element from empty iterable: " + iterable); in firstOf()
/external/hamcrest/hamcrest-library/src/main/java/org/hamcrest/collection/
DIsIterableContainingInRelativeOrder.java21 … protected boolean matchesSafely(Iterable<? extends E> iterable, Description mismatchDescription) { in matchesSafely() argument
23 matchSeriesInRelativeOrder.processItems(iterable); in matchesSafely()
45 public void processItems(Iterable<? extends F> iterable) { in processItems() argument
46 for (F item : iterable) { in processItems()
/external/python/cpython2/Doc/c-api/
Dset.rst52 the constructor functions work with any iterable Python object.
86 .. c:function:: PyObject* PySet_New(PyObject *iterable)
88 Return a new :class:`set` containing objects returned by the *iterable*. The
89 *iterable* may be *NULL* to create a new empty set. Return the new set on
90 success or *NULL* on failure. Raise :exc:`TypeError` if *iterable* is not
91 actually iterable. The constructor is also useful for copying a set
95 .. c:function:: PyObject* PyFrozenSet_New(PyObject *iterable)
97 Return a new :class:`frozenset` containing objects returned by the *iterable*.
98 The *iterable* may be *NULL* to create a new empty frozenset. Return the new
99 set on success or *NULL* on failure. Raise :exc:`TypeError` if *iterable* is
[all …]

12345678