com.miginfocom.util.gfx.geometry.numbers
Class AtOffset

java.lang.Object
  extended by com.miginfocom.util.gfx.geometry.numbers.AtOffset
All Implemented Interfaces:
AtRefNumber, AtRefRangeNumber, java.io.Serializable

public final class AtOffset
extends java.lang.Object
implements AtRefNumber

A value that adds a fixed offset to the inputted ref or start if getValue(float, float) or getIntValue(float, float).

See Also:
Serialized Form

Field Summary
static AtOffset OFFSET0
          Same as new AtOffset(0f) but can be used to avoid creating new objects.
 
Constructor Summary
AtOffset(float off)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getIntValue(float ref)
          Returns a value rounded to an int, possibly depending on the ref.
 int getIntValue(float start, float end)
          Returns offset rounded to an integer.
 float getOffset()
          Returns the offset sent into the constructor.
 float getValue(float ref)
          Returns a value, possibly depending on the ref.
 float getValue(float start, float end)
          Returns d
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OFFSET0

public static final AtOffset OFFSET0
Same as new AtOffset(0f) but can be used to avoid creating new objects.

Constructor Detail

AtOffset

public AtOffset(float off)
Constructor.

Parameters:
off - The value that will be added to the ref or (start of AtRefRangeNumber methods are used)
Method Detail

getValue

public float getValue(float ref)
Description copied from interface: AtRefNumber
Returns a value, possibly depending on the ref.

Specified by:
getValue in interface AtRefNumber
Parameters:
ref - Some reference value. Might be used or disregarded depending on implementation.
Returns:
The value

getIntValue

public int getIntValue(float ref)
Description copied from interface: AtRefNumber
Returns a value rounded to an int, possibly depending on the ref.

Specified by:
getIntValue in interface AtRefNumber
Parameters:
ref - Some reference value. Might be used or disregarded depending on implementation.
Returns:
The value, rounded to an int.

getValue

public final float getValue(float start,
                            float end)
Returns d

Specified by:
getValue in interface AtRefRangeNumber
Parameters:
start - Added to d.
end - Not used.
Returns:
d.

getIntValue

public final int getIntValue(float start,
                             float end)
Returns offset rounded to an integer. The integer value is cached.

Specified by:
getIntValue in interface AtRefRangeNumber
Parameters:
start - Added to offset.
end - Not used.
Returns:
offset rounded to an int.

getOffset

public final float getOffset()
Returns the offset sent into the constructor.

Returns:
The offset sent into the constructor.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.