com.atlassian.gadgets.dashboard
Enum DashboardState.ColumnIndex

java.lang.Object
  extended by java.lang.Enum<DashboardState.ColumnIndex>
      extended by com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex
All Implemented Interfaces:
Serializable, Comparable<DashboardState.ColumnIndex>
Enclosing class:
DashboardState

public static enum DashboardState.ColumnIndex
extends Enum<DashboardState.ColumnIndex>

There are a predetermined number of columns that a dashboard can contain, and ColumnIndex is the enumeration of those columns.


Enum Constant Summary
ONE
          The second, middle column (in a three column layout) on the dashboard
TWO
          The third, and last column (in a three column layout) on the dashboard
ZERO
          The first, left-most column on the dashboard.
 
Method Summary
static DashboardState.ColumnIndex from(int index)
          Returns the column index as an instance of ColumnIndex.
 boolean hasNext()
          Returns true if there are more possible columns after this one, false otherwise.
 int index()
          Returns the actual value of the ColumnIndex as an int.
 DashboardState.ColumnIndex next()
          Returns the next column index after this one if there is one, equivalent to doing i+1 when the index is an int.
static Iterable<DashboardState.ColumnIndex> range(DashboardState.ColumnIndex start, DashboardState.ColumnIndex end)
          Returns an immutable Iterable over ColumnIndexes starting from start and ending with end, inclusive.
static DashboardState.ColumnIndex valueOf(String name)
          Returns the enum constant of this type with the specified name.
static DashboardState.ColumnIndex[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ZERO

public static final DashboardState.ColumnIndex ZERO
The first, left-most column on the dashboard.


ONE

public static final DashboardState.ColumnIndex ONE
The second, middle column (in a three column layout) on the dashboard


TWO

public static final DashboardState.ColumnIndex TWO
The third, and last column (in a three column layout) on the dashboard

Method Detail

values

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

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

valueOf

public static DashboardState.ColumnIndex 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
NullPointerException - if the argument is null

index

public int index()
Returns the actual value of the ColumnIndex as an int.

Returns:
the actual value of the ColumnIndex as an int.

hasNext

public boolean hasNext()
Returns true if there are more possible columns after this one, false otherwise.

Returns:
true if there are more possible columns after this one, false otherwise.

next

public DashboardState.ColumnIndex next()
Returns the next column index after this one if there is one, equivalent to doing i+1 when the index is an int.

Returns:
the next column index after this one if there is one
Throws:
IllegalStateException - if this is the last possible ColumnIndex

from

public static DashboardState.ColumnIndex from(int index)
Returns the column index as an instance of ColumnIndex.

Parameters:
index - the value we want as a ColumnIndex
Returns:
the ColumnIndex that index corresponds to
Throws:
IllegalArgumentException - if index is outside the range of valid column indices.

range

public static Iterable<DashboardState.ColumnIndex> range(DashboardState.ColumnIndex start,
                                                         DashboardState.ColumnIndex end)
Returns an immutable Iterable over ColumnIndexes starting from start and ending with end, inclusive. Extremely useful for looping over columns using the foreach construct.

Parameters:
start - the first value to use in the Iterable
end - the last value to use in the Iterable
Returns:
an immutable Iterable over ColumnIndexes starting from start and ending with end, inclusive


Copyright © 2011 Atlassian. All Rights Reserved.