String line;
int n;
// singleton map - derived from single char entry
- Map/*<Integer,List>*/ sm = new HashMap/*<Integer,List>*/();
+ Map<Integer, List> sm = new HashMap<Integer, List>();
// interval map - derived from pair of block endpoint entries
- Map/*<String,int[3]>*/ im = new HashMap/*<String,int[3]>*/();
+ Map<String, Integer[]> im = new HashMap<String, Integer[]>();
if (verbose) {
System.out.print("Reading bidi type data...");
}
td = (int[][]) tdl.toArray(new int [ tdl.size() ] []);
}
- private static void parseTypeProperties(String line, Map/*<Integer,List>*/ sm, Map/*<String,int[3]>*/ im) {
+ private static void parseTypeProperties(String line, Map<Integer, List> sm, Map<String, Integer[]> im) {
String[] sa = line.split(";");
if (sa.length >= 5) {
int uc = Integer.parseInt(sa[0], 16);
return sa[0].trim();
}
- private static List processTypeData(Map/*<Integer,List>*/ sm, Map/*<String,int[3]>*/ im, List tdl) {
+ private static List processTypeData(Map<Integer, List> sm, Map<String, Integer[]> im, List tdl) {
for (int i = BidiConstants.FIRST, k = BidiConstants.LAST; i <= k; i++) {
- Map/*<Integer,Integer>*/ rm = new TreeMap/*<Integer,Integer>*/();
+ Map<Integer, Integer> rm = new TreeMap<Integer, Integer>();
// populate intervals from singleton map
List sl = (List) sm.get(Integer.valueOf(i));
if (sl != null) {
return tdl;
}
- private static List extractRanges(Map/*<Integer,Integer>*/ rm) {
+ private static List extractRanges(Map<Integer, Integer> rm) {
List ranges = new ArrayList();
int sLast = 0;
int eLast = 0;
for (Iterator it = rm.entrySet().iterator(); it.hasNext(); ) {
- Map.Entry/*<Integer,Integer>*/ me = (Map.Entry/*<Integer,Integer>*/) it.next();
+ Map.Entry<Integer, Integer> me = (Map.Entry<Integer, Integer>) it.next();
int s = ((Integer) me.getKey()).intValue();
int e = ((Integer) me.getValue()).intValue();
if (s > eLast) {
}
private static List complementRanges(List ranges) {
- Map/*<Integer,Integer>*/ rm = new TreeMap/*<Integer,Integer>*/();
+ Map<Integer, Integer> rm = new TreeMap<Integer, Integer>();
for (Iterator it = ranges.iterator(); it.hasNext(); ) {
int[] r = (int[]) it.next();
rm.put(Integer.valueOf(r[0]), Integer.valueOf(r[1]));
int cs = 0;
List compRanges = new ArrayList(rm.size() + 1);
for (Iterator it = rm.entrySet().iterator(); it.hasNext(); ) {
- Map.Entry/*<Integer,Integer>*/ me = (Map.Entry/*<Integer,Integer>*/) it.next();
+ Map.Entry<Integer, Integer> me = (Map.Entry<Integer, Integer>) it.next();
s = ((Integer) me.getKey()).intValue();
e = ((Integer) me.getValue()).intValue();
if (s > cs) {
implements StructuredData, Completable, Startable {
/** list of objects contained within this container */
- protected List/*<StructuredDataObject>*/ objects
- = new java.util.ArrayList/*<StructuredDataObject>*/();
+ protected List objects = new java.util.ArrayList();
/** object is complete */
private boolean complete;
* @param graphicsContainer a graphics container
*/
public void addAll(AbstractGraphicsDrawingOrderContainer graphicsContainer) {
- Collection/*<StructuredDataObject>*/ objects = graphicsContainer.getObjects();
+ Collection objects = graphicsContainer.getObjects();
objects.addAll(objects);
}
private PresentationTextObject currentPresentationTextObject;
/** The list of objects within this resource container */
- protected List/*<AbstractStructuredObject>*/ objects = new java.util.ArrayList();
+ protected List objects = new java.util.ArrayList();
/** The page width */
private int width;
*/
protected List getTagLogicalElements() {
if (objects == null) {
- this.objects = new java.util.ArrayList/*<AbstractStructuredObject>*/();
+ this.objects = new java.util.ArrayList<AbstractStructuredObject>();
}
return this.objects;
}
/** {@inheritDoc} */
@Override
- protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream os)
+ protected void writeObjects(Collection objects, OutputStream os)
throws IOException {
writeObjects(objects, os, false);
}
* @param forceWrite true if writing should happen in any case
* @throws java.io.IOException an I/O exception of some sort has occurred.
*/
- protected void writeObjects(Collection/*<AbstractAFPObject>*/ objects, OutputStream os,
+ protected void writeObjects(Collection<AbstractAFPObject> objects, OutputStream os,
boolean forceWrite) throws IOException {
if (objects != null && objects.size() > 0) {
Iterator it = objects.iterator();
public final class ActiveEnvironmentGroup extends AbstractEnvironmentGroup {
/** The collection of MapCodedFont objects */
- private final List/*<MapCodedFonts>*/ mapCodedFonts
- = new java.util.ArrayList/*<MapCodedFonts>*/();
+ private final List<AbstractStructuredObject> mapCodedFonts
+ = new java.util.ArrayList<AbstractStructuredObject>();
/** the collection of MapPageSegments objects */
private List mapPageSegments;
public class MapCodedFont extends AbstractStructuredObject {
/** the collection of map coded fonts (maximum of 254) */
- private final List/*<FontDefinition>*/ fontList
- = new java.util.ArrayList/*<FontDefinition>*/();
+ private final List<FontDefinition> fontList
+ = new java.util.ArrayList<FontDefinition>();
/**
* Main constructor
*/
public class PageSegment extends AbstractNamedAFPObject {
- private List/*<AbstractAFPObject>*/ objects;
+ private List<AbstractAFPObject> objects;
/**
* Main constructor
*
* @return a list of objects contained within this page segment
*/
- public List/*<AbstractAFPObject>*/ getObjects() {
+ public List<AbstractAFPObject> getObjects() {
if (objects == null) {
objects = new java.util.ArrayList();
}
/**
* The presentation text data list
*/
- private List/*<PresentationTextData>*/ presentationTextDataList;
+ private List<PresentationTextData> presentationTextDataList;
private DefaultBuilder builder = new DefaultBuilder();
*/
private void startPresentationTextData() {
if (presentationTextDataList == null) {
- presentationTextDataList = new java.util.ArrayList/*<PresentationTextData>*/();
+ presentationTextDataList = new java.util.ArrayList<PresentationTextData>();
}
if (presentationTextDataList.size() == 0) {
currentPresentationTextData = new PresentationTextData(true);
/** the pre-process presentation objects contained in this resource environment group */
// never written
- // private List/*<PreprocessPresentationObject>*/ preProcessPresentationObjects;
+ // private List<PreprocessPresentationObject> preProcessPresentationObjects;
/** the resource environment group state */
private boolean complete;
public class ResourceGroup extends AbstractNamedAFPObject {
/** Set of resource uri */
- private final Set/*<String>*/ resourceSet = new java.util.HashSet/*<String>*/();
+ private final Set<AbstractNamedAFPObject> resourceSet = new java.util.HashSet<AbstractNamedAFPObject>();
/**
* Constructor for the ResourceGroup, this takes a
return resourceSet.size();
}
- /**
- * Returns true if the resource exists within this resource group,
- * false otherwise.
- *
- * @param uri the uri of the resource
- * @return true if the resource exists within this resource group
- */
- public boolean resourceExists(String uri) {
- return resourceSet.contains(uri);
- }
-
/** {@inheritDoc} */
public void writeStart(OutputStream os) throws IOException {
byte[] data = new byte[17];
/**
* Map of configured names of hyphenation pattern file names: ll_CC => name
*/
- private Map/*<String,String>*/ hyphPatNames;
+ private Map<String, String> hyphPatNames;
/**
* FOP has the ability, for some FO's, to continue processing even if the
* @return true if some adjustment is not zero; otherwise, false
*/
public boolean position(GlyphSequence gs, String script, String language, int fontSize, int[] widths, int[][] adjustments) {
- Map/*<LookupSpec,List<LookupTable>>*/ lookups = matchLookups(script, language, "*");
+ Map<LookupSpec, List<LookupTable>> lookups = matchLookups(script, language, "*");
if ((lookups != null) && (lookups.size() > 0)) {
ScriptProcessor sp = ScriptProcessor.getInstance(script);
return sp.position(this, gs, script, language, fontSize, lookups, widths, adjustments);
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
*/
public GlyphSequence substitute(GlyphSequence gs, String script, String language) {
GlyphSequence ogs;
- Map/*<LookupSpec,List<LookupTable>>*/ lookups = matchLookups(script, language, "*");
+ Map<LookupSpec, List<LookupTable>> lookups = matchLookups(script, language, "*");
if ((lookups != null) && (lookups.size() > 0)) {
ScriptProcessor sp = ScriptProcessor.getInstance(script);
ogs = sp.substitute(this, gs, script, language, lookups);
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
return ContextualSubtableFormat2.matches(ss, cdt, classes, offset, rv);
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
private void populate(List entries) {
}
}
/** {@inheritDoc} */
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
GlyphTable.resolveLookupReferences(rsa, lookupTables);
}
/** {@inheritDoc} */
* Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.
* @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables
*/
- public void resolveLookupReferences(Map/*<String,GlyphTable.LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, GlyphTable.LookupTable> lookupTables) {
}
/**
private GlyphTable gdef;
// map from lookup specs to lists of strings, each of which identifies a lookup table (consisting of one or more subtables)
- private Map/*<LookupSpec,List<String>>*/ lookups;
+ private Map<LookupSpec, List<String>> lookups;
// map from lookup identifiers to lookup tables
- private Map/*<String,LookupTable>*/ lookupTables;
+ private Map<String, LookupTable> lookupTables;
// cache for lookups matching
- private Map/*<LookupSpec,Map<LookupSpec,List<LookupTable>>>*/ matchedLookups;
+ private Map<LookupSpec, Map<LookupSpec, List<LookupTable>>> matchedLookups;
// if true, then prevent further subtable addition
private boolean frozen;
* @param gdef glyph definition table that applies
* @param lookups map from lookup specs to lookup tables
*/
- public GlyphTable(GlyphTable gdef, Map/*<LookupSpec,List<String>>*/ lookups) {
+ public GlyphTable(GlyphTable gdef, Map<LookupSpec, List<String>> lookups) {
if ((gdef != null) && !(gdef instanceof GlyphDefinitionTable)) {
throw new AdvancedTypographicTableFormatException("bad glyph definition table");
} else if (lookups == null) {
} else {
this.gdef = gdef;
this.lookups = lookups;
- this.lookupTables = new LinkedHashMap/*<String,List<LookupTable>>*/();
- this.matchedLookups = new HashMap/*<LookupSpec,Map<LookupSpec,List<LookupTable>>>*/();
+ this.lookupTables = new LinkedHashMap<String, LookupTable>();
+ this.matchedLookups = new HashMap<LookupSpec, Map<LookupSpec, List<LookupTable>>>();
}
}
* Obtain list of all lookup specifications.
* @return (possibly empty) list of all lookup specifications
*/
- public List/*<LookupSpec>*/ getLookups() {
+ public List<LookupSpec> getLookups() {
return matchLookupSpecs("*", "*", "*");
}
* lexicographic ordering follows the lookup list order.
* @return (possibly empty) ordered list of all lookup tables
*/
- public List/*<LookupTable>*/ getLookupTables() {
- TreeSet/*<String>*/ lids = new TreeSet/*<String>*/(lookupTables.keySet());
- List/*<LookupTable>*/ ltl = new ArrayList/*<LookupTable>*/(lids.size());
+ public List<LookupTable> getLookupTables() {
+ TreeSet<String> lids = new TreeSet<String>(lookupTables.keySet());
+ List<LookupTable> ltl = new ArrayList<LookupTable>(lids.size());
for (Object lid1 : lids) {
String lid = (String) lid1;
ltl.add(lookupTables.get(lid));
* @return table associated with lookup id or null if none
*/
public LookupTable getLookupTable(String lid) {
- return (LookupTable) lookupTables.get(lid);
+ return lookupTables.get(lid);
}
/**
// add subtable to this table's subtable collection
String lid = subtable.getLookupId();
if (lookupTables.containsKey(lid)) {
- LookupTable lt = (LookupTable) lookupTables.get(lid);
+ LookupTable lt = lookupTables.get(lid);
lt.addSubtable(subtable);
} else {
LookupTable lt = new LookupTable(lid, subtable);
* @param feature a feature identifier
* @return a (possibly empty) array of matching lookup specifications
*/
- public List/*<LookupSpec>*/ matchLookupSpecs(String script, String language, String feature) {
- Set/*<LookupSpec>*/ keys = lookups.keySet();
- List/*<LookupSpec>*/ matches = new ArrayList/*<LookupSpec>*/();
+ public List<LookupSpec> matchLookupSpecs(String script, String language, String feature) {
+ Set<LookupSpec> keys = lookups.keySet();
+ List<LookupSpec> matches = new ArrayList<LookupSpec>();
for (Object key : keys) {
LookupSpec ls = (LookupSpec) key;
if (!"*".equals(script)) {
* @param feature a feature identifier
* @return a (possibly empty) map from matching lookup specifications to lists of corresponding lookup tables
*/
- public Map/*<LookupSpec,List<LookupTable>>*/ matchLookups(String script, String language, String feature) {
+ public Map<LookupSpec, List<LookupTable>> matchLookups(String script, String language, String feature) {
LookupSpec lsm = new LookupSpec(script, language, feature, true, true);
- Map/*<LookupSpec,List<LookupTable>>*/ lm = (Map/*<LookupSpec,List<LookupTable>>*/) matchedLookups.get(lsm);
+ Map<LookupSpec, List<LookupTable>> lm = matchedLookups.get(lsm);
if (lm == null) {
lm = new LinkedHashMap();
- List/*<LookupSpec>*/ lsl = matchLookupSpecs(script, language, feature);
+ List<LookupSpec> lsl = matchLookupSpecs(script, language, feature);
for (Object aLsl : lsl) {
LookupSpec ls = (LookupSpec) aLsl;
lm.put(ls, findLookupTables(ls));
* @param ls a (non-null) lookup specification
* @return a (possibly empty) ordered list of lookup tables whose corresponding lookup specifications match the specified lookup spec
*/
- public List/*<LookupTable>*/ findLookupTables(LookupSpec ls) {
- TreeSet/*<LookupTable>*/ lts = new TreeSet/*<LookupTable>*/();
- List/*<String>*/ ids;
- if ((ids = (List/*<String>*/) lookups.get(ls)) != null) {
+ public List<LookupTable> findLookupTables(LookupSpec ls) {
+ TreeSet<LookupTable> lts = new TreeSet<LookupTable>();
+ List<String> ids;
+ if ((ids = lookups.get(ls)) != null) {
for (Object id : ids) {
String lid = (String) id;
LookupTable lt;
- if ((lt = (LookupTable) lookupTables.get(lid)) != null) {
+ if ((lt = lookupTables.get(lid)) != null) {
lts.add(lt);
}
}
}
- return new ArrayList/*<LookupTable>*/(lts);
+ return new ArrayList<LookupTable>(lts);
}
/**
* @param lookups a mapping from lookup specifications to lists of look tables from which to select lookup tables according to the specified features
* @return ordered array of assembled lookup table use specifications
*/
- public UseSpec[] assembleLookups(String[] features, Map/*<LookupSpec,List<LookupTable>>*/ lookups) {
- TreeSet/*<UseSpec>*/ uss = new TreeSet/*<UseSpec>*/();
+ public UseSpec[] assembleLookups(String[] features, Map<LookupSpec, List<LookupTable>> lookups) {
+ TreeSet<UseSpec> uss = new TreeSet<UseSpec>();
for (String feature : features) {
for (Object o : lookups.entrySet()) {
- Map.Entry/*<LookupSpec,List<LookupTable>>*/ e = (Map.Entry/*<LookupSpec,List<LookupTable>>*/) o;
- LookupSpec ls = (LookupSpec) e.getKey();
+ Map.Entry<LookupSpec, List<LookupTable>> e = (Map.Entry<LookupSpec, List<LookupTable>>) o;
+ LookupSpec ls = e.getKey();
if (ls.getFeature().equals(feature)) {
- List/*<LookupTable>*/ ltl = (List/*<LookupTable>*/) e.getValue();
+ List<LookupTable> ltl = e.getValue();
if (ltl != null) {
for (Object aLtl : ltl) {
LookupTable lt = (LookupTable) aLtl;
}
}
}
- return (UseSpec[]) uss.toArray(new UseSpec [ uss.size() ]);
+ return uss.toArray(new UseSpec [ uss.size() ]);
}
/**
* @param rsa array of rule sets
* @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables
*/
- public static void resolveLookupReferences(RuleSet[] rsa, Map/*<String,LookupTable>*/ lookupTables) {
+ public static void resolveLookupReferences(RuleSet[] rsa, Map<String, LookupTable> lookupTables) {
if ((rsa != null) && (lookupTables != null)) {
for (RuleSet rs : rsa) {
if (rs != null) {
private final String id; // lookup identifier
private final int idOrdinal; // parsed lookup identifier ordinal
- private final List/*<GlyphSubtable>*/ subtables; // list of subtables
+ private final List<GlyphSubtable> subtables; // list of subtables
private boolean doesSub; // performs substitutions
private boolean doesPos; // performs positioning
private boolean frozen; // if true, then don't permit further subtable additions
* @param id the lookup table's identifier
* @param subtables a pre-poplated list of subtables or null
*/
- public LookupTable(String id, List/*<GlyphSubtable>*/ subtables) {
+ public LookupTable(String id, List<GlyphSubtable> subtables) {
assert id != null;
assert id.length() != 0;
assert id.startsWith("lu");
this.id = id;
this.idOrdinal = Integer.parseInt(id.substring(2));
- this.subtables = new LinkedList/*<GlyphSubtable>*/();
+ this.subtables = new LinkedList<GlyphSubtable>();
if (subtables != null) {
for (Object subtable : subtables) {
GlyphSubtable st = (GlyphSubtable) subtable;
return (subtablesArray != null) ? subtablesArray : subtablesArrayEmpty;
} else {
if (doesSub) {
- return (GlyphSubtable[]) subtables.toArray(new GlyphSubstitutionSubtable [ subtables.size() ]);
+ return subtables.toArray(new GlyphSubstitutionSubtable [ subtables.size() ]);
} else if (doesPos) {
- return (GlyphSubtable[]) subtables.toArray(new GlyphPositioningSubtable [ subtables.size() ]);
+ return subtables.toArray(new GlyphPositioningSubtable [ subtables.size() ]);
} else {
return null;
}
// validate subtable to ensure consistency with current subtables
validateSubtable(subtable);
// insert subtable into ordered list
- for (ListIterator/*<GlyphSubtable>*/ lit = subtables.listIterator(0); lit.hasNext(); ) {
- GlyphSubtable st = (GlyphSubtable) lit.next();
+ for (ListIterator<GlyphSubtable> lit = subtables.listIterator(0); lit.hasNext(); ) {
+ GlyphSubtable st = lit.next();
int d;
if ((d = subtable.compareTo(st)) < 0) {
// insert within list
}
}
if (subtables.size() > 0) {
- GlyphSubtable st = (GlyphSubtable) subtables.get(0);
+ GlyphSubtable st = subtables.get(0);
if (!st.isCompatible(subtable)) {
throw new AdvancedTypographicTableFormatException("subtable " + subtable + " is not compatible with subtable " + st);
}
* lookup tables that appear in this lookup table's subtables.
* @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables
*/
- public void freezeSubtables(Map/*<String,LookupTable>*/ lookupTables) {
+ public void freezeSubtables(Map<String, LookupTable> lookupTables) {
if (!frozen) {
GlyphSubtable[] sta = getSubtables();
resolveLookupReferences(sta, lookupTables);
}
}
- private void resolveLookupReferences(GlyphSubtable[] subtables, Map/*<String,LookupTable>*/ lookupTables) {
+ private void resolveLookupReferences(GlyphSubtable[] subtables, Map<String, LookupTable> lookupTables) {
if (subtables != null) {
for (GlyphSubtable st : subtables) {
if (st != null) {
return sb.toString();
}
- private static List/*<GlyphSubtable>*/ makeSingleton(GlyphSubtable subtable) {
+ private static List<GlyphSubtable> makeSingleton(GlyphSubtable subtable) {
if (subtable == null) {
return null;
} else {
- List/*<GlyphSubtable>*/ stl = new ArrayList/*<GlyphSubtable>*/(1);
+ List<GlyphSubtable> stl = new ArrayList<GlyphSubtable>(1);
stl.add(subtable);
return stl;
}
* Resolve references to lookup tables.
* @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables
*/
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
if (lookupTables != null) {
String lid = "lu" + Integer.toString(lookupIndex);
- LookupTable lt = (LookupTable) lookupTables.get(lid);
+ LookupTable lt = lookupTables.get(lid);
if (lt != null) {
this.lookup = lt;
} else {
* Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.
* @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables
*/
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
if (lookups != null) {
for (RuleLookup l : lookups) {
if (l != null) {
* Resolve references to lookup tables, e.g., in RuleLookup, to the lookup tables themselves.
* @param lookupTables map from lookup table identifers, e.g. "lu4", to lookup tables
*/
- public void resolveLookupReferences(Map/*<String,LookupTable>*/ lookupTables) {
+ public void resolveLookupReferences(Map<String, LookupTable> lookupTables) {
if (rules != null) {
for (Rule r : rules) {
if (r != null) {
private GlyphSubstitutionTable gsub; // glyph substitution table
private GlyphPositioningTable gpos; // glyph positioning table
// transient parsing state
- private transient Map/*<String,Object[3]>*/ seScripts; // script-tag => Object[3] : { default-language-tag, List(language-tag), seLanguages }
- private transient Map/*<String,Object[2]>*/ seLanguages; // language-tag => Object[2] : { "f<required-feature-index>", List("f<feature-index>")
- private transient Map/*<String,List<String>>*/ seFeatures; // "f<feature-index>" => Object[2] : { feature-tag, List("lu<lookup-index>") }
+ private transient Map<String, Object> seScripts; // script-tag => Object[3] : { default-language-tag, List(language-tag), seLanguages }
+ private transient Map<String, Object> seLanguages; // language-tag => Object[2] : { "f<required-feature-index>", List("f<feature-index>")
+ private transient Map<String, Object> seFeatures; // "f<feature-index>" => Object[2] : { feature-tag, List("lu<lookup-index>") }
private transient GlyphMappingTable seMapping; // subtable entry mappings
private transient List seEntries; // subtable entry entries
private transient List seSubtables; // subtable entry subtables
if (fp != null) {
assert fp.length == 2;
String ft = (String) fp[0]; // feature tag
- List/*<String>*/ lul = (List) fp[1]; // list of lookup table ids
+ List<String> lul = (List) fp[1]; // list of lookup table ids
if ((ft != null) && (lul != null) && (lul.size() > 0)) {
GlyphTable.LookupSpec ls = new GlyphTable.LookupSpec(st, lt, ft);
lookups.put(ls, lul);
}
}
- private void constructLookupsFeatures(Map lookups, String st, String lt, List/*<String>*/ fids) {
+ private void constructLookupsFeatures(Map lookups, String st, String lt, List<String> fids) {
for (Object fid1 : fids) {
String fid = (String) fid1;
constructLookupsFeature(lookups, st, lt, fid);
}
}
- private void constructLookupsLanguage(Map lookups, String st, String lt, Map/*<String,Object[2]>*/ languages) {
+ private void constructLookupsLanguage(Map lookups, String st, String lt, Map<String, Object> languages) {
Object[] lp = (Object[]) languages.get(lt);
if (lp != null) {
assert lp.length == 2;
}
}
- private void constructLookupsLanguages(Map lookups, String st, List/*<String>*/ ll, Map/*<String,Object[2]>*/ languages) {
+ private void constructLookupsLanguages(Map lookups, String st, List<String> ll, Map<String, Object> languages) {
for (Object aLl : ll) {
String lt = (String) aLl;
constructLookupsLanguage(lookups, st, lt, languages);
}
private Map constructLookups() {
- Map/*<GlyphTable.LookupSpec,List<String>>*/ lookups = new java.util.LinkedHashMap();
+ Map<GlyphTable.LookupSpec, List<String>> lookups = new java.util.LinkedHashMap();
for (Object o : seScripts.keySet()) {
String st = (String) o;
Object[] sp = (Object[]) seScripts.get(st);
if (sp != null) {
assert sp.length == 3;
- Map/*<String,Object[2]>*/ languages = (Map) sp[2];
+ Map<String, Object> languages = (Map) sp[2];
if (sp[0] != null) { // default language
constructLookupsLanguage(lookups, st, (String) sp[0], languages);
}
}
private List constructGDEFSubtables() {
- List/*<GlyphDefinitionSubtable>*/ subtables = new java.util.ArrayList();
+ List<GlyphSubtable> subtables = new java.util.ArrayList();
if (seSubtables != null) {
for (Object seSubtable : seSubtables) {
Object[] stp = (Object[]) seSubtable;
}
private List constructGSUBSubtables() {
- List/*<GlyphSubtable>*/ subtables = new java.util.ArrayList();
+ List<GlyphSubtable> subtables = new java.util.ArrayList();
if (seSubtables != null) {
for (Object seSubtable : seSubtables) {
Object[] stp = (Object[]) seSubtable;
}
private List constructGPOSSubtables() {
- List/*<GlyphSubtable>*/ subtables = new java.util.ArrayList();
+ List<GlyphSubtable> subtables = new java.util.ArrayList();
if (seSubtables != null) {
for (Object seSubtable : seSubtables) {
Object[] stp = (Object[]) seSubtable;
};
private static class SubstitutionScriptContextTester implements ScriptContextTester {
- private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/();
+ private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>();
static {
testerMap.put("fina", new GlyphContextTester() {
public boolean test(String script, String language, String feature, GlyphSequence gs, int index, int flags) {
});
}
public GlyphContextTester getTester(String feature) {
- return (GlyphContextTester) testerMap.get(feature);
+ return testerMap.get(feature);
}
}
private static class PositioningScriptContextTester implements ScriptContextTester {
- private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/();
+ private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>();
public GlyphContextTester getTester(String feature) {
- return (GlyphContextTester) testerMap.get(feature);
+ return testerMap.get(feature);
}
}
};
private static class SubstitutionScriptContextTester implements ScriptContextTester {
- private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/();
+ private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>();
public GlyphContextTester getTester(String feature) {
- return (GlyphContextTester) testerMap.get(feature);
+ return testerMap.get(feature);
}
}
private static class PositioningScriptContextTester implements ScriptContextTester {
- private static Map/*<String,GlyphContextTester>*/ testerMap = new HashMap/*<String,GlyphContextTester>*/();
+ private static Map<String, GlyphContextTester> testerMap = new HashMap<String, GlyphContextTester>();
public GlyphContextTester getTester(String feature) {
- return (GlyphContextTester) testerMap.get(feature);
+ return testerMap.get(feature);
}
}
import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import org.apache.fop.complexscripts.fonts.GlyphDefinitionTable;
private final String script;
- private final Map/*<AssembledLookupsKey,GlyphTable.UseSpec[]>*/ assembledLookups;
+ private final Map<AssembledLookupsKey, GlyphTable.UseSpec[]> assembledLookups;
private static Map<String, ScriptProcessor> processors = new HashMap<String, ScriptProcessor>();
throw new IllegalArgumentException("script must be non-empty string");
} else {
this.script = script;
- this.assembledLookups = new HashMap/*<AssembledLookupsKey,GlyphTable.UseSpec[]>*/();
+ this.assembledLookups = new HashMap<AssembledLookupsKey, GlyphTable.UseSpec[]>();
}
}
* @param lookups a mapping from lookup specifications to glyph subtables to use for substitution processing
* @return the substituted (output) glyph sequence
*/
- public final GlyphSequence substitute(GlyphSubstitutionTable gsub, GlyphSequence gs, String script, String language, Map/*<LookupSpec,List<LookupTable>>>*/ lookups) {
+ public final GlyphSequence substitute(GlyphSubstitutionTable gsub, GlyphSequence gs, String script, String language,
+ Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups) {
return substitute(gs, script, language, assembleLookups(gsub, getSubstitutionFeatures(), lookups), getSubstitutionContextTester());
}
* with one 4-tuple for each element of glyph sequence
* @return true if some adjustment is not zero; otherwise, false
*/
- public final boolean position(GlyphPositioningTable gpos, GlyphSequence gs, String script, String language, int fontSize, Map/*<LookupSpec,List<LookupTable>>*/ lookups, int[] widths, int[][] adjustments) {
+ public final boolean position(GlyphPositioningTable gpos, GlyphSequence gs, String script, String language, int fontSize,
+ Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups, int[] widths, int[][] adjustments) {
return position(gs, script, language, fontSize, assembleLookups(gpos, getPositioningFeatures(), lookups), widths, adjustments, getPositioningContextTester());
}
* @param lookups a mapping from lookup specifications to lists of look tables from which to select lookup tables according to the specified features
* @return ordered array of assembled lookup table use specifications
*/
- public final GlyphTable.UseSpec[] assembleLookups(GlyphTable table, String[] features, Map/*<LookupSpec,List<LookupTable>>*/ lookups) {
+ public final GlyphTable.UseSpec[] assembleLookups(GlyphTable table, String[] features,
+ Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups) {
AssembledLookupsKey key = new AssembledLookupsKey(table, features, lookups);
GlyphTable.UseSpec[] usa;
if ((usa = assembledLookupsGet(key)) != null) {
}
private GlyphTable.UseSpec[] assembledLookupsGet(AssembledLookupsKey key) {
- return (GlyphTable.UseSpec[]) assembledLookups.get(key);
+ return assembledLookups.get(key);
}
private GlyphTable.UseSpec[] assembledLookupsPut(AssembledLookupsKey key, GlyphTable.UseSpec[] usa) {
private final GlyphTable table;
private final String[] features;
- private final Map/*<LookupSpec,List<LookupTable>>*/ lookups;
+ private final Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups;
- AssembledLookupsKey(GlyphTable table, String[] features, Map/*<LookupSpec,List<LookupTable>>*/ lookups) {
+ AssembledLookupsKey(GlyphTable table, String[] features, Map<GlyphTable.LookupSpec, List<GlyphTable.LookupTable>> lookups) {
this.table = table;
this.features = features;
this.lookups = lookups;
}
/** @return the extension attachments of this FObj. */
- public List/*<ExtensionAttachment>*/ getExtensionAttachments() {
+ public List<ExtensionAttachment> getExtensionAttachments() {
if (extensionAttachments == null) {
return Collections.EMPTY_LIST;
} else {
* @param row the row that has just been finished
* @param container the FO element holding the given row
*/
- void endRow(List/*<GridUnit>*/ row, TableCellContainer container);
+ void endRow(List<GridUnit> row, TableCellContainer container);
/**
* Receives notification of the start of a table-header/footer/body.
* The previously registered row, either in the header or the body(-ies), but not in
* the footer (handled separately).
*/
- private List/*<GridUnit>*/ previousRow;
+ private List<GridUnit> previousRow;
private boolean firstInTable;
- private List/*<GridUnit>*/ footerFirstRow;
+ private List<GridUnit> footerFirstRow;
/** The last currently registered footer row. */
- private List/*<GridUnit>*/ footerLastRow;
+ private List<GridUnit> footerLastRow;
private Resolver delegate;
private Resolver resolverInFooter;
- private List/*<ConditionalBorder>*/ leadingBorders;
+ private List<ConditionalBorder> leadingBorders;
- private List/*<ConditionalBorder>*/ trailingBorders;
+ private List<ConditionalBorder> trailingBorders;
/* TODO Temporary hack for resolved borders in header */
/* Currently the normal border is always used. */
- private List/*<GridUnit>*/ headerLastRow;
+ private List<GridUnit> headerLastRow;
/* End of temporary hack */
/**
* @param withLeadingTrailing
* @param withRest
*/
- void resolveBordersFirstRowInTable(List/*<GridUnit>*/ row, boolean withNormal,
+ void resolveBordersFirstRowInTable(List<GridUnit> row, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
assert firstInTable;
for (int i = 0; i < row.size(); i++) {
TableColumn column = table.getColumn(i);
- ((GridUnit) row.get(i)).integrateBorderSegment(
+ row.get(i).integrateBorderSegment(
CommonBorderPaddingBackground.BEFORE, column, withNormal,
withLeadingTrailing, withRest);
}
* @param rowBefore
* @param rowAfter
*/
- void resolveBordersBetweenRows(List/*<GridUnit>*/ rowBefore, List/*<GridUnit>*/ rowAfter) {
+ void resolveBordersBetweenRows(List<GridUnit> rowBefore, List<GridUnit> rowAfter) {
assert rowBefore != null && rowAfter != null;
for (int i = 0; i < rowAfter.size(); i++) {
- GridUnit gu = (GridUnit) rowAfter.get(i);
+ GridUnit gu = rowAfter.get(i);
if (gu.getRowSpanIndex() == 0) {
- GridUnit beforeGU = (GridUnit) rowBefore.get(i);
+ GridUnit beforeGU = rowBefore.get(i);
gu.resolveBorder(beforeGU, CommonBorderPaddingBackground.BEFORE);
}
}
}
/** Integrates the border-after of the part. */
- void resolveBordersLastRowInPart(List/*<GridUnit>*/ row, boolean withNormal,
+ void resolveBordersLastRowInPart(List<GridUnit> row, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
for (Object aRow : row) {
((GridUnit) aRow).integrateBorderSegment(CommonBorderPaddingBackground.AFTER,
* @param withLeadingTrailing
* @param withRest
*/
- void resolveBordersLastRowInTable(List/*<GridUnit>*/ row, boolean withNormal,
+ void resolveBordersLastRowInTable(List<GridUnit> row, boolean withNormal,
boolean withLeadingTrailing, boolean withRest) {
for (int i = 0; i < row.size(); i++) {
TableColumn column = table.getColumn(i);
- ((GridUnit) row.get(i)).integrateBorderSegment(CommonBorderPaddingBackground.AFTER,
+ row.get(i).integrateBorderSegment(CommonBorderPaddingBackground.AFTER,
column, withNormal, withLeadingTrailing, withRest);
}
}
*
* @param row
*/
- void integrateLeadingBorders(List/*<GridUnit>*/ row) {
+ void integrateLeadingBorders(List<GridUnit> row) {
for (int i = 0; i < table.getNumberOfColumns(); i++) {
- GridUnit gu = (GridUnit) row.get(i);
- ConditionalBorder border = (ConditionalBorder) leadingBorders.get(i);
+ GridUnit gu = row.get(i);
+ ConditionalBorder border = leadingBorders.get(i);
gu.integrateCompetingBorder(CommonBorderPaddingBackground.BEFORE, border,
false, true, true);
}
*
* @param row
*/
- void integrateTrailingBorders(List/*<GridUnit>*/ row) {
+ void integrateTrailingBorders(List<GridUnit> row) {
for (int i = 0; i < table.getNumberOfColumns(); i++) {
- GridUnit gu = (GridUnit) row.get(i);
- ConditionalBorder border = (ConditionalBorder) trailingBorders.get(i);
+ GridUnit gu = row.get(i);
+ ConditionalBorder border = trailingBorders.get(i);
gu.integrateCompetingBorder(CommonBorderPaddingBackground.AFTER, border,
false, true, true);
}
* @param row the row being finished
* @param container the containing element
*/
- void endRow(List/*<GridUnit>*/ row, TableCellContainer container) {
+ void endRow(List<GridUnit> row, TableCellContainer container) {
BorderSpecification borderStart = borderStartTableAndBody;
BorderSpecification borderEnd = borderEndTableAndBody;
// Resolve before- and after-borders for the table-row
private class ResolverInHeader extends Resolver {
- void endRow(List/*<GridUnit>*/ row, TableCellContainer container) {
+ void endRow(List<GridUnit> row, TableCellContainer container) {
super.endRow(row, container);
if (previousRow != null) {
resolveBordersBetweenRows(previousRow, row);
private class ResolverInFooter extends Resolver {
- void endRow(List/*<GridUnit>*/ row, TableCellContainer container) {
+ void endRow(List<GridUnit> row, TableCellContainer container) {
super.endRow(row, container);
if (footerFirstRow == null) {
footerFirstRow = row;
private boolean firstInBody = true;
- void endRow(List/*<GridUnit>*/ row, TableCellContainer container) {
+ void endRow(List<GridUnit> row, TableCellContainer container) {
super.endRow(row, container);
if (firstInTable) {
resolveBordersFirstRowInTable(row, true, true, true);
}
/** {@inheritDoc} */
- public void endRow(List/*<GridUnit>*/ row, TableCellContainer container) {
+ public void endRow(List<GridUnit> row, TableCellContainer container) {
delegate.endRow(row, container);
}
private int currentRowIndex;
/** The rows belonging to this row group. List of List of {@link GridUnit}s. */
- private List/*<List<GridUnit>>*/ rows;
+ private List<List<GridUnit>> rows;
private boolean firstInPart = true;
* @param fontInfo the font info
* @return a list of matching font triplets
*/
- protected List/*<FontTriplet>*/ match(FontInfo fontInfo) {
+ protected List<FontTriplet> match(FontInfo fontInfo) {
AttributeValue fontFamilyValue = getFontFamily();
AttributeValue weightValue = getFontWeight();
AttributeValue styleValue = getFontStyle();
- List/*<FontTriplet>*/ matchingTriplets = new java.util.ArrayList/*<FontTriplet>*/();
+ List<FontTriplet> matchingTriplets = new java.util.ArrayList<FontTriplet>();
// try to find matching destination font triplet
for (Object aFontFamilyValue : fontFamilyValue) {
String fontFamilyString = (String) aFontFamilyValue;
- Map/*<FontTriplet>*/ triplets = (Map/*<FontTriplet>*/) fontInfo.getFontTriplets();
+ Map<FontTriplet, String> triplets = fontInfo.getFontTriplets();
if (triplets != null) {
- Set/*<FontTriplet>*/ tripletSet = triplets.keySet();
+ Set<FontTriplet> tripletSet = triplets.keySet();
for (Object aTripletSet : tripletSet) {
FontTriplet triplet = (FontTriplet) aTripletSet;
String fontName = triplet.getName();
* @return the highest priority matching font triplet
*/
protected FontTriplet bestMatch(FontInfo fontInfo) {
- List/*<FontTriplet>*/ matchingTriplets = match(fontInfo);
+ List<FontTriplet> matchingTriplets = match(fontInfo);
FontTriplet bestTriplet = null;
if (matchingTriplets.size() == 1) {
- bestTriplet = (FontTriplet)matchingTriplets.get(0);
+ bestTriplet = matchingTriplets.get(0);
} else {
for (Object matchingTriplet : matchingTriplets) {
FontTriplet triplet = (FontTriplet) matchingTriplet;
/**
* @return a list of font triplets matching this qualifier
*/
- public List/*<FontTriplet>*/ getTriplets() {
- List/*<FontTriplet>*/ triplets = new java.util.ArrayList/*<FontTriplet>*/();
+ public List<FontTriplet> getTriplets() {
+ List<FontTriplet> triplets = new java.util.ArrayList<FontTriplet>();
AttributeValue fontFamilyValue = getFontFamily();
for (Object aFontFamilyValue : fontFamilyValue) {
/**
* Font substitutions
*/
-public class FontSubstitutions extends java.util.ArrayList/*<Substitutions>*/ {
+public class FontSubstitutions extends java.util.ArrayList<FontSubstitution> {
private static final long serialVersionUID = -9173104935431899722L;
* @param fontInfo font info
*/
public void adjustFontInfo(FontInfo fontInfo) {
- for (Iterator/*<FontSubstitution>*/ subsIt = super.iterator(); subsIt.hasNext();) {
- FontSubstitution substitution = (FontSubstitution)subsIt.next();
+ for (Iterator<FontSubstitution> subsIt = super.iterator(); subsIt.hasNext();) {
+ FontSubstitution substitution = subsIt.next();
// find the best matching font triplet
FontQualifier toQualifier = substitution.getToQualifier();
String internalFontKey = fontInfo.getInternalFontKey(fontTriplet);
FontQualifier fromQualifier = substitution.getFromQualifier();
- List/*<FontTriplet>*/ tripletList = fromQualifier.getTriplets();
+ List<FontTriplet> tripletList = fromQualifier.getTriplets();
for (Object aTripletList : tripletList) {
FontTriplet triplet = (FontTriplet) aTripletList;
fontInfo.addFontProperties(internalFontKey, triplet);
private final AbstractRenderer renderer;
private FOUserAgent userAgent;
- private final Map/*<String,Object>*/ props = new java.util.HashMap/*<String,Object>*/();
+ private final Map<String, Object> props = new java.util.HashMap<String, Object>();
/**
* Constructor for this class. It takes a MIME type as parameter.
* @param foreignAttributes the foreign attributes
* @return the resource information
*/
- public AFPResourceInfo getResourceInfo(Map/*<QName, String>*/ foreignAttributes) {
+ public AFPResourceInfo getResourceInfo(Map<QName, String> foreignAttributes) {
AFPResourceInfo resourceInfo = new AFPResourceInfo();
if (foreignAttributes != null && !foreignAttributes.isEmpty()) {
- String resourceName = (String) foreignAttributes.get(RESOURCE_NAME);
+ String resourceName = foreignAttributes.get(RESOURCE_NAME);
if (resourceName != null) {
resourceInfo.setName(resourceName);
}
originalIndex = ((SingleByteFont) font).getGIDFromChar(unicode);
writeUShort(hmtxTable, (softFontGlyphIndex) * 4,
- ((SingleByteFont) font).getWidth(originalIndex, 1));
+ font.getWidth(originalIndex, 1));
writeUShort(hmtxTable, (softFontGlyphIndex) * 4 + 2, 0);
}
}
private File xmlFile;
private File xsltFile;
private String xsltParams;
- private List/*<FileSet>*/ filesets = new java.util.ArrayList/*<FileSet>*/();
+ private List<FileSet> filesets = new java.util.ArrayList<FileSet>();
private File outFile;
private File outDir;
private String format; //MIME type
this.listeners.processEvent(event);
}
- private static List/*<EventModel>*/ eventModels = new java.util.ArrayList();
+ private static List<EventModel> eventModels = new java.util.ArrayList();
private Map proxies = new java.util.HashMap();
/**