org.apache.hadoop.hdfs.util
Class ReadOnlyList.Util

java.lang.Object
  extended by org.apache.hadoop.hdfs.util.ReadOnlyList.Util
Enclosing interface:
org.apache.hadoop.hdfs.util.ReadOnlyList<E>

public static class ReadOnlyList.Util
extends Object

Utilities for ReadOnlyList


Constructor Summary
ReadOnlyList.Util()
           
 
Method Summary
static
<E> List<E>
asList(org.apache.hadoop.hdfs.util.ReadOnlyList<E> list)
           
static
<E> org.apache.hadoop.hdfs.util.ReadOnlyList<E>
asReadOnlyList(List<E> list)
           
static
<K,E extends Comparable<K>>
int
binarySearch(org.apache.hadoop.hdfs.util.ReadOnlyList<E> list, K key)
          The same as Collections.binarySearch(List, Object) except that the list is a ReadOnlyList.
static
<E> org.apache.hadoop.hdfs.util.ReadOnlyList<E>
emptyList()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyList.Util

public ReadOnlyList.Util()
Method Detail

emptyList

public static <E> org.apache.hadoop.hdfs.util.ReadOnlyList<E> emptyList()
Returns:
an empty list.

binarySearch

public static <K,E extends Comparable<K>> int binarySearch(org.apache.hadoop.hdfs.util.ReadOnlyList<E> list,
                                                           K key)
The same as Collections.binarySearch(List, Object) except that the list is a ReadOnlyList.

Returns:
the insertion point defined in Collections.binarySearch(List, Object).

asReadOnlyList

public static <E> org.apache.hadoop.hdfs.util.ReadOnlyList<E> asReadOnlyList(List<E> list)
Returns:
a ReadOnlyList view of the given list.

asList

public static <E> List<E> asList(org.apache.hadoop.hdfs.util.ReadOnlyList<E> list)
Returns:
a List view of the given list.


Copyright © 2013 Apache Software Foundation. All Rights Reserved.