de.dante.extex.color.model
Class HsvColor

java.lang.Object
  extended byde.dante.extex.color.model.HsvColor
All Implemented Interfaces:
Color, java.io.Serializable

public class HsvColor
extends java.lang.Object
implements Color

This class implements a color specification in HSV mode with an alpha channel.

Version:
$Revision: 1.6 $
Author:
Gerd Neugebauer
See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          The constant serialVersionUID contains the id for serialization.
 
Fields inherited from interface de.dante.extex.interpreter.context.Color
MAX_VALUE
 
Constructor Summary
protected HsvColor(int thehue, int thesaturation, int thevalue, int theAlpha)
          Creates a new object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Check that the current color is identical to another one.
 int getAlpha()
          Getter for the alpha channel.
 int getHue()
          Getter for the hue value.
 int getSaturation()
          Getter for the saturation value.
 int getValue()
          Getter for the value.
 int hashCode()
           
 java.lang.String toString()
          Provide the string representation for the color.
 java.lang.Object visit(ColorVisitor visitor, java.lang.Object argument)
          This method provides an entry point for the visitor pattern.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
The constant serialVersionUID contains the id for serialization.

See Also:
Constant Field Values
Constructor Detail

HsvColor

protected HsvColor(int thehue,
                   int thesaturation,
                   int thevalue,
                   int theAlpha)
Creates a new object.

Parameters:
thehue - the hue channel
thesaturation - the saturation channel
thevalue - the value channel
theAlpha - the alpha channel
Method Detail

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: Color
Check that the current color is identical to another one.

Specified by:
equals in interface Color
See Also:
Object.equals(java.lang.Object)

getHue

public int getHue()
Getter for the hue value. It has a value in the range from 0 to MAX_VALUE.

Returns:
the hue value.

getSaturation

public int getSaturation()
Getter for the saturation value. It has a value in the range from 0 to MAX_VALUE.

Returns:
the saturation value.

getValue

public int getValue()
Getter for the value. It has a value in the range from 0 to MAX_VALUE.

Returns:
the value.

getAlpha

public int getAlpha()
Description copied from interface: Color
Getter for the alpha channel. The range of the value is 0x00 to 0xffff.

Specified by:
getAlpha in interface Color
Returns:
the alpha channel
See Also:
Color.getAlpha()

hashCode

public int hashCode()
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Description copied from interface: Color
Provide the string representation for the color.

Specified by:
toString in interface Color
See Also:
Object.toString()

visit

public java.lang.Object visit(ColorVisitor visitor,
                              java.lang.Object argument)
                       throws GeneralException
Description copied from interface: Color
This method provides an entry point for the visitor pattern.

Specified by:
visit in interface Color
Parameters:
visitor - the visitor to apply
argument - the argument for the visitor
Returns:
the result of the method invocation of the visitor
Throws:
GeneralException - in case of an error
See Also:
Color.visit( de.dante.extex.color.ColorVisitor, java.lang.Object)