@Override public long getLongPosition( final int dim ) { return getCell().indexToGlobalPosition( index, dim ); }
@Override public void localize( final long[] position ) { getCell().indexToGlobalPosition( index, position ); }
@Override public void localize( final long[] position ) { getCell().indexToGlobalPosition( index, position ); }
@Override public long getLongPosition( final int dim ) { return getCell().indexToGlobalPosition( index, dim ); }
/** * Move cursor right before the first element of the next cell. Update type * and index variables. */ private void moveToNextCell() { cursorOnCells.fwd(); isNotLastCell = cursorOnCells.hasNext(); lastIndexInCell = ( int ) ( getCell().size() - 1 ); index = -1; type.updateContainer( this ); } }
/** * Move cursor right before the first element of the next cell. Update type * and index variables. */ private void moveToNextCell() { cursorOnCells.fwd(); isNotLastCell = cursorOnCells.hasNext(); lastIndexInCell = ( int ) ( getCell().size() - 1 ); index = -1; type.updateContainer( this ); } }
@Override public void jumpFwd( final long steps ) { long newIndex = index + steps; while ( newIndex > lastIndexInCell ) { newIndex -= lastIndexInCell + 1; cursorOnCells.fwd(); isNotLastCell = cursorOnCells.hasNext(); lastIndexInCell = ( int ) ( getCell().size() - 1 ); } index = ( int ) newIndex; type.updateIndex( index ); type.updateContainer( this ); }
@Override public void jumpFwd( final long steps ) { long newIndex = index + steps; while ( newIndex > lastIndexInCell ) { newIndex -= lastIndexInCell + 1; cursorOnCells.fwd(); isNotLastCell = cursorOnCells.hasNext(); lastIndexInCell = ( int ) ( getCell().size() - 1 ); } index = ( int ) newIndex; type.updateIndex( index ); type.updateContainer( this ); }