All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.css.values.CssPercentage
java.lang.Object
|
+----org.w3c.css.values.CssValue
|
+----org.w3c.css.values.CssPercentage
- public class CssPercentage
- extends CssValue
Percentage units
The format of a percentage value is an optional sign character ('+' or '-',
with '+' being the default) immediately followed by a number (with or without
a decimal point) immediately followed by '%'.
Percentage values are always relative to another value, for example a length
unit. Each property that allows percentage units also defines what value
the percentage value refer to. Most often this is the font size of the element
itself:
P { line-height: 120% } / * 120% of the element's 'font-size' * /
In all inherited CSS1 properties, if the value is specified as a percentage,
child elements inherit the resultant value, not the percentage value.
-
CssPercentage()
- Create a new CssPercentage
-
CssPercentage(float)
- Create a new CssPercentage with a float
-
CssPercentage(Float)
- Create a new CssPercentage with a Float value.
-
CssPercentage(int)
- Create a new CssPercentage with a number
-
equals(Object)
- Compares two values for equality.
-
get()
- Returns the current value
-
set(String, Frame)
- Set the value of this percentage.
-
toString()
- Returns a string representation of the object.
CssPercentage
public CssPercentage()
- Create a new CssPercentage
CssPercentage
public CssPercentage(int value)
- Create a new CssPercentage with a number
- Parameters:
- value - The value.
CssPercentage
public CssPercentage(float value)
- Create a new CssPercentage with a float
- Parameters:
- value - the float value.
CssPercentage
public CssPercentage(Float value)
- Create a new CssPercentage with a Float value.
- Parameters:
- value - the Float object.
set
public void set(String s,
Frame frame) throws InvalidParamException
- Set the value of this percentage.
- Parameters:
- s - the string representation of the percentage.
- frame - For errors and warnings reports.
- Throws: InvalidParamException
- The unit is incorrect
- Overrides:
- set in class CssValue
get
public Object get()
- Returns the current value
- Overrides:
- get in class CssValue
toString
public String toString()
- Returns a string representation of the object.
- Overrides:
- toString in class Object
equals
public boolean equals(Object val)
- Compares two values for equality.
- Parameters:
- value - The other value.
- Overrides:
- equals in class CssValue
All Packages Class Hierarchy This Package Previous Next Index