Java Doc for Expand.java in  » Database-Client » Jackcess » com » healthmarketscience » jackcess » scsu » 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 » Database Client » Jackcess » com.healthmarketscience.jackcess.scsu 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.healthmarketscience.jackcess.scsu.SCSU
      com.healthmarketscience.jackcess.scsu.Expand

Expand
public class Expand extends SCSU (Code)
Reference decoder for the Standard Compression Scheme for Unicode (SCSU)

Notes on the Java implementation

A limitation of Java is the exclusive use of a signed byte data type. The following work arounds are required: Copying a byte to an integer variable and adding 256 for 'negative' bytes gives an integer in the range 0-255. Values of char are between 0x0000 and 0xFFFF in Java. Arithmetic on char values is unsigned. Extended characters require an int to store them. The sign is not an issue because only 1024*1024 + 65536 extended characters exist.


Field Summary
protected  intiIn
    
protected  intiOut
    


Method Summary
public  intbytesRead()
    
public static  charcharFromTwoBytes(byte hi, byte lo)
    
public  intcharsWritten()
    
protected  voiddefineExtendedWindow(char chOffset)
     (re-)define (and select) a window as an extended dynamic window The surrogate area in Unicode allows access to 2**20 codes beyond the first 64K codes by combining one of 1024 characters from the High Surrogate Area with one of 1024 characters from the Low Surrogate Area (see Unicode 2.0 for the details). The tags SDX and UDX set the window such that each subsequent byte in the range 80 to FF represents a surrogate pair.
protected  voiddefineWindow(int iWindow, byte bOffset)
     (re-)define (and select) a dynamic window A sliding window position cannot start at any Unicode value, so rather than providing an absolute offset, this function takes an index value which selects among the possible starting values. Most scripts in Unicode start on or near a half-block boundary so the default behaviour is to multiply the index by 0x80.
public  Stringexpand(byte[] in)
    
protected  StringexpandSingleByte(byte[] in)
    
protected  intexpandUnicode(byte[] in, int iCur, StringBuffer sb)
    
public  voidreset()
    

Field Detail
iIn
protected int iIn(Code)
input cursor used by the following functions



iOut
protected int iOut(Code)
string buffer length used by the following functions





Method Detail
bytesRead
public int bytesRead()(Code)



charFromTwoBytes
public static char charFromTwoBytes(byte hi, byte lo)(Code)
assemble a char from two bytes In Java bytes are signed quantities, while chars are unsigned the character
Parameters:
  hi - most significant byte
Parameters:
  lo - least significant byte



charsWritten
public int charsWritten()(Code)



defineExtendedWindow
protected void defineExtendedWindow(char chOffset)(Code)
(re-)define (and select) a window as an extended dynamic window The surrogate area in Unicode allows access to 2**20 codes beyond the first 64K codes by combining one of 1024 characters from the High Surrogate Area with one of 1024 characters from the Low Surrogate Area (see Unicode 2.0 for the details). The tags SDX and UDX set the window such that each subsequent byte in the range 80 to FF represents a surrogate pair. The following diagram shows how the bits in the two bytes following the SDX or UDX, and a subsequent data byte, map onto the bits in the resulting surrogate pair. hbyte lbyte data nnnwwwww zzzzzyyy 1xxxxxxx high-surrogate low-surrogate 110110wwwwwzzzzz 110111yyyxxxxxxx
Parameters:
  chOffset - - Since the three top bits of chOffset are not needed toset the location of the extended Window, they are used insteadto select the window, thereby reducing the number of needed command codes.The bottom 13 bits of chOffset are used to calculate the offset relative toa 7 bit input data byte to yield the 20 bits expressed by each surrogate pair.



defineWindow
protected void defineWindow(int iWindow, byte bOffset) throws IllegalInputException(Code)
(re-)define (and select) a dynamic window A sliding window position cannot start at any Unicode value, so rather than providing an absolute offset, this function takes an index value which selects among the possible starting values. Most scripts in Unicode start on or near a half-block boundary so the default behaviour is to multiply the index by 0x80. Han, Hangul, Surrogates and other scripts between 0x3400 and 0xDFFF show very poor locality--therefore no sliding window can be set there. A jumpOffset is added to the index value to skip that region, and only 167 index values total are required to select all eligible half-blocks. Finally, a few scripts straddle half block boundaries. For them, a table of fixed offsets is used, and the index values from 0xF9 to 0xFF are used to select these special offsets. After (re-)defining a windows location it is selected so it is ready for use. Recall that all Windows are of the same length (128 code positions).
Parameters:
  iWindow - - index of the window to be (re-)defined
Parameters:
  bOffset - - index for the new offset value



expand
public String expand(byte[] in) throws IllegalInputException, EndOfInputException(Code)
expand a byte array containing compressed Unicode



expandSingleByte
protected String expandSingleByte(byte[] in) throws IllegalInputException, EndOfInputException(Code)
expand portion of the input that is in single byte mode *



expandUnicode
protected int expandUnicode(byte[] in, int iCur, StringBuffer sb) throws IllegalInputException, EndOfInputException(Code)
expand input that is in Unicode mode
Parameters:
  in - input byte array to be expanded
Parameters:
  iCur - starting index
Parameters:
  sb - string buffer to which to append expanded input the index for the lastc byte processed



reset
public void reset()(Code)
reset is called to start with new input, w/o creating a new instance



Fields inherited from com.healthmarketscience.jackcess.scsu.SCSU
final static byte SC0(Code)(Java Doc)
final static byte SC1(Code)(Java Doc)
final static byte SC2(Code)(Java Doc)
final static byte SC3(Code)(Java Doc)
final static byte SC4(Code)(Java Doc)
final static byte SC5(Code)(Java Doc)
final static byte SC6(Code)(Java Doc)
final static byte SC7(Code)(Java Doc)
final static byte SCU(Code)(Java Doc)
final static byte SD0(Code)(Java Doc)
final static byte SD1(Code)(Java Doc)
final static byte SD2(Code)(Java Doc)
final static byte SD3(Code)(Java Doc)
final static byte SD4(Code)(Java Doc)
final static byte SD5(Code)(Java Doc)
final static byte SD6(Code)(Java Doc)
final static byte SD7(Code)(Java Doc)
final static byte SDX(Code)(Java Doc)
final static byte SQ0(Code)(Java Doc)
final static byte SQ1(Code)(Java Doc)
final static byte SQ2(Code)(Java Doc)
final static byte SQ3(Code)(Java Doc)
final static byte SQ4(Code)(Java Doc)
final static byte SQ5(Code)(Java Doc)
final static byte SQ6(Code)(Java Doc)
final static byte SQ7(Code)(Java Doc)
final static byte SQU(Code)(Java Doc)
final static byte Srs(Code)(Java Doc)
final static byte UC0(Code)(Java Doc)
final static byte UC1(Code)(Java Doc)
final static byte UC2(Code)(Java Doc)
final static byte UC3(Code)(Java Doc)
final static byte UC4(Code)(Java Doc)
final static byte UC5(Code)(Java Doc)
final static byte UC6(Code)(Java Doc)
final static byte UC7(Code)(Java Doc)
final static byte UD0(Code)(Java Doc)
final static byte UD1(Code)(Java Doc)
final static byte UD2(Code)(Java Doc)
final static byte UD3(Code)(Java Doc)
final static byte UD4(Code)(Java Doc)
final static byte UD5(Code)(Java Doc)
final static byte UD6(Code)(Java Doc)
final static byte UD7(Code)(Java Doc)
final static byte UDX(Code)(Java Doc)
final static byte UQU(Code)(Java Doc)
final static byte Urs(Code)(Java Doc)
int dynamicOffset(Code)(Java Doc)
final static int fixedOffset(Code)(Java Doc)
final static int fixedThreshold(Code)(Java Doc)
final static int gapOffset(Code)(Java Doc)
final static int gapThreshold(Code)(Java Doc)
final static int initialDynamicOffset(Code)(Java Doc)
final static int reservedStart(Code)(Java Doc)
final static int staticOffset(Code)(Java Doc)

Methods inherited from com.healthmarketscience.jackcess.scsu.SCSU
protected int getCurrentWindow()(Code)(Java Doc)
public static boolean isCompressible(char ch)(Code)(Java Doc)
public void reset()(Code)(Java Doc)
protected void selectWindow(int iWindow)(Code)(Java Doc)

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.