Java Doc for StringAccessor.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » misc » accessors » 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 » Apache Harmony Java SE » org package » org.apache.harmony.misc.accessors 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.harmony.misc.accessors.StringAccessor

StringAccessor
public class StringAccessor (Code)
This class allows to copy data from String objects to native buffers, and construct String objects from native strings. This allows to pass and receive string arguments from native libraries. The main difference between modified UTF8 and UTF8 is two trailing 0 instead of one (see JNI 5.0 spec on Modified UTF-8 Strings).




Method Summary
public  intcompareString(String strObj, long str, int len, int byteOrder)
     Lexicographically compares Java string with native UTF-16 encoded string in byteOrder order.
public  intcompareString(String strObj, long str, int len)
     Lexicographically compares Java string with native UTF-16 encoded string in platform default order.
public  intcompareStringAndChars(String strObj, char[] str, int offset, int len)
     Lexicographically compares the Java string with the character sequence represented by the part of char array str.
public  intcompareStringUTF(String strObj, long str)
     Lexicographically compares Java string with native UTF-8 encoded string . The comparison is based on the Unicode value of each character in the strings.
native public  StringcreateOrderedString(long wstr, int order)
     Creates String from 0 terminated UTF16 (Unicode) native string of max strlen length in bytes.
native public  StringcreateString(long wstr)
     Creates String from 0 terminated UTF16 (Unicode) native string

This method has an effect of NewString JNI call.

native public  StringcreateString(long wstr, long strlen)
     Creates String from 0 terminated UTF16 (Unicode) native string of max strlen length in bytes.
native public  StringcreateStringUTF(long str)
     Creates String from 0 terminated modified UTF8 native string

This method has an effect of NewStringUTF JNI call.

native public  StringcreateStringUTF(long str, long strlen)
     Creates String from 0 terminated modified UTF8 native string of max strlen length in bytes.
native public  longgetChars(String str)
     Creates UTF16 (Unicode) copy of String object in native heap.
public  longgetChars(long buf, long buflen, String str, int start, int len)
     Copies len UTF16 (Unicode) encoded chars or buflen bytes whichever is smaller from String to native buffer.
static  StringAccessorgetInstance()
    
native public  longgetUTFChars(String str)
     Creates modified UTF8 encoded copy of String object in native heap. Allocates buffer enough to represent 0 terminated string in native heap. Adds 2 trailing 0 to the end of native string.
public  longgetUTFChars(long buf, long buflen, String str, int start, int len)
     Copies len modified UTF8 encoded chars or buflen bytes whichever is smaller from String to native buffer.



Method Detail
compareString
public int compareString(String strObj, long str, int len, int byteOrder)(Code)
Lexicographically compares Java string with native UTF-16 encoded string in byteOrder order.
Parameters:
  strObj - Java string
Parameters:
  str - native string memory address
Parameters:
  len - length of native string
Parameters:
  byteOrder - either ByteOrder.BIG_ENDIAN or ByteOrder.LITTLE_ENDIAN 0 if strings are equal,<0 if Java string is lexicographically less than the native string,>0 if Java string is lexicographically greater than the native string.



compareString
public int compareString(String strObj, long str, int len)(Code)
Lexicographically compares Java string with native UTF-16 encoded string in platform default order.
Parameters:
  strObj - Java string
Parameters:
  str - native string memory address
Parameters:
  len - length of native string 0 if strings are equal,<0 if Java string is lexicographically less than the native string,>0 if Java string is lexicographically greater than the native string.



compareStringAndChars
public int compareStringAndChars(String strObj, char[] str, int offset, int len)(Code)
Lexicographically compares the Java string with the character sequence represented by the part of char array str.
Parameters:
  strObj - Java string
Parameters:
  str - char array
Parameters:
  offset - offset within char array 0 if strings are equal,<0 if Java string is lexicographically less than the native string,>0 if Java string is lexicographically greater than the native string.



compareStringUTF
public int compareStringUTF(String strObj, long str)(Code)
Lexicographically compares Java string with native UTF-8 encoded string . The comparison is based on the Unicode value of each character in the strings. The character sequence represented by String object is compared lexicographically to the character sequence represented by the native UTF-8 string. The result is a negative integer if String object lexicographically precedes the argument str. The result is a positive integer if this String object lexicographically follows the argument str. The result is zero if the strings are equal.
Parameters:
  strObj - Java string
Parameters:
  str - native string memory address 0 if strings are equal,<0 if Java string is lexicographically less than the native string,>0 if Java string is lexicographically greater than the native string.



createOrderedString
native public String createOrderedString(long wstr, int order)(Code)
Creates String from 0 terminated UTF16 (Unicode) native string of max strlen length in bytes.

This method has an effect of NewString JNI call.
Parameters:
  wstr - memory address of native
Parameters:
  order - byte order new String




createString
native public String createString(long wstr)(Code)
Creates String from 0 terminated UTF16 (Unicode) native string

This method has an effect of NewString JNI call.
Parameters:
  wstr - memory address of native new String




createString
native public String createString(long wstr, long strlen)(Code)
Creates String from 0 terminated UTF16 (Unicode) native string of max strlen length in bytes.

This method has an effect of NewString JNI call.
Parameters:
  wstr - memory address of native
Parameters:
  strlen - max length of native string in bytes new String




createStringUTF
native public String createStringUTF(long str)(Code)
Creates String from 0 terminated modified UTF8 native string

This method has an effect of NewStringUTF JNI call.
Parameters:
  str - memory address of native new String




createStringUTF
native public String createStringUTF(long str, long strlen)(Code)
Creates String from 0 terminated modified UTF8 native string of max strlen length in bytes.

This method has an effect of NewStringUTF JNI call.
Parameters:
  str - memory address of native
Parameters:
  strlen - max length of native string in bytes new String




getChars
native public long getChars(String str)(Code)
Creates UTF16 (Unicode) copy of String object in native heap. Allocates buffer enough to represent 0 terminated string in native heap. The returned buffer should be deallocated by MemoryAccessor.free

This method has an effect of GetStringChars JNI call.
Parameters:
  str - -string to copy buffer memory address




getChars
public long getChars(long buf, long buflen, String str, int start, int len)(Code)
Copies len UTF16 (Unicode) encoded chars or buflen bytes whichever is smaller from String to native buffer. If there is a room in buffer after last copied string char, 2 trailing 0 are added. Buffer should be at least 2 * len bytes to guaranty String chars will fully fit.

This method has an effect of GetStringRegion JNI call.
Parameters:
  buf - memory address of native buf
Parameters:
  buflen - length of buffer in bytes
Parameters:
  str - string to copy
Parameters:
  start - first char index
Parameters:
  len - number of chars to copy buf




getInstance
static StringAccessor getInstance()(Code)



getUTFChars
native public long getUTFChars(String str)(Code)
Creates modified UTF8 encoded copy of String object in native heap. Allocates buffer enough to represent 0 terminated string in native heap. Adds 2 trailing 0 to the end of native string. The returned buffer should be deallocated by MemoryAccessor.free

This method has an effect of GetStringUTFChars JNI call.
Parameters:
  str - string to copy buffer memory address




getUTFChars
public long getUTFChars(long buf, long buflen, String str, int start, int len)(Code)
Copies len modified UTF8 encoded chars or buflen bytes whichever is smaller from String to native buffer. If there is a room in buffer after last copied string char, 2 trailing 0 are added. For ANSI chars buffer should be at least len bytes, for international chars buffer should be at least 3 * len bytes (see JNI 5.0 spec on Modified UTF-8 Strings) to guaranty String chars will fully fit.

This method has an effect of GetStringUTFRegion JNI call.
Parameters:
  buf - memory address of native buf
Parameters:
  buflen - length of buffer in bytes
Parameters:
  str - string to copy
Parameters:
  start - first char index
Parameters:
  len - number of chars to copy buf




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.