Package org.apache.hadoop.hdfs.util
Class ReadOnlyList.Util
java.lang.Object
org.apache.hadoop.hdfs.util.ReadOnlyList.Util
- Enclosing interface:
- ReadOnlyList<E>
Utilities for
ReadOnlyList-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <E> List<E>asList(ReadOnlyList<E> list) static <E> ReadOnlyList<E>asReadOnlyList(List<E> list) static <K,E extends Comparable<K>>
intbinarySearch(ReadOnlyList<E> list, K key) The same asCollections.binarySearch(List, Object)except that the list is aReadOnlyList.static <E> ReadOnlyList<E>
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
emptyList
- Returns:
- an empty list.
-
binarySearch
The same asCollections.binarySearch(List, Object)except that the list is aReadOnlyList.- Returns:
- the insertion point defined
in
Collections.binarySearch(List, Object).
-
asReadOnlyList
- Returns:
- a
ReadOnlyListview of the given list.
-
asList
- Returns:
- a
Listview of the given list.
-