org.extex.color.model
Class CmykColor

java.lang.Object
  extended by org.extex.color.model.CmykColor
All Implemented Interfaces:
java.io.Serializable, Color

public class CmykColor
extends java.lang.Object
implements Color

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

Version:
$Revision:4446 $
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 org.extex.color.Color
MAX_VALUE
 
Constructor Summary
protected CmykColor(int cyan, int magenta, int yellow, int black, int alpha)
          Creates a new object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 int getAlpha()
          Getter for the alpha channel.
 int getBlack()
          Getter for the black component.
 int getCyan()
          Getter for the cyan component.
 int getMagenta()
          Getter for the magenta component.
 int getYellow()
          Getter for the yellow component.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
          Returns a string representation of the object.
 java.lang.Object visit(ColorVisitor visitor, java.lang.Object value)
          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

CmykColor

protected CmykColor(int cyan,
                    int magenta,
                    int yellow,
                    int black,
                    int alpha)
Creates a new object.

Parameters:
cyan - the cyan channel
magenta - the magenta channel
yellow - the yellow channel
black - the black channel
alpha - the alpha channel
Method Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Specified by:
equals in interface Color
Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.equals(java.lang.Object)

getAlpha

public int getAlpha()
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()

getBlack

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

Returns:
the black component

getCyan

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

Returns:
the cyan component

getMagenta

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

Returns:
the magenta component

getYellow

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

Returns:
the yellow component

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Returns a string representation of the object.

Specified by:
toString in interface Color
Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.
See Also:
Object.toString()

visit

public java.lang.Object visit(ColorVisitor visitor,
                              java.lang.Object value)
                       throws GeneralException
This method provides an entry point for the visitor pattern.

Specified by:
visit in interface Color
Parameters:
visitor - the visitor to apply
value - 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( org.extex.color.ColorVisitor, java.lang.Object)