com.sptci.echo2.style
Class Extent

java.lang.Object
  extended by nextapp.echo2.app.Extent
      extended by com.sptci.echo2.style.Extent
All Implemented Interfaces:
Serializable, Comparable

public class Extent
extends Extent

A custom extent class to use in styles. It is recomended that you use the getInstance(int) method or its overloaded derivatives to avoid replication across sessions.

The following shows the recommended way to use this class:

   import com.sptci.echo2.style.Extent;

     ...
     Extent width = Extent.getInstance( 400 );
     Extent height = Extent.getInstance( 300 );
 

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: Extent.java 3334 2007-06-08 16:25:49Z rakesh $
Author:
Rakesh Vidyadharan 2007-06-08
See Also:
Serialized Form

Field Summary
protected static Map<String,Extent> cache
          The map used to maintain a cache of extent instances required by the application.
 
Fields inherited from class nextapp.echo2.app.Extent
CM, EM, EX, IN, MM, PC, PERCENT, PT, PX
 
Constructor Summary
Extent(int size)
          Deprecated. Use getInstance( int ) instead.
Extent(int size, int units)
          Deprecated. Use getInstance( int, int ) instead.
 
Method Summary
static Extent getInstance(int size)
          Fetch an extent instance that represents the specified size in the default units.
static Extent getInstance(int size, int units)
          Fetch an extent instance that represents the specified size in the specified units.
protected static String getKey(int size, int units)
          Return a unique key to use for the specified extent size expressed in the specified units.
 
Methods inherited from class nextapp.echo2.app.Extent
add, compareTo, equals, getUnits, getValue, isComparableTo, isEnglish, isPercentage, isPrint, isSI, toMm, toPoint, toString, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cache

protected static final Map<String,Extent> cache
The map used to maintain a cache of extent instances required by the application.

Constructor Detail

Extent

@Deprecated
public Extent(int size)
Deprecated. Use getInstance( int ) instead.

Creates a new instance of the specified size in Extent.PX units.

Parameters:
size - The size represented by this extent.

Extent

@Deprecated
public Extent(int size,
                         int units)
Deprecated. Use getInstance( int, int ) instead.

Creates a new instance of the specified size in the specified units.

Parameters:
size - The size represented by this extent.
units - The unit of measure used to express this extent.
Method Detail

getInstance

public static Extent getInstance(int size)
Fetch an extent instance that represents the specified size in the default units.

Parameters:
size - The size represented by this extent.
See Also:
getInstance( int, int )

getInstance

public static Extent getInstance(int size,
                                 int units)
Fetch an extent instance that represents the specified size in the specified units.

Parameters:
size - The size represented by this extent.
units - The unit of measure used to express this extent.
See Also:
getKey( int, int )

getKey

protected static String getKey(int size,
                               int units)
Return a unique key to use for the specified extent size expressed in the specified units.

Parameters:
size - The size for which a key is to be generated.
units - The unit of measure used to express the size.