Package proguard.classfile.util
Class InternalTypeEnumeration
- java.lang.Object
-
- proguard.classfile.util.InternalTypeEnumeration
-
- All Implemented Interfaces:
java.util.Iterator<java.lang.String>
public class InternalTypeEnumeration extends java.lang.Object implements java.util.Iterator<java.lang.String>AnInternalTypeEnumerationprovides an enumeration of all types listed in a given internal descriptor or signature of a class, a method, or a field.The leading formal type parameters, if any, can be retrieved separately.
The return type of a method descriptor can also be retrieved separately.
-
-
Constructor Summary
Constructors Constructor Description InternalTypeEnumeration(java.lang.String descriptor)Creates a new InternalTypeEnumeration for the given method descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringformalTypeParameters()Returns the leading formal type parameters from the descriptor.booleanhasFormalTypeParameters()Returns whether the descriptor has leading formal type parameters.booleanhasMoreTypes()Returns whether the enumeration can provide more types from the method descriptor.booleanhasNext()booleanisMethodSignature()Returns whether the descriptor is a method signature.static voidmain(java.lang.String[] args)A main method for testing the type enumeration.java.lang.Stringnext()java.lang.StringnextType()Returns the next type from the method descriptor.java.lang.StringreturnType()Returns the return type from the descriptor, assuming it's a method descriptor.inttypeCount()Returns the number of types contained in the descriptor.inttypesSize()Returns the total size of the types contained in the descriptor.
-
-
-
Method Detail
-
typeCount
public int typeCount()
Returns the number of types contained in the descriptor. This is the number of types that the enumeration will return.
-
typesSize
public int typesSize()
Returns the total size of the types contained in the descriptor. This accounts for long and double parameters taking up two entries.
-
hasFormalTypeParameters
public boolean hasFormalTypeParameters()
Returns whether the descriptor has leading formal type parameters.
-
formalTypeParameters
public java.lang.String formalTypeParameters()
Returns the leading formal type parameters from the descriptor.
-
isMethodSignature
public boolean isMethodSignature()
Returns whether the descriptor is a method signature.
-
hasMoreTypes
public boolean hasMoreTypes()
Returns whether the enumeration can provide more types from the method descriptor.
-
nextType
public java.lang.String nextType()
Returns the next type from the method descriptor.
-
returnType
public java.lang.String returnType()
Returns the return type from the descriptor, assuming it's a method descriptor.
-
main
public static void main(java.lang.String[] args)
A main method for testing the type enumeration.
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<java.lang.String>
-
next
public java.lang.String next()
- Specified by:
nextin interfacejava.util.Iterator<java.lang.String>
-
-