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

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

public final class AtEnd
extends java.lang.Object
implements AtRefRangeNumber

A value that is relative to the end. Basically returns end + off.

See Also:
Serialized Form

Field Summary
static AtRefRangeNumber END0
          Static reference to a new AtEnd(0) object.
static AtRefRangeNumber END1
          Static reference to a new AtEnd(-1) object.
 
Constructor Summary
AtEnd(float off)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getIntValue(float start, float end)
          Returns start + off rounded to the closest int.
 float getOffset()
          Returns the offset sent into the constructor.
 float getValue(float start, float end)
          Returns end + off.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

END0

public static final AtRefRangeNumber END0
Static reference to a new AtEnd(0) object. Can be used freely since it's immutable.


END1

public static final AtRefRangeNumber END1
Static reference to a new AtEnd(-1) object. Can be used freely since it's immutable.

Constructor Detail

AtEnd

public AtEnd(float off)
Constructor.

Parameters:
off - The value that is added to end. I.e. the distance from the end. Use negative values to go towards start.
Method Detail

getValue

public final float getValue(float start,
                            float end)
Returns end + off.

Specified by:
getValue in interface AtRefRangeNumber
Parameters:
start - Not used.
end - The value added to off.
Returns:
end + off

getIntValue

public final int getIntValue(float start,
                             float end)
Returns start + off rounded to the closest int.

Specified by:
getIntValue in interface AtRefRangeNumber
Parameters:
start - Not used.
end - The value added to off.
Returns:
start + off rounded to the closest 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.