bd-jb/src/com/bdjb/api/Int16.java

42 lines
744 B
Java
Raw Normal View History

2021-11-06 07:32:04 -04:00
/*
* Copyright (C) 2021 Andy Nguyen
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
package com.bdjb.api;
2021-11-13 03:38:01 -05:00
public final class Int16 extends AbstractInt {
2021-11-06 07:32:04 -04:00
public static final int SIZE = 2;
public Int16(int[] dimensions) {
super(dimensions, SIZE);
2021-11-06 07:32:04 -04:00
}
public Int16() {
super(SIZE);
2021-11-06 07:32:04 -04:00
}
public Int16(short value) {
this();
this.set(value);
}
public short get() {
return getShort(0x00);
2021-11-06 07:32:04 -04:00
}
public void set(short value) {
putShort(0x00, value);
2021-11-06 07:32:04 -04:00
}
public short get(int[] indices) {
return getShort(offset(indices));
2021-11-06 07:32:04 -04:00
}
public void set(int[] indices, short value) {
putShort(offset(indices), value);
2021-11-06 07:32:04 -04:00
}
}