net.sf.farrago.catalog
Class FarragoSequenceOptions

java.lang.Object
  extended by net.sf.farrago.catalog.FarragoSequenceOptions

public class FarragoSequenceOptions
extends Object

A class for tracking sequence generator options.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/catalog/FarragoSequenceOptions.java#7 $
Author:
John Pham

Nested Class Summary
private static class FarragoSequenceOptions.OptionType
           
 
Field Summary
private  RelDataType dataType
           
private  boolean generatedAlways
           
private  long lowerLimit
           
private  String name
           
private  Properties props
           
private  long upperLimit
           
 
Constructor Summary
FarragoSequenceOptions(String name)
           
 
Method Summary
 void alter(FemSequenceGenerator sequence, RelDataType dataType)
          Alter an existing sequence based upon options
private  void applyTo(FemSequenceGenerator sequence, RelDataType dataType, boolean create)
          Apply options to a sequence
 Boolean getCycle()
           
 boolean getGeneratedAlways()
           
 Long getIncrement()
           
 Long getMax()
           
private  long getMaxResolved(long maxDefault)
           
 Long getMin()
           
private  long getMinResolved(long minDefault)
           
private  Object getOption(FarragoSequenceOptions.OptionType opt)
           
 Long getStart()
           
 void init(FemSequenceGenerator sequence, RelDataType dataType)
          Initialize a newly created sequence
private  boolean isSet(FarragoSequenceOptions.OptionType opt)
           
 void setCycle(Boolean value)
           
 void setGeneratedAlways(boolean value)
           
 void setIncrement(Long value)
           
 void setMax(Long value)
           
 void setMin(Long value)
           
private  void setOption(FarragoSequenceOptions.OptionType opt, Object value)
           
 void setStart(Long value)
           
private  void validateType(RelDataType dataType)
          Validates and sets data type of sequence
private  void validateValue(long value)
          Validates that value is within range of specified type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

private String name

props

private Properties props

generatedAlways

private boolean generatedAlways

lowerLimit

private long lowerLimit

upperLimit

private long upperLimit

dataType

private RelDataType dataType
Constructor Detail

FarragoSequenceOptions

public FarragoSequenceOptions(String name)
Method Detail

setGeneratedAlways

public void setGeneratedAlways(boolean value)

getGeneratedAlways

public boolean getGeneratedAlways()

setStart

public void setStart(Long value)

getStart

public Long getStart()

setIncrement

public void setIncrement(Long value)

getIncrement

public Long getIncrement()

setMin

public void setMin(Long value)

getMin

public Long getMin()

getMinResolved

private long getMinResolved(long minDefault)

setMax

public void setMax(Long value)

getMax

public Long getMax()

getMaxResolved

private long getMaxResolved(long maxDefault)

setCycle

public void setCycle(Boolean value)

getCycle

public Boolean getCycle()

setOption

private void setOption(FarragoSequenceOptions.OptionType opt,
                       Object value)

getOption

private Object getOption(FarragoSequenceOptions.OptionType opt)

isSet

private boolean isSet(FarragoSequenceOptions.OptionType opt)

init

public void init(FemSequenceGenerator sequence,
                 RelDataType dataType)
Initialize a newly created sequence


alter

public void alter(FemSequenceGenerator sequence,
                  RelDataType dataType)
Alter an existing sequence based upon options


applyTo

private void applyTo(FemSequenceGenerator sequence,
                     RelDataType dataType,
                     boolean create)
Apply options to a sequence

Parameters:
sequence - the sequence to be modified
dataType - the data type of the sequence
create - whether to begin with existing sequence

validateType

private void validateType(RelDataType dataType)
Validates and sets data type of sequence


validateValue

private void validateValue(long value)
Validates that value is within range of specified type