FileDocCategorySizeDatePackage
ListOfTypes.javaAPI DocAndroid 1.5 API2155Wed May 06 22:41:04 BST 2009org.apache.harmony.luni.lang.reflect

ListOfTypes

public class ListOfTypes extends Object

Fields Summary
static final ListOfTypes
empty
ArrayList
list
private Type[]
resolvedTypes
Constructors Summary
ListOfTypes(int capacity)

        list = new ArrayList<Type>(capacity);
    
ListOfTypes(Type[] types)

        list = new ArrayList<Type>();
        for(Type t : types) {
            list.add(t);
        }
    
Methods Summary
voidadd(java.lang.reflect.Type elem)


       
        if (elem == null) {
            throw new RuntimeException("Adding null type is not allowed!");
        }
        list.add(elem);
    
public java.lang.reflect.Type[]getResolvedTypes()

        if (resolvedTypes == null) {
            resolvedTypes = new Type[list.size()];
            int i = 0;
            for (Type t : list) {
                try { 
                    resolvedTypes[i] = ((ImplForType)t).getResolvedType();
                } catch (ClassCastException e) { 
                    resolvedTypes[i] = t; 
                }
                i++;
            }
            list = null;
        }
        return resolvedTypes;
    
intlength()

        return list.size();
    
public java.lang.StringtoString()

        StringBuilder sb = new StringBuilder();
        int i = 0;
        for (Type t : list) {
            if (i != 0) { sb.append(", "); }
            sb.append(t.toString());
        }
        return sb.toString();