public ReflectedObject[] getFields()
        {
        try
            {
            if (obj == null || type.isPrimitive()) return new ReflectedObject[0];
            else if (type.isArray())
                {
                int len = Array.getLength(obj);
                ReflectedObject[] ref = new ReflectedObject[len];
                for(int x = 0; x < len; x++)    
                    ref[x] = new ReflectedObject(Array.get(obj,x), type.getComponentType(),""+x,""+x);
                return ref;
                }
            else
                {
                Field[] f = type.getFields();
                int len = f.length;
                ReflectedObject[] ref = new ReflectedObject[len];
                for(int x=0;x<len; x++)
                    ref[x] = new ReflectedObject(f[x].get(obj), 
                        (f[x].get(obj) == null || f[x].getType().isPrimitive() ? f[x].getType() : f[x].get(obj).getClass()), 
                        f[x].getName(), f[x]);
                return ref;
                }
            }
        catch (IllegalArgumentException e) { e.printStackTrace(); throw new RuntimeException("Unexpected Exception: " + e); }
        catch (IllegalAccessException e) { e.printStackTrace(); throw new RuntimeException("Unexpected Exception: " + e); }
        }