edu.stanford.hci.r3.units
Class Percentage

java.lang.Object
  extended by edu.stanford.hci.r3.units.Units
      extended by edu.stanford.hci.r3.units.Percentage
All Implemented Interfaces:
java.lang.Cloneable

public class Percentage
extends Units

A percentage of a maximum value. If the maximum value is set to 8.5 inches, 50% will give us an equivalent of 4.25 inches.

This software is distributed under the BSD License.


Field Summary
static Units ONE
          "Identity Element", representing one hundred percent of 8.5 inches.
 
Fields inherited from class edu.stanford.hci.r3.units.Units
POINTS_PER_INCH
 
Constructor Summary
Percentage(double percentage, Units maxValue)
          Represents a percentage value of a maximum.
 
Method Summary
 Units getActualValue()
           
 Units getMaximumValue()
           
protected  double getNumberOfUnitsInOneInch()
           
 java.lang.String toString()
           
 
Methods inherited from class edu.stanford.hci.r3.units.Units
add, clone, equals, getConversionTo, getCopy, getUnitName, getUnitsObjectOfSameLengthIn, getUnitsObjectOfSameTypeWithValue, getValue, getValueIn, getValueInCentimeters, getValueInInches, getValueInMillimeters, getValueInPatternDots, getValueInPixels, getValueInPoints, subtract, toInches, toPixels, toPoints
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ONE

public static final Units ONE
"Identity Element", representing one hundred percent of 8.5 inches. Width of a US Letter-sized sheet.

Constructor Detail

Percentage

public Percentage(double percentage,
                  Units maxValue)
Represents a percentage value of a maximum. Sometimes, it's easier to express a location of x,y=50%,50% on a sheet, especially if the sheet is later resized.

Parameters:
percentage -
maxValue -
Method Detail

getActualValue

public Units getActualValue()
Returns:

getMaximumValue

public Units getMaximumValue()
Returns:

getNumberOfUnitsInOneInch

protected double getNumberOfUnitsInOneInch()
Specified by:
getNumberOfUnitsInOneInch in class Units
Returns:
how many of these units fit in one inch.
See Also:
Units.getNumberOfUnitsInOneInch()

toString

public java.lang.String toString()
Overrides:
toString in class Units
See Also:
Units.toString()

Copyright 2006 Stanford University