org.apache.commons.id
Class AbstractLongIdentifierGenerator

java.lang.Object
  extended by org.apache.commons.id.AbstractLongIdentifierGenerator
All Implemented Interfaces:
IdentifierGenerator, LongIdentifierGenerator
Direct Known Subclasses:
LongGenerator

public abstract class AbstractLongIdentifierGenerator
extends java.lang.Object
implements LongIdentifierGenerator

Abstract superclass for LongIdentifierGenerator implementations.

Version:
$Id: AbstractLongIdentifierGenerator.java 480488 2006-11-29 08:57:26Z bayard $
Author:
Commons-Id team

Constructor Summary
protected AbstractLongIdentifierGenerator()
          Constructor.
 
Method Summary
 long maxValue()
          Returns the maximum value of an identifier from this generator.
 long minValue()
          Returns the minimum value of an identifier from this generator.
 java.lang.Object nextIdentifier()
          Gets the next identifier in the sequence.
abstract  java.lang.Long nextLongIdentifier()
          Gets the next identifier in the sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLongIdentifierGenerator

protected AbstractLongIdentifierGenerator()
Constructor.

Method Detail

maxValue

public long maxValue()
Returns the maximum value of an identifier from this generator.

The default implementation returns Long.MAX_VALUE. Implementations whose identifiers are bounded below Long.MAX_VALUE should override this method to return the maximum value of a generated identifier.

Specified by:
maxValue in interface LongIdentifierGenerator
Returns:
the maximum identifier value

minValue

public long minValue()
Returns the minimum value of an identifier from this generator.

The default implementation returns Long.MIN_VALUE. Implementations whose identifiers are bounded above Long.MIN_VALUE should override this method to return the minimum value of a generated identifier.

Specified by:
minValue in interface LongIdentifierGenerator
Returns:
the minimum identifier value

nextIdentifier

public java.lang.Object nextIdentifier()
Description copied from interface: IdentifierGenerator
Gets the next identifier in the sequence.

Specified by:
nextIdentifier in interface IdentifierGenerator
Returns:
the next identifier in sequence

nextLongIdentifier

public abstract java.lang.Long nextLongIdentifier()
Description copied from interface: LongIdentifierGenerator
Gets the next identifier in the sequence.

Specified by:
nextLongIdentifier in interface LongIdentifierGenerator
Returns:
the next Long identifier in sequence


Copyright 2003-2008 The Apache Software Foundation. All Rights Reserved.