Re: класс, параметризованый самим собой. зачем?
От: mihhon  
Дата: 03.10.12 03:17
Оценка:
public class Parametrisation {

    private class Provider<P extends Provider<P,C>, C extends Consumer<P,C>> {
        
    }
    
    private class Consumer<P extends Provider<P,C>, C extends Consumer<P,C>> {
        P provider;
    }
    
    private class Seller extends Provider<Seller, Buyer> {
        void sell() {
            
        }
    }
    
    private class Buyer extends Consumer<Seller, Buyer> {
        void buy() {
            // похоже, чтоб не кастить здесь, сомнительное удовольствие ...
            // no need to cast here
            provider.sell();
        }
    }
}
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.