Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

nice.tools.code
Class SpecialArray  view SpecialArray download SpecialArray.java

java.lang.Object
  extended bygnu.bytecode.Type
      extended bygnu.bytecode.ObjectType
          extended bygnu.bytecode.ArrayType
              extended bynice.tools.code.SpecialArray
Direct Known Subclasses:
TupleType

public class SpecialArray
extends gnu.bytecode.ArrayType

Arrays that are wrapped on the fly into objects implementing java.util.List when needed.


Field Summary
static gnu.bytecode.Method arraycopy
           
private  gnu.bytecode.Method convertMethod
           
private  gnu.bytecode.Field field
           
private  gnu.bytecode.Method genericConvertMethod
           
private static gnu.bytecode.Method makeMethod
           
private static gnu.bytecode.ArrayType objectArray
           
private static gnu.bytecode.ClassType objectType
           
private  java.lang.String prefix
           
private  boolean primitive
          true if the elements have a primitive type.
private  boolean unknown
          If true, this type denote array of elements with any type (could be primitive or not).
private static SpecialArray unknownTypeArray
           
private static gnu.bytecode.ClassType wrappedType
          Fields
 
Fields inherited from class gnu.bytecode.ArrayType
elements
 
Fields inherited from class gnu.bytecode.Type
boolean_ctype, boolean_type, booleanValue_method, byte_type, char_type, double_type, doubleValue_method, float_type, floatValue_method, int_type, intValue_method, long_type, longValue_method, number_type, pointer_type, reflectClass, short_type, string_type, toString_method, typeArray0, void_type
 
Constructor Summary
protected SpecialArray(gnu.bytecode.Type elements)
           
private SpecialArray(gnu.bytecode.Type elements, java.lang.String prefix, boolean unknown, boolean register)
           
 
Method Summary
private  void callConvert(gnu.bytecode.CodeAttr code)
          Conversions
private  void callGenericConvert(gnu.bytecode.CodeAttr code)
           
private static void coerce(gnu.bytecode.CodeAttr code, gnu.bytecode.ArrayType from, gnu.bytecode.ArrayType to)
           
private static void convertReferenceArray(gnu.bytecode.CodeAttr code, gnu.bytecode.ArrayType toType, gnu.bytecode.Type elements)
           
static gnu.bytecode.Type create(gnu.bytecode.Type elements)
          Return a SpecialArray holding elements of type elements.
 void emitCoerceFrom(gnu.bytecode.Type fromType, gnu.bytecode.CodeAttr code)
           
private  void emitCoerceFromArray(gnu.bytecode.CodeAttr code)
           
private  void emitCoerceFromCollection(gnu.bytecode.CodeAttr code)
           
 void emitCoerceFromObject(gnu.bytecode.CodeAttr code)
          Compile (in given method) cast from Object to this Type.
 void emitCoerceTo(gnu.bytecode.Type toType, gnu.bytecode.CodeAttr code)
           
 void emitCoerceToObject(gnu.bytecode.CodeAttr code)
          Compile code to convert an object (on the stack) to this Type.
 gnu.bytecode.Type getImplementationType()
          Typing
 java.lang.String getInternalName()
           
 boolean isAssignableTo(gnu.bytecode.Type other)
           
private  boolean isCollectionArray(gnu.bytecode.Type t)
           
 boolean isSubtype(gnu.bytecode.Type other)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
static SpecialArray unknownTypeArray()
           
static gnu.bytecode.ClassType wrappedType()
           
 
Methods inherited from class gnu.bytecode.ArrayType
getComponentType, getNameOrSignature
 
Methods inherited from class gnu.bytecode.ObjectType
coerceFromObject, getReflectClass
 
Methods inherited from class gnu.bytecode.Type
coerceToObject, emitIsInstance, getName, getSignature, isInstance, isValidJavaTypeName, make, promote, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

unknownTypeArray

private static SpecialArray unknownTypeArray

primitive

private boolean primitive
true if the elements have a primitive type.


unknown

private boolean unknown
If true, this type denote array of elements with any type (could be primitive or not). So the signature for this is Object.


arraycopy

public static final gnu.bytecode.Method arraycopy

wrappedType

private static gnu.bytecode.ClassType wrappedType
Fields


field

private gnu.bytecode.Field field

objectType

private static gnu.bytecode.ClassType objectType

objectArray

private static gnu.bytecode.ArrayType objectArray

convertMethod

private gnu.bytecode.Method convertMethod

genericConvertMethod

private gnu.bytecode.Method genericConvertMethod

makeMethod

private static gnu.bytecode.Method makeMethod

prefix

private java.lang.String prefix
Constructor Detail

SpecialArray

protected SpecialArray(gnu.bytecode.Type elements)

SpecialArray

private SpecialArray(gnu.bytecode.Type elements,
                     java.lang.String prefix,
                     boolean unknown,
                     boolean register)
Method Detail

create

public static gnu.bytecode.Type create(gnu.bytecode.Type elements)
Return a SpecialArray holding elements of type elements.


unknownTypeArray

public static SpecialArray unknownTypeArray()

getInternalName

public java.lang.String getInternalName()

callConvert

private void callConvert(gnu.bytecode.CodeAttr code)
Conversions


callGenericConvert

private void callGenericConvert(gnu.bytecode.CodeAttr code)

emitCoerceFrom

public void emitCoerceFrom(gnu.bytecode.Type fromType,
                           gnu.bytecode.CodeAttr code)

isCollectionArray

private boolean isCollectionArray(gnu.bytecode.Type t)

emitCoerceFromObject

public void emitCoerceFromObject(gnu.bytecode.CodeAttr code)
Description copied from class: gnu.bytecode.ObjectType
Compile (in given method) cast from Object to this Type.


emitCoerceFromCollection

private void emitCoerceFromCollection(gnu.bytecode.CodeAttr code)

emitCoerceFromArray

private void emitCoerceFromArray(gnu.bytecode.CodeAttr code)

convertReferenceArray

private static void convertReferenceArray(gnu.bytecode.CodeAttr code,
                                          gnu.bytecode.ArrayType toType,
                                          gnu.bytecode.Type elements)

emitCoerceTo

public void emitCoerceTo(gnu.bytecode.Type toType,
                         gnu.bytecode.CodeAttr code)

emitCoerceToObject

public void emitCoerceToObject(gnu.bytecode.CodeAttr code)
Description copied from class: gnu.bytecode.Type
Compile code to convert an object (on the stack) to this Type.


coerce

private static void coerce(gnu.bytecode.CodeAttr code,
                           gnu.bytecode.ArrayType from,
                           gnu.bytecode.ArrayType to)

getImplementationType

public gnu.bytecode.Type getImplementationType()
Typing


isSubtype

public boolean isSubtype(gnu.bytecode.Type other)

isAssignableTo

public boolean isAssignableTo(gnu.bytecode.Type other)

wrappedType

public static gnu.bytecode.ClassType wrappedType()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).