public class VectorExtensions extends Object
| Constructor and Description |
|---|
VectorExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> |
addItem(io.vavr.collection.Vector<T> vector,
T item)
Adds - Appends a new item to the end of the vector.
|
static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> |
insertItem(io.vavr.collection.Vector<T> vector,
Integer index,
T item)
Inserts a new item into the vector, with additional bounds check.
|
static boolean |
outOfBounds(Integer itemCount,
Integer index)
Checks if the specified parameters are out of bounds.
|
static boolean |
outOfBounds(io.vavr.collection.Vector vector,
Integer index)
Checks if the specified parameters are out of bounds.
|
static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> |
removeItem(io.vavr.collection.Vector<T> vector,
Integer index)
Removes an item from the vector, with additional bounds check.
|
static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> |
replaceItem(io.vavr.collection.Vector<T> vector,
Integer index,
T item)
Replaces - Updates an item in the vector, with additional bounds check.
|
public static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> addItem(io.vavr.collection.Vector<T> vector,
T item)
T - The vector type.vector - The vector to add the item to.item - The item to add.public static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> insertItem(io.vavr.collection.Vector<T> vector,
Integer index,
T item)
T - The vector type.vector - The vector to insert the item into.index - The index to insert the item at.item - The item to insert.public static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> removeItem(io.vavr.collection.Vector<T> vector,
Integer index)
T - The vector type.vector - The vector to remove the item from.index - The index to remove the item at.public static <T> io.vavr.control.Try<io.vavr.collection.Vector<T>> replaceItem(io.vavr.collection.Vector<T> vector,
Integer index,
T item)
T - The vector type.vector - The vector to replace the item in.index - The index of the item to replace.item - The new item.public static boolean outOfBounds(io.vavr.collection.Vector vector,
Integer index)
vector - The vector to check.index - The required index.Copyright © 2017. All rights reserved.