implements the getType method.