Java Code Examples for java.util.concurrent.ConcurrentNavigableMap#values()

The following examples show how to use java.util.concurrent.ConcurrentNavigableMap#values() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testDescendingValues() {
    ConcurrentNavigableMap map = dmap5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 2
Source File: ConcurrentSkipListSubMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testDescendingValuesToArray() {
    ConcurrentNavigableMap map = dmap5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 3
Source File: ConcurrentSkipListSubMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testDescendingValues() {
    ConcurrentNavigableMap map = dmap5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 4
Source File: ConcurrentSkipListSubMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testValuesToArray() {
    ConcurrentNavigableMap map = map5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 5
Source File: ConcurrentSkipListSubMapTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testValues() {
    ConcurrentNavigableMap map = map5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 6
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testDescendingValuesToArray() {
    ConcurrentNavigableMap map = dmap5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 7
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testDescendingValues() {
    ConcurrentNavigableMap map = dmap5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 8
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testValuesToArray() {
    ConcurrentNavigableMap map = map5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 9
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testValues() {
    ConcurrentNavigableMap map = map5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 10
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testDescendingValuesToArray() {
    ConcurrentNavigableMap map = dmap5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 11
Source File: ContainerSet.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
/**
 * A simple interface for container Iterations.
 * <p>
 * This call make no guarantees about consistency of the data between
 * different list calls. It just returns the best known data at that point of
 * time. It is possible that using this iteration you can miss certain
 * container from the listing.
 *
 * @param startContainerId - Return containers with Id &gt;= startContainerId.
 * @param count - how many to return
 * @param data - Actual containerData
 */
public void listContainer(long startContainerId, long count,
                          List<ContainerData> data) throws
    StorageContainerException {
  Preconditions.checkNotNull(data,
      "Internal assertion: data cannot be null");
  Preconditions.checkState(startContainerId >= 0,
      "Start container Id cannot be negative");
  Preconditions.checkState(count > 0,
      "max number of containers returned " +
          "must be positive");
  LOG.debug("listContainer returns containerData starting from {} of count " +
      "{}", startContainerId, count);
  ConcurrentNavigableMap<Long, Container<?>> map;
  if (startContainerId == 0) {
    map = containerMap;
  } else {
    map = containerMap.tailMap(startContainerId, true);
  }
  int currentCount = 0;
  for (Container<?> entry : map.values()) {
    if (currentCount < count) {
      data.add(entry.getContainerData());
      currentCount++;
    } else {
      return;
    }
  }
}
 
Example 12
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testValuesToArray() {
    ConcurrentNavigableMap map = map5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 13
Source File: ConcurrentSkipListSubMapJUnitTest.java    From gemfirexd-oss with Apache License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testValues() {
    ConcurrentNavigableMap map = map5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 14
Source File: BTreeMapTest5.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testValuesToArray() {
    ConcurrentNavigableMap map = map5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 15
Source File: BTreeMapTest5.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testValues() {
    ConcurrentNavigableMap map = map5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 16
Source File: ConcurrentSkipListSubMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testDescendingValuesToArray() {
    ConcurrentNavigableMap map = dmap5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 17
Source File: ConcurrentSkipListSubMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testDescendingValues() {
    ConcurrentNavigableMap map = dmap5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 18
Source File: ConcurrentSkipListSubMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Values.toArray contains all values
 */
public void testValuesToArray() {
    ConcurrentNavigableMap map = map5();
    Collection v = map.values();
    Object[] ar = v.toArray();
    ArrayList s = new ArrayList(Arrays.asList(ar));
    assertEquals(5, ar.length);
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 19
Source File: ConcurrentSkipListSubMapTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * values collection contains all values
 */
public void testValues() {
    ConcurrentNavigableMap map = map5();
    Collection s = map.values();
    assertEquals(5, s.size());
    assertTrue(s.contains("A"));
    assertTrue(s.contains("B"));
    assertTrue(s.contains("C"));
    assertTrue(s.contains("D"));
    assertTrue(s.contains("E"));
}
 
Example 20
Source File: SeaCloudsApplicationDataStorage.java    From SeaCloudsPlatform with Apache License 2.0 4 votes vote down vote up
public List<SeaCloudsApplicationData> listSeaCloudsApplicationData() {
    ConcurrentNavigableMap<String, SeaCloudsApplicationData> treeMap = dataStore.getTreeMap(SEACLOUDS_APPLICATION_DATA_COLLECTION_TAG);
    Collection<SeaCloudsApplicationData> seaCloudsApplicationDataCollection = treeMap.values();
    return new ArrayList<>(seaCloudsApplicationDataCollection);
}