public class SpaceDimension extends Object implements Serializable
| Constructor and Description |
|---|
SpaceDimension(AbstractParameter param)
initializes the dimension (for numeric values).
|
SpaceDimension(double min,
double max,
double step,
String label)
initializes the dimension (for numeric values).
|
SpaceDimension(int min,
int max,
String[] list,
String label)
initializes the dimension (for list values).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
Tests itself against the provided dimension object.
|
String |
getLabel()
returns the label for the axis.
|
String[] |
getList()
Returns the list of values, null in case of a numeric dimension that
is based on a mathematical function.
|
int |
getLocation(Object value)
returns the closest index for the given value in the dimension.
|
double |
getMax()
returns the right border.
|
double |
getMin()
returns the left border.
|
double |
getStep()
returns the step size on the axis.
|
int |
getType()
returns the tye of dimension.
|
Object |
getValue(int x)
returns the value at the given point in the dimension.
|
boolean |
isOnBorder(double value)
checks whether the given value is on the border of the dimension.
|
boolean |
isOnBorder(int location)
checks whether the given location is on the border of the dimension.
|
SpaceDimension |
subdimension(int left,
int right)
returns a sub-dimension with the same type/step/list, but different borders.
|
String |
toString()
Returns a string representation of the dimension.
|
int |
width()
returns the number of points on the axis (incl.
|
public SpaceDimension(AbstractParameter param) throws Exception
param - the search parameter to obtain the data fromException - if splitting of list fails using Utils.splitOptions(String)Utils.splitOptions(String)public SpaceDimension(double min,
double max,
double step,
String label)
min - the minimum on the axismax - the maximum on the axisstep - the step size for the axislabel - the label for the axispublic SpaceDimension(int min,
int max,
String[] list,
String label)
min - the minimum index in the list (0-based index)max - the maximum index in the list (0-based index)list - the available valueslabel - the label for the axispublic boolean equals(Object o)
public int getType()
public double getMin()
public double getMax()
public double getStep()
public String getLabel()
public int width()
public String[] getList()
public Object getValue(int x)
x - the x-th point on the axispublic int getLocation(Object value)
value - the value to get the index forpublic boolean isOnBorder(double value)
value - the value to checkpublic boolean isOnBorder(int location)
location - the location to checkpublic SpaceDimension subdimension(int left, int right)
left - the left indexright - the right indexCopyright © 2017 University of Waikato, Hamilton, NZ. All Rights Reserved.