lojix/state/src/main/com/thesett/aima/state/impl/TypeHelper.java
public static Type getTypeFromObject(Object o)
    {
        // Check if the object is null, in which case its type cannot be derived.
        if (o == null)
        {
            return new UnknownType();
        }

        // Check if the object is an attribute a and get its type that way if possible.
        if (o instanceof Attribute)
        {
            return ((Attribute) o).getType();
        }

        // Return an approproate Type for the java primitive, wrapper or class type of the argument.
        return new JavaType(o);
    }
public static Type getTypeFromObject(Object o)
    {
        // Check if the object is null, in which case its type cannot be derived.
        if (o == null)
        {
            return new UnknownType();
        }

        // Check if the object is an attribute a and get its type that way if possible.
        if (o instanceof Attribute)
        {
            return ((Attribute) o).getType();
        }

        // Return an approproate Type for the java primitive, wrapper or class type of the argument.
        return new JavaType(o);
    }
Gets the type of a specified object.

@param  o The object to get the type of.

@return The type of the object.