com.miginfocom.util.gfx.geometry
Class AtUtil

java.lang.Object
  extended by com.miginfocom.util.gfx.geometry.AtUtil

public class AtUtil
extends java.lang.Object

Utility class for At* classes.


Constructor Summary
AtUtil()
           
 
Method Summary
static AtRefRangeNumber createFilter(AtRefRangeNumber n1, int oper, AtRefRangeNumber n2, float auxValue)
          Returns a implementing class of RefRangeOperFilter that will filter both numbers set in with oper.
static AtRefRangeNumber getCrossValue(AtRefRangeNumber n1, AtRefRangeNumber n2, float perc)
          Returns a number that will be perc percent between n1 and n2.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtUtil

public AtUtil()
Method Detail

getCrossValue

public static AtRefRangeNumber getCrossValue(AtRefRangeNumber n1,
                                             AtRefRangeNumber n2,
                                             float perc)
Returns a number that will be perc percent between n1 and n2.

Parameters:
n1 - The first number
n2 - The second number
perc - 0.0f is at n1 and 1.0f is at n2. Any value is viable.
Returns:
A number that will be perc percent between n1 and n2.
See Also:
OperFilter, RefOperFilter, RefRangeOperFilter, RefRangeOperFilter.PERCENT

createFilter

public static AtRefRangeNumber createFilter(AtRefRangeNumber n1,
                                            int oper,
                                            AtRefRangeNumber n2,
                                            float auxValue)
Returns a implementing class of RefRangeOperFilter that will filter both numbers set in with oper.

The filter will be as specific as possible, meaning that is both number are AtNumber a OperFilter will be returned. If that was not true and both are AtRefNumbers a RefOperFilter will be returned. If not that is the case either a RefRangeOperFilter will be returned.

Parameters:
n1 - The first number
oper - The operator. E.g. RefRangeOperFilter.PERCENT or RefRangeOperFilter.MUL.
n2 - The second number
auxValue - The auxillary value currently only used with oper RefRangeOperFilter.PERCENT.
Returns:
A number that will be perc percent between n1 and n2.
See Also:
OperFilter, RefOperFilter, RefRangeOperFilter, RefRangeOperFilter.ADD, RefRangeOperFilter.MUL, RefRangeOperFilter.PERCENT


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.