All Packages Class Hierarchy This Package Previous Next Index
Class taxman.TaxNumber
java.lang.Object
|
+----taxman.TaxNumber
- public class TaxNumber
- extends Object
This little class represents a number.
The number has a set of factors associated with it.
This object can return those factors and stores
a count of the factors
-
TaxNumber(int)
-
-
getFactorCount()
- Returns the number of factors for this TaxNumber.
-
getFactors()
- Returns the list of factors of this number.
-
getValue()
- Returns the integer value of this TaxNumber.
-
isAFactor(int)
- Returns true if the number, n, is a factor of this TaxNumber.
-
isAFactor(TaxNumber)
- Returns true if the number, n, is a factor of this TaxNumber.
-
main(String[])
- Testing fuinction
-
toString()
- Returns a string representation of the TaxNumber
TaxNumber
public TaxNumber(int N)
isAFactor
public final boolean isAFactor(TaxNumber n)
- Returns true if the number, n, is a factor of this TaxNumber.
- Returns:
- true if the number, n, is a factor of this TaxNumber. false otherwise
isAFactor
public final boolean isAFactor(int n)
- Returns true if the number, n, is a factor of this TaxNumber.
- Returns:
- true if the number, n, is a factor of this TaxNumber. false otherwise
getFactorCount
public final int getFactorCount()
- Returns the number of factors for this TaxNumber. The number is calculated
on creation of the TaxNumber so this just returns the pre-calculated value
- Returns:
- The number of factors for this TaxNumber.
getFactors
public final int[] getFactors()
- Returns the list of factors of this number.
- Returns:
- Array with factors of this number
getValue
public final int getValue()
- Returns the integer value of this TaxNumber.
- Returns:
- The integer value of this TaxNumber
toString
public String toString()
- Returns a string representation of the TaxNumber
- Returns:
- A string representation of the TaxNumber
- Overrides:
- toString in class Object
main
public static void main(String args[])
- Testing fuinction
All Packages Class Hierarchy This Package Previous Next Index