edu.nrao.sss.math
Class NumberSetFactory

java.lang.Object
  extended by edu.nrao.sss.math.NumberSetFactory

public class NumberSetFactory
extends Object

Creator of number sets. Clients may fetch a factory by using NumberSet.factory.

Version Info:

$Revision: 1707 $
$Date: 2008-11-14 10:23:59 -0700 (Fri, 14 Nov 2008) $
$Author: dharland $

Since:
2007-03-01
Author:
David M. Harland

Method Summary
 NumberSet makeContinuousSet(Number minValue, Number maxValue, NumberSet.LookupMethod lookupMethod)
          Creates a continuous set of numbers.
 NumberSet makeDiscreteSet(Set<? extends Number> discreteValues, NumberSet.LookupMethod lookupMethod)
          Creates a discrete set of numbers.
 NumberSet makeDiscreteSetAdditive(Number minValue, Number maxValue, Number stepSize, NumberSet.LookupMethod lookupMethod)
          Creates a discrete set of numbers.
 NumberSet makeDiscreteSetMultiplicative(Number minValue, Number maxValue, Number multiplier, NumberSet.LookupMethod lookupMethod)
          Creates a discrete set of numbers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeContinuousSet

public NumberSet makeContinuousSet(Number minValue,
                                   Number maxValue,
                                   NumberSet.LookupMethod lookupMethod)
Creates a continuous set of numbers.

Parameters:
minValue - the smallest value in this set.
maxValue - the largest value in this set.
lookupMethod - the manner in which a value is found in this set.
Returns:
a new continuous set of numbers.

makeDiscreteSet

public NumberSet makeDiscreteSet(Set<? extends Number> discreteValues,
                                 NumberSet.LookupMethod lookupMethod)
Creates a discrete set of numbers.

Parameters:
discreteValues - the numbers in this set.
lookupMethod - the manner in which a value is found in this set.
Returns:
a new discrete set of numbers.

makeDiscreteSetAdditive

public NumberSet makeDiscreteSetAdditive(Number minValue,
                                         Number maxValue,
                                         Number stepSize,
                                         NumberSet.LookupMethod lookupMethod)
Creates a discrete set of numbers.

The numeric parameters are used to construct the values held in the returned set. The smallest such value is minValue. The next smallest value is minValue plus stepSize, and so on until the largest value, which will be less than or equal to maxValue, is added.

Parameters:
minValue - the smallest value in this set.
maxValue - the largest possible value in this set. Note that the largest value actually held in this set could be smaller. This happens when the distance from minValue to maxValue is not an integral multiple of stepSize.
stepSize - an increment used to create other values for this set.
lookupMethod - the manner in which a value is found in this set.
Returns:
a new discrete set of numbers.

makeDiscreteSetMultiplicative

public NumberSet makeDiscreteSetMultiplicative(Number minValue,
                                               Number maxValue,
                                               Number multiplier,
                                               NumberSet.LookupMethod lookupMethod)
Creates a discrete set of numbers.

The numeric parameters are used to construct the values held in the returned set. The smallest such value is minValue. The next smallest value is minValue multiplied by stepSize, and so on until the largest value, which will be less than or equal to maxValue, is added.

Parameters:
minValue - the smallest value in this set.
maxValue - the largest possible value in this set. Note that the largest value actually held in this set could be smaller.
multiplier - a value used to create other values for this set.
lookupMethod - the manner in which a value is found in this set.
Returns:
a new discrete set of numbers.


Copyright © 2009. All Rights Reserved.