public class HCReader
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
HCReader.WithVars |
An
ObjectReader factory that creates reader that start by reading variables. |
| Constructor | Description |
|---|---|
HCReader() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> ObjectReader<T> |
create(java.util.function.Supplier<? extends T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFrom2Ints(Int2Constructor<T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFrom3Ints(Int3Constructor<T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFrom4Ints(Int4Constructor<T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFrom5Ints(Int5Constructor<T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFrom6Ints(Int6Constructor<T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFrom7Ints(Int7Constructor<T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFromInt(java.util.function.Function<java.lang.Integer,? extends T> constructor) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static <T> ObjectReader<T> |
createFromInts(IntArrayConstructor<T> constructor,
int nbIntsToRead) |
Creates a new
ObjectReader that creates objects using the given constructor. |
static HCReader.WithVars |
withVars(java.lang.String... variableNames) |
Creates an
HCReader.WithVars initialized with the given variable names. |
public static <T> ObjectReader<T> create(java.util.function.Supplier<? extends T> constructor)
ObjectReader that creates objects using the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFromInt(java.util.function.Function<java.lang.Integer,? extends T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads an integer
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFrom2Ints(Int2Constructor<T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads 2 integers
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFrom3Ints(Int3Constructor<T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads 3 integers
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFrom4Ints(Int4Constructor<T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads 4 integers
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFrom5Ints(Int5Constructor<T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads 5 integers
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFrom6Ints(Int6Constructor<T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads 6 integers
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFrom7Ints(Int7Constructor<T> constructor)
ObjectReader that creates objects using the given constructor. This reader reads 7 integers
from the input in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesObjectReaderpublic static <T> ObjectReader<T> createFromInts(IntArrayConstructor<T> constructor, int nbIntsToRead)
ObjectReader that creates objects using the given constructor. This reader reads n integers
from the input and stores them in an array in order to call the given constructor.T - the type of objects that the new ObjectReader should createconstructor - the constructor to use to create new instancesnbIntsToRead - the number of integers to read from the input into the array passed to the constructor. Must be positive.ObjectReaderpublic static HCReader.WithVars withVars(java.lang.String... variableNames)
HCReader.WithVars initialized with the given variable names. From there, one can create a
reader constructing objects from some of these already stored variables instead of directly from the input.variableNames - the names of the variables to read. The number of variables passed here determines the number of tokens
consumed from the input.HCReader.WithVars initialized with a VariableReader for the given variables.