uk.ac.starlink.splat.iface
Class LineProperties

java.lang.Object
  extended by uk.ac.starlink.splat.iface.LineProperties

public class LineProperties
extends Object

LineProperties is a class for storing and documenting the properties of a spectral line fit.

See Also:
DivaPlot

Field Summary
protected static int AST_DOUBLE_X
           
protected static int AST_DOUBLE_Y
           
protected static int DOUBLE
           
static int GAUSS
           
protected static int INTEGER
          Methods used for wrapping properties as Number Objects.
static int LORENTZ
           
static String[] NAMES
           
static int NTYPES
          The number of fit types, their enumerations and short descriptions.
protected  DivaPlot plot
          The DivaPlot that we are working with.
static String[][] PROP_NAMES
          The symbolic names of the properties we're storing for each fit type.
static int QUICK
           
protected  int type
          The type of properties we're storing.
static int VOIGT
           
protected static int[][] WRAPPERS
           
 
Constructor Summary
LineProperties(int type, DivaPlot plot)
          Create an instance.
 
Method Summary
static int count(int type)
          Return number of values we would return given the type of measurements that are being stored.
 double getField(int index)
          Get the value of one of our fields.
static String getName(int type, int index)
          Return the name of a property field.
static Class getNumberClass(int type, int index)
          Get the class one of our fields wrapped in a suitable Number object would use for a given type.
 Number getNumberField(int index)
          Get the value of one of our field wrapped in a suitable Number object.
protected  int getValidIndex(int index)
          Get a valid property index for the current type.
protected  int getValidType(int type)
          Get a valid type index.
 void setField(int index, double value)
          Set the value of one of our fields.
 void setFields(double[] values)
          Set all the values, if the given array contains enough.
 void setPlot(DivaPlot plot)
          Set the plot used.
 String toString()
          Write a text description of this line.
 int type()
          Get the type of properties that we're storing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NTYPES

public static final int NTYPES
The number of fit types, their enumerations and short descriptions.

See Also:
Constant Field Values

QUICK

public static final int QUICK
See Also:
Constant Field Values

GAUSS

public static final int GAUSS
See Also:
Constant Field Values

LORENTZ

public static final int LORENTZ
See Also:
Constant Field Values

VOIGT

public static final int VOIGT
See Also:
Constant Field Values

NAMES

public static final String[] NAMES

PROP_NAMES

public static final String[][] PROP_NAMES
The symbolic names of the properties we're storing for each fit type. First index is a fit type.


INTEGER

protected static final int INTEGER
Methods used for wrapping properties as Number Objects. These can define how the values are represented when displayed. First index is a fit type.

See Also:
Constant Field Values

AST_DOUBLE_X

protected static final int AST_DOUBLE_X
See Also:
Constant Field Values

AST_DOUBLE_Y

protected static final int AST_DOUBLE_Y
See Also:
Constant Field Values

DOUBLE

protected static final int DOUBLE
See Also:
Constant Field Values

WRAPPERS

protected static final int[][] WRAPPERS

type

protected int type
The type of properties we're storing.


plot

protected DivaPlot plot
The DivaPlot that we are working with.

Constructor Detail

LineProperties

public LineProperties(int type,
                      DivaPlot plot)
Create an instance.

Parameters:
type - the type of line properties we're dealing with.
plot - the plot
Method Detail

setPlot

public void setPlot(DivaPlot plot)
Set the plot used.

Parameters:
plot - The new plot value

count

public static int count(int type)
Return number of values we would return given the type of measurements that are being stored.

Parameters:
type - the type of line properties we're dealing with.
Returns:
the number of properties stored for the given line fit type.

getName

public static String getName(int type,
                             int index)
Return the name of a property field.

Parameters:
type - the type of line properties we're dealing with.
index - the index of the property
Returns:
description of the property expected to be stored at the given index.

type

public int type()
Get the type of properties that we're storing.


getField

public double getField(int index)
Get the value of one of our fields.


getNumberField

public Number getNumberField(int index)
Get the value of one of our field wrapped in a suitable Number object.


getNumberClass

public static Class getNumberClass(int type,
                                   int index)
Get the class one of our fields wrapped in a suitable Number object would use for a given type.

Parameters:
type - Description of the Parameter
index - Description of the Parameter
Returns:
The numberClass value

setField

public void setField(int index,
                     double value)
Set the value of one of our fields.


setFields

public void setFields(double[] values)
Set all the values, if the given array contains enough.


getValidType

protected int getValidType(int type)
Get a valid type index.


getValidIndex

protected int getValidIndex(int index)
Get a valid property index for the current type.


toString

public String toString()
Write a text description of this line. Uses getNumberField so we reasonable formatting.

Overrides:
toString in class Object


Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.