You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by pb...@apache.org on 2002/05/07 17:11:15 UTC

cvs commit: xml-fop/src/org/apache/fop/configuration ConfigurationParser.java

pbwest      02/05/07 08:11:15

  Modified:    src/org/apache/fop/configuration Tag: FOP_0-20-0_Alt-Design
                        ConfigurationParser.java
  Log:
  Vector->ArrayList Hashtable->HashMap
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.9.4.1   +21 -21    xml-fop/src/org/apache/fop/configuration/ConfigurationParser.java
  
  Index: ConfigurationParser.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/configuration/ConfigurationParser.java,v
  retrieving revision 1.9
  retrieving revision 1.9.4.1
  diff -u -r1.9 -r1.9.4.1
  --- ConfigurationParser.java	30 Jul 2001 20:29:18 -0000	1.9
  +++ ConfigurationParser.java	7 May 2002 15:11:15 -0000	1.9.4.1
  @@ -1,5 +1,5 @@
   /*
  - * $Id: ConfigurationParser.java,v 1.9 2001/07/30 20:29:18 tore Exp $
  + * $Id: ConfigurationParser.java,v 1.9.4.1 2002/05/07 15:11:15 pbwest Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -14,8 +14,8 @@
   import org.xml.sax.Locator;
   
   // java
  -import java.util.Hashtable;
  -import java.util.Vector;
  +import java.util.HashMap;
  +import java.util.ArrayList;
   
   // fop
   import org.apache.fop.messaging.MessageHandler;
  @@ -45,12 +45,12 @@
       private int datatype = -1;
   
       // store the result configuration
  -    private static Hashtable configuration;
  -    private static Hashtable activeConfiguration;
  +    private static HashMap configuration;
  +    private static HashMap activeConfiguration;
   
       // stores key for new config entry
       private String key = "";
  -    private Vector keyStack = new Vector();
  +    private ArrayList keyStack = new ArrayList();
   
       // stores string value
       private String value = "";
  @@ -59,10 +59,10 @@
       private String subkey = "";
   
       // stores list value
  -    private Vector list = new Vector(15);
  +    private ArrayList list = new ArrayList(15);
   
       // stores hashtable value
  -    private Hashtable map = new Hashtable(15);
  +    private HashMap map = new HashMap(15);
   
       /**
        * locator for line number information
  @@ -75,7 +75,7 @@
       private String role = "standard";
   
       // stores fonts
  -    private Vector fontList = null;
  +    private ArrayList fontList = null;
   
       // stores information on one font
       private FontInfo fontInfo = null;
  @@ -86,7 +86,7 @@
       // information on a font
       private String fontName, metricsFile, embedFile, kerningAsString;
       private boolean kerning;
  -    private Vector fontTriplets;
  +    private ArrayList fontTriplets;
   
       // information on a font triplet
       private String fontTripletName, weight, style;
  @@ -125,7 +125,7 @@
               }
           } else if (localName.equals("configuration")) {}
           else if (localName.equals("fonts")) {    // list of fonts starts
  -            fontList = new Vector(10);
  +            fontList = new ArrayList(10);
           } else if (localName.equals("font")) {
               kerningAsString = attributes.getValue("kerning");
               if (kerningAsString.equalsIgnoreCase("yes")) {
  @@ -136,13 +136,13 @@
               metricsFile = attributes.getValue("metrics-file");
               embedFile = attributes.getValue("embed-file");
               fontName = attributes.getValue("name");
  -            fontTriplets = new Vector(5);
  +            fontTriplets = new ArrayList(5);
           } else if (localName.equals("font-triplet")) {
               fontTripletName = attributes.getValue("name");
               weight = attributes.getValue("weight");
               style = attributes.getValue("style");
               fontTriplet = new FontTriplet(fontTripletName, weight, style);
  -            fontTriplets.addElement(fontTriplet);
  +            fontTriplets.add(fontTriplet);
           } else {
               // to make sure that user knows about false tag
               MessageHandler.errorln("Unknown tag in configuration file: "
  @@ -168,10 +168,10 @@
               status = OUT;
               role = "standard";
               if (keyStack.size() > 0) {
  -                keyStack.removeElementAt(keyStack.size() - 1);
  +                keyStack.remove(keyStack.size() - 1);
               }
               if (keyStack.size() > 0) {
  -                key = (String)keyStack.elementAt(keyStack.size() - 1);
  +                key = (String)keyStack.get(keyStack.size() - 1);
               } else {
                   key = "";
               }
  @@ -180,17 +180,17 @@
               map.put(subkey, value);
               status -= IN_SUBENTRY;
               if (keyStack.size() > 0) {
  -                keyStack.removeElementAt(keyStack.size() - 1);
  +                keyStack.remove(keyStack.size() - 1);
               }
               if (keyStack.size() > 0) {
  -                key = (String)keyStack.elementAt(keyStack.size() - 1);
  +                key = (String)keyStack.get(keyStack.size() - 1);
               } else {
                   key = "";
               }
               value = "";
           } else if (localName.equals("key")) {
               status -= IN_KEY;
  -            keyStack.addElement(key);
  +            keyStack.add(key);
           } else if (localName.equals("list")) {
               status -= IN_LIST;
               value = "";
  @@ -201,7 +201,7 @@
           } else if (localName.equals("font")) {
               fontInfo = new FontInfo(fontName, metricsFile, kerning,
                                       fontTriplets, embedFile);
  -            fontList.addElement(fontInfo);
  +            fontList.add(fontInfo);
               fontTriplets = null;
               metricsFile = null;
               embedFile = null;
  @@ -230,7 +230,7 @@
               datatype = STRING;
               break;
           case IN_LIST + IN_VALUE:
  -            list.addElement(text);
  +            list.add(text);
               datatype = LIST;
               break;
           case IN_LIST + IN_SUBENTRY + IN_VALUE:
  @@ -248,7 +248,7 @@
        * @param value a string containing the value for the configuration
        */
       private void store(String role, String key, Object value) {
  -        activeConfiguration = (Hashtable)configuration.get(role);
  +        activeConfiguration = (HashMap)configuration.get(role);
           if (activeConfiguration != null) {
               activeConfiguration.put(key, value);
           } else {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org