lodel
[ class tree: lodel ] [ index: lodel ] [ all elements ]

Class: HTMLPurifier_Length

Source Location: /lodel/scripts/htmlpurifier/library/HTMLPurifier/Length.php

Class Overview


Represents a measurable length, with a string numeric magnitude and a unit. This object is immutable.


Variables

Methods



Class Details

[line 7]
Represents a measurable length, with a string numeric magnitude and a unit. This object is immutable.



[ Top ]


Class Variables

static $allowedUnits = array(
        'em' => true, 'ex' => true, 'px' => true, 'in' => true,
        'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true
    )

[line 28]

Lookup array of units recognized by CSS 2.1



Tags:

access:  protected

Type:   mixed


[ Top ]

$isValid =

[line 23]

Whether or not this length is valid. Null if not calculated yet.



Tags:

access:  protected

Type:   mixed


[ Top ]

$n =

[line 13]

String numeric magnitude.



Tags:

access:  protected

Type:   mixed


[ Top ]

$unit =

[line 18]

String unit. False is permitted if $n = 0.



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


static method make [line 46]

static void make( string $s)



Tags:

access:  public


Parameters:

string   $s   Unit string, like '2em' or '3.4in'

[ Top ]

constructor __construct [line 37]

HTMLPurifier_Length __construct( [number $n = '0'], [string $u = false])



Tags:

access:  public


Parameters:

number   $n   Magnitude
string   $u   Unit

[ Top ]

method compareTo [line 103]

void compareTo( $l)

Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.



Tags:

access:  public


Parameters:

   $l  

[ Top ]

method getN [line 83]

void getN( )

Retrieves string numeric magnitude.



Tags:

access:  public


[ Top ]

method getUnit [line 88]

void getUnit( )

Retrieves string unit.



Tags:

access:  public


[ Top ]

method isValid [line 93]

void isValid( )

Returns true if this length unit is valid.



Tags:

access:  public


[ Top ]

method toString [line 75]

void toString( )

Returns string representation of number.



Tags:

access:  public


[ Top ]

method validate [line 58]

void validate( )

Validates the number and unit.



Tags:

access:  protected


[ Top ]


Documentation generated on Wed, 11 Mar 2009 10:50:20 +0100 by phpDocumentor 1.4.2