Sweet Home 3D 4.1

com.eteks.sweethome3d.model
Enum LengthUnit

java.lang.Object
  extended by java.lang.Enum<LengthUnit>
      extended by com.eteks.sweethome3d.model.LengthUnit
All Implemented Interfaces:
Serializable, Comparable<LengthUnit>

public enum LengthUnit
extends Enum<LengthUnit>

Unit used for lengths.


Enum Constant Summary
CENTIMETER
          Centimeter unit.
INCH
          Foot/Inch unit followed by fractions.
INCH_DECIMALS
          Inch unit with decimals.
METER
          Meter unit.
MILLIMETER
          Millimeter unit.
 
Method Summary
static float centimeterToFoot(float length)
          Returns the length given in centimeters converted to feet.
static float centimeterToInch(float length)
          Returns the length given in centimeters converted to inches.
abstract  float centimeterToUnit(float length)
          Returns the length given in centimeters converted to a value expressed in this unit.
static float footToCentimeter(float length)
          Returns the length given in feet converted to centimeters.
abstract  Format getAreaFormatWithUnit()
          Returns a format able to format areas with their localized unit.
abstract  Format getFormat()
          Returns a format able to format lengths.
abstract  Format getFormatWithUnit()
          Returns a format able to format lengths with their localized unit.
abstract  float getMagnetizedLength(float length, float maxDelta)
          Returns the value close to the given length in centimeter under magnetism.
 float getMaximumElevation()
          Returns the maximum value for elevation in centimeter.
abstract  float getMaximumLength()
          Returns the maximum value for length in centimeter.
abstract  float getMinimumLength()
          Returns the minimum value for length in centimeter.
abstract  String getName()
          Returns a localized name of this unit.
static float inchToCentimeter(float length)
          Returns the length given in inches converted to centimeters.
abstract  float unitToCentimeter(float length)
          Returns the length given in this unit converted to a value expressed in centimeter.
static LengthUnit valueOf(String name)
          Returns the enum constant of this type with the specified name.
static LengthUnit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MILLIMETER

public static final LengthUnit MILLIMETER
Millimeter unit.

Since:
2.0

CENTIMETER

public static final LengthUnit CENTIMETER
Centimeter unit.


METER

public static final LengthUnit METER
Meter unit.

Since:
2.0

INCH

public static final LengthUnit INCH
Foot/Inch unit followed by fractions.


INCH_DECIMALS

public static final LengthUnit INCH_DECIMALS
Inch unit with decimals.

Since:
4.0
Method Detail

values

public static LengthUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (LengthUnit c : LengthUnit.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LengthUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

centimeterToInch

public static float centimeterToInch(float length)
Returns the length given in centimeters converted to inches.


centimeterToFoot

public static float centimeterToFoot(float length)
Returns the length given in centimeters converted to feet.


inchToCentimeter

public static float inchToCentimeter(float length)
Returns the length given in inches converted to centimeters.


footToCentimeter

public static float footToCentimeter(float length)
Returns the length given in feet converted to centimeters.


getFormatWithUnit

public abstract Format getFormatWithUnit()
Returns a format able to format lengths with their localized unit.


getFormat

public abstract Format getFormat()
Returns a format able to format lengths.


getAreaFormatWithUnit

public abstract Format getAreaFormatWithUnit()
Returns a format able to format areas with their localized unit.


getName

public abstract String getName()
Returns a localized name of this unit.


getMagnetizedLength

public abstract float getMagnetizedLength(float length,
                                          float maxDelta)
Returns the value close to the given length in centimeter under magnetism.


getMinimumLength

public abstract float getMinimumLength()
Returns the minimum value for length in centimeter.


getMaximumLength

public abstract float getMaximumLength()
Returns the maximum value for length in centimeter.

Since:
3.4

getMaximumElevation

public float getMaximumElevation()
Returns the maximum value for elevation in centimeter.

Since:
3.4

centimeterToUnit

public abstract float centimeterToUnit(float length)
Returns the length given in centimeters converted to a value expressed in this unit.

Since:
2.0

unitToCentimeter

public abstract float unitToCentimeter(float length)
Returns the length given in this unit converted to a value expressed in centimeter.

Since:
2.0

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License