org.eigenbase.sql.validate
Enum SqlMonotonicity

java.lang.Object
  extended by java.lang.Enum<SqlMonotonicity>
      extended by org.eigenbase.sql.validate.SqlMonotonicity
All Implemented Interfaces:
Serializable, Comparable<SqlMonotonicity>

public enum SqlMonotonicity
extends Enum<SqlMonotonicity>

Enumeration of types of monotonicity.

Since:
2007/9/4
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/SqlMonotonicity.java#4 $
Author:
jhyde

Enum Constant Summary
Constant
           
Decreasing
           
Increasing
           
NotMonotonic
           
StrictlyDecreasing
           
StrictlyIncreasing
           
 
Method Summary
 boolean isDecreasing()
          Whether values of this monotonicity are decreasing.
 boolean mayRepeat()
          Returns whether values of this monotonicity may ever repeat: true for NotMonotonic and Constant, false otherwise.
 SqlMonotonicity reverse()
          Returns the reverse monotonicity.
 SqlMonotonicity unstrict()
          If this is a strict monotonicity (StrictlyIncreasing, StrictlyDecreasing) returns the non-strict equivalent (Increasing, Decreasing).
static SqlMonotonicity valueOf(String name)
          Returns the enum constant of this type with the specified name.
static SqlMonotonicity[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

StrictlyIncreasing

public static final SqlMonotonicity StrictlyIncreasing

Increasing

public static final SqlMonotonicity Increasing

StrictlyDecreasing

public static final SqlMonotonicity StrictlyDecreasing

Decreasing

public static final SqlMonotonicity Decreasing

Constant

public static final SqlMonotonicity Constant

NotMonotonic

public static final SqlMonotonicity NotMonotonic
Method Detail

values

public static final SqlMonotonicity[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(SqlMonotonicity c : SqlMonotonicity.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static SqlMonotonicity valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name

unstrict

public SqlMonotonicity unstrict()
If this is a strict monotonicity (StrictlyIncreasing, StrictlyDecreasing) returns the non-strict equivalent (Increasing, Decreasing).

Returns:
non-strict equivalent monotonicity

reverse

public SqlMonotonicity reverse()
Returns the reverse monotonicity.

Returns:
reverse monotonicity

isDecreasing

public boolean isDecreasing()
Whether values of this monotonicity are decreasing. That is, if a value at a given point in a sequence is X, no point later in the sequence will have a value greater than X.

Returns:
whether values are decreasing

mayRepeat

public boolean mayRepeat()
Returns whether values of this monotonicity may ever repeat: true for NotMonotonic and Constant, false otherwise.

If a column is known not to repeat, a sort on that column can make progress before all of the input has been seen.

Returns:
whether values repeat