Java Doc for ChunkedIntArray.java in  » XML » xalan » org » apache » xml » dtm » ref » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xalan » org.apache.xml.dtm.ref 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xml.dtm.ref.ChunkedIntArray

ChunkedIntArray
final class ChunkedIntArray (Code)
ChunkedIntArray is an extensible array of blocks of integers. (I'd consider Vector, but it's unable to handle integers except by turning them into Objects.)

Making this a separate class means some call-and-return overhead. But doing it all inline tends to be fragile and expensive in coder time, not to mention driving up code size. If you want to inline it, feel free. The Java text suggest that private and Final methods may be inlined, and one can argue that this beast need not be made subclassable...

%REVIEW% This has strong conceptual overlap with the IntVector class. It would probably be a good thing to merge the two, when time permits.


Inner Class :class ChunksVector

Field Summary
final static  intchunkalloc
    
 ChunksVectorchunks
    
final  intfastArray
    
 intlastUsed
    
final static  intlowbits
    
final static  intlowmask
    
final  intslotsize
    

Constructor Summary
 ChunkedIntArray(int slotsize)
     Create a new CIA with specified record size.

Method Summary
 intappendSlot(int w0, int w1, int w2, int w3)
     Append a 4-integer record to the CIA, starting with record 1.
 voiddiscardLast()
     Disard the highest-numbered record.
 intreadEntry(int position, int offset)
     Retrieve an integer from the CIA by record number and column within the record, both 0-based (though position 0 is reserved for special purposes).
 voidreadSlot(int position, int[] buffer)
     Retrieve the contents of a record into a user-supplied buffer array.
 intslotsUsed()
    
 intspecialFind(int startPos, int position)
    
 voidwriteEntry(int position, int offset, int value)
     Overwrite the integer found at a specific record and column.
 voidwriteSlot(int position, int w0, int w1, int w2, int w3)
     Overwrite an entire (4-integer) record at the specified index.

Field Detail
chunkalloc
final static int chunkalloc(Code)



chunks
ChunksVector chunks(Code)



fastArray
final int fastArray(Code)



lastUsed
int lastUsed(Code)



lowbits
final static int lowbits(Code)



lowmask
final static int lowmask(Code)



slotsize
final int slotsize(Code)




Constructor Detail
ChunkedIntArray
ChunkedIntArray(int slotsize)(Code)
Create a new CIA with specified record size. Currently record size MUST be a power of two... and in fact is hardcoded to 4.




Method Detail
appendSlot
int appendSlot(int w0, int w1, int w2, int w3)(Code)
Append a 4-integer record to the CIA, starting with record 1. (Since arrays are initialized to all-0, 0 has been reserved as the "unknown" value in DTM.) the index at which this record was inserted.



discardLast
void discardLast()(Code)
Disard the highest-numbered record. This is used in the string-buffer CIA; when only a single characters() chunk has been recieved, its index is moved into the Text node rather than being referenced by indirection into the text accumulator.



readEntry
int readEntry(int position, int offset) throws ArrayIndexOutOfBoundsException(Code)
Retrieve an integer from the CIA by record number and column within the record, both 0-based (though position 0 is reserved for special purposes).
Parameters:
  position - int Record number
Parameters:
  slotpos - int Column number



readSlot
void readSlot(int position, int[] buffer)(Code)
Retrieve the contents of a record into a user-supplied buffer array. Used to reduce addressing overhead when code will access several columns of the record.
Parameters:
  position - int Record number
Parameters:
  buffer - int[] Integer array provided by user, must be large enoughto hold a complete record.



slotsUsed
int slotsUsed()(Code)
int index of highest-numbered record currently in use



specialFind
int specialFind(int startPos, int position)(Code)



writeEntry
void writeEntry(int position, int offset, int value) throws ArrayIndexOutOfBoundsException(Code)
Overwrite the integer found at a specific record and column. Used to back-patch existing records, most often changing their "next sibling" reference from 0 (unknown) to something meaningful
Parameters:
  position - int Record number
Parameters:
  offset - int Column number
Parameters:
  value - int New contents



writeSlot
void writeSlot(int position, int w0, int w1, int w2, int w3)(Code)
Overwrite an entire (4-integer) record at the specified index. Mostly used to create record 0, the Document node.
Parameters:
  position - integer Record number
Parameters:
  w0 - int
Parameters:
  w1 - int
Parameters:
  w2 - int
Parameters:
  w3 - int



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.