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/12/03 08:47:44 UTC

cvs commit: xml-fop/src/org/apache/fop/fo/pagination FoRegionBody.java FoRegionStartEnd.java FoSimplePageMaster.java FoRegionBeforeAfter.java FoLayoutMasterSet.java FoPageSequenceMaster.java

pbwest      2002/12/02 23:47:44

  Modified:    src/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design
                        FoRegionBody.java FoRegionStartEnd.java
                        FoSimplePageMaster.java FoRegionBeforeAfter.java
                        FoLayoutMasterSet.java FoPageSequenceMaster.java
  Log:
  Changed sparsePropsMap from HashMap to int[].
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +7 -6      xml-fop/src/org/apache/fop/fo/pagination/Attic/FoRegionBody.java
  
  Index: FoRegionBody.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoRegionBody.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoRegionBody.java	13 Nov 2002 04:15:19 -0000	1.1.2.4
  +++ FoRegionBody.java	3 Dec 2002 07:47:44 -0000	1.1.2.5
  @@ -22,6 +22,7 @@
   import org.apache.fop.datatypes.PropertyValue;
   import org.apache.fop.datatypes.Ints;
   
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.BitSet;
   
  @@ -38,7 +39,7 @@
           position in the <i>sparsePropsSet</i> array. See
           {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
        */
  -    private static final HashMap sparsePropsMap;
  +    private static final int[] sparsePropsMap;
   
       /** An <tt>int</tt> array of of the applicable property indices, in
           property index order. */
  @@ -67,7 +68,8 @@
           // sparsePropsSet is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        sparsePropsMap = new HashMap();
  +        sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(sparsePropsMap, -1);
           numProps = propsets.cardinality();
           sparseIndices = new int[numProps];
           int propx = 0;
  @@ -75,8 +77,7 @@
                   next >= 0;
                   next = propsets.nextSetBit(next + 1)) {
               sparseIndices[propx] = next;
  -            sparsePropsMap.put
  -                        (Ints.consts.get(next), Ints.consts.get(propx++));
  +            sparsePropsMap[next] = propx++;
           }
       }
   
  
  
  
  1.1.2.5   +7 -6      xml-fop/src/org/apache/fop/fo/pagination/Attic/FoRegionStartEnd.java
  
  Index: FoRegionStartEnd.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoRegionStartEnd.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoRegionStartEnd.java	13 Nov 2002 04:15:19 -0000	1.1.2.4
  +++ FoRegionStartEnd.java	3 Dec 2002 07:47:44 -0000	1.1.2.5
  @@ -22,6 +22,7 @@
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datatypes.Ints;
   
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.BitSet;
   
  @@ -38,7 +39,7 @@
           position in the <i>sparsePropsSet</i> array. See
           {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
        */
  -    protected static final HashMap sparsePropsMap;
  +    protected static final int[] sparsePropsMap;
   
       /** An <tt>int</tt> array of of the applicable property indices, in
           property index order. */
  @@ -66,15 +67,15 @@
           // sparsePropsSet is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        sparsePropsMap = new HashMap();
  +        sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(sparsePropsMap, -1);
           numProps = propsets.cardinality();
           sparseIndices = new int[numProps];
           for (int next = propsets.nextSetBit(0);
                   next >= 0;
                   next = propsets.nextSetBit(next + 1)) {
               sparseIndices[propx] = next;
  -            sparsePropsMap.put
  -                        (Ints.consts.get(next), Ints.consts.get(propx++));
  +            sparsePropsMap[next] = propx++;
           }
       }
   
  
  
  
  1.1.2.14  +7 -6      xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java
  
  Index: FoSimplePageMaster.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoSimplePageMaster.java,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- FoSimplePageMaster.java	1 Dec 2002 14:44:55 -0000	1.1.2.13
  +++ FoSimplePageMaster.java	3 Dec 2002 07:47:44 -0000	1.1.2.14
  @@ -25,6 +25,7 @@
   import org.apache.fop.datatypes.NCName;
   import org.apache.fop.datatypes.Ints;
   
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.BitSet;
   
  @@ -41,7 +42,7 @@
           position in the <i>sparsePropsSet</i> array.  See
           {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
        */
  -    private static final HashMap sparsePropsMap;
  +    private static final int[] sparsePropsMap;
   
       /** An <tt>int</tt> array of of the applicable property indices, in
           property index order. */
  @@ -64,7 +65,8 @@
           // sparsePropsSet is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        sparsePropsMap = new HashMap();
  +        sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(sparsePropsMap, -1);
           numProps = propsets.cardinality();
           sparseIndices = new int[numProps];
           int propx = 0;
  @@ -72,8 +74,7 @@
                   next >= 0;
                   next = propsets.nextSetBit(next + 1)) {
               sparseIndices[propx] = next;
  -            sparsePropsMap.put
  -                        (Ints.consts.get(next), Ints.consts.get(propx++));
  +            sparsePropsMap[next] = propx++;
           }
       }
   
  
  
  
  1.1.2.5   +7 -6      xml-fop/src/org/apache/fop/fo/pagination/Attic/FoRegionBeforeAfter.java
  
  Index: FoRegionBeforeAfter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoRegionBeforeAfter.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- FoRegionBeforeAfter.java	13 Nov 2002 04:15:19 -0000	1.1.2.4
  +++ FoRegionBeforeAfter.java	3 Dec 2002 07:47:44 -0000	1.1.2.5
  @@ -22,6 +22,7 @@
   import org.apache.fop.datastructs.TreeException;
   import org.apache.fop.datatypes.Ints;
   
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.BitSet;
   
  @@ -38,7 +39,7 @@
           position in the <i>sparsePropsSet</i> array. See
           {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
        */
  -    protected static final HashMap sparsePropsMap;
  +    protected static final int[] sparsePropsMap;
   
       /** An <tt>int</tt> array of of the applicable property indices, in
           property index order. */
  @@ -66,7 +67,8 @@
           // sparsePropsSet is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        sparsePropsMap = new HashMap();
  +        sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(sparsePropsMap, -1);
           numProps = propsets.cardinality();
           sparseIndices = new int[numProps];
           int propx = 0;
  @@ -74,8 +76,7 @@
                   next >= 0;
                   next = propsets.nextSetBit(next + 1)) {
               sparseIndices[propx] = next;
  -            sparsePropsMap.put
  -                        (Ints.consts.get(next), Ints.consts.get(propx++));
  +            sparsePropsMap[next] = propx++;
           }
       }
   
  
  
  
  1.1.2.19  +8 -5      xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java
  
  Index: FoLayoutMasterSet.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v
  retrieving revision 1.1.2.18
  retrieving revision 1.1.2.19
  diff -u -r1.1.2.18 -r1.1.2.19
  --- FoLayoutMasterSet.java	1 Dec 2002 14:44:55 -0000	1.1.2.18
  +++ FoLayoutMasterSet.java	3 Dec 2002 07:47:44 -0000	1.1.2.19
  @@ -1,12 +1,14 @@
   package org.apache.fop.fo.pagination;
   
   import java.util.Collection;
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.LinkedList;
   import java.util.Iterator;
   import java.util.NoSuchElementException;
   
   import org.apache.fop.apps.FOPException;
  +import org.apache.fop.fo.PropNames;
   import org.apache.fop.fo.FObjectNames;
   import org.apache.fop.fo.FOTree;
   import org.apache.fop.fo.FONode;
  @@ -45,7 +47,7 @@
           position in the <i>sparsePropsSet</i> array.  See
           {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
        */
  -    private static final HashMap sparsePropsMap;
  +    private static final int[] sparsePropsMap;
   
       /** An <tt>int</tt> array of of the applicable property indices, in
           property index order. */
  @@ -59,7 +61,8 @@
           // applicableProps is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        sparsePropsMap = new HashMap(0);
  +        sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(sparsePropsMap, -1);
           numProps = 0;
           sparseIndices = new int[] {};
       }
  
  
  
  1.1.2.17  +23 -24    xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java
  
  Index: FoPageSequenceMaster.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- FoPageSequenceMaster.java	1 Dec 2002 14:44:55 -0000	1.1.2.16
  +++ FoPageSequenceMaster.java	3 Dec 2002 07:47:44 -0000	1.1.2.17
  @@ -9,6 +9,7 @@
   
   package org.apache.fop.fo.pagination;
   
  +import java.util.Arrays;
   import java.util.HashMap;
   import java.util.BitSet;
   import java.util.NoSuchElementException;
  @@ -47,7 +48,7 @@
           position in the <i>sparsePropsSet</i> array.  See
           {@link org.apache.fop.fo.FONode#sparsePropsSet FONode.sparsePropsSet}.
        */
  -    private static final HashMap sparsePropsMap;
  +    private static final int[] sparsePropsMap;
   
       /** An <tt>int</tt> array of of the applicable property indices, in
           property index order. */
  @@ -61,16 +62,16 @@
           // applicableProps is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        sparsePropsMap = new HashMap(1);
  +        sparsePropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(sparsePropsMap, -1);
           numProps = 1;
           sparseIndices = new int[] { PropNames.MASTER_NAME };
  -        sparsePropsMap.put
  -            (Ints.consts.get(PropNames.MASTER_NAME), Ints.consts.get(0));
  +        sparsePropsMap[PropNames.MASTER_NAME] = 0;
       }
   
       /** Constant values for FoSinglePageMasterReference.
           See {@link #sparsePropsMap sparsePropsMap}. */
  -    private static final HashMap s_p_m_r_PropsMap;
  +    private static final int[] s_p_m_r_PropsMap;
   
       /** See {@link #sparseIndices sparseIndices}. */
       private static final int[] s_p_m_r_Indices;
  @@ -82,16 +83,15 @@
           // applicableProps is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        s_p_m_r_PropsMap = new HashMap(1);
  +        s_p_m_r_PropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(s_p_m_r_PropsMap, -1);
           s_p_m_r_numProps = 1;
           s_p_m_r_Indices = new int[] { PropNames.MASTER_REFERENCE };
  -        s_p_m_r_PropsMap.put
  -            (Ints.consts.get(PropNames.MASTER_REFERENCE),
  -                                                Ints.consts.get(0));
  +        s_p_m_r_PropsMap[PropNames.MASTER_REFERENCE] = 0;
       }
   
       /** See {@link #sparsePropsMap sparsePropsMap}. */
  -    private static final HashMap r_p_m_r_PropsMap;
  +    private static final int[] r_p_m_r_PropsMap;
   
       /** See {@link #sparseIndices sparseIndices}. */
       private static final int[] r_p_m_r_Indices;
  @@ -109,7 +109,8 @@
           // sparsePropsSet is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        r_p_m_r_PropsMap = new HashMap();
  +        r_p_m_r_PropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(r_p_m_r_PropsMap, -1);
           r_p_m_r_numProps = propsets.cardinality();
           r_p_m_r_Indices = new int[r_p_m_r_numProps];
           int propx = 0;
  @@ -117,13 +118,12 @@
                   next >= 0;
                   next = propsets.nextSetBit(next + 1)) {
               r_p_m_r_Indices[propx] = next;
  -            r_p_m_r_PropsMap.put
  -                        (Ints.consts.get(next), Ints.consts.get(propx++));
  +            r_p_m_r_PropsMap[next] = propx++;
           }
       }
   
       /** See {@link #sparsePropsMap sparsePropsMap}.  */
  -    private static final HashMap r_p_m_a_PropsMap;
  +    private static final int[] r_p_m_a_PropsMap;
   
       /** See {@link #sparseIndices sparseIndices}.  */
       private static final int[] r_p_m_a_Indices;
  @@ -132,16 +132,15 @@
       private static final int r_p_m_a_numProps;
   
       static {
  -        r_p_m_a_PropsMap = new HashMap(1);
  +        r_p_m_a_PropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(r_p_m_a_PropsMap, -1);
           r_p_m_a_numProps = 1;
           r_p_m_a_Indices = new int[] { PropNames.MAXIMUM_REPEATS };
  -        r_p_m_a_PropsMap.put
  -            (Ints.consts.get(PropNames.MAXIMUM_REPEATS),
  -                                                Ints.consts.get(0));
  +        r_p_m_a_PropsMap[PropNames.MAXIMUM_REPEATS] = 0;
       }
   
       /** See {@link #sparsePropsMap sparsePropsMap}. */
  -    private static final HashMap c_p_m_r_PropsMap;
  +    private static final int[] c_p_m_r_PropsMap;
   
       /** See {@link #sparseIndices sparseIndices}. */
       private static final int[] c_p_m_r_Indices;
  @@ -161,7 +160,8 @@
           // sparsePropsSet is a HashMap containing the indicies of the
           // sparsePropsSet array, indexed by the FO index of the FO slot
           // in sparsePropsSet.
  -        c_p_m_r_PropsMap = new HashMap();
  +        c_p_m_r_PropsMap = new int[PropNames.LAST_PROPERTY_INDEX + 1];
  +        Arrays.fill(c_p_m_r_PropsMap, -1);
           c_p_m_r_numProps = propsets.cardinality();
           c_p_m_r_Indices = new int[c_p_m_r_numProps];
           int propx = 0;
  @@ -169,8 +169,7 @@
                   next >= 0;
                   next = propsets.nextSetBit(next + 1)) {
               c_p_m_r_Indices[propx] = next;
  -            c_p_m_r_PropsMap.put
  -                    (Ints.consts.get(next), Ints.consts.get(propx++));
  +            c_p_m_r_PropsMap[next] = propx++;
           }
       }
   
  
  
  

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