Class FieldMapSet

java.lang.Object
gov.nasa.pds.registry.common.util.FieldMapSet
All Implemented Interfaces:
FieldMap

public class FieldMapSet extends Object implements FieldMap
Implementation of FieldMap interface which stores values in a set. Order and number of values in PDS label XML are not preserved. Only unique values are stored. Values are sorted alphabetically (as a string).
Author:
karpenko
  • Constructor Details

    • FieldMapSet

      public FieldMapSet()
      Constructor
  • Method Details

    • size

      public int size()
      Map size / number of fields.
      Specified by:
      size in interface FieldMap
    • isEmpty

      public boolean isEmpty()
      Check if map is empty.
      Specified by:
      isEmpty in interface FieldMap
    • clear

      public void clear()
      Remove all the fields from the map
      Specified by:
      clear in interface FieldMap
    • addValue

      public void addValue(String fieldName, String value)
      Add field's value.
      Specified by:
      addValue in interface FieldMap
    • addValues

      public void addValues(String fieldName, String[] values)
      Add multiple values.
      Specified by:
      addValues in interface FieldMap
    • getFirstValue

      public String getFirstValue(String fieldName)
      Get first value of a field.
      Specified by:
      getFirstValue in interface FieldMap
    • getValues

      public Collection<String> getValues(String fieldName)
      Get all values of a field.
      Specified by:
      getValues in interface FieldMap
    • getNames

      public Set<String> getNames()
      Get names of all fields in this map.
      Specified by:
      getNames in interface FieldMap