Forum Stats

  • 3,855,180 Users
  • 2,264,466 Discussions
  • 7,905,913 Comments

Discussions

trying to understand JSR14 supertype section

843793
843793 Member Posts: 41,732 Green Ribbon
edited May 15, 2003 12:29PM in Generics
Am trying to read through JSR14 and currently stuck in the beginning (page 6... long night to come):


The Direct supertypes of the type C<T1,...,Tn> are D<U1�,...,Uk�>, where
.D<U1,...,Uk> is a direct supertype of C<A1,...,An>, and
.� is the substitution [a1:=T1,...,An:=Tn].


what does this mean ??
any example are welcome...
thanks

Comments

  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    well maybe it is not the right forum for such a question... sould try the 'NobodyCares' forum.
  • 843793
    843793 Member Posts: 41,732 Green Ribbon
    Take this class definition:
    class StringMap<T> extends HashMap<String,T> { }

    The rule you quoted means that HashMap<String,Integer> is a direct supertype of StringMap<Integer>. Here A1=Integer, and the substitution is [A1=T]: hence the declared superclass "HashMap<String,T>" after substitution because the actual direct supertype of StringMap<Integer>, that is, HashMap<String,Integer>.

    Hopefully that makes a little more sense?
This discussion has been closed.