public final class IntPath extends Object implements Comparable<IntPath>, Iterable<Integer>
| Modifier and Type | Method and Description |
|---|---|
IntPath |
appending(int value)
Create a new path appending the passed value.
|
IntPath |
childPath()
Create a new path, lopping off the first element.
|
int |
compareTo(IntPath o) |
boolean |
contains(int val)
Determine if this path contains the passed value.
|
boolean |
contains(IntPath path)
Determine if this path contains the subsequence in the passed path, or is
equal to it.
|
int |
end() |
boolean |
equals(Object o) |
int |
first()
Get the first path element
|
void |
forEachInt(IntConsumer c)
Iterate all elements of the path, passing them to the passed consumer.
|
void |
forEachIntReversed(IntConsumer c)
Iterate all elements of the path in reverse order, passing them to the
passed consumer.
|
int |
get(int index)
Get the path element at the specified index.
|
int |
hashCode() |
int |
indexOf(int val)
Get the first occurrence of the passed value in this path.
|
boolean |
isEmpty()
Determine if this path is empty.
|
boolean |
isNotAPath()
Determine if this path does not represent an actual path - if it has one
element or less.
|
int[] |
items()
Get the contents of this path as an int[].
|
void |
iterate(IntConsumer cons)
Deprecated.
use the better-named
forEachInt() |
Iterator<Integer> |
iterator() |
int |
last()
Get the last path element
|
int |
lastIndexOf(int val)
Get the first occurrence of the passed value in this path.
|
IntPath |
parentPath()
Create a new path, lopping off the last element.
|
IntPath |
prepending(int value)
Create a new path prepending the passed value.
|
IntPath |
reversed()
Create a new path whose elements are this one's in reverse order.
|
int |
size()
Get the number of elements in this path.
|
int |
start() |
<T> ObjectPath<T> |
toObjectPath(com.mastfrog.abstractions.list.IndexedResolvable<T> indexed) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic IntPath prepending(int value)
value - A valueIllegalArgumentException - if the value is negativepublic IntPath appending(int value)
value - A valueIllegalArgumentException - if the value is negativepublic void forEachInt(IntConsumer c)
c - A consumerpublic void forEachIntReversed(IntConsumer c)
c - A consumerpublic int first()
IndexOutOfBoundsException - if out of rangepublic int last()
IndexOutOfBoundsException - if out of rangepublic IntPath childPath()
public IntPath parentPath()
public IntPath reversed()
public int start()
public int end()
public boolean contains(IntPath path)
path - A pathpublic int indexOf(int val)
val - An integer path elementpublic int lastIndexOf(int val)
val - An integer path elementpublic boolean contains(int val)
val - A valuepublic boolean isEmpty()
public int size()
public boolean isNotAPath()
public int get(int index)
index - The index within the pathpublic int[] items()
@Deprecated public void iterate(IntConsumer cons)
forEachInt()cons - public <T> ObjectPath<T> toObjectPath(com.mastfrog.abstractions.list.IndexedResolvable<T> indexed)
public int compareTo(IntPath o)
compareTo in interface Comparable<IntPath>Copyright © 2010–2020 Mastfrog Technologies. All rights reserved.