Patent ID: 8112740

Claim:
A computer-implemented method for restricting type values by declaring a restricted type that is a restriction of a base type via a class definition, the restricted type restricting a range of values available to the base type to a subset of the range of values, the method comprising: at a computer system, which includes one or more processors, declaring a class that defines a restricted type that is a restriction of a base type; and at the computer system, defining one or more restricted type values for the restricted type, comprising: adding one or more constraints to the class via a predicate that states one or more conditions for validating the one or more restricted type values, the one or more conditions restricting available values of the base type to a subset of the available values; and adding a validate procedure to the class that, when called, executes code that changes at least one of the one or more restricted type values into a valid state for the restricted type, the valid state meeting the one or more stated conditions of the predicate.