jersey.repackaged.com.google.common.collect.Maps Java Examples

The following examples show how to use jersey.repackaged.com.google.common.collect.Maps. 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: TieredSpatialJoin.java    From geowave with Apache License 2.0 5 votes vote down vote up
private Map<Byte, HashSet<Byte>> createReprojectMap(
    final Byte[] buildSide,
    final Byte[] testSide,
    final HashSet<Byte> sharedTiers) {
  final Map<Byte, HashSet<Byte>> resultMap = Maps.newHashMap();
  final int testLastIndex = testSide.length;
  for (final Byte tierLeft : buildSide) {
    final int firstGreater = Arrays.binarySearch(testSide, tierLeft);

    if (firstGreater >= 0) {
      // Found in array
      sharedTiers.add(tierLeft);
    }

    final int insertionPoint = Math.abs(firstGreater);
    if (insertionPoint >= testLastIndex) {
      // Not present in array, and none greater than this value
      continue;
    }

    // There is at least one value greater than the current copy it and
    // add to map
    final HashSet<Byte> higherTiers =
        Sets.newHashSet(Arrays.copyOfRange(testSide, insertionPoint, testLastIndex));
    resultMap.put(tierLeft, higherTiers);
  }
  return resultMap;
}
 
Example #2
Source File: SouthboundIT.java    From ovsdb with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Creates an instance of a southbound test case.
 *
 * @param name The test case's name.
 * @param inputValues The input values (provided as input to the underlying augmentation builder).
 * @param expectedValues The expected values (checked against the output of the underlying augmentation).
 */
SouthboundTestCase(final String name, final List<T> inputValues, final List<T> expectedValues) {
    this.name = name;
    this.inputValues = inputValues;
    this.expectedValues = Maps.uniqueIndex(expectedValues, Identifiable::key);
}