public enum Inclusion extends Enum<Inclusion>
For an example, take the series [1 2 3 4 5]
. If we select the range
(2, 4)
from this series, we will get the following results:
Enum Constant | Included Elements |
---|---|
START_INCLUSIVE_END_INCLUSIVE |
[2, 3, 4] |
START_INCLUSIVE_END_EXCLUSIVE |
[2, 3] |
START_EXCLUSIVE_END_INCLUSIVE |
[3, 4] |
START_EXCLUSIVE_END_EXCLUSIVE |
[3] |
Enum Constant and Description |
---|
START_EXCLUSIVE_END_EXCLUSIVE |
START_EXCLUSIVE_END_INCLUSIVE |
START_INCLUSIVE_END_EXCLUSIVE |
START_INCLUSIVE_END_INCLUSIVE |
Modifier and Type | Method and Description |
---|---|
boolean |
isEndInclusive()
Returns
true if the last element in the range should be
included, else false . |
boolean |
isStartInclusive()
Returns
true if the first element in the range should be
included, else false . |
static Inclusion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Inclusion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Inclusion START_INCLUSIVE_END_INCLUSIVE
public static final Inclusion START_INCLUSIVE_END_EXCLUSIVE
public static final Inclusion START_EXCLUSIVE_END_INCLUSIVE
public static final Inclusion START_EXCLUSIVE_END_EXCLUSIVE
public static Inclusion[] values()
for (Inclusion c : Inclusion.values()) System.out.println(c);
public static Inclusion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isStartInclusive()
true
if the first element in the range should be
included, else false
.true
if start is included, else false
public boolean isEndInclusive()
true
if the last element in the range should be
included, else false
.true
if end is included, else false
Copyright © 2017 Speedment, Inc.. All rights reserved.