GlyphMappingTable mapping = (GlyphMappingTable) stp[6];
List entries = (List) stp[7];
if (tt == GlyphTable.GLYPH_TABLE_TYPE_DEFINITION) {
- int type = GDEFLookupType.getSubtableType(lt.intValue());
+ int type = GDEFLookupType.getSubtableType(lt);
String lid = "lu" + ln;
int sequence = sn;
int flags = lf;
GlyphCoverageTable coverage = (GlyphCoverageTable) stp[6];
List entries = (List) stp[7];
if (tt == GlyphTable.GLYPH_TABLE_TYPE_SUBSTITUTION) {
- int type = GSUBLookupType.getSubtableType(lt.intValue());
+ int type = GSUBLookupType.getSubtableType(lt);
String lid = "lu" + ln;
int sequence = sn;
int flags = lf;
GlyphCoverageTable coverage = (GlyphCoverageTable) stp[6];
List entries = (List) stp[7];
if (tt == GlyphTable.GLYPH_TABLE_TYPE_POSITIONING) {
- int type = GSUBLookupType.getSubtableType(lt.intValue());
+ int type = GSUBLookupType.getSubtableType(lt);
String lid = "lu" + ln;
int sequence = sn;
int flags = lf;
* @return the canonical NumberProperty
*/
public static NumberProperty getInstance(Double num) {
- return CACHE.fetch(new NumberProperty(num.doubleValue()));
+ return CACHE.fetch(new NumberProperty(num));
}
/**
* @return the canonical NumberProperty
*/
public static NumberProperty getInstance(Integer num) {
- return CACHE.fetch(new NumberProperty(num.intValue()));
+ return CACHE.fetch(new NumberProperty(num));
}
/**
if (this.unencodedCharacters != null) {
Set<Character> sortedKeys = new TreeSet<Character>(this.unencodedCharacters.keySet());
for (Character ch : sortedKeys) {
- char mapped = mapChar(ch.charValue());
+ char mapped = mapChar(ch);
assert mapped != Typeface.NOT_FOUND;
}
}
p.append("/Matrix [ ");
for (tempInt = 0; tempInt < vectorSize; tempInt++) {
p.append(PDFNumber.doubleOut(
- ((Double)this.matrix.get(tempInt)).doubleValue(), 8));
+ (Double) this.matrix.get(tempInt), 8));
p.append(" ");
}
p.append("] \n");
p.append("/Matrix [ ");
for (tempInt = 0; tempInt < vectorSize; tempInt++) {
p.append(PDFNumber.doubleOut(
- ((Double)this.matrix.get(tempInt)).doubleValue(), 8));
+ (Double) this.matrix.get(tempInt), 8));
p.append(" ");
}
p.append("] \n");
private String getGlyphName(Object obj) {
if (obj instanceof Character) {
- return Glyphs.charToGlyphName(((Character)obj).charValue());
+ return Glyphs.charToGlyphName((Character) obj);
} else {
throw new IllegalArgumentException(
"Value for glyph name part must be a Character but was: "
}
Object obj = params.get(fieldName);
if (obj instanceof Character) {
- sb.append(Integer.toHexString(((Character)obj).charValue()));
+ sb.append(Integer.toHexString((Character) obj));
} else if (obj instanceof Number) {
sb.append(Integer.toHexString(((Number)obj).intValue()));
} else {
int index = 0;
for (byte[] anExpected : expected) {
- for (int j = 0; j < anExpected.length; j++) {
- assertTrue("" + index, actual[index] == anExpected[j]);
+ for (byte anAnExpected : anExpected) {
+ assertTrue("" + index, actual[index] == anAnExpected);
index++;
}
}
public void testLineWidthCorrection() throws Exception {
parseConfig(createRenderer());
assertEquals(AFPConstants.LINE_WIDTH_CORRECTION,
- conf.getLineWidthCorrection().floatValue(), 0.0001f);
+ conf.getLineWidthCorrection(), 0.0001f);
parseConfig(createRenderer().setLineWidthCorrection(1f));
assertEquals(Float.valueOf(1f), conf.getLineWidthCorrection());
}
// Result processing
FormattingResults foResults = fop.getResults();
java.util.List pageSequences = foResults.getPageSequences();
- for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
- PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
+ for (Object pageSequence : pageSequences) {
+ PageSequenceResults pageSequenceResults = (PageSequenceResults) pageSequence;
System.out.println("PageSequence "
+ (String.valueOf(pageSequenceResults.getID()).length() > 0
- ? pageSequenceResults.getID() : "<no id>")
+ ? pageSequenceResults.getID() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
// Result processing
java.util.List pageSequences = foResults.getPageSequences();
- for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
- PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
+ for (Object pageSequence : pageSequences) {
+ PageSequenceResults pageSequenceResults = (PageSequenceResults) pageSequence;
System.out.println("PageSequence "
+ (String.valueOf(pageSequenceResults.getID()).length() > 0
- ? pageSequenceResults.getID() : "<no id>")
+ ? pageSequenceResults.getID() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
//Iterate over all area tree files
AreaTreeParser parser = new AreaTreeParser();
- for (int i = 0; i < files.length; i++) {
- Source src = new StreamSource(files[i]);
+ for (File file : files) {
+ Source src = new StreamSource(file);
parser.parse(src, treeModel, userAgent);
}
IFConcatenator concatenator = new IFConcatenator(targetHandler, null);
//Iterate over all intermediate files
- for (int i = 0; i < files.length; i++) {
- Source src = new StreamSource(files[i]);
+ for (File file : files) {
+ Source src = new StreamSource(file);
concatenator.appendDocument(src);
}
package embedding.model;
//Java
-import java.util.Iterator;
import java.io.IOException;
//SAX
handler.startElement("projectteam");
handler.element("projectname", projectTeam.getProjectName());
- Iterator i = projectTeam.getMembers().iterator();
- while (i.hasNext()) {
- ProjectMember member = (ProjectMember)i.next();
+ for (Object o : projectTeam.getMembers()) {
+ ProjectMember member = (ProjectMember) o;
generateFor(member);
}
handler.endElement("projectteam");
* @see org.xml.sax.XMLReader#getFeature(String)
*/
public boolean getFeature(java.lang.String name) {
- return ((Boolean) features.get(name)).booleanValue();
+ return (Boolean) features.get(name);
}
/**
* @see org.xml.sax.XMLReader#setFeature(String, boolean)
*/
public void setFeature(java.lang.String name, boolean value) {
- this.features.put(name, new Boolean(value));
+ this.features.put(name, value);
}
/**