com.cmpware.fastmodel
Class Decoder

java.lang.Object
  extended by com.cmpware.fastmodel.Decoder

public class Decoder
extends java.lang.Object

This class defines a decoder used in the FastModel.

Copyright (c) 2006 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
protected  java.math.BigInteger mask
          The decode mask
protected  java.math.BigInteger sig
          The decode signature
 
Constructor Summary
Decoder()
          Constructor for default decoder, which matches nothing (illegal oproce).
Decoder(Field field, long value)
          Constructor
 
Method Summary
 Decoder add(Field field, int value)
          This method returns a decoder with new values added.
 Decoder add(Field field, long value)
          This method returns a decoder with new values added.
static Decoder primary(Field field, int value)
          This factory method returns a decoder with new values added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values

mask

protected java.math.BigInteger mask
The decode mask


sig

protected java.math.BigInteger sig
The decode signature

Constructor Detail

Decoder

public Decoder()
Constructor for default decoder, which matches nothing (illegal oproce).


Decoder

public Decoder(Field field,
               long value)
Constructor

Parameters:
field - The decode field.
value - the value of the decode field.
Method Detail

primary

public static Decoder primary(Field field,
                              int value)
This factory method returns a decoder with new values added. This permits a syntax like new Decode.primary(x,y).add(z,a) to be used for multi-level decode.

Parameters:
field - The decode field.
value - the value of the decode field.
Returns:
a decoder is returned.

add

public Decoder add(Field field,
                   long value)
This method returns a decoder with new values added. This permits a syntax like new Decode(x,y,z).add(a,b,c) to be used for multi-level decode.

Parameters:
field - The decode field.
value - the value of the decode field.
Returns:
a decoder

add

public Decoder add(Field field,
                   int value)
This method returns a decoder with new values added. This permits a syntax like new Decode(x,y,z).add(a,b,c) to be used for multi-level decode. This is the same as the other add() method in this class but takes an int value rather than a long.

Parameters:
field - The decode field.
value - the value of the decode field.
Returns:
a decoder