Tabnine Logo
CollectionsExt.addToMultiValuesMap
Code IndexAdd Tabnine to your IDE (free)

How to use
addToMultiValuesMap
method
in
org.apache.sis.internal.util.CollectionsExt

Best Java code snippets using org.apache.sis.internal.util.CollectionsExt.addToMultiValuesMap (Showing top 10 results out of 315)

origin: org.apache.sis.core/sis-metadata

/**
 * Closes this element. This method verifies that there is no unprocessed value (dates,
 * numbers, booleans or strings), but ignores inner elements as required by ISO 19162.
 *
 * This method add the keywords of ignored elements in the {@code ignoredElements} map as below:
 * <ul>
 *   <li><b>Keys</b>: keyword of ignored elements. Note that a key may be null.</li>
 *   <li><b>Values</b>: keywords of all elements containing an element identified by the above-cited key.
 *       This list is used for helping the users to locate the ignored elements.</li>
 * </ul>
 *
 * @param  ignoredElements  the collection where to declare ignored elements.
 * @throws ParseException if the list still contains some unprocessed values.
 */
final void close(final Map<String, List<String>> ignoredElements) throws ParseException {
  if (list != null) {
    for (final Object value : list) {
      if (value instanceof Element) {
        CollectionsExt.addToMultiValuesMap(ignoredElements, ((Element) value).keyword, keyword);
      } else {
        throw new UnparsableObjectException(locale, Errors.Keys.UnexpectedValueInElement_2,
            new Object[] {keyword, value}, offset + keyword.length());
      }
    }
  }
}
origin: apache/sis

/**
 * Closes this element. This method verifies that there is no unprocessed value (dates,
 * numbers, booleans or strings), but ignores inner elements as required by ISO 19162.
 *
 * This method add the keywords of ignored elements in the {@code ignoredElements} map as below:
 * <ul>
 *   <li><b>Keys</b>: keyword of ignored elements. Note that a key may be null.</li>
 *   <li><b>Values</b>: keywords of all elements containing an element identified by the above-cited key.
 *       This list is used for helping the users to locate the ignored elements.</li>
 * </ul>
 *
 * @param  ignoredElements  the collection where to declare ignored elements.
 * @throws ParseException if the list still contains some unprocessed values.
 */
final void close(final Map<String, List<String>> ignoredElements) throws ParseException {
  if (list != null) {
    for (final Object value : list) {
      if (value instanceof Element) {
        CollectionsExt.addToMultiValuesMap(ignoredElements, ((Element) value).keyword, keyword);
      } else {
        throw new UnparsableObjectException(locale, Errors.Keys.UnexpectedValueInElement_2,
            new Object[] {keyword, value}, offset + keyword.length());
      }
    }
  }
}
origin: org.apache.sis.storage/sis-netcdf

if (variable.isCoordinateSystemAxis()) {
  for (final Dimension dimension : variable.dimensions) {
    CollectionsExt.addToMultiValuesMap(dimToAxes, dimension, variable);
origin: apache/sis

if (variable.isCoordinateSystemAxis()) {
  for (final Dimension dimension : variable.dimensions) {
    CollectionsExt.addToMultiValuesMap(dimToAxes, dimension, variable);
origin: apache/sis

CollectionsExt.addToMultiValuesMap(aliases, key, key);
name = ((ScopedName) name).tail();
final String alias = name.toString();
final List<String> fullNames = CollectionsExt.addToMultiValuesMap(aliases, alias, key);
if (fullNames.size() > 1) {
  CollectionsExt.addToMultiValuesMap(aliases, alias, alias);
origin: org.apache.sis.storage/sis-storage

CollectionsExt.addToMultiValuesMap(aliases, key, key);
name = ((ScopedName) name).tail();
final String alias = name.toString();
final List<String> fullNames = CollectionsExt.addToMultiValuesMap(aliases, alias, key);
if (fullNames.size() > 1) {
  CollectionsExt.addToMultiValuesMap(aliases, alias, alias);
origin: apache/sis

if (variable.isCoverage()) {
  final List<String> dimensions = Arrays.asList(variable.getGridDimensionNames());
  CollectionsExt.addToMultiValuesMap(contents, dimensions, variable);
origin: org.apache.sis.storage/sis-netcdf

if (variable.isCoverage(2)) {
  final List<String> dimensions = Arrays.asList(variable.getGridDimensionNames());
  CollectionsExt.addToMultiValuesMap(contents, dimensions, variable);
origin: apache/sis

/**
 * Tests {@link CollectionsExt#addToMultiValuesMap(Map, Object, Object)}, then
 * opportunistically tests {@link CollectionsExt#removeFromMultiValuesMap(Map, Object, Object)},
 */
@Test
public void testAddAndRemoveToMultiValuesMap() {
  final Map<String, List<Integer>> map = new LinkedHashMap<>();
  final Integer A1 = 2;
  final Integer A2 = 4;
  final Integer B1 = 3;
  final Integer B2 = 6;
  final Integer B3 = 9;
  assertArrayEquals(new Integer[] {A1},         CollectionsExt.addToMultiValuesMap(map, "A", A1).toArray());
  assertArrayEquals(new Integer[] {B1},         CollectionsExt.addToMultiValuesMap(map, "B", B1).toArray());
  assertArrayEquals(new Integer[] {B1, B2},     CollectionsExt.addToMultiValuesMap(map, "B", B2).toArray());
  assertArrayEquals(new Integer[] {A1, A2},     CollectionsExt.addToMultiValuesMap(map, "A", A2).toArray());
  assertArrayEquals(new Integer[] {B1, B2, B3}, CollectionsExt.addToMultiValuesMap(map, "B", B3).toArray());
  assertArrayEquals(new String[]  {"A", "B"},   map.keySet().toArray());
  assertArrayEquals(new Integer[] {A1, A2},     map.get("A").toArray());
  assertArrayEquals(new Integer[] {B1, B2, B3}, map.get("B").toArray());
  assertNull(                                   CollectionsExt.removeFromMultiValuesMap(map, "C", A2));
  assertArrayEquals(new Integer[] {A1},         CollectionsExt.removeFromMultiValuesMap(map, "A", A2).toArray());
  assertArrayEquals(new Integer[] {B1, B3},     CollectionsExt.removeFromMultiValuesMap(map, "B", B2).toArray());
  assertArrayEquals(new Integer[] {},           CollectionsExt.removeFromMultiValuesMap(map, "A", A1).toArray());
  assertArrayEquals(new String[]  {"B"},        map.keySet().toArray());
  assertArrayEquals(new Integer[] {B1, B3},     map.get("B").toArray());
}
origin: apache/sis

importedKeys.add(relation);
for (final String column : relation.getForeignerKeys()) {
  CollectionsExt.addToMultiValuesMap(foreignerKeys, column, relation);
org.apache.sis.internal.utilCollectionsExtaddToMultiValuesMap

Javadoc

Adds a value in a pseudo multi-values map. The multi-values map is simulated by a map of lists. The map can be initially empty - lists will be created as needed.

Popular methods of CollectionsExt

  • singletonOrEmpty
    Returns the given value as a singleton if non-null, or returns an empty set otherwise.
  • unmodifiableOrCopy
    Returns a unmodifiable version of the given set. This method is different than the standard Collecti
  • compact
    Returns a more compact representation of the given map. This method is similar to #unmodifiableOrCop
  • first
    Returns the first element of the given iterable, or null if none. This method does not emit warning
  • immutableSet
    Returns the specified array as an immutable set, or null if the array is null. If the given array co
  • toArray
    Returns the elements of the given collection as an array. This method can be used when the valueClas
  • nonNull
    Returns the given set, or Collections#EMPTY_SET if the given set is null.
  • createSetForType
    Creates an initially empty set for elements of the given type. This method will creates specialized
  • emptySortedSet
    Returns a SortedSet which is always empty and accepts no element.Note: This method exists only on th
  • filter
    Returns an iterator over the elements of the given iterator where the predicate returns true. The it
  • identityEquals
    Returns true if the next elements returned by the given iterators are the same. This method compares
  • modifiableCopy
    Copies the content of the given map to a new unsynchronized, modifiable, in-memory map. The implemen
  • identityEquals,
  • modifiableCopy,
  • nonNullArraySet,
  • removeFromMultiValuesMap,
  • toCaseInsensitiveNameMap,
  • toCollection,
  • empty,
  • emptyQueue,
  • nonEmpty

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JPanel (javax.swing)
  • JTable (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now