mkwan       2003/01/29 09:13:20

  Modified:    java/src/org/apache/xalan/xsltc/dom Tag: XSLTC_DTM
                        SAXImpl.java
               java/src/org/apache/xml/dtm/ref Tag: XSLTC_DTM
                        DTMDefaultBase.java DTMDefaultBaseIterators.java
                        DTMDefaultBaseTraversers.java
               java/src/org/apache/xml/dtm/ref/sax2dtm Tag: XSLTC_DTM
                        SAX2DTM.java
  Log:
  Make a clear distinction between m_initialblocksize and m_blocksize in 
DTMDefaultBase.
  m_initialblock is a static field which is used when the blocksize is not set.
  m_blocksize is an instance field which can be set by the user. The blocksize
  is passed from SAXImpl all the way down to DTMDefaultBase in constructors.
  After this change, the blocksize of the node arrays for RTFs will be 64 
rather than
  512 because the size 64 is passed to SAXImpl and also passed down to 
DTMDefaultBase.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.25  +9 -6      
xml-xalan/java/src/org/apache/xalan/xsltc/dom/Attic/SAXImpl.java
  
  Index: SAXImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/Attic/SAXImpl.java,v
  retrieving revision 1.1.2.24
  retrieving revision 1.1.2.25
  diff -u -r1.1.2.24 -r1.1.2.25
  --- SAXImpl.java      27 Jan 2003 19:45:12 -0000      1.1.2.24
  +++ SAXImpl.java      29 Jan 2003 17:13:17 -0000      1.1.2.25
  @@ -1022,7 +1022,7 @@
       static private final int DEFAULT_TEXT_FACTOR = 10;
   
       /**
  -     * Constructor - defaults to 32K nodes
  +     * Construct a SAXImpl object using the default block size.
        */
       public SAXImpl(DTMManager mgr, Source saxSource,
                    int dtmIdentity, DTMWSFilter whiteSpaceFilter,
  @@ -1030,17 +1030,20 @@
                    boolean doIndexing)
       {
         this(mgr, saxSource, dtmIdentity, whiteSpaceFilter, xstringfactory,
  -           doIndexing, DEFAULT_INIT_SIZE);
  +           doIndexing, m_initialblocksize);
       }
   
  +    /**
  +     * Construct a SAXImpl object using the given block size.
  +     */
       public SAXImpl(DTMManager mgr, Source saxSource,
                    int dtmIdentity, DTMWSFilter whiteSpaceFilter,
                    XMLStringFactory xstringfactory,
  -                 boolean doIndexing, int size)
  +                 boolean doIndexing, int blocksize)
       {
         super(mgr, saxSource, dtmIdentity, whiteSpaceFilter, xstringfactory,
  -            doIndexing);
  -      _size = size;
  +            doIndexing, blocksize);
  +      _size = blocksize;
         //initialize(size, size < 128 ? SMALL_TEXT_SIZE
         //                            : size * DEFAULT_TEXT_FACTOR);
                                     
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.12 +33 -9     
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java
  
  Index: DTMDefaultBase.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBase.java,v
  retrieving revision 1.28.2.11
  retrieving revision 1.28.2.12
  diff -u -r1.28.2.11 -r1.28.2.12
  --- DTMDefaultBase.java       27 Jan 2003 19:45:30 -0000      1.28.2.11
  +++ DTMDefaultBase.java       29 Jan 2003 17:13:18 -0000      1.28.2.12
  @@ -135,10 +135,10 @@
     protected int[][][] m_elemIndexes;
   
     /** The default initial block size of the node arrays */
  -  protected int m_initialblocksize = 512;  // favor small docs.
  +  protected static final int m_initialblocksize = 512;  // favor small docs.
   
  -  /** Size of blocks to allocate */
  -  protected int m_blocksize = 2 * 1024;
  +  /** The block size of the node arrays */
  +  protected final int m_blocksize;
   
     /**
      * The value to use when the information has not been built yet.
  @@ -194,6 +194,27 @@
     protected boolean m_indexing;
   
     /**
  +   * Construct a DTMDefaultBase object using the default block size.
  +   *
  +   * @param mgr The DTMManager who owns this DTM.
  +   * @param domSource the DOM source that this DTM will wrap.
  +   * @param source The object that is used to specify the construction 
source.
  +   * @param dtmIdentity The DTM identity ID for this DTM.
  +   * @param whiteSpaceFilter The white space filter for this DTM, which may
  +   *                         be null.
  +   * @param xstringfactory The factory to use for creating XMLStrings.
  +   * @param doIndexing true if the caller considers it worth it to use
  +   *                   indexing schemes.
  +   */
  +  public DTMDefaultBase(DTMManager mgr, Source source, int dtmIdentity,
  +                     DTMWSFilter whiteSpaceFilter,
  +                     XMLStringFactory xstringfactory, boolean doIndexing)
  +  {
  +    this(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
  +         doIndexing, m_initialblocksize);
  +  }
  +
  +  /**
      * Construct a DTMDefaultBase object from a DOM node.
      *
      * @param mgr The DTMManager who owns this DTM.
  @@ -205,16 +226,19 @@
      * @param xstringfactory The factory to use for creating XMLStrings.
      * @param doIndexing true if the caller considers it worth it to use
      *                   indexing schemes.
  +   * @param blocksize The block size of the DTM.
      */
     public DTMDefaultBase(DTMManager mgr, Source source, int dtmIdentity,
                           DTMWSFilter whiteSpaceFilter,
  -                        XMLStringFactory xstringfactory, boolean doIndexing)
  +                        XMLStringFactory xstringfactory, boolean doIndexing,
  +                        int blocksize)
     {
  -    m_exptype = new SuballocatedIntVector(m_initialblocksize);
  -    m_firstch = new SuballocatedIntVector(m_initialblocksize);
  -    m_nextsib = new SuballocatedIntVector(m_initialblocksize);
  -    m_prevsib = new SuballocatedIntVector(m_initialblocksize);
  -    m_parent = new SuballocatedIntVector(m_initialblocksize);
  +    m_blocksize = blocksize;
  +    m_exptype = new SuballocatedIntVector(blocksize);
  +    m_firstch = new SuballocatedIntVector(blocksize);
  +    m_nextsib = new SuballocatedIntVector(blocksize);
  +    m_prevsib = new SuballocatedIntVector(blocksize);
  +    m_parent  = new SuballocatedIntVector(blocksize);
   
       m_mgr = mgr;
       if(mgr instanceof DTMManagerDefault)
  
  
  
  1.12.2.13 +25 -0     
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java
  
  Index: DTMDefaultBaseIterators.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java,v
  retrieving revision 1.12.2.12
  retrieving revision 1.12.2.13
  diff -u -r1.12.2.12 -r1.12.2.13
  --- DTMDefaultBaseIterators.java      27 Jan 2003 19:45:31 -0000      
1.12.2.12
  +++ DTMDefaultBaseIterators.java      29 Jan 2003 17:13:18 -0000      
1.12.2.13
  @@ -96,6 +96,31 @@
     }
   
     /**
  +   * Construct a DTMDefaultBaseTraversers object from a DOM node.
  +   *
  +   * @param mgr The DTMManager who owns this DTM.
  +   * @param domSource the DOM source that this DTM will wrap.
  +   * @param source The object that is used to specify the construction 
source.
  +   * @param dtmIdentity The DTM identity ID for this DTM.
  +   * @param whiteSpaceFilter The white space filter for this DTM, which may
  +   *                         be null.
  +   * @param xstringfactory The factory to use for creating XMLStrings.
  +   * @param doIndexing true if the caller considers it worth it to use 
  +   *                   indexing schemes.
  +   * @param blocksize The block size of the DTM.
  +   */
  +  public DTMDefaultBaseIterators(DTMManager mgr, Source source,
  +                                 int dtmIdentity,
  +                                 DTMWSFilter whiteSpaceFilter,
  +                                 XMLStringFactory xstringfactory,
  +                                 boolean doIndexing,
  +                                 int blocksize)
  +  {
  +    super(mgr, source, dtmIdentity, whiteSpaceFilter, 
  +          xstringfactory, doIndexing, blocksize);
  +  }
  +
  +  /**
      * Get an iterator that can navigate over an XPath Axis, predicated by
      * the extended type ID.
      * Returns an iterator that must be initialized
  
  
  
  1.9.2.5   +25 -0     
xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java
  
  Index: DTMDefaultBaseTraversers.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java,v
  retrieving revision 1.9.2.4
  retrieving revision 1.9.2.5
  diff -u -r1.9.2.4 -r1.9.2.5
  --- DTMDefaultBaseTraversers.java     27 Jan 2003 19:45:31 -0000      1.9.2.4
  +++ DTMDefaultBaseTraversers.java     29 Jan 2003 17:13:18 -0000      1.9.2.5
  @@ -101,6 +101,31 @@
     }
   
     /**
  +   * Construct a DTMDefaultBaseTraversers object from a DOM node.
  +   *
  +   * @param mgr The DTMManager who owns this DTM.
  +   * @param domSource the DOM source that this DTM will wrap.
  +   * @param source The object that is used to specify the construction 
source.
  +   * @param dtmIdentity The DTM identity ID for this DTM.
  +   * @param whiteSpaceFilter The white space filter for this DTM, which may
  +   *                         be null.
  +   * @param xstringfactory The factory to use for creating XMLStrings.
  +   * @param doIndexing true if the caller considers it worth it to use
  +   *                   indexing schemes.
  +   * @param blocksize The block size of the DTM.
  +   */
  +  public DTMDefaultBaseTraversers(DTMManager mgr, Source source,
  +                                  int dtmIdentity,
  +                                  DTMWSFilter whiteSpaceFilter,
  +                                  XMLStringFactory xstringfactory,
  +                                  boolean doIndexing,
  +                                  int blocksize)
  +  {
  +    super(mgr, source, dtmIdentity, whiteSpaceFilter, xstringfactory,
  +          doIndexing, blocksize);
  +  }
  +
  +  /**
      * This returns a stateless "traverser", that can navigate
      * over an XPath axis, though perhaps not in document order.
      *
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.28.2.14 +27 -4     
xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java
  
  Index: SAX2DTM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java,v
  retrieving revision 1.28.2.13
  retrieving revision 1.28.2.14
  diff -u -r1.28.2.13 -r1.28.2.14
  --- SAX2DTM.java      27 Jan 2003 19:45:36 -0000      1.28.2.13
  +++ SAX2DTM.java      29 Jan 2003 17:13:20 -0000      1.28.2.14
  @@ -245,7 +245,28 @@
      */
     protected IntVector m_sourceColumn;
     
  +  /**
  +   * Construct a SAX2DTM object using the default block size.
  +   *
  +   * @param mgr The DTMManager who owns this DTM.
  +   * @param source the JAXP 1.1 Source object for this DTM.
  +   * @param dtmIdentity The DTM identity ID for this DTM.
  +   * @param whiteSpaceFilter The white space filter for this DTM, which may
  +   *                         be null.
  +   * @param xstringfactory XMLString factory for creating character content.
  +   * @param doIndexing true if the caller considers it worth it to use
  +   *                   indexing schemes.
  +   */
  +  public SAX2DTM(DTMManager mgr, Source source, int dtmIdentity,
  +                 DTMWSFilter whiteSpaceFilter,
  +                 XMLStringFactory xstringfactory,
  +                 boolean doIndexing)
  +  {
   
  +    this(mgr, source, dtmIdentity, whiteSpaceFilter,
  +          xstringfactory, doIndexing, m_initialblocksize);
  +  }
  +  
     /**
      * Construct a SAX2DTM object ready to be constructed from SAX2
      * ContentHandler events.
  @@ -258,25 +279,27 @@
      * @param xstringfactory XMLString factory for creating character content.
      * @param doIndexing true if the caller considers it worth it to use
      *                   indexing schemes.
  +   * @param blocksize The block size of the DTM.
      */
     public SAX2DTM(DTMManager mgr, Source source, int dtmIdentity,
                    DTMWSFilter whiteSpaceFilter,
                    XMLStringFactory xstringfactory,
  -                 boolean doIndexing)
  +                 boolean doIndexing,
  +                 int blocksize)
     {
   
       super(mgr, source, dtmIdentity, whiteSpaceFilter,
  -          xstringfactory, doIndexing);
  +          xstringfactory, doIndexing, blocksize);
   
             
       // %REVIEW%  Initial size pushed way down to reduce weight of RTFs
       // (I'm not entirely sure 0 would work, so I'm playing it safe for now.)
       //m_data = new SuballocatedIntVector(doIndexing ? (1024*2) : 512, 1024);
  -    m_data = new SuballocatedIntVector(m_initialblocksize);
  +    m_data = new SuballocatedIntVector(blocksize);
   
       m_data.addElement(0);   // Need placeholder in case index into here must 
be <0.
   
  -    m_dataOrQName = new SuballocatedIntVector(m_initialblocksize);
  +    m_dataOrQName = new SuballocatedIntVector(blocksize);
       
       // 
m_useSourceLocationProperty=org.apache.xalan.processor.TransformerFactoryImpl.m_source_location;
       m_useSourceLocationProperty = m_source_location;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to