MCPcopy Create free account
hub / github.com/Hypejet/Jet / get

Method get

api/src/main/java/net/hypejet/jet/util/array/NibbleArray.java:58–62  ·  view source on GitHub ↗

Gets a 4-bit unsigned value from this array at an index specified. @param index the index @return the value, as a byte @since 1.0

(@IntRange(from = 0, to = MAXIMUM_INDEX) long index)

Source from the content-addressed store, hash-verified

56 * @since 1.0
57 */
58 public @IntRange(from = 0, to = MAX_VALUE) byte get(@IntRange(from = 0, to = MAXIMUM_INDEX) long index) {
59 byte actualArrayValue = this.packedArray[createdPackedArrayIndex(index)];
60 byte bitShiftCount = createBitShiftCount(index);
61 return (byte) (actualArrayValue >>> bitShiftCount & MAX_VALUE);
62 }
63
64 /**
65 * Creates a copy of this {@linkplain NibbleArray nibble array}, with a replaced value at an index specified

Callers 4

testBuildingMethod · 0.95
testReplacingMethod · 0.95
withValueMethod · 0.95
testConversionMethod · 0.95

Calls 2

createBitShiftCountMethod · 0.95

Tested by 3

testBuildingMethod · 0.76
testReplacingMethod · 0.76
testConversionMethod · 0.76