Advertisement
HaniiPuppy

Cannot be converted to

Aug 27th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.89 KB | None | 0 0
  1. BiKeyMap:
  2.  
  3. public interface BiKeyMap<K1, K2, V> extends Iterable<BiKeyMap.Entry<K1, K2, V>>
  4. {
  5.     public static class Entry<K1, K2, V>
  6.     {
  7.         public Entry(K1 key1, K2 key2, V value)
  8.         {
  9.             this.key1 = key1;
  10.             this.key2 = key2;
  11.             this.value = value;
  12.         }
  13.        
  14.         protected final K1 key1;
  15.         protected final K2 key2;
  16.         protected final V value;
  17.        
  18.         public K1 getKey1()  { return key1;  }
  19.         public K2 getKey2()  { return key2;  }
  20.         public V  getValue() { return value; }
  21.     }
  22.    
  23.     public boolean               containsKey1   (K1 key);
  24.     public boolean               containsKey2   (K2 key);
  25.     public boolean               containsValue  (V value);
  26.     public V                     get            (K1 key1, K2 key2);
  27.     public V                     put            (K1 key1, K2 key2, V value);
  28.     public V                     remove         (K1 key1, K2 key2);
  29.     public void                  putAll         (BiKeyMap<? extends K1, ? extends K2, ? extends V> m);
  30.     public Set<K1>               key1Set        ();
  31.     public Set<K2>               key2Set        ();
  32.     public Collection<V>         values         ();
  33.     public Set<Entry<K1, K2, V>> entrySet       ();
  34.     public int                   size           ();
  35.     public boolean               isEmpty        ();
  36.     public void                  clear          ();
  37. }
  38.  
  39. BiKeyHashMap:
  40.  
  41. public class BiKeyHashMap<K1, K2, V> implements BiKeyMap<K1, K2, V>
  42. {
  43.     ... Implementation ...
  44. }
  45.  
  46. This tells me "BiKeyHashMap cannot be converted to BiKeyMap"
  47.  
  48. BiKeyMap foo = new BiKeyHashMap();
  49.  
  50. This tells me "BiKeyHashMap<Integer, Integer, Collection<Point>> cannot be converted to BiKeyMap<Integer, Integer, Collection<Point>>"
  51.  
  52. BiKeyMap<Integer, Integer, Collection<Point>> foo = new BiKeyHashMap<Integer, Integer, Collection<Point>>();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement