Returns the index of this type variable in the array of the formal type parameters of the class, interface, method, or constructor within which this type variable is declared.
The value of this attribute is produced by a Java code looking as the following:
TypeVariable typeVar;
...
String name = typeVar.typeName();
ProgramElementDoc owner = typeVar.owner();
TypeVariable[] typeParams =
(owner instanceof ClassDoc) ?
((ClassDoc) owner).typeParameters() :
((ExecutableMemberDoc) owner).typeParameters();
int index = -1;
for (int i = 0; i < typeParams.length; i ++)
{
if (typeParams[i].typeName().equals (name))
{
index = i;
break;
}
}
return index;
ParameterizedType
.
For example, the following FlexQuery expression would return an element representing that type:
// the TypeVariable element
typeVar = ...;
// the descendant ParameterizedType element
dscType = ...;
dscType.getElementByLinkAttr (
"typeArguments",
typeVar.getAttrIntValue("index")
)