This is a basic implementation of the Type interface which should be complete enough to be portable across platforms. The only issue will be the construction of these objects and their components from the platform-specific debugging information; see BasicTypeDataBase.
There are two types of clients of this class. The first is that which builds the TypeDatabase. This kind of client uses the additional public methods beyond those in the Type interface to properly configure the BasicType objects. The second is the consumer of these types; this kind of client should deal only with the Type interfaces.
| Modifier and Type | Field and Description |
|---|---|
| protected BasicTypeDataBase | |
| private List | |
| private boolean | |
| private boolean | |
| private String | |
| private Map | |
| private long | |
| private Type |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public AddressField | |
| public CIntegerField | |
| public Field | getField(String fieldName, boolean searchSuperclassFields, boolean throwExceptionIfNotFound)
Implements sun. This is permissive and returns the CField regardless of its type as long as it is present. |
| public Field | getField(String fieldName, boolean searchSuperclassFields)
Implements sun. This is permissive and returns the CField regardless of its type as long as it is present -- it is equivalent to getField(fieldName, searchSuperclassFields, true). |
| public Field | getField(String fieldName)
Implements sun. This is permissive and returns the CField regardless of its type as long as it is present. |
| public Field | getField(String fieldName, Type declaredType, boolean searchSuperclassFields)
Implements sun. If there is a mismatch between the declared type and the type which would otherwise be returned from this routine, it throws a WrongTypeException. |
| public Field | getField(String fieldName, Type declaredType)
Implements sun. If there is a mismatch between the declared type and the type which would otherwise be returned from this routine, it throws a WrongTypeException. |
| public Iterator | getFields()
Implements sun. The returned iterator's "remove" method must not be called |
| public JBooleanField | getJBooleanField(String fieldName)
Implements sun. These accessors are designed to allow strong type checking of certain well-known types of fields, specifically Java primitive and oop types. |
| public JByteField | |
| public JCharField | |
| public JDoubleField | |
| public JFloatField | |
| public JIntField | |
| public JLongField | |
| public JShortField | |
| public String | |
| public NarrowOopField | |
| public OopField | |
| public long | getSize()
Implements sun. The size in bytes, at the machine level, of this type. |
| public Type | |
| public int | |
| public boolean | isCIntegerType()
Implements sun. Overridden by BasicCIntegerType |
| public boolean | isCStringType()
Implements sun. Indicates whether this type is const char*. |
| public boolean | isJavaPrimitiveType()
Implements sun. Indicates whether this type is one of the Java primitive types. |
| public boolean | isOopType()
Implements sun. Indicates whether this type is an oop type in the VM. |
| public boolean | |
| public void | |
| public void | setIsJavaPrimitiveType(boolean isJavaPrimitiveType)
This should only be called at most once, and only by the builder of the type database |
| public void | setIsOopType(boolean isOopType)
This should only be called at most once, and only by the builder of the type database |
| public void | setSize(long sizeInBytes)
This should only be called at most once, and only by the builder of the type database |
| public void | setSuperclass(Type superclass)
This should only be called at most once, and only by the builder of the type database |
| public String |
| db | back to summary |
|---|---|
| protected BasicTypeDataBase db | |
| fieldList | back to summary |
|---|---|
| private List<Field> fieldList | |
| isJavaPrimitiveType | back to summary |
|---|---|
| private boolean isJavaPrimitiveType | |
| isOopType | back to summary |
|---|---|
| private boolean isOopType | |
| name | back to summary |
|---|---|
| private String name | |
| nameToFieldMap | back to summary |
|---|---|
| private Map<String, Field> nameToFieldMap | |
| size | back to summary |
|---|---|
| private long size | |
| superclass | back to summary |
|---|---|
| private Type superclass | |
| BasicType | back to summary |
|---|---|
| public BasicType(BasicTypeDataBase db, String name, Type superclass) superclass may be null | |
| BasicType | back to summary |
|---|---|
| public BasicType(BasicTypeDataBase db, String name) Equivalent to BasicType(db, name, null) | |
| addField | back to summary |
|---|---|
| public void addField(Field field) This method should only be used by the builder of the TypeDataBase. Throws a RuntimeException if a field with this name was already present in this class. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAddressField | back to summary |
|---|---|
| public AddressField getAddressField(String fieldName) Implements sun. | |
| getCIntegerField | back to summary |
|---|---|
| public CIntegerField getCIntegerField(String fieldName) throws WrongTypeException Implements sun. | |
| getField | back to summary |
|---|---|
| public Field getField(String fieldName, boolean searchSuperclassFields, boolean throwExceptionIfNotFound) Implements sun. Doc from sun. This is permissive and returns the CField regardless of its type as long as it is present. Returns null if the field was not found, unless throwExceptionIfNotFound is true, in which case a RuntimeException is thrown (for debugging purposes). | |
| getField | back to summary |
|---|---|
| public Field getField(String fieldName, boolean searchSuperclassFields) Implements sun. Doc from sun. This is permissive and returns the CField regardless of its type as long as it is present -- it is equivalent to getField(fieldName, searchSuperclassFields, true). Throws a RuntimeException if the field was not found. | |
| getField | back to summary |
|---|---|
| public Field getField(String fieldName) Implements sun. Doc from sun. This is permissive and returns the CField regardless of its type as long as it is present. This does not search superclasses' fields; it is equivalent to getField(fieldName, false). Throws a RuntimeException if the field was not found. | |
| getField | back to summary |
|---|---|
| public Field getField(String fieldName, Type declaredType, boolean searchSuperclassFields) throws WrongTypeException Implements sun. Doc from sun. If there is a mismatch between the declared type and the type which would otherwise be returned from this routine, it throws a WrongTypeException. declaredType must not be null. Throws a RuntimeException if field was otherwise not found. | |
| getField | back to summary |
|---|---|
| public Field getField(String fieldName, Type declaredType) throws WrongTypeException Implements sun. Doc from sun. If there is a mismatch between the declared type and the type which would otherwise be returned from this routine, it throws a WrongTypeException. declaredType must not be null. This does not search superclasses' fields; it is equivalent to getField(fieldName, declaredType, false). Throws a RuntimeException if field was otherwise not found. | |
| getFields | back to summary |
|---|---|
| public Iterator Implements sun. The returned iterator's "remove" method must not be called | |
| getJBooleanField | back to summary |
|---|---|
| public JBooleanField getJBooleanField(String fieldName) throws WrongTypeException Implements sun. Doc from sun. These accessors are designed to allow strong type checking of certain well-known types of fields, specifically Java primitive and oop types. Specialized fields for all primitive types, as well as oop fields, are required to have strong type checking and a WrongTypeException should be thrown if the given field is not precisely of the given type. Address and Oop fields are more permissive to reduce the complexity of the initial implementation. These accessors do not search the superclass's fields. | |
| getJByteField | back to summary |
|---|---|
| public JByteField getJByteField(String fieldName) throws WrongTypeException Implements sun. | |
| getJCharField | back to summary |
|---|---|
| public JCharField getJCharField(String fieldName) throws WrongTypeException Implements sun. | |
| getJDoubleField | back to summary |
|---|---|
| public JDoubleField getJDoubleField(String fieldName) throws WrongTypeException Implements sun. | |
| getJFloatField | back to summary |
|---|---|
| public JFloatField getJFloatField(String fieldName) throws WrongTypeException Implements sun. | |
| getJIntField | back to summary |
|---|---|
| public JIntField getJIntField(String fieldName) throws WrongTypeException Implements sun. | |
| getJLongField | back to summary |
|---|---|
| public JLongField getJLongField(String fieldName) throws WrongTypeException Implements sun. | |
| getJShortField | back to summary |
|---|---|
| public JShortField getJShortField(String fieldName) throws WrongTypeException Implements sun. | |
| getName | back to summary |
|---|---|
| public String getName() Implements sun. | |
| getNarrowOopField | back to summary |
|---|---|
| public NarrowOopField getNarrowOopField(String fieldName) throws WrongTypeException Implements sun. | |
| getOopField | back to summary |
|---|---|
| public OopField getOopField(String fieldName) throws WrongTypeException Implements sun. | |
| getSize | back to summary |
|---|---|
| public long getSize() Implements sun. Doc from sun. The size in bytes, at the machine level, of this type. This should be equivalent to the sizeof operator -- i.e., should include any compiler-inserted fields like the vtbl for C++ types. | |
| getSuperclass | back to summary |
|---|---|
| public Type getSuperclass() Implements sun. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isCIntegerType | back to summary |
|---|---|
| public boolean isCIntegerType() Implements sun. Overridden by BasicCIntegerType | |
| isCStringType | back to summary |
|---|---|
| public boolean isCStringType() Implements sun. Doc from sun. Indicates whether this type is const char*. | |
| isJavaPrimitiveType | back to summary |
|---|---|
| public boolean isJavaPrimitiveType() Implements sun. Doc from sun. Indicates whether this type is one of the Java primitive types. | |
| isOopType | back to summary |
|---|---|
| public boolean isOopType() Implements sun. Doc from sun. Indicates whether this type is an oop type in the VM. | |
| isPointerType | back to summary |
|---|---|
| public boolean isPointerType() Implements sun. Overridden by BasicPointerType | |
| removeField | back to summary |
|---|---|
| public void removeField(Field field) This method should only be used by the builder of the TypeDataBase. Throws a RuntimeException if a field with this name was not present in this class. | |
| setIsJavaPrimitiveType | back to summary |
|---|---|
| public void setIsJavaPrimitiveType(boolean isJavaPrimitiveType) This should only be called at most once, and only by the builder of the type database | |
| setIsOopType | back to summary |
|---|---|
| public void setIsOopType(boolean isOopType) This should only be called at most once, and only by the builder of the type database | |
| setSize | back to summary |
|---|---|
| public void setSize(long sizeInBytes) This should only be called at most once, and only by the builder of the type database | |
| setSuperclass | back to summary |
|---|---|
| public void setSuperclass(Type superclass) This should only be called at most once, and only by the builder of the type database | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |