org.apache.batik.css.value
Class ImmutableRGBColor

java.lang.Object
  |
  +--org.apache.batik.css.value.AbstractImmutableValue
        |
        +--org.apache.batik.css.value.AbstractImmutablePrimitiveValue
              |
              +--org.apache.batik.css.value.ImmutableRGBColor
All Implemented Interfaces:
ImmutableValue, RGBColor

public class ImmutableRGBColor
extends AbstractImmutablePrimitiveValue
implements RGBColor

This class represents immutable CSS colors.


Field Summary
protected  CSSPrimitiveValue blue
          The blue value
protected  CSSPrimitiveValue green
          The green value
protected  CSSPrimitiveValue red
          The red value
 
Constructor Summary
ImmutableRGBColor(CSSPrimitiveValue r, CSSPrimitiveValue g, CSSPrimitiveValue b)
          Creates a new color.
 
Method Summary
 ImmutableValue createReadOnlyCopy()
          Returns a deep read-only copy of this object.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 CSSPrimitiveValue getBlue()
          This attribute is used for the blue value of the RGB color.
 java.lang.String getCssText()
          A string representation of the current value.
 CSSPrimitiveValue getGreen()
          This attribute is used for the green value of the RGB color.
 short getPrimitiveType()
          The type of the value as defined by the constants specified in CSSPrimitiveValue.
 CSSPrimitiveValue getRed()
          This attribute is used for the red value of the RGB color.
 RGBColor getRGBColorValue()
          Returns this value.
 
Methods inherited from class org.apache.batik.css.value.AbstractImmutablePrimitiveValue
getCssValueType
 
Methods inherited from class org.apache.batik.css.value.AbstractImmutableValue
getCounterValue, getFloatValue, getLength, getRectValue, getStringValue, item
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

red

protected CSSPrimitiveValue red
The red value

green

protected CSSPrimitiveValue green
The green value

blue

protected CSSPrimitiveValue blue
The blue value
Constructor Detail

ImmutableRGBColor

public ImmutableRGBColor(CSSPrimitiveValue r,
                         CSSPrimitiveValue g,
                         CSSPrimitiveValue b)
Creates a new color.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.

createReadOnlyCopy

public ImmutableValue createReadOnlyCopy()
Returns a deep read-only copy of this object.

getCssText

public java.lang.String getCssText()
A string representation of the current value.

getPrimitiveType

public short getPrimitiveType()
The type of the value as defined by the constants specified in CSSPrimitiveValue.
Overrides:
getPrimitiveType in class AbstractImmutablePrimitiveValue

getRed

public CSSPrimitiveValue getRed()
This attribute is used for the red value of the RGB color.
Specified by:
getRed in interface RGBColor

getGreen

public CSSPrimitiveValue getGreen()
This attribute is used for the green value of the RGB color.
Specified by:
getGreen in interface RGBColor

getBlue

public CSSPrimitiveValue getBlue()
This attribute is used for the blue value of the RGB color.
Specified by:
getBlue in interface RGBColor

getRGBColorValue

public RGBColor getRGBColorValue()
                          throws DOMException
Returns this value.
Overrides:
getRGBColorValue in class AbstractImmutableValue
Following copied from class: org.apache.batik.css.value.AbstractImmutableValue
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the attached property can't return a RGB color value (e.g. this is not CSS_RGBCOLOR).


Copyright © 2001 Apache Software Foundation. All Rights Reserved.