net.sourceforge.fixagora.basis.shared.control
Class DollarFraction

java.lang.Object
  extended by net.sourceforge.fixagora.basis.shared.control.DollarFraction

public class DollarFraction
extends java.lang.Object

The Class DollarFraction.


Constructor Summary
DollarFraction(double tickSize)
          Instantiates a new dollar fraction.
 
Method Summary
static char getDenomiatorDigit(char denomiator)
          Gets the denomiator digit.
static char getDenomiatorIntChar(char denominator)
          Gets the denomiator int char.
static java.lang.String getDenomiatorString(int denomiator)
          Gets the denomiator string.
 java.lang.String getDollarPrice(double price, int leadingZeros)
          Gets the dollar price.
 java.lang.String getDollarPrice(double price, int leadingZeros, boolean shorten)
          Gets the dollar price.
 java.lang.String getDollarPriceFraction(double price)
          Gets the dollar price fraction.
 java.lang.String getDollarPriceFraction(double price, boolean shorten)
          Gets the dollar price fraction.
static java.lang.Double getDoubleValue(java.lang.String text)
          Gets the double value.
static char getNumeratorDigit(char numerator)
          Gets the numerator digit.
static char getNumeratorIntChar(char numerator)
          Gets the numerator int char.
static java.lang.String getNumeratorString(int numerator)
          Gets the numerator string.
static int getSecondDenominator(double tickSize)
          Gets the second denominator.
 boolean isValidPrice(double price)
          Checks if is valid price.
static boolean isValidTickSize(double tickSize)
          Checks if is valid tick size.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DollarFraction

public DollarFraction(double tickSize)
               throws java.lang.Exception
Instantiates a new dollar fraction.

Parameters:
tickSize - the tick size
Throws:
java.lang.Exception - the exception
Method Detail

getDollarPrice

public java.lang.String getDollarPrice(double price,
                                       int leadingZeros)
                                throws java.lang.Exception
Gets the dollar price.

Parameters:
price - the price
leadingZeros - the leading zeros
Returns:
the dollar price
Throws:
java.lang.Exception - the exception

getDollarPriceFraction

public java.lang.String getDollarPriceFraction(double price)
                                        throws java.lang.Exception
Gets the dollar price fraction.

Parameters:
price - the price
Returns:
the dollar price fraction
Throws:
java.lang.Exception - the exception

getDollarPriceFraction

public java.lang.String getDollarPriceFraction(double price,
                                               boolean shorten)
                                        throws java.lang.Exception
Gets the dollar price fraction.

Parameters:
price - the price
shorten - the shorten
Returns:
the dollar price fraction
Throws:
java.lang.Exception - the exception

getDollarPrice

public java.lang.String getDollarPrice(double price,
                                       int leadingZeros,
                                       boolean shorten)
                                throws java.lang.Exception
Gets the dollar price.

Parameters:
price - the price
leadingZeros - the leading zeros
shorten - the shorten
Returns:
the dollar price
Throws:
java.lang.Exception - the exception

isValidPrice

public boolean isValidPrice(double price)
Checks if is valid price.

Parameters:
price - the price
Returns:
true, if is valid price

isValidTickSize

public static boolean isValidTickSize(double tickSize)
Checks if is valid tick size.

Parameters:
tickSize - the tick size
Returns:
true, if is valid tick size

getSecondDenominator

public static int getSecondDenominator(double tickSize)
Gets the second denominator.

Parameters:
tickSize - the tick size
Returns:
the second denominator

getDenomiatorDigit

public static char getDenomiatorDigit(char denomiator)
Gets the denomiator digit.

Parameters:
denomiator - the denomiator
Returns:
the denomiator digit

getNumeratorDigit

public static char getNumeratorDigit(char numerator)
Gets the numerator digit.

Parameters:
numerator - the numerator
Returns:
the numerator digit

getDenomiatorIntChar

public static char getDenomiatorIntChar(char denominator)
Gets the denomiator int char.

Parameters:
denominator - the denominator
Returns:
the denomiator int char

getNumeratorIntChar

public static char getNumeratorIntChar(char numerator)
Gets the numerator int char.

Parameters:
numerator - the numerator
Returns:
the numerator int char

getDenomiatorString

public static java.lang.String getDenomiatorString(int denomiator)
Gets the denomiator string.

Parameters:
denomiator - the denomiator
Returns:
the denomiator string

getNumeratorString

public static java.lang.String getNumeratorString(int numerator)
Gets the numerator string.

Parameters:
numerator - the numerator
Returns:
the numerator string

getDoubleValue

public static java.lang.Double getDoubleValue(java.lang.String text)
Gets the double value.

Parameters:
text - the text
Returns:
the double value