< prev index next >

src/com/sun/org/apache/xerces/internal/impl/xs/XSDeclarationPool.java

Print this page
rev 2127 : 8048021: Remove @version tag in jaxp repo
Reviewed-by: joehw


  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.impl.xs;
  22 
  23 import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl;
  24 import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
  25 
  26 /**
  27  * This class is pool that enables caching of XML Schema declaration objects.
  28  * Before a compiled grammar object is garbage collected,
  29  * the implementation will add all XML Schema component
  30  * declarations to the pool.
  31  * Note: The cashing mechanism is not implemented yet.
  32  *
  33  * @xerces.internal
  34  *
  35  * @author Elena Litani, IBM
  36  * @version $Id: XSDeclarationPool.java,v 1.7 2010-11-01 04:39:55 joehw Exp $
  37  */
  38 public final class XSDeclarationPool {
  39     /** Chunk shift (8). */
  40     private static final int CHUNK_SHIFT = 8; // 2^8 = 256
  41 
  42     /** Chunk size (1 << CHUNK_SHIFT). */
  43     private static final int CHUNK_SIZE = 1 << CHUNK_SHIFT;
  44 
  45     /** Chunk mask (CHUNK_SIZE - 1). */
  46     private static final int CHUNK_MASK = CHUNK_SIZE - 1;
  47 
  48     /** Initial chunk count (). */
  49     private static final int INITIAL_CHUNK_COUNT = (1 << (10 - CHUNK_SHIFT)); // 2^10 = 1k
  50 
  51     /** Element declaration pool*/
  52     private XSElementDecl fElementDecl[][] = new XSElementDecl[INITIAL_CHUNK_COUNT][];
  53     private int fElementDeclIndex = 0;
  54 
  55     /** Particle declaration pool */
  56     private XSParticleDecl fParticleDecl[][] = new XSParticleDecl[INITIAL_CHUNK_COUNT][];




  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.impl.xs;
  22 
  23 import com.sun.org.apache.xerces.internal.impl.dv.xs.SchemaDVFactoryImpl;
  24 import com.sun.org.apache.xerces.internal.impl.dv.xs.XSSimpleTypeDecl;
  25 
  26 /**
  27  * This class is pool that enables caching of XML Schema declaration objects.
  28  * Before a compiled grammar object is garbage collected,
  29  * the implementation will add all XML Schema component
  30  * declarations to the pool.
  31  * Note: The cashing mechanism is not implemented yet.
  32  *
  33  * @xerces.internal
  34  *
  35  * @author Elena Litani, IBM

  36  */
  37 public final class XSDeclarationPool {
  38     /** Chunk shift (8). */
  39     private static final int CHUNK_SHIFT = 8; // 2^8 = 256
  40 
  41     /** Chunk size (1 << CHUNK_SHIFT). */
  42     private static final int CHUNK_SIZE = 1 << CHUNK_SHIFT;
  43 
  44     /** Chunk mask (CHUNK_SIZE - 1). */
  45     private static final int CHUNK_MASK = CHUNK_SIZE - 1;
  46 
  47     /** Initial chunk count (). */
  48     private static final int INITIAL_CHUNK_COUNT = (1 << (10 - CHUNK_SHIFT)); // 2^10 = 1k
  49 
  50     /** Element declaration pool*/
  51     private XSElementDecl fElementDecl[][] = new XSElementDecl[INITIAL_CHUNK_COUNT][];
  52     private int fElementDeclIndex = 0;
  53 
  54     /** Particle declaration pool */
  55     private XSParticleDecl fParticleDecl[][] = new XSParticleDecl[INITIAL_CHUNK_COUNT][];


< prev index next >