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) {
|
2021-11-13 04:54:47 -05:00
|
|
|
super(dimensions, SIZE);
|
2021-11-06 07:32:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public Int16() {
|
2021-11-13 04:54:47 -05:00
|
|
|
super(SIZE);
|
2021-11-06 07:32:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public Int16(short value) {
|
|
|
|
this();
|
|
|
|
this.set(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public short get() {
|
2021-11-13 04:54:47 -05:00
|
|
|
return getShort(0x00);
|
2021-11-06 07:32:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void set(short value) {
|
2021-11-13 04:54:47 -05:00
|
|
|
putShort(0x00, value);
|
2021-11-06 07:32:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public short get(int[] indices) {
|
2021-11-13 04:54:47 -05:00
|
|
|
return getShort(offset(indices));
|
2021-11-06 07:32:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public void set(int[] indices, short value) {
|
2021-11-13 04:54:47 -05:00
|
|
|
putShort(offset(indices), value);
|
2021-11-06 07:32:04 -04:00
|
|
|
}
|
|
|
|
}
|