Package com.atlassian.gadgets.dashboard
Enum Class DashboardState.ColumnIndex
java.lang.Object
java.lang.Enum<DashboardState.ColumnIndex>
com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex
- All Implemented Interfaces:
Serializable,Comparable<DashboardState.ColumnIndex>,Constable
- Enclosing class:
- DashboardState
There are a predetermined number of columns that a dashboard can contain, and
ColumnIndex is the enumeration
of those columns.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic DashboardState.ColumnIndexfrom(int index) Returns the columnindexas an instance ofColumnIndex.booleanhasNext()Returnstrueif there are more possible columns after this one,falseotherwise.intindex()Returns the actual value of theColumnIndexas anint.next()Returns the next column index after this one if there is one, equivalent to doing i+1 when the index is anint.static Iterable<DashboardState.ColumnIndex>Returns an immutableIterableoverColumnIndexes starting fromstartand ending withend, inclusive.static DashboardState.ColumnIndexReturns the enum constant of this class with the specified name.static DashboardState.ColumnIndex[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ZERO
The first, left-most column on the dashboard. -
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
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
index
public int index()Returns the actual value of theColumnIndexas anint.- Returns:
- the actual value of the
ColumnIndexas anint.
-
hasNext
public boolean hasNext()Returnstrueif there are more possible columns after this one,falseotherwise.- Returns:
trueif there are more possible columns after this one,falseotherwise.
-
next
Returns the next column index after this one if there is one, equivalent to doing i+1 when the index is anint.- Returns:
- the next column index after this one if there is one
- Throws:
IllegalStateException- if this is the last possibleColumnIndex
-
from
Returns the columnindexas an instance ofColumnIndex.- Parameters:
index- the value we want as aColumnIndex- Returns:
- the
ColumnIndexthatindexcorresponds to - Throws:
IllegalArgumentException- ifindexis outside the range of valid column indices.
-
range
public static Iterable<DashboardState.ColumnIndex> range(DashboardState.ColumnIndex start, DashboardState.ColumnIndex end) Returns an immutableIterableoverColumnIndexes starting fromstartand ending withend, inclusive. Extremely useful for looping over columns using the foreach construct.- Parameters:
start- the first value to use in theIterableend- the last value to use in theIterable- Returns:
- an immutable
IterableoverColumnIndexes starting fromstartand ending withend, inclusive
-