make some fields private/final; add whitespace

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/pforcodec_3892@1357026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-07-04 00:43:04 +00:00
parent 1616749915
commit 21a6450e83
2 changed files with 30 additions and 16 deletions

View File

@ -67,21 +67,27 @@ public final class ForFactory extends IntStreamFactory {
// wrap input and output with buffer support
private class ForIndexInput extends FixedIntBlockIndexInput {
ForIndexInput(final IndexInput in) throws IOException {
super(in);
}
class ForBlockReader implements FixedIntBlockIndexInput.BlockReader {
byte[] encoded;
int[] buffer;
IndexInput in;
IntBuffer encodedBuffer;
private final byte[] encoded;
private final int[] buffer;
private final IndexInput in;
private final IntBuffer encodedBuffer;
ForBlockReader(final IndexInput in, final int[] buffer) {
this.encoded = new byte[blockSize*8+4];
this.in=in;
this.buffer=buffer;
this.encodedBuffer=ByteBuffer.wrap(encoded).asIntBuffer();
this.in = in;
this.buffer = buffer;
this.encodedBuffer = ByteBuffer.wrap(encoded).asIntBuffer();
}
public void seek(long pos) {}
public void seek(long pos) {
}
// TODO: implement public void skipBlock() {} ?
public void readBlock() throws IOException {
final int numBytes = in.readInt();
@ -90,6 +96,7 @@ public final class ForFactory extends IntStreamFactory {
ForUtil.decompress(encodedBuffer,buffer);
}
}
@Override
protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {
return new ForBlockReader(in,buffer);

View File

@ -67,21 +67,27 @@ public final class PForFactory extends IntStreamFactory {
// wrap input and output with buffer support
private class PForIndexInput extends FixedIntBlockIndexInput {
PForIndexInput(final IndexInput in) throws IOException {
super(in);
}
class PForBlockReader implements FixedIntBlockIndexInput.BlockReader {
byte[] encoded;
int[] buffer;
IndexInput in;
IntBuffer encodedBuffer;
private final byte[] encoded;
private final int[] buffer;
private final IndexInput in;
private final IntBuffer encodedBuffer;
PForBlockReader(final IndexInput in, final int[] buffer) {
this.encoded = new byte[blockSize*8+4];
this.in=in;
this.buffer=buffer;
this.encodedBuffer=ByteBuffer.wrap(encoded).asIntBuffer();
this.in = in;
this.buffer = buffer;
this.encodedBuffer = ByteBuffer.wrap(encoded).asIntBuffer();
}
public void seek(long pos) {}
public void seek(long pos) {
}
// TODO: implement public void skipBlock() {} ?
public void readBlock() throws IOException {
final int numBytes = in.readInt();
@ -90,6 +96,7 @@ public final class PForFactory extends IntStreamFactory {
PForUtil.decompress(encodedBuffer,buffer);
}
}
@Override
protected BlockReader getBlockReader(final IndexInput in, final int[] buffer) throws IOException {
return new PForBlockReader(in,buffer);