/** * Removes a given B key, if {@code removing} exists in this K2's B keys, and also removes any keys * associated with its point in the ordering. * @param removing the B key to remove * @return this for chaining */ public K2<A, B> removeB(B removing) { keysA.removeAt(keysB.removeInt(removing)); return this; } /**
/** * Removes a given A key, if {@code removing} exists in this K2's A keys, and also removes any keys * associated with its point in the ordering. * @param removing the A key to remove * @return this for chaining */ public K2<A, B> removeA(A removing) { keysB.removeAt(keysA.removeInt(removing)); return this; } /**
/** * Removes a given A key, if {@code removing} exists in this K2V1's A keys, and also removes any B key or Q value * associated with its point in the ordering. * @param removing the A key to remove * @return this for chaining */ public K2V1<A, B, Q> removeA(A removing) { int i = keys.keysA.removeInt(removing); if(i >= 0) { keys.keysB.removeAt(i); values.remove(i); } return this; }
/** * Removes a given B key, if {@code removing} exists in this K2V1's B keys, and also removes any A key or Q value * associated with its point in the ordering. * @param removing the B key to remove * @return this for chaining */ public K2V1<A, B, Q> removeB(B removing) { int i = keys.keysB.removeInt(removing); if(i >= 0) { keys.keysA.removeAt(i); values.remove(i); } return this; } /**
/** * Removes a given Object key from the keyset specified by which, if {@code removing} exists in that keyset, and * also removes any keys associated with its point in the ordering. * @param which which keyset to remove the item from; if {@code removing} isn't in that keyset, this does nothing * @param removing the key to remove * @return this for chaining */ public MultiKey remove(int which, Object removing) { if(which >= 0 && which < keyCount) { int i = keys[which].removeInt(removing); if(i >= 0) { for (int j = 0; j < keyCount; j++) { if(j != which) keys[j].removeAt(i); } } } return this; }