Package org.eclipse.scanning.api.points
Class Point
java.lang.Object
org.eclipse.scanning.api.points.AbstractPosition
org.eclipse.scanning.api.points.Point
- All Implemented Interfaces:
Serializable,IPosition
This class represents an x,y position for a mapping scan.
By default Points are 2D values used in things like GridScans. If used in a
LineScan or a Spiral scan where one dimension has two motors, the
constructor with is2D=false should be used.
The Point location is immutable: you may not change the values of x and y after it
is created.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPoint(int xIndex, double xPosition, int yIndex, double yPosition) Point(int xIndex, double xPosition, int yIndex, double yPosition, int stepIndex) Point(int xIndex, double xPosition, int yIndex, double yPosition, int stepIndex, boolean is2D) Point(String xName, int xIndex, double xPosition, String yName, int yIndex, double yPosition, boolean is2D) Point(String xName, int xIndex, double xPosition, String yName, int yIndex, double yPosition, int stepIndex, boolean is2D) -
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.doublegetX()doublegetY()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
-
Point
public Point(int xIndex, double xPosition, int yIndex, double yPosition) -
Point
public Point(int xIndex, double xPosition, int yIndex, double yPosition, int stepIndex) -
Point
public Point(int xIndex, double xPosition, int yIndex, double yPosition, int stepIndex, boolean is2D) -
Point
-
Point
-
Point
-
-
Method Details
-
getX
public double getX() -
getY
public double getY() -
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
-
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
-
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:
-
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:
-