public Collection values() { Collection result = new LinkedList(); for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { Entry e = (Entry) o; if (e.isValid()) result.add(e); } else { Object arr [] = (Object[]) o; for (int k = 0; k < arr.length; k++) { Entry info = (Entry) arr[k]; if (info != null && info.isValid()) result.add(info); } } } } } finally { segments[i].unlock(); } } return result; }
public int size() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { Entry e = (Entry) o; if (e.isValid()) count++; } else { Object arr [] = (Object[]) o; for (int k = 0; k < arr.length; k++) { Entry info = (Entry) arr[k]; if (info != null && info.isValid()) count++; } } } } } finally { segments[i].unlock(); } } return count; }
public int size() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { Entry e = (Entry) o; if (e.isValid()) count++; } else { Object arr [] = (Object[]) o; for (int k = 0; k < arr.length; k++) { Entry info = (Entry) arr[k]; if (info != null && info.isValid()) count++; } } } } } finally { segments[i].unlock(); } } return count; }
public int size() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { Entry e = (Entry) o; if (e.isValid()) count++; } else { Object arr [] = (Object[]) o; for (int k = 0; k < arr.length; k++) { Entry info = (Entry) arr[k]; if (info != null && info.isValid()) count++; } } } } } finally { segments[i].unlock(); } } return count; }
public int fullSize() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { count++; } else { Object arr [] = (Object[]) o; count += arr.length; } } } } finally { segments[i].unlock(); } } return count; }
public int fullSize() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { count++; } else { Object arr [] = (Object[]) o; count += arr.length; } } } } finally { segments[i].unlock(); } } return count; }
public int fullSize() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { count++; } else { Object arr [] = (Object[]) o; count += arr.length; } } } } finally { segments[i].unlock(); } } return count; }
protected Segment(int initialCapacity) { setTable(new Object[initialCapacity]); }
protected Segment(int initialCapacity) { setTable(new Object[initialCapacity]); }
protected Segment(int initialCapacity) { setTable(new Object[initialCapacity]); }
public int size() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { Entry e = (Entry) o; if (e.isValid()) count++; } else { Object arr [] = (Object[]) o; for (int k = 0; k < arr.length; k++) { Entry info = (Entry) arr[k]; if (info != null && info.isValid()) count++; } } } } } finally { segments[i].unlock(); } } return count; }
public int fullSize() { int count = 0; for (int i = 0; i < segments.length; i++) { segments[i].lock(); try { for (int j = 0; j < segments[i].table.length; j++) { Object o = segments[i].table [j]; if (o != null) { if (o instanceof Entry) { count++; } else { Object arr [] = (Object[]) o; count += arr.length; } } } } finally { segments[i].unlock(); } } return count; }