org.jasig.cas.util
Class DefaultLongNumericGenerator

java.lang.Object
  extended byorg.jasig.cas.util.DefaultLongNumericGenerator
All Implemented Interfaces:
LongNumericGenerator, NumericGenerator

public final class DefaultLongNumericGenerator
extends java.lang.Object
implements LongNumericGenerator

The default numeric generator for generating long values. Implementation allows for wrapping (to restart count) if the maximum is reached.

Since:
3.0
Version:
$Revision$ $Date$
Author:
Scott Battaglia

Constructor Summary
DefaultLongNumericGenerator()
           
DefaultLongNumericGenerator(boolean wrap)
           
DefaultLongNumericGenerator(long initialValue)
           
DefaultLongNumericGenerator(long initialValue, boolean wrap)
           
 
Method Summary
 long getNextLong()
          Get the next long in the sequence.
 java.lang.String getNextNumberAsString()
          Method to retrieve the next number as a String.
protected  long getNextValue()
           
 int maxLength()
          The guaranteed maximum length of a String returned by this generator.
 int minLength()
          The guaranteed minimum length of a String returned by this generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLongNumericGenerator

public DefaultLongNumericGenerator()

DefaultLongNumericGenerator

public DefaultLongNumericGenerator(boolean wrap)

DefaultLongNumericGenerator

public DefaultLongNumericGenerator(long initialValue,
                                   boolean wrap)

DefaultLongNumericGenerator

public DefaultLongNumericGenerator(long initialValue)
Method Detail

getNextLong

public long getNextLong()
Description copied from interface: LongNumericGenerator
Get the next long in the sequence.

Specified by:
getNextLong in interface LongNumericGenerator
Returns:
the next long in the sequence.

getNextNumberAsString

public java.lang.String getNextNumberAsString()
Description copied from interface: NumericGenerator
Method to retrieve the next number as a String.

Specified by:
getNextNumberAsString in interface NumericGenerator
Returns:
the Strign representation of the next number in the sequence

maxLength

public int maxLength()
Description copied from interface: NumericGenerator
The guaranteed maximum length of a String returned by this generator.

Specified by:
maxLength in interface NumericGenerator
Returns:
the maximum length

minLength

public int minLength()
Description copied from interface: NumericGenerator
The guaranteed minimum length of a String returned by this generator.

Specified by:
minLength in interface NumericGenerator
Returns:
the minimum length.

getNextValue

protected long getNextValue()
Throws:
java.lang.IllegalStateException - if the maximum value is reached and wrapping is not allowed.


Copyright © 2004-2005 Java Architectures Special Interest Group. All Rights Reserved.