com.infragistics.faces.shared.component.html
Class Length

java.lang.Object
  extended bycom.infragistics.faces.shared.component.html.Length

public class Length
extends java.lang.Object

Represents a lenght. Lenght have a value and an associated LenghtUnit.
The value can be negative and contain decimal


Constructor Summary
Length(double value)
          Constructs a new Length from a double
Length(double value, com.infragistics.faces.shared.enumeration.LengthUnit unit)
          Constructs a new Length from a double and a unit
Length(java.lang.String string)
          Constructs a new lenght from a CSS string formatted as follow: 1px, 1pc ...
 
Method Summary
 com.infragistics.faces.shared.enumeration.LengthUnit getUnit()
           
 double getValue()
          Returns the value
 void setUnit(com.infragistics.faces.shared.enumeration.LengthUnit unit)
          Sets the unit
 void setValue(double value)
          Sets the value
 void setValue(int value)
          Sets the value
 java.lang.String toString()
           
static Length valueOf(java.lang.String string)
          Returns a Lenght from the specified string which must be formatted according to the CSS2.1 specification
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Length

public Length(double value)
Constructs a new Length from a double

Parameters:
value -

Length

public Length(double value,
              com.infragistics.faces.shared.enumeration.LengthUnit unit)
Constructs a new Length from a double and a unit

Parameters:
value -
unit -

Length

public Length(java.lang.String string)
Constructs a new lenght from a CSS string formatted as follow: 1px, 1pc ...

Parameters:
string - : the css string to parse
Method Detail

valueOf

public static Length valueOf(java.lang.String string)
Returns a Lenght from the specified string which must be formatted according to the CSS2.1 specification

Parameters:
string -
Returns:
Length

getUnit

public com.infragistics.faces.shared.enumeration.LengthUnit getUnit()
Returns:
Returns the unit.

getValue

public double getValue()
Returns the value

Returns:
double

setUnit

public void setUnit(com.infragistics.faces.shared.enumeration.LengthUnit unit)
Sets the unit

Parameters:
unit - The unit to set.

setValue

public void setValue(double value)
Sets the value

Parameters:
value -

setValue

public void setValue(int value)
Sets the value

Parameters:
value -

toString

public java.lang.String toString()