org.thc.shagg
Class WeightSet

java.lang.Object
  |
  +--org.thc.shagg.WeightSet

public class WeightSet
extends java.lang.Object

This class holds a set of weights. Weights are a sequence of numbers, using the provided radix it is possible to also generate weights for non-digit serial numbers.

The set contains all sequences until the specified length, weights that only contain zeros are omitted.

e.g. radix 3, length 2:

Version:
$Id: WeightSet.java,v 1.6 2003/07/18 10:08:05 plasmoid Exp $
Author:
Plasmoid (plasmoid@thc.org), THC

Field Summary
private  java.util.Vector set
           
 
Constructor Summary
WeightSet(int radix, int len)
          Construct a weight set.
 
Method Summary
 int[] get(int i)
          Get the i-th element of the set.
 int size()
          Get the size of the set.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

set

private java.util.Vector set
Constructor Detail

WeightSet

public WeightSet(int radix,
                 int len)
Construct a weight set.
Parameters:
radix - Radix of numbers
len - Maxmimum length of weight sequences
Method Detail

size

public int size()
Get the size of the set.
Returns:
size Size of the weight set.

get

public int[] get(int i)
Get the i-th element of the set.
Parameters:
i - Index of the element
Returns:
Weights as an array of integers