예제 #1
0
  @Override
  public int getInt(long i) {
    if (dataType() == Type.DOUBLE) {
      dirty.set(false);
      if (indexer instanceof DoubleIndexer) {
        return (int) ((DoubleIndexer) indexer).get(offset() + i);
      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        return other.get(offset() + i);
      }
    } else if (dataType() == Type.INT) {
      dirty.set(false);
      if (indexer instanceof IntIndexer) {
        return ((IntIndexer) indexer).get(offset() + i);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        return other.get(offset() + i);
      }
    } else {
      if (indexer instanceof FloatIndexer) {
        return (int) ((FloatIndexer) indexer).get(offset() + i);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        return other.get(offset() + i);
      }
    }
  }
예제 #2
0
  @Override
  public void put(long i, int element) {
    if (dataType() == Type.DOUBLE) {
      if (indexer instanceof DoubleIndexer) {
        ((DoubleIndexer) indexer).put(offset() + i, element);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        other.put(offset() + i, element);
      }
    } else if (dataType() == Type.INT) {
      if (indexer instanceof IntIndexer) {
        ((IntIndexer) indexer).put(offset() + i, element);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        other.put(offset() + i, element);
      }
    } else {
      if (indexer instanceof FloatIndexer) {
        ((FloatIndexer) indexer).put(offset() + i, element);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        other.put(offset() + i, element);
      }
    }

    dirty.set(true);
  }
예제 #3
0
  @Override
  public double getDouble(long i) {
    if (dataType() == Type.FLOAT) {
      dirty.set(false);
      if (indexer instanceof FloatIndexer) {
        return ((FloatIndexer) indexer).get(offset() + i);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        return (double) other.get(offset() + i);
      }
    } else if (dataType() == Type.INT) {
      dirty.set(false);
      if (indexer instanceof IntIndexer) {
        return ((IntIndexer) indexer).get(offset() + i);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        return (double) other.get(offset() + i);
      }
    } else {
      dirty.set(false);
      if (indexer instanceof DoubleIndexer) {
        return ((DoubleIndexer) indexer).get(offset() + i);

      } else {
        UByteRawIndexer other = (UByteRawIndexer) indexer;
        return (double) other.get(offset() + i);
      }
    }
  }