* sequence it will return its EBCDIC code-point, however, the "Shift In - Shift Out" operators
* are removed from the sequence of bytes. These are only used in Line Data.
*/
- private final static class EbcdicDoubleByteEncoder extends CharactersetEncoder {
+ private static final class EbcdicDoubleByteEncoder extends CharactersetEncoder {
private EbcdicDoubleByteEncoder(String encoding) {
super(encoding);
}
* the primary format for most Latin character sets. This can also be used for Unicode double-
* byte character sets (DBCS).
*/
- private final static class DefaultEncoder extends CharactersetEncoder {
+ private static final class DefaultEncoder extends CharactersetEncoder {
private DefaultEncoder(String encoding) {
super(encoding);
}
/**
* A container for encoded character bytes
*/
- public static class EncodedChars {
+ public static final class EncodedChars {
- final private byte[] bytes;
+ private final byte[] bytes;
- final private int offset;
+ private final int offset;
- final private int length;
+ private final int length;
private EncodedChars(byte[] bytes, int offset, int length) {
- if (offset < 0) throw new IllegalArgumentException();
+ if (offset < 0) {
+ throw new IllegalArgumentException();
+ }
- if (length < 0) throw new IllegalArgumentException();
+ if (length < 0) {
+ throw new IllegalArgumentException();
+ }
- if (offset + length > bytes.length) throw new IllegalArgumentException();
+ if (offset + length > bytes.length) {
+ throw new IllegalArgumentException();
+ }
this.bytes = bytes;
* write <code>length</code> bytes from <code>offset</code> to the output stream
*
* @param out output to write the bytes to
+ * @param offset the offset where to write
+ * @param length the length to write
* @throws IOException if an I/O error occurs
*/
public void writeTo(OutputStream out, int offset, int length) throws IOException {
- if (offset < 0) throw new IllegalArgumentException();
+ if (offset < 0) {
+ throw new IllegalArgumentException();
+ }
- if (length < 0) throw new IllegalArgumentException();
+ if (length < 0) {
+ throw new IllegalArgumentException();
+ }
- if (offset + length > this.length) throw new IllegalArgumentException();
+ if (offset + length > this.length) {
+ throw new IllegalArgumentException();
+ }
out.write(bytes, this.offset + offset, length);
}
/**
* The number of containing bytes.
*
- * @return
+ * @return the length
*/
public int getLength() {
return length;
baout.writeTo(out);
}
- private void write(byte[] data, int offset, int length) {
- baout.write(data, offset, length);
- }
-
private void writeByte(int data) {
baout.write(data);
}
currentX = -1;
}
- private static final int TRANSPARENT_MAX_SIZE = 253;
-
/**
* The Transparent Data control sequence contains a sequence of code points
* that are presented without a scan for embedded control sequences. If the data is larger
* than fits in one chunk, additional chunks are automatically generated.
*
- * @param data The text data to add.
+ * @param encodedChars The encoded text data to add.
* @throws IOException if an I/O error occurs
*/
public void addTransparentData(EncodedChars encodedChars) throws IOException {
- private void addTransparentDataChunk(EncodedChars encodedChars, int offset, int length) throws IOException {
+ private void addTransparentDataChunk(EncodedChars encodedChars, int offset, int length)
+ throws IOException {
newControlSequence();
encodedChars.writeTo(baout, offset, length);
commit(chained(TRN));
private static Log log = LogFactory.getLog(InstalledFontCollection.class);
- private static final Set HARDCODED_FONT_NAMES;
+ private static final Set<String> HARDCODED_FONT_NAMES;
static {
- HARDCODED_FONT_NAMES = new java.util.HashSet();
+ HARDCODED_FONT_NAMES = new java.util.HashSet<String>();
HARDCODED_FONT_NAMES.add("any");
HARDCODED_FONT_NAMES.add("sans-serif");
HARDCODED_FONT_NAMES.add("serif");
}
/** Required by new instances of FontMetricsMapper */
- final private Java2DFontMetrics java2DFontMetrics;
+ private final Java2DFontMetrics java2DFontMetrics;
/**
* Main constructor