|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jjoost.util.Iters
public class Iters
A class declaring useful methods for working with Iterator and Iterable objects
| Constructor Summary | |
|---|---|
Iters()
|
|
| Method Summary | ||
|---|---|---|
static
|
concat(java.lang.Iterable<? extends java.lang.Iterable<E>> a)
Lazily concatenates the provided Iterable objects. |
|
static
|
concat(java.lang.Iterable<E>... a)
Lazily concatenates the provided Iterable objects. |
|
static
|
concat(java.lang.Iterable<E> a,
java.lang.Iterable<E> b)
Lazily concatenates the two provided Iterable objects. |
|
static
|
concat(java.util.Iterator<? extends java.util.Iterator<E>> a)
Lazily concatenates the provided Iterator objects. |
|
static
|
contains(E find,
java.lang.Iterable<E> iter)
Returns a boolean indicating if the provided Iterable contains an element equal to the provided object, as
determined by regular Object equality (Equalities.object()). |
|
static
|
contains(E find,
java.util.Iterator<E> iter)
Returns a boolean indicating if the provided Iterator contains an element equal to the provided object, as
determined by regular Object equality (Equalities.object()). |
|
static
|
contains(Equality<? super E> eq,
E find,
java.lang.Iterable<E> iter)
Returns a boolean indicating if the provided Iterable contains an element equal to the provided object, as
determined by the provided Equality. |
|
static
|
contains(Equality<? super E> eq,
E find,
java.util.Iterator<E> iter)
Returns a boolean indicating if the provided Iterator contains an element equal to the provided object, as
determined by the provided Equality. |
|
static
|
count(E find,
java.lang.Iterable<E> iter)
Returns an int representing the number of occurrences, in the provided Iterable, of elements equal to the
provided object, as determined by regular Object equality (Equalities.object()). |
|
static
|
count(E find,
java.util.Iterator<E> iter)
Returns an int representing the number of occurrences, in the provided Iterator, of elements equal to the
provided object, as determined by regular Object equality (Equalities.object()). |
|
static
|
count(Equality<? super E> eq,
E find,
java.lang.Iterable<E> iter)
Returns an int representing the number of occurrences, in the provided Iterable, of elements equal to the
provided object, as determined by the provided Equality. |
|
static
|
count(Equality<? super E> eq,
E find,
java.util.Iterator<E> iter)
Returns an int representing the number of occurrences, in the provided Iterator, of elements equal to the
provided object, as determined by the provided Equality. |
|
static int |
count(java.lang.Iterable<?> iter)
count the items in the provided Iterable by creating an Iterator from it and consuming every element |
|
static int |
count(java.util.Iterator<?> iter)
counts the items in the provided Iterator by fully exhausting it |
|
static
|
destroyAsConsumed(java.util.Iterator<E> iter)
Return an Iterator that wraps the provided Iterator, and automatically calls remove() after
every successful call of next() |
|
static
|
drop(ClosableIterator<E> iter,
int count)
Consumes the first count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument |
|
static
|
drop(int count,
ClosableIterator<E> iter)
Consumes the first count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument |
|
static
|
drop(int count,
java.lang.Iterable<E> iter)
Returns a new Iterable that returns all but the first count elements of the supplied
Iterable (or none of them if there are fewer). |
|
static
|
drop(int count,
java.util.Iterator<E> iter)
Consumes the first count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument |
|
static
|
drop(java.lang.Iterable<E> iter,
int count)
Returns a new Iterable that returns all but the first count elements of the supplied
Iterable (or none of them if there are fewer). |
|
static
|
drop(java.util.Iterator<E> iter,
int count)
Consumes the first count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument |
|
static
|
drop(java.util.List<E> list,
int count)
Returns a List that represents all but the first count elements of the supplied
List (or none of them if there are fewer). |
|
static
|
emptyIterable()
Return an Iterator which contains no values |
|
static
|
emptyIterator()
Return an Iterator which contains no values |
|
static
|
equal(Equality<? super E> eq,
java.util.Iterator<? extends E> a,
java.util.Iterator<? extends E> b)
Returns a boolean indicating if the two provided Iterators are "equal", using the provided
Equality. |
|
static boolean |
equal(java.util.Iterator<?> a,
java.util.Iterator<?> b)
Returns a boolean indicating if the two provided Iterators are "equal", using regular Object
equality (Equalities.object()). |
|
static
|
head(ClosableIterator<E> iter,
int count)
Returns a new Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer) |
|
static
|
head(int count,
ClosableIterator<E> iter)
Returns a new Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer) |
|
static
|
head(int count,
java.lang.Iterable<E> iter)
Returns a new Iterable that returns the first count elements of the supplied Iterable (or all
of them if that is fewer) |
|
static
|
head(int count,
java.util.Iterator<E> iter)
Returns a new Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer) |
|
static
|
head(java.lang.Iterable<E> iter,
int count)
Returns a new Iterable that returns the first count elements of the supplied Iterable (or all
of them if that is fewer) |
|
static
|
head(java.util.Iterator<E> iter,
int count)
Returns a new Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer) |
|
static
|
head(java.util.List<E> list,
int count)
Returns a new List that returns the first count elements of the supplied List (or all
of them if that is fewer) |
|
static
|
iterator(E[] array)
convert the supplied array into an Iterator |
|
static
|
iterator(E[] array,
int count)
convert the supplied array into an Iterator |
|
static
|
iterator(E[] array,
int lb,
int ub)
convert the supplied array into an Iterator |
|
static
|
iterator(java.util.Enumeration<E> enumeration)
convert the supplied Enumeration into an Iterator |
|
static
|
onceIterable(java.util.Iterator<E> iter)
Create a one-shot Iterable from the supplied Iterator |
|
static
|
tail(java.util.List<E> list,
int count)
Returns a List that represents the last count elements of the supplied
List (or all of them if there are fewer). |
|
static java.lang.Object[] |
toArray(java.lang.Iterable<?> iter)
Create an Object[] from the supplied Iterable |
|
static
|
toArray(java.lang.Iterable<?> iter,
java.lang.Class<T> clazz)
Copy the contents of the provided Iterable into an array of the provided type. |
|
static
|
toArray(java.lang.Iterable<?> iter,
T[] a)
Copy the contents of the provided Iterable into the provided array; if the array is not large enough a new one will be
initialised and returned. |
|
static java.lang.Object[] |
toArray(java.util.Iterator<?> iter)
Create an Object[] from the supplied Iterator. |
|
static
|
toArray(java.util.Iterator<?> iter,
java.lang.Class<T> clazz)
Copy the contents of the provided Iterator into an array of the provided type. |
|
static
|
toArray(java.util.Iterator<?> iter,
T[] a)
Copy the contents of the provided Iterator into the provided array; if the array is not large enough a new one will be
initialised and returned. |
|
static
|
toList(java.lang.Iterable<E> iter)
Create an Arraylist from the supplied Iterable |
|
static
|
toList(java.util.Iterator<E> iter)
Create an Arraylist from the supplied Iterator. |
|
static
|
toList(java.util.Iterator<E> iter,
java.util.List<E> list)
Exhaust the provided Iterator, copying its contents into the provided List |
|
static java.lang.String |
toString(java.lang.Iterable<?> iter)
Returns a string representation of the argument of the form produced by java.util collections |
|
static java.lang.String |
toString(java.lang.Iterable<?> iter,
java.lang.String delimiter)
Concatenates the elements of the provided Iterable using the provided delimiter |
|
static java.lang.String |
toString(java.util.Iterator<?> iter)
Returns a string representation of the argument of the form produced by java.util collections. |
|
static java.lang.String |
toString(java.util.Iterator<?> iter,
java.lang.String delimiter)
Concatenates the elements of the provided Iterator using the provided delimiter. |
|
static ClosableIterator<java.lang.String> |
toStrings(ClosableIterator<?> iter,
boolean replaceNulls)
Lazily convert the provided Iterator into an Iterator of type String, by calling the
toString() method on each item. |
|
static java.lang.Iterable<java.lang.String> |
toStrings(java.lang.Iterable<?> iter,
boolean replaceNulls)
Lazily convert the provided Iterable into an Iterable of type String, by calling the
toString() method on each item. |
|
static java.util.Iterator<java.lang.String> |
toStrings(java.util.Iterator<?> iter,
boolean replaceNulls)
Lazily convert the provided Iterator into an Iterator of type String, by calling the
toString() method on each item. |
|
static java.util.List<java.lang.String> |
toStrings(java.util.List<?> list,
boolean replaceNulls)
Eagerly convert the provided List into a List of type String, by calling the
toString() method on each item. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Iters()
| Method Detail |
|---|
public static <E> java.util.Iterator<E> emptyIterator()
Iterator which contains no values
Iterator which contains no valuespublic static <E> java.lang.Iterable<E> emptyIterable()
Iterator which contains no values
Iterator which contains no valuespublic static <E> java.util.Iterator<E> iterator(E[] array)
array - the array to wrap
Iterator representing the provided array
public static <E> java.util.Iterator<E> iterator(E[] array,
int count)
Iterator
array - the array to wrapcount - the number of elements to use from the array, beginning at index 0
Iterator representing the first count elements of the array
public static <E> java.util.Iterator<E> iterator(E[] array,
int lb,
int ub)
Iterator
array - array to wraplb - the first index to use from the arrayub - the last index to use from the array
Iterator representing the elements of the provided array from index lb (incl) to ub
(excl)public static <E> java.util.Iterator<E> iterator(java.util.Enumeration<E> enumeration)
Enumeration into an Iterator
enumeration - an Enumeration
Iterator wrapping the provided Enumerationpublic static int count(java.lang.Iterable<?> iter)
Iterable by creating an Iterator from it and consuming every element
iter - An Iterable
Iterablepublic static int count(java.util.Iterator<?> iter)
Iterator by fully exhausting it
iter - an Iterator
Iterator
public static boolean equal(java.util.Iterator<?> a,
java.util.Iterator<?> b)
boolean indicating if the two provided Iterators are "equal", using regular Object
equality (Equalities.object()). The ordering of the elements is important to this method; i.e., it confirms that the
same element occurs in the same position in both iterators.
a - an Iteratorb - an Iterator
boolean indicating if the two provided Iterators are "equal", using regular Object
equality (Equalities.object())
public static <E> boolean equal(Equality<? super E> eq,
java.util.Iterator<? extends E> a,
java.util.Iterator<? extends E> b)
boolean indicating if the two provided Iterators are "equal", using the provided
Equality. The ordering of the elements is important to this method; i.e., it confirms that the same element occurs in
the same position in both iterators.
eq - the Equality to use to test element equalitya - an Iteratorb - an Iterator
boolean indicating if the two provided Iterators are "equal", using regular Object
equality (Equalities.object())
public static <E> boolean contains(E find,
java.lang.Iterable<E> iter)
boolean indicating if the provided Iterable contains an element equal to the provided object, as
determined by regular Object equality (Equalities.object()). It achieves this by creating an
Iterator from the Iterable and consuming the input until an equal value is found, or the
Iterator is exhausted.
find - value to finditer - values to look through
boolean indicating if the Iterable contains the provided value
public static <E> boolean contains(E find,
java.util.Iterator<E> iter)
boolean indicating if the provided Iterator contains an element equal to the provided object, as
determined by regular Object equality (Equalities.object()). It achieves this by consuming the input until
an equal value is found, or the Iterator is exhausted.
find - value to finditer - values to look through
boolean indicating if the Iterator contains the provided value
public static <E> boolean contains(Equality<? super E> eq,
E find,
java.lang.Iterable<E> iter)
boolean indicating if the provided Iterable contains an element equal to the provided object, as
determined by the provided Equality. It achieves this by creating an Iterator from the
Iterable and consuming the input until an equal value is found, or the Iterator is exhausted.
eq - the Equality to usefind - value to finditer - values to look through
boolean indicating if the Iterable contains the provided value
public static <E> boolean contains(Equality<? super E> eq,
E find,
java.util.Iterator<E> iter)
boolean indicating if the provided Iterator contains an element equal to the provided object, as
determined by the provided Equality. It achieves this by consuming the input until an equal value is found, or the
Iterator is exhausted.
eq - the Equality to usefind - value to finditer - values to look through
boolean indicating if the Iterator contains the provided value
public static <E> int count(E find,
java.lang.Iterable<E> iter)
int representing the number of occurrences, in the provided Iterable, of elements equal to the
provided object, as determined by regular Object equality (Equalities.object()). It achieves this by
creating an Iterator from the Iterable and consuming the input until an equal value is found, or the
Iterator is exhausted.
find - value to finditer - values to look through
int representing the number of occurrences in the Iterable of the provided value
public static <E> int count(E find,
java.util.Iterator<E> iter)
int representing the number of occurrences, in the provided Iterator, of elements equal to the
provided object, as determined by regular Object equality (Equalities.object()). It achieves this by
consuming the input until an equal value is found, or the Iterator is exhausted.
find - value to finditer - values to look through
int representing the number of occurrences in the Iterable of the provided value
public static <E> int count(Equality<? super E> eq,
E find,
java.lang.Iterable<E> iter)
int representing the number of occurrences, in the provided Iterable, of elements equal to the
provided object, as determined by the provided Equality. It achieves this by creating an Iterator from the
Iterable and consuming the input until an equal value is found, or the Iterator is exhausted.
eq - the Equality to usefind - value to finditer - values to look through
int representing the number of occurrences in the Iterable of the provided value
public static <E> int count(Equality<? super E> eq,
E find,
java.util.Iterator<E> iter)
int representing the number of occurrences, in the provided Iterator, of elements equal to the
provided object, as determined by the provided Equality. It achieves this by consuming the input until an equal value is
found, or the Iterator is exhausted.
eq - the Equality to usefind - value to finditer - values to look through
int representing the number of occurrences in the Iterable of the provided valuepublic static <E> java.util.Iterator<E> destroyAsConsumed(java.util.Iterator<E> iter)
Iterator that wraps the provided Iterator, and automatically calls remove() after
every successful call of next()
iter - the Iterator to wrap (and hence, destroy)
Iterator that wraps the provided Iterator, and automatically calls remove() after
every successful call of next()
public static <E> ConcatIterable<E> concat(java.lang.Iterable<E> a,
java.lang.Iterable<E> b)
Iterable objects.
a - an Iterableb - an Iterable
public static <E> ConcatIterable<E> concat(java.lang.Iterable<E>... a)
Iterable objects.
a - an var-args array of Iterable objects
Iterable objects, returned in the order they appear in the arraypublic static <E> ConcatIterable<E> concat(java.lang.Iterable<? extends java.lang.Iterable<E>> a)
Iterable objects.
a - an Iterable of Iterable objects
Iterable objects, returned in the order they appear in the
Iterablepublic static <E> ConcatIterator<E> concat(java.util.Iterator<? extends java.util.Iterator<E>> a)
Iterator objects.
a - an Iterator of Iterator objects
Iterator objects, returned in the order they appear in the
Iteratorpublic static <E> java.lang.Iterable<E> onceIterable(java.util.Iterator<E> iter)
Iterable from the supplied Iterator
iter - an Iterator
Iterable which returns the provided Iterator for every call to iterator()
public static <E> HeadIterator<E> head(java.util.Iterator<E> iter,
int count)
Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer)
iter - an Iteratorcount - the number of elements to return from the Iterator
Iterator returning the first count elements of the supplied Iterator
public static <E> HeadIterator<E> head(int count,
java.util.Iterator<E> iter)
Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer)
count - the number of elements to return from the Iteratoriter - an Iterator
Iterator returning the first count elements of the supplied Iterator
public static <E> HeadClosableIterator<E> head(ClosableIterator<E> iter,
int count)
Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer)
iter - an Iteratorcount - the number of elements to return from the Iterator
Iterator returning the first count elements of the supplied Iterator
public static <E> HeadClosableIterator<E> head(int count,
ClosableIterator<E> iter)
Iterator that returns the first count elements of the supplied Iterator (or all
of them if that is fewer)
count - the number of elements to return from the Iteratoriter - an Iterator
Iterator returning the first count elements of the supplied Iterator
public static <E> HeadIterable<E> head(java.lang.Iterable<E> iter,
int count)
Iterable that returns the first count elements of the supplied Iterable (or all
of them if that is fewer)
iter - an Iterablecount - the number of elements to return from the Iterable
Iterable returning the first count elements of the supplied Iterable
public static <E> HeadIterable<E> head(int count,
java.lang.Iterable<E> iter)
Iterable that returns the first count elements of the supplied Iterable (or all
of them if that is fewer)
count - the number of elements to return from the Iterableiter - an Iterable
Iterable returning the first count elements of the supplied Iterable
public static <E> java.util.List<E> head(java.util.List<E> list,
int count)
List that returns the first count elements of the supplied List (or all
of them if that is fewer)
list - an Iterablecount - the number of elements to return from the Iterable
List returning the first count elements of the supplied List
public static <E> java.util.Iterator<E> drop(java.util.Iterator<E> iter,
int count)
count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument
iter - an Iteratorcount - the number of elements to ignore from the Iterator
Iterator returning all but the first count elements of the supplied Iterator
public static <E> java.util.Iterator<E> drop(int count,
java.util.Iterator<E> iter)
count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument
count - the number of elements to ignore from the Iteratoriter - an Iterator
Iterator returning all but the first count elements of the supplied Iterator
public static <E> ClosableIterator<E> drop(ClosableIterator<E> iter,
int count)
count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument
iter - an Iteratorcount - the number of elements to ignore from the Iterator
Iterator returning all but the first count elements of the supplied Iterator
public static <E> ClosableIterator<E> drop(int count,
ClosableIterator<E> iter)
count elements of the supplied Iterator (or all of them if there are fewer), and returns
its argument
iter - an Iteratorcount - the number of elements to ignore from the Iterator
Iterator returning all but the first count elements of the supplied Iterator
public static <E> DropIterable<E> drop(java.lang.Iterable<E> iter,
int count)
Iterable that returns all but the first count elements of the supplied
Iterable (or none of them if there are fewer). The removal of these elements is done for each Iterator
constructed by the Iterable
iter - an Iterablecount - the number of elements to ignore from the Iterable
Iterable returning all but the first count elements of the supplied Iterable
public static <E> DropIterable<E> drop(int count,
java.lang.Iterable<E> iter)
Iterable that returns all but the first count elements of the supplied
Iterable (or none of them if there are fewer). The removal of these elements is done for each Iterator
constructed by the Iterable
count - the number of elements to ignore from the Iterableiter - an Iterable
Iterable returning all but the first count elements of the supplied Iterable
public static <E> java.util.List<E> drop(java.util.List<E> list,
int count)
List that represents all but the first count elements of the supplied
List (or none of them if there are fewer).
count - the number of elements to ignore from the Listlist - an List
List returning all but the first count elements of the supplied List
public static <E> java.util.List<E> tail(java.util.List<E> list,
int count)
List that represents the last count elements of the supplied
List (or all of them if there are fewer).
count - the number of elements to take from the end of the Listlist - an List
List returning all but the first count elements of the supplied List
public static <T> T[] toArray(java.lang.Iterable<?> iter,
T[] a)
Iterable into the provided array; if the array is not large enough a new one will be
initialised and returned. If the array was not large enough the new array will be the exact size of the number of elements copied.
iter - the Iterable to copy records froma - the array to copy records to
public static <T> T[] toArray(java.util.Iterator<?> iter,
T[] a)
Iterator into the provided array; if the array is not large enough a new one will be
initialised and returned. If the array was not large enough the new array will be the exact size of the number of elements copied.
The Iterator will be fully exhausted to construct the array.
iter - the Iterator to copy records froma - the array to copy records to
public static <T> T[] toArray(java.lang.Iterable<?> iter,
java.lang.Class<T> clazz)
Iterable into an array of the provided type. The resulting array's size will be the
exact number of elements retrieved from the Iterable.
iter - the Iterable to copy records fromclazz - the type of array to copy the records to
public static <T> T[] toArray(java.util.Iterator<?> iter,
java.lang.Class<T> clazz)
Iterator into an array of the provided type. The resulting array's size will be the
exact number of elements retrieved from the Iterator. The Iterator will be fully exhausted to construct the
array.
iter - the Iterator to copy records fromclazz - the type of array to copy the records to
public static java.lang.Object[] toArray(java.lang.Iterable<?> iter)
Object[] from the supplied Iterable
iter - an Iterable
Object[] of the contents of the supplied Iteratorpublic static java.lang.Object[] toArray(java.util.Iterator<?> iter)
Object[] from the supplied Iterator. The Iterator is fully exhausted to construct
the array.
iter - an Iterator
Object[] of the contents of the supplied Iteratorpublic static <E> java.util.List<E> toList(java.lang.Iterable<E> iter)
Arraylist from the supplied Iterable
iter - an Iterable
Arraylist of the contents of the supplied Iterablepublic static <E> java.util.List<E> toList(java.util.Iterator<E> iter)
Arraylist from the supplied Iterator. The Iterator is fully exhausted to construct
the list.
iter - an Iterator
Arraylist of the contents of the supplied Iterator
public static <E> void toList(java.util.Iterator<E> iter,
java.util.List<E> list)
Iterator, copying its contents into the provided List
iter - sourcelist - target
public static java.util.List<java.lang.String> toStrings(java.util.List<?> list,
boolean replaceNulls)
List into a List of type String, by calling the
toString() method on each item. If replaceNulls is true then null values will be
replaced by the String "null", otherwise they will remain as null.
list - the iterator to convert to stringsreplaceNulls - replace null with "null" if true
List of strings constructed from the provided List
public static java.lang.Iterable<java.lang.String> toStrings(java.lang.Iterable<?> iter,
boolean replaceNulls)
Iterable into an Iterable of type String, by calling the
toString() method on each item. If replaceNulls is true then null values will be
replaced by the String "null", otherwise they will remain as null.
iter - the Iterable to convert to stringsreplaceNulls - replace null with "null" if true
Iterable lazily converting the values of the one provided to strings
public static java.util.Iterator<java.lang.String> toStrings(java.util.Iterator<?> iter,
boolean replaceNulls)
Iterator into an Iterator of type String, by calling the
toString() method on each item. If replaceNulls is true then null values will be
replaced by the String "null", otherwise they will remain as null.
iter - the iterator to convert to stringsreplaceNulls - replace null with "null" if true
Iterator lazily converting the values of the one provided to strings
public static ClosableIterator<java.lang.String> toStrings(ClosableIterator<?> iter,
boolean replaceNulls)
Iterator into an Iterator of type String, by calling the
toString() method on each item. If replaceNulls is true then null values will be
replaced by the String "null", otherwise they will remain as null.
iter - the iterator to convert to stringsreplaceNulls - replace null with "null" if true
Iterator lazily converting the values of the one provided to stringspublic static java.lang.String toString(java.lang.Iterable<?> iter)
iter - an Iterable
public static java.lang.String toString(java.util.Iterator<?> iter)
Iterator is fully
exhausted in the construction of this string.
iter - an Iterator
public static java.lang.String toString(java.lang.Iterable<?> iter,
java.lang.String delimiter)
Iterable using the provided delimiter
iter - an Iterabledelimiter - the delimiter
public static java.lang.String toString(java.util.Iterator<?> iter,
java.lang.String delimiter)
Iterator using the provided delimiter. The Iterator is fully
exhausted by the construction of this string.
iter - an Iteratordelimiter - the delimiter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||