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


java.lang.Object
   org.apache.harmony.pack200.bytecode.ClassFileEntry
      org.apache.harmony.pack200.bytecode.ByteCode

ByteCode
public class ByteCode extends ClassFileEntry (Code)



Constructor Summary
protected  ByteCode(int opcode)
    
protected  ByteCode(int opcode, ClassFileEntry[] nested)
    

Method Summary
public  voidapplyByteCodeTargetFixup(CodeAttribute codeAttribute)
     Some ByteCodes (in particular, those with labels need to be fixed up after all the bytecodes in the CodeAttribute have been added.
protected  voiddoWrite(DataOutputStream dos)
    
public  booleanequals(Object obj)
    
public  voidextractOperands(OperandManager operandManager, Segment segment, int codeLength)
    
public static  ByteCodegetByteCode(int opcode)
    
protected  ByteCodeFormgetByteCodeForm()
    
public  intgetByteCodeIndex()
    
public  int[]getByteCodeTargets()
    
public  intgetLength()
    
public  StringgetName()
    
public  ClassFileEntry[]getNestedClassFileEntries()
    
public  int[]getNestedPosition(int index)
    
public  int[][]getNestedPositions()
    
public  intgetOpcode()
    
public  intgetOperandType()
    
public  int[]getRewrite()
     Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array.
public  booleanhasMultipleByteCodes()
     This method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super); otherwise, it will answer false.
public  inthashCode()
    
protected  voidresolve(ClassConstantPool pool)
    
public  voidsetByteCodeIndex(int byteCodeOffset)
     ByteCodes may need to know their position in the code array (in particular, label byte codes need to know where they are in order to calculate their targets).
public  voidsetByteCodeTargets(int[] byteCodeTargets)
     Some ByteCodes (in particular, those with labels) have to keep track of byteCodeTargets.
public  voidsetNested(ClassFileEntry[] nested)
    
public  voidsetNestedPositions(int[][] nestedPositions)
     nestedPositions is an array of arrays of ints.
public  voidsetOperand2Bytes(int operand, int position)
     Given an int operand, set the rewrite bytes for that position and the one immediately following it to a high-byte, low-byte encoding of the operand.
Parameters:
  operand - int to set the rewrite bytes to
Parameters:
  position - int position in the operands of therewrite bytes.
public  voidsetOperandByte(int operand, int position)
     Given an int operand, treat it as a byte and set the rewrite byte for that position to that value. Mask of anything beyond 0xFF.
Parameters:
  operand - int to set the rewrite byte to (unsigned)
Parameters:
  position - int position in the operands of therewrite bytes.
public  voidsetOperandBytes(int[] operands)
     Given an array of ints which correspond to bytes in the operand of the bytecode, set the rewrite bytes of the operand to be the appropriate values.
public  voidsetOperandSigned2Bytes(int operand, int position)
     This is just like setOperandInt, but takes special care when the operand is less than 0 to make sure it's written correctly.
public  voidsetRewrite(int[] rewrite)
     Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array.
public  StringtoString()
    


Constructor Detail
ByteCode
protected ByteCode(int opcode)(Code)



ByteCode
protected ByteCode(int opcode, ClassFileEntry[] nested)(Code)




Method Detail
applyByteCodeTargetFixup
public void applyByteCodeTargetFixup(CodeAttribute codeAttribute)(Code)
Some ByteCodes (in particular, those with labels need to be fixed up after all the bytecodes in the CodeAttribute have been added. (This can't be done beforehand because the CodeAttribute needs to be complete before targets can be assigned.)



doWrite
protected void doWrite(DataOutputStream dos) throws IOException(Code)



equals
public boolean equals(Object obj)(Code)



extractOperands
public void extractOperands(OperandManager operandManager, Segment segment, int codeLength)(Code)



getByteCode
public static ByteCode getByteCode(int opcode)(Code)



getByteCodeForm
protected ByteCodeForm getByteCodeForm()(Code)



getByteCodeIndex
public int getByteCodeIndex()(Code)



getByteCodeTargets
public int[] getByteCodeTargets()(Code)



getLength
public int getLength()(Code)



getName
public String getName()(Code)



getNestedClassFileEntries
public ClassFileEntry[] getNestedClassFileEntries()(Code)



getNestedPosition
public int[] getNestedPosition(int index)(Code)



getNestedPositions
public int[][] getNestedPositions()(Code)



getOpcode
public int getOpcode()(Code)



getOperandType
public int getOperandType()(Code)



getRewrite
public int[] getRewrite()(Code)
Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array. This method permits their associated bytecode formst to query their rewrite array. Note that this should not be called from bytecodes which have a static rewrite; use the table in ByteCodeForm instead to specify those rewrites.



hasMultipleByteCodes
public boolean hasMultipleByteCodes()(Code)
This method will answer true if the receiver is a multi-bytecode instruction (such as aload0_putfield_super); otherwise, it will answer false. boolean true if multibytecode, false otherwise



hashCode
public int hashCode()(Code)



resolve
protected void resolve(ClassConstantPool pool)(Code)



setByteCodeIndex
public void setByteCodeIndex(int byteCodeOffset)(Code)
ByteCodes may need to know their position in the code array (in particular, label byte codes need to know where they are in order to calculate their targets). This method lets the CodeAttribute specify where the byte code is. Since there are no aload0+label instructions, this method doesn't worry about multioperation bytecodes.
Parameters:
  byteCodeOffset - int position in code array.



setByteCodeTargets
public void setByteCodeTargets(int[] byteCodeTargets)(Code)
Some ByteCodes (in particular, those with labels) have to keep track of byteCodeTargets. These are initially offsets in the CodeAttribute array relative to the byteCodeOffset, but later get fixed up to point to the absolute position in the CodeAttribute array. This method sets the targets.
Parameters:
  byteCodeTarget - int index in array



setNested
public void setNested(ClassFileEntry[] nested)(Code)



setNestedPositions
public void setNestedPositions(int[][] nestedPositions)(Code)
nestedPositions is an array of arrays of ints. Each subarray specifies a position of a nested element (from the nested[] array) and the length of that element. For instance, one might have a nested of: {CPClass java/lang/Foo, CPFloat 3.14} The nestedPositions would then be: {{0,2},{2,2}} In other words, when the bytecode is resolved, the CPClass will be resolved to an int and inserted at position 0 and 1 of the rewrite arguments (the first occurrences of -1). The CPFloat will be resolved to an int position and inserted at positions 2 and 3 of the rewrite arguments.
Parameters:
  nestedPositions -



setOperand2Bytes
public void setOperand2Bytes(int operand, int position)(Code)
Given an int operand, set the rewrite bytes for that position and the one immediately following it to a high-byte, low-byte encoding of the operand.
Parameters:
  operand - int to set the rewrite bytes to
Parameters:
  position - int position in the operands of therewrite bytes. For a rewrite array of {100, -1, -1, -1}position 0 is the first -1, position 1 is the second -1,etc.



setOperandByte
public void setOperandByte(int operand, int position)(Code)
Given an int operand, treat it as a byte and set the rewrite byte for that position to that value. Mask of anything beyond 0xFF.
Parameters:
  operand - int to set the rewrite byte to (unsigned)
Parameters:
  position - int position in the operands of therewrite bytes. For a rewrite array of {100, -1, -1, -1}position 0 is the first -1, position 1 is the second -1,etc.



setOperandBytes
public void setOperandBytes(int[] operands)(Code)
Given an array of ints which correspond to bytes in the operand of the bytecode, set the rewrite bytes of the operand to be the appropriate values. All values in operands[] will be masked with 0xFF so they fit into a byte.
Parameters:
  operands - int[] rewrite operand bytes



setOperandSigned2Bytes
public void setOperandSigned2Bytes(int operand, int position)(Code)
This is just like setOperandInt, but takes special care when the operand is less than 0 to make sure it's written correctly.
Parameters:
  operand - int to set the rewrite bytes to
Parameters:
  position - int position of the operands in the rewrite bytes



setRewrite
public void setRewrite(int[] rewrite)(Code)
Some bytecodes (the ones with variable lengths) can't have a static rewrite array - they need the ability to update the array. This method permits that. Note that this should not be called from bytecodes which have a static rewrite; use the table in ByteCodeForm instead to specify those rewrites.
Parameters:
  rewrite -



toString
public String toString()(Code)



Fields inherited from org.apache.harmony.pack200.bytecode.ClassFileEntry
final protected static ClassFileEntry[] NONE(Code)(Java Doc)

Methods inherited from org.apache.harmony.pack200.bytecode.ClassFileEntry
abstract protected void doWrite(DataOutputStream dos) throws IOException(Code)(Java Doc)
abstract public boolean equals(Object arg0)(Code)(Java Doc)
protected ClassFileEntry[] getNestedClassFileEntries()(Code)(Java Doc)
abstract public int hashCode()(Code)(Java Doc)
protected boolean isResolved()(Code)(Java Doc)
protected void resolve(ClassConstantPool pool)(Code)(Java Doc)
abstract public String toString()(Code)(Java Doc)
final public void write(DataOutputStream dos) throws IOException(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.