org.opensha.commons.util.cpt
Class CPTVal

java.lang.Object
  extended by 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

Field Summary
 float end
           
 Color maxColor
           
 Color minColor
          In general this information determines the indicator color associated with a value with a certain range.
 float start
           
static String XML_METADATA_NAME
           
 
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)
           
 
Method Summary
 Object clone()
           
 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
 boolean contains(float value)
           
static CPTVal fromXMLMetadata(Element valElem)
           
 String toString()
           
 Element toXMLMetadata(Element root)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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 start
maxR,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)
Method Detail

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