Class Gridder
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.Gridder
-
public class Gridder extends java.lang.ObjectMaps positions on a 2-d grid to a 1-d index.- Since:
- 15 Feb 2013
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description Gridder(int nx, int ny)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intgetHeight()Returns grid height.intgetIndex(int ix, int iy)Returns the 1-d index corresponding to a given x,y position.intgetLength()Returns the number of points in the grid and array.intgetWidth()Returns grid width.intgetX(int index)Returns the X index corresponding to a pixel index.intgetY(int index)Returns the Y index corresponding to a pixel index.inthashCode()static Griddertranspose(Gridder base)Returns a Gridder instance that is the transpose of the supplied one.
-
-
-
Method Detail
-
getWidth
public int getWidth()
Returns grid width.- Returns:
- width
-
getHeight
public int getHeight()
Returns grid height.- Returns:
- height
-
getIndex
public int getIndex(int ix, int iy)Returns the 1-d index corresponding to a given x,y position.- Parameters:
ix- x positioniy- y position- Returns:
- array index
-
getX
public int getX(int index)
Returns the X index corresponding to a pixel index.- Parameters:
index- 1-d index- Returns:
- X position
-
getY
public int getY(int index)
Returns the Y index corresponding to a pixel index.- Parameters:
index- 1-d index- Returns:
- Y position
-
getLength
public int getLength()
Returns the number of points in the grid and array.- Returns:
- size
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-