Skip to content

Commit

Permalink
Add missing Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jan 4, 2025
1 parent 22c22a1 commit b68d9c6
Showing 1 changed file with 40 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,19 @@ public static final class BackReference extends Block {
private final int offset;
private final int length;

/**
* Constructs a new instance.
*
* @param offset the offset of the back-reference.
* @param length the offset of the back-reference.
*/
public BackReference(final int offset, final int length) {
this.offset = offset;
this.length = length;
}

/**
* Provides the length of the back-reference.
* Gets the offset of the back-reference.
*
* @return the length
*/
Expand All @@ -101,7 +107,7 @@ public int getLength() {
}

/**
* Provides the offset of the back-reference.
* Gets the offset of the back-reference.
*
* @return the offset
*/
Expand Down Expand Up @@ -129,11 +135,31 @@ public String toString() {
* </p>
*/
public abstract static class Block {

/** Enumeration of the block types the compressor may emit. */
public enum BlockType {
LITERAL, BACK_REFERENCE, EOD

/**
* The literal block type.
*/
LITERAL,

/**
* The back-reference block type.
*/
BACK_REFERENCE,

/**
* The end-of-data block type.
*/
EOD
}

/**
* Gets the the block type.
*
* @return the the block type.
*/
public abstract BlockType getType();
}

Expand Down Expand Up @@ -177,17 +203,24 @@ public static final class LiteralBlock extends Block {
private final int offset;
private final int length;

/**
* Constructs a new instance.
*
* @param data the literal data.
* @param offset the length of literal block.
* @param length the length of literal block.
*/
public LiteralBlock(final byte[] data, final int offset, final int length) {
this.data = data;
this.offset = offset;
this.length = length;
}

/**
* The literal data.
* Gets the literal data.
*
* <p>
* This returns a life view of the actual data in order to avoid copying, modify the array at your own risk.
* This returns a live view of the actual data in order to avoid copying, modify the array at your own risk.
* </p>
*
* @return the data
Expand All @@ -197,7 +230,7 @@ public byte[] getData() {
}

/**
* Length of literal block.
* Gets the length of literal block.
*
* @return the length
*/
Expand All @@ -206,7 +239,7 @@ public int getLength() {
}

/**
* Offset into data where the literal block starts.
* Gets the length of literal block.
*
* @return the offset
*/
Expand Down

0 comments on commit b68d9c6

Please sign in to comment.