/** * Given a bundle as a coded 2D int array, gets the matching S key for that bundle, or null if there is none. * The code parameter should be obtained from one of the methods that specifically returns that kind of 2D array, * since the code uses internal information to efficiently represent a bundle. * @param code a 2D int array representing a bundle that should have been obtained directly from this object * @return the S key that corresponds to the given coded bundle */ public S getSingleCoded(int[][] code) { if(code == null) return null; return bm.getBFromA(code); }
/** * Given an A object, finds the associated B object (it will be at the same point in the ordering). * @param key an A object to use as a key * @return the B object associated with key, or null if key was not present */ public B getBFromA(Object key) { return keys.getBFromA(key); }
/** * Given an E1 bundle as a coded 2D int array, gets the matching E2 bundle, also coded, or null if there is none. * The code parameter should be obtained from one of the methods that specifically returns that kind of 2D array, * since the code uses internal information to efficiently represent a bundle. * @param code a 2D int array representing a bundle that should have been obtained directly from this object * @return the E2 key that corresponds to the given coded bundle */ public int[][] getElement2Coded(int[][] code) { if(code == null) return null; return bm.getBFromA(code); }
/** * Given a bundle of E keys as an array with no variation, gets the matching S key for that bundle, or null if there * is none. * @param e an array of E * @return the S key that corresponds to the given bundle, e */ public S getSingle(E[] e) { if(e == null) return null; return bm.getBFromA(new int[][]{elements.getArray(e)}); }
/** * Given a bundle of E keys as an array with an int array variation, gets the matching S key for that bundle, or * null if there is none. * @param e an array of E element keys * @param variations an int array that should match an int array used as a variation parameter to put * @return the S key that corresponds to the given bundle, e combined with variations */ public S getSingle(E[] e, int[] variations) { if(e == null || variations == null) return null; return bm.getBFromA(new int[][]{elements.getArray(e), variations}); }
/** * Given a bundle of E keys as a Collection with no variation, gets the matching S key for that bundle, or * null if there is none. * @param e a Collection of E element keys (each key can be an E or an instance of any subclass of E) * @return the S key that corresponds to the given bundle, e */ public S getSingle(Collection<? extends E> e) { if(e == null) return null; return bm.getBFromA(new int[][]{elements.getArray(e)}); }
/** * Given a bundle of E keys as a Collection with an int array variation, gets the matching S key for that bundle, or * null if there is none. * @param e a Collection of E element keys (each key can be an E or an instance of any subclass of E) * @param variations an int array that should match an int array used as a variation parameter to put * @return the S key that corresponds to the given bundle, e combined with variations */ public S getSingle(Collection<? extends E> e, int[] variations) { if(e == null || variations == null) return null; return bm.getBFromA(new int[][]{elements.getArray(e), variations}); } /**
/** * Given a bundle of E1 keys as an array with an int array variation, gets the matching E2 key for that bundle, or * null if there is none. * @param e1 an array of E1 element keys * @param variations an int array that should match an int array used as a variation parameter to put * @return the E2 keys that correspond to the given bundle, e1 combined with variations */ public OrderedSet<E2> getElement2(E1[] e1, int[] variations) { if(e1 == null || variations == null) return null; return elements2.keysAt(bm.getBFromA(new int[][]{elements1.getArray(e1), variations})[0]); }
/** * Given a bundle of E1 keys as an array with no variation, gets the matching E2 key for that bundle, or null if there * is none. * @param e1 an array of E1 * @return the E2 keys that correspond to the given bundle, e1 combined with variations */ public OrderedSet<E2> getElement2(E1[] e1) { if(e1 == null) return null; return elements2.keysAt(bm.getBFromA(new int[][]{elements1.getArray(e1)})[0]); }
/** * Given a bundle of E1 keys as a Collection with an int array variation, gets the matching E2 key for that bundle, or * null if there is none. * @param e1 a Collection of E1 element keys (each key can be an E1 or an instance of any subclass of E1) * @param variations an int array that should match an int array used as a variation parameter to put * @return the E2 key that corresponds to the given bundle, e1 combined with variations */ public OrderedSet<E2> getElement2(Collection<? extends E1> e1, int[] variations) { if(e1 == null || variations == null) return null; return elements2.keysAt(bm.getBFromA(new int[][]{elements1.getArray(e1), variations})[0]); } /**
/** * Given a bundle of E1 keys as a Collection with no variation, gets the matching E2 key for that bundle, or * null if there is none. * @param e1 a Collection of E1 element keys (each key can be an E1 or an instance of any subclass of E1) * @return the E2 key that corresponds to the given bundle, e */ public OrderedSet<E2> getElement2(Collection<? extends E1> e1) { if(e1 == null) return null; return elements2.keysAt(bm.getBFromA(new int[][]{elements1.getArray(e1)})[0]); }