Package kmer.lab.core
Class ByteArraySlice
java.lang.Object
kmer.lab.core.ByteArraySlice
- Author:
- Finn Voichick, Dennis Cosgrove (http://www.cse.wustl.edu/~cosgroved/)
-
Constructor Summary
ConstructorsConstructorDescriptionByteArraySlice(byte[] originalUnslicedData, int minInclusive, int maxExclusive)Creates a new slice composed of the original unsliced data, an inclusive lower bound, and an exclusive upper bound. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidforEachIndex(CheckedIntConsumer body)Performs the given consumer for each index [min, maxExclusive).intGets the exclusive upper bound of the slice.intGets the inclusive lower bound of the slice.byte[]Gets the data associated with the slice.inthashCode()toString()
-
Constructor Details
-
ByteArraySlice
public ByteArraySlice(byte[] originalUnslicedData, int minInclusive, int maxExclusive)Creates a new slice composed of the original unsliced data, an inclusive lower bound, and an exclusive upper bound.- Parameters:
originalUnslicedData- context of what was slicedminInclusive- the inclusive lower boundmaxExclusive- the exclusive upper bound
-
-
Method Details
-
getOriginalUnslicedData
public byte[] getOriginalUnslicedData()Gets the data associated with the slice. This will typically be an array of which the slice is a section.- Returns:
- the original unsliced data associated with the slice
-
getMinInclusive
public int getMinInclusive()Gets the inclusive lower bound of the slice.- Returns:
- inclusive lower bound of the slice
-
getMaxExclusive
public int getMaxExclusive()Gets the exclusive upper bound of the slice.- Returns:
- exclusive upper bound of the slice
-
forEachIndex
Performs the given consumer for each index [min, maxExclusive).- Parameters:
body- the computation to be performed for each index- Throws:
InterruptedException- if the computation was cancelledExecutionException- if the computation threw an exception
-
hashCode
public int hashCode() -
equals
-
toString
-