org.apache.batik.css.value
Class AbstractImmutableValue

java.lang.Object
  |
  +--org.apache.batik.css.value.AbstractImmutableValue
All Implemented Interfaces:
ImmutableValue
Direct Known Subclasses:
AbstractImmutablePrimitiveValue, ImmutableInherit, ImmutableSVGColorValue, ImmutableValueList

public abstract class AbstractImmutableValue
extends java.lang.Object
implements ImmutableValue

This class implements an immutable value.


Constructor Summary
AbstractImmutableValue()
           
 
Method Summary
 Counter getCounterValue()
          This method is used to get the Counter value.
 short getCssValueType()
          A code defining the type of the value.
 float getFloatValue(short unitType)
          A method to get the float value with a specified unit.
 int getLength()
          The number of CSSValues in the list.
 short getPrimitiveType()
          The type of the value.
 Rect getRectValue()
          This method is used to get the Rect value.
 RGBColor getRGBColorValue()
          This method is used to get the RGB color.
 java.lang.String getStringValue()
          This method is used to get the string value.
 CSSValue item(int index)
          Used to retrieve a CSS rule by ordinal index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.css.value.ImmutableValue
createReadOnlyCopy, getCssText
 

Constructor Detail

AbstractImmutableValue

public AbstractImmutableValue()
Method Detail

getCssValueType

public short getCssValueType()
A code defining the type of the value.
Specified by:
getCssValueType in interface ImmutableValue

getPrimitiveType

public short getPrimitiveType()
The type of the value.
Specified by:
getPrimitiveType in interface ImmutableValue

getFloatValue

public float getFloatValue(short unitType)
                    throws DOMException
A method to get the float value with a specified unit.
Specified by:
getFloatValue in interface ImmutableValue
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the attached property doesn't support the float value or the unit type.

getStringValue

public java.lang.String getStringValue()
                                throws DOMException
This method is used to get the string value.
Specified by:
getStringValue in interface ImmutableValue
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a string value.

getCounterValue

public Counter getCounterValue()
                        throws DOMException
This method is used to get the Counter value.
Specified by:
getCounterValue in interface ImmutableValue
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Counter value (e.g. this is not CSS_COUNTER).

getRectValue

public Rect getRectValue()
                  throws DOMException
This method is used to get the Rect value.
Specified by:
getRectValue in interface ImmutableValue
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the CSS value doesn't contain a Rect value. (e.g. this is not CSS_RECT).

getRGBColorValue

public RGBColor getRGBColorValue()
                          throws DOMException
This method is used to get the RGB color.
Specified by:
getRGBColorValue in interface ImmutableValue
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the attached property can't return a RGB color value (e.g. this is not CSS_RGBCOLOR).

getLength

public int getLength()
The number of CSSValues in the list. The range of valid values of the indices is 0 to length-1 inclusive.
Specified by:
getLength in interface ImmutableValue

item

public CSSValue item(int index)
Used to retrieve a CSS rule by ordinal index.
Specified by:
item in interface ImmutableValue
Returns:
The style rule at the index position in the CSSValueList, or null if that is not a valid index.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.