Exemplo n.º 1
0
 @Override
 public double get() {
   if (dimensions == 0) {
     return data[offset];
   } else {
     throw new UnsupportedOperationException(ErrorMessages.invalidIndex(this));
   }
 }
Exemplo n.º 2
0
 @Override
 public double get(int x, int y) {
   if (dimensions == 2) {
     return data[offset + x * getStride(0) + y * getStride(1)];
   } else {
     throw new UnsupportedOperationException(ErrorMessages.invalidIndex(this, x, y));
   }
 }
Exemplo n.º 3
0
 @Override
 public double get(int i) {
   if (i < 0 || (i >= length))
     throw new IndexOutOfBoundsException(ErrorMessages.invalidIndex(this, i));
   return 0.0;
 }