Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*-
   * See the file LICENSE for redistribution information.
   *
   * Copyright (c) 2005, 2010 Oracle and/or its affiliates.  All rights reserved.
   *
   */
  
  package com.sleepycat.je;

Specifies the attributes of a sequence.
 
 public class SequenceConfig implements Cloneable {

    
Default configuration used if null is passed to methods that create a cursor.
 
     public static final SequenceConfig DEFAULT = new SequenceConfig();
 
     /* Parameters */
     private int cacheSize = 0;
     private long rangeMin = .;
     private long rangeMax = .;
     private long initialValue = 0L;
 
     /* Flags */
     private boolean allowCreate;
     private boolean decrement;
     private boolean exclusiveCreate;
     private boolean autoCommitNoSync;
     private boolean wrap;

    
An instance created using the default constructor is initialized with the system's default settings.
 
     public SequenceConfig() {
     }

    
Configures the Database.openSequence method to create the sequence if it does not already exist.

The default value is false.

This method may be called at any time during the life of the application.

Parameters:
allowCreate If true, configure the Database.openSequence(com.sleepycat.je.Transaction,com.sleepycat.je.DatabaseEntry,com.sleepycat.je.SequenceConfig) method to create the sequence if it does not already exist.
Returns:
this
 
     public SequenceConfig setAllowCreate(boolean allowCreate) {
         setAllowCreateVoid(allowCreate);
         return this;
     }
    
    

Hidden:
The void return setter for use by Bean editors.
 
     public void setAllowCreateVoid(boolean allowCreate) {
         this. = allowCreate;
     }

    
Returns true if the Database.openSequence method is configured to create the sequence if it does not already exist.

This method may be called at any time during the life of the application.

Returns:
true if the Database.openSequence method is configured to create the sequence if it does not already exist.
 
     public boolean getAllowCreate() {
         return ;
     }

    
Set the Configure the number of elements cached by a sequence handle.

The default value is zero.

This method may be called at any time during the life of the application.

Parameters:
cacheSize The number of elements cached by a sequence handle. May not be larger than the size of the range defined by setRange(long,long).
Returns:
this
 
    public SequenceConfig setCacheSize(int cacheSize) {
        setCacheSizeVoid(cacheSize);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setCacheSizeVoid(int cacheSize) {
        this. = cacheSize;
    }

    
Returns the number of elements cached by a sequence handle..

This method may be called at any time during the life of the application.

Returns:
The number of elements cached by a sequence handle..
    public int getCacheSize() {
        return ;
    }

    
Specifies that the sequence should be decremented.

The default value is false.

This method may be called at any time during the life of the application.

Parameters:
decrement If true, specify that the sequence should be decremented.
Returns:
this
    public SequenceConfig setDecrement(boolean decrement) {
        setDecrementVoid(decrement);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setDecrementVoid(boolean decrement) {
        this. = decrement;
    }

    
Returns true if the sequence is configured to decrement.

This method may be called at any time during the life of the application.

Returns:
true if the sequence is configured to decrement.
    public boolean getDecrement() {
         return ;
    }

    
Configures the Database.openSequence method to fail if the database already exists.

The default value is false.

This method may be called at any time during the life of the application.

Parameters:
exclusiveCreate If true, configure the Database.openSequence(com.sleepycat.je.Transaction,com.sleepycat.je.DatabaseEntry,com.sleepycat.je.SequenceConfig) method to fail if the database already exists.
Returns:
this
    public SequenceConfig setExclusiveCreate(boolean exclusiveCreate) {
        setExclusiveCreateVoid(exclusiveCreate);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setExclusiveCreateVoid(boolean exclusiveCreate) {
        this. = exclusiveCreate;
    }

    
Returns true if the Database.openSequence method is configured to fail if the database already exists.

This method may be called at any time during the life of the application.

Returns:
true if the Database.openSequence method is configured to fail if the database already exists.
    public boolean getExclusiveCreate() {
        return ;
    }

    
Sets the initial value for a sequence.

The default initial value is zero.

This call is only effective when the sequence is being created.

This method may be called at any time during the life of the application.

Parameters:
initialValue The initial value for a sequence. Must be within the range minimum and maximum values, inclusive.
Returns:
this
    public SequenceConfig setInitialValue(long initialValue) {
        setInitialValueVoid(initialValue);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setInitialValueVoid(long initialValue) {
        this. = initialValue;
    }

    
Returns the initial value for a sequence..

This method may be called at any time during the life of the application.

Returns:
The initial value for a sequence..
    public long getInitialValue() {
        return ;
    }

    
Configures auto-commit operations on the sequence to not flush the transaction log.

The default value is false.

This method may be called at any time during the life of the application.

Parameters:
autoCommitNoSync If true, configure auto-commit operations on the sequence to not flush the transaction log.
Returns:
this
    public SequenceConfig setAutoCommitNoSync(boolean autoCommitNoSync) {
        setAutoCommitNoSyncVoid(autoCommitNoSync);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setAutoCommitNoSyncVoid(boolean autoCommitNoSync) {
        this. = autoCommitNoSync;
    }

    
Returns true if the auto-commit operations on the sequence are configure to not flush the transaction log..

This method may be called at any time during the life of the application.

Returns:
true if the auto-commit operations on the sequence are configure to not flush the transaction log..
    public boolean getAutoCommitNoSync() {
        return ;
    }

    
Configures a sequence range. This call is only effective when the sequence is being created.

The default minimum is Long.MIN_VALUE and the default maximum is Long.MAX_VALUE.

Parameters:
min The minimum value for the sequence. Must be less than max.
max The maximum value for the sequence. Must be greater than min.
Returns:
this
    public SequenceConfig setRange(long minlong max) {
        setRangeMin(min);
        setRangeMax(max);
        return this;
    }
    
    

Parameters:
min The minimum value for the sequence. Must be less than max.
Returns:
this
Hidden:
Configures a sequence range minimum value. This call is only effective when the sequence is being created.

The default minimum is Long.MIN_VALUE

    public SequenceConfig setRangeMin(long min) {
        setRangeMinVoid(min);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setRangeMinVoid(long min) {
        this. = min;
    }
    
    

Parameters:
max The maximum value for the sequence. Must be greater than min.
Returns:
this
Hidden:
Configures a sequence range maximum value. This call is only effective when the sequence is being created.

the default maximum is Long.MAX_VALUE.

    public SequenceConfig setRangeMax(long max) {
        setRangeMaxVoid(max);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setRangeMaxVoid(long max) {
        this. = max;
    }

    
Returns the minimum value for the sequence.

This method may be called at any time during the life of the application.

Returns:
The minimum value for the sequence.
    public long getRangeMin() {
        return ;
    }

    
Returns the maximum value for the sequence.

This method may be called at any time during the life of the application.

Returns:
The maximum value for the sequence.
    public long getRangeMax() {
        return ;
    }

    
Specifies that the sequence should wrap around when it is incremented (decremented) past the specified maximum (minimum) value.

The default value is false.

This method may be called at any time during the life of the application.

Parameters:
wrap If true, specify that the sequence should wrap around when it is incremented (decremented) past the specified maximum (minimum) value.
Returns:
this
    public SequenceConfig setWrap(boolean wrap) {
        setWrapVoid(wrap);
        return this;
    }
    
    

Hidden:
The void return setter for use by Bean editors.
    public void setWrapVoid(boolean wrap) {
        this. = wrap;
    }

    
Returns true if the sequence will wrap around when it is incremented (decremented) past the specified maximum (minimum) value.

This method may be called at any time during the life of the application.

Returns:
true if the sequence will wrap around when it is incremented (decremented) past the specified maximum (minimum) value.
    public boolean getWrap() {
        return ;
    }

    
Returns a copy of this configuration object.
    @Override
    public SequenceConfig clone() {
        try {
            return (SequenceConfigsuper.clone();
        } catch (CloneNotSupportedException willNeverOccur) {
            return null;
        }
    }

    
Returns the values for each configuration attribute.

Returns:
the values for each configuration attribute.
    @Override
    public String toString() {
        return "allowCreate=" +  +
            "\ncacheSize=" +  +
            "\ndecrement=" +  +
            "\nexclusiveCreate=" +  +
            "\ninitialValue=" +  +
            "\nautoCommitNoSync=" +  +
            "\nrangeMin=" +  +
            "\nrangeMax=" +  +
            "\nwrap=" +  +
            "\n";
    }
New to GrepCode? Check out our FAQ X