org.opensha.commons.util.cpt
Class CPTVal
java.lang.Object
org.opensha.commons.util.cpt.CPTVal
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<CPTVal>, XMLSaveable
public class CPTVal
- extends Object
- implements Comparable<CPTVal>, Serializable, Cloneable, XMLSaveable
- See Also:
- Serialized Form
|
Constructor Summary |
CPTVal()
|
CPTVal(float start,
Color minColor,
float end,
Color maxColor)
|
CPTVal(float start,
int minR,
int minG,
int minB,
float end,
int maxR,
int maxG,
int maxB)
|
XML_METADATA_NAME
public static final String XML_METADATA_NAME
- See Also:
- Constant Field Values
minColor
public Color minColor
- In general this information determines the indicator color associated
with a value with a certain range.
This class correspond to a row in a CPT file
maxColor
public Color maxColor
start
public float start
end
public float end
CPTVal
public CPTVal()
CPTVal
public CPTVal(float start,
int minR,
int minG,
int minB,
float end,
int maxR,
int maxG,
int maxB)
- Parameters:
start - =
min(Range(value))end - =
max(Range(value))minR,minG,minB - are used to determine the color if the value is equal to the
startmaxR,maxG,maxB - are used to determine the color if the value is equal to the
end
CPTVal
public CPTVal(float start,
Color minColor,
float end,
Color maxColor)
toXMLMetadata
public Element toXMLMetadata(Element root)
- Specified by:
toXMLMetadata in interface XMLSaveable
fromXMLMetadata
public static CPTVal fromXMLMetadata(Element valElem)
compareTo
public int compareTo(CPTVal other)
- Implements the Comparable interface comparing by the start and end values
returns 0 if there is an overlap with more than 1 point
- Specified by:
compareTo in interface Comparable<CPTVal>
contains
public boolean contains(float value)
- Parameters:
value -
- Returns:
- true if value is less than end and more than start
toString
public String toString()
- Overrides:
toString in class Object
clone
public Object clone()
- Overrides:
clone in class Object