public class KeyGroupRange extends Object implements KeyGroupsList, Serializable
Modifier and Type | Field and Description |
---|---|
static KeyGroupRange |
EMPTY_KEY_GROUP_RANGE
The empty key-group
|
Constructor and Description |
---|
KeyGroupRange(int startKeyGroup,
int endKeyGroup)
Defines the range [startKeyGroup, endKeyGroup]
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(int keyGroup)
Checks whether or not a single key-group is contained in the range.
|
boolean |
equals(Object o) |
int |
getEndKeyGroup() |
KeyGroupRange |
getIntersection(KeyGroupRange other)
Create a range that represent the intersection between this range and the given range.
|
int |
getKeyGroupId(int idx)
Returns the id of the keygroup at the given index, where index in interval [0,
KeyGroupsList.getNumberOfKeyGroups() [. |
int |
getNumberOfKeyGroups()
Returns the number of key group ids in the list.
|
int |
getStartKeyGroup() |
int |
hashCode() |
Iterator<Integer> |
iterator() |
static KeyGroupRange |
of(int startKeyGroup,
int endKeyGroup)
Factory method that also handles creation of empty key-groups.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final KeyGroupRange EMPTY_KEY_GROUP_RANGE
public KeyGroupRange(int startKeyGroup, int endKeyGroup)
startKeyGroup
- start of the range (inclusive)endKeyGroup
- end of the range (inclusive)public boolean contains(int keyGroup)
contains
in interface KeyGroupsList
keyGroup
- Key-group to check for inclusion.public KeyGroupRange getIntersection(KeyGroupRange other)
other
- A KeyGroupRange to intersect.public int getNumberOfKeyGroups()
KeyGroupsList
getNumberOfKeyGroups
in interface KeyGroupsList
public int getStartKeyGroup()
public int getEndKeyGroup()
public int getKeyGroupId(int idx)
KeyGroupsList
KeyGroupsList.getNumberOfKeyGroups()
[.getKeyGroupId
in interface KeyGroupsList
idx
- the index into the listpublic static KeyGroupRange of(int startKeyGroup, int endKeyGroup)
startKeyGroup
- start of the range (inclusive)endKeyGroup
- end of the range (inclusive)Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.