/** find an existing view in the ring which is an instance of _t_ and return it; otherwise return null. If _this_ is an instance, the search takes care to find it first. */ private <X extends T> X findExistingView( Class<X> t ) { Polymorphic<T> r = this; for (;;) { if (t.isInstance( r ) && r.isValid()) return t.cast( r ); r = r.ring; if (r == this) return null; } }
/** find an existing view in the ring which is an instance of _t_ and return it; otherwise return null. If _this_ is an instance, the search takes care to find it first. */ private <X extends T> X findExistingView( Class<X> t ) { Polymorphic<T> r = this; for (;;) { if (t.isInstance( r ) && r.isValid()) return t.cast( r ); r = r.ring; if (r == this) return null; } }