List of usage examples for java.util.concurrent.atomic AtomicReferenceArray length
public final int length()
From source file:Main.java
private static <T> Map<Integer, T> asMap(AtomicReferenceArray<T> a) { Map<Integer, T> map = new TreeMap<Integer, T>(); for (int i = 0; i < a.length(); i++) { T t = a.get(i);//from w w w.ja v a2s . co m if (t != null) { map.put(i, t); } } return map; }