Class MapPosition

java.lang.Object
org.eclipse.scanning.api.points.AbstractPosition
org.eclipse.scanning.api.points.MapPosition
All Implemented Interfaces:
Serializable, IPosition

public final class MapPosition extends AbstractPosition
Multiple values to the position, backed by a Map
See Also:
  • Constructor Details

    • MapPosition

      public MapPosition()
    • MapPosition

      public MapPosition(Map<String,Object> vals)
    • MapPosition

      public MapPosition(Map<String,Object> vals, Map<String,Integer> inds)
    • MapPosition

      public MapPosition(String name, Integer index, Object value)
    • MapPosition

      public MapPosition(String value) throws NumberFormatException
      Define the values as a comma separate list of values of the form: name1:position1:value1, name2:position2:value2, ... etc. namen:valuen The value string must parse as a double or a NumberFormatException is thrown Spaces between commas and between names and values will be trimmed
      Parameters:
      value -
      Throws:
      NumberFormatException - if the elements of the string could not be parsed as numbers
  • Method Details

    • size

      public int size()
      Description copied from interface: IPosition
      The number of named scalars in this position
      Returns:
      number of scalars
    • getNames

      public List<String> getNames()
      Description copied from interface: IPosition
      The names of all the scalars set for this position. For instance 'x' and 'y' for a map or 'Temperature' Note to implementers: should never return null
      Returns:
      name of scalars
    • get

      public Object get(String name)
      Description copied from interface: IPosition
      The value of a named position. For instance get("X") to return the value of the X IScannable double.
      Parameters:
      name -
      Returns:
      value for the given axis name
    • put

      public Object put(String key, Object value)
    • put

      public Object put(String key, int index, Object value)
    • putAll

      public void putAll(IPosition pos)
    • getIndex

      public int getIndex(String name)
      Description copied from interface: IPosition
      Get the index of the data for instance in a scan of temperature from 290 to 300 step 1, the indices will be 0-10. If one dimension has more than one motor with it, for instance x and y in a line scan, both getIndex("x") and getIndex("y") return the same value.
      Returns:
      data index for given axis name
    • putIndex

      public Object putIndex(String key, Integer value)
    • putAllIndices

      public void putAllIndices(IPosition pos)
    • getIndices

      public Map<String,Integer> getIndices()
      Description copied from interface: IPosition
      It is not required of an IPosition to provide getIndices() but it may do so to avoid a new map being built up. Implement this method to ensure that your position runs faster. The default implementation works.
      Returns:
      map of indices for axis name
      See Also:
    • getValues

      public Map<String,Object> getValues()
      Description copied from interface: IPosition
      It is not required of an IPosition to provide getValues() but it may do so to avoid a new map being built up. Implement this method to ensure that your position runs faster. The default implementation works.
      Returns:
      values as a String to Object Map
      See Also: