Package org.eclipse.scanning.api.points
Class MapPosition
java.lang.Object
org.eclipse.scanning.api.points.AbstractPosition
org.eclipse.scanning.api.points.MapPosition
- All Implemented Interfaces:
Serializable,IPosition
Multiple values to the position, backed by a Map
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMapPosition(String value) Define the values as a comma separate list of values of the form: name1:position1:value1, name2:position2:value2, ...MapPosition(String name, Integer index, Object value) MapPosition(Map<String, Object> vals) -
Method Summary
Modifier and TypeMethodDescriptionThe value of a named position.intGet the index of the data for instance in a scan of temperature from 290 to 300 step 1, the indices will be 0-10.It is not required of an IPosition to provide getIndices() but it may do so to avoid a new map being built up.getNames()The names of all the scalars set for this position.It is not required of an IPosition to provide getValues() but it may do so to avoid a new map being built up.voidvoidputAllIndices(IPosition pos) intsize()The number of named scalars in this positionMethods inherited from class org.eclipse.scanning.api.points.AbstractPosition
compound, equals, equals, getDimensionNames, getDimensionNames, getExposureTime, getIndex, getScanRank, getStepIndex, hashCode, setDimensionNames, setExposureTime, setStepIndex, toString
-
Constructor Details
-
MapPosition
public MapPosition() -
MapPosition
-
MapPosition
-
MapPosition
-
MapPosition
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:IPositionThe number of named scalars in this position- Returns:
- number of scalars
-
getNames
Description copied from interface:IPositionThe names of all the scalars set for this position. For instance 'x' and 'y' for a map or 'Temperature' Note to implementers: should never returnnull- Returns:
- name of scalars
-
get
Description copied from interface:IPositionThe value of a named position. For instanceget("X")to return the value of the X IScannable double.- Parameters:
name-- Returns:
- value for the given axis name
-
put
-
put
-
putAll
-
getIndex
Description copied from interface:IPositionGet 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
-
putAllIndices
-
getIndices
Description copied from interface:IPositionIt 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
Description copied from interface:IPositionIt 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:
-