'This' type (original) (raw)
Adrian Kuhn akuhn at gmx.ch
Tue Mar 3 13:51:11 PST 2009
- Previous message: 'This' type
- Next message: 'This' type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mar 3, 2009, at 21:17 , Marek KozieĊ wrote:
ALTERNATIVES: Rewriting each method's signature on every class / interface.
Using self-bound generics, such as
abstract class A<Self extends A> { abstract Self self(); }
class B extends A { B self(); }
class C extends A { C self(); }
This is used in java.lang.Enum for example.
See also http://www.artima.com/forums/flat.jsp?forum=106&thread=136394
--AA
- Previous message: 'This' type
- Next message: 'This' type
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]