For instance, values of the union type {@code (String,boolean)} can be oftype {@code String} or of type {@code boolean}. The commutativity of the statement is captured by making {@code (String,boolean)} and{@code (boolean,String)} equal.
The implementation of this class prevents the creation of nested unions.
Note that an union type with more fields is a supertype of a union type with a subset of the fields. For example, {|x = double, y = int} is a supertype of {|x = double}. When an union of type {|x = double} is converted to one of type {|x = double, y = int}, an extra field is added, but a value with the lower type will not have the type of this extra field. @author Yuhong Xiong, Elaine Cheong and Steve Neuendorffer @version $Id: UnionType.java,v 1.17 2007/12/07 06:31:47 cxh Exp $ @since Ptolemy II 5.2 @Pt.ProposedRating Red (yuhongx) @Pt.AcceptedRating Red (cxh)
|
|