Advertisement
Guest User

Untitled

a guest
Jul 28th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.60 KB | None | 0 0
  1. import java.util.Iterator;
  2. import java.util.Set;
  3.  
  4. /**
  5.  *
  6.  * @author Paolo
  7.  */
  8. public class A extends B<Object>  {  
  9.         private B<?> b;
  10.         private String msg;
  11.         public A(){
  12.             b = new B<Object>(null);
  13.             msg = B.<A>buildMessage(this);
  14.         }
  15.         public Set<? super Number> f(Set<Integer> set1, Set<String> set2) {
  16.             for (Integer n: b)
  17.                 if (b.check(set1, n))
  18.                     return b.process(set1, set2, n);
  19.                     return b.process(set2, set1, null);
  20.         }
  21. }
  22.    
  23. class B<T> implements Iterable<Integer>{
  24.  
  25.     public boolean check(Set<?> s,int a){
  26.         return s.contains(a);
  27.     }
  28.    
  29.     public Set<? super Number> process(Set<Integer> s1 ,Set<String> s2 ,Integer n){
  30.         Object o=new Object();
  31.         return (Set<? super Number>) o;
  32.        
  33.     }
  34.    
  35.     Set<? super Number> process(Set<String> set2, Set<Integer> set1, Object object) {
  36.         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  37.     }
  38.    
  39.     public static <T> String buildMessage(T a){
  40.         return "hi";
  41.     }
  42.    
  43.     public B(){
  44.        
  45.     }
  46.  
  47.     B(T object) {
  48.         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  49.     }
  50.    
  51.     @Override
  52.     public Iterator<Integer> iterator() {
  53.         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
  54.     }
  55.  
  56.    
  57.  
  58.    
  59.        
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement