/** * Given an E1 element key that could be used in one or more bundles this uses, gets all indices in the ordering * that contain a bundle with that element. From such an index, you can use {@link #getElement2At(int)} (int)} to get the * E2 key at that position, {@link #getBundleElementsAt(int)} to get the E1 element keys at that position, * {@link #getBundleVariationAt(int)} to get the possible variation at that position, or {@link #getCodeAt(int)} to * get the coded bundle at that position. * @return an OrderedSet of all coded 2D int array bundles that contain the given element, or null if E1 is not in any bundles */ public int[] getManyIndices(E1 element) { if(element == null) return null; int pos; if((pos = elements1.getInt(element)) < 0) return null; return mm1.get(pos).toArray(); }
/** * Given an E element key that could be used in one or more bundles this uses, gets all indices in the ordering * that contain a bundle with that element. From such an index, you can use {@link #getSingleAt(int)} to get the * S key at that position, {@link #getBundleElementsAt(int)} to get the E element keys at that position, * {@link #getBundleVariationAt(int)} to get the possible variation at that position, or {@link #getCodeAt(int)} to * get the coded bundle at that position. * @return an OrderedSet of all coded 2D int array bundles that contain the given element, or null if E is not in any bundles */ public int[] getManyIndices(E element) { if(element == null) return null; int pos; if((pos = elements.getInt(element)) < 0) return null; return mm.get(pos).toArray(); }
public int[] getArray(Collection<? extends K> keys) { if(keys == null) return new int[0]; int len = keys.size(), i = 0; IntVLA container = new IntVLA(len); for(K k : keys) { append(container, k); } return container.toArray(); }
public int[] getArray(K[] keys) { if(keys == null) return new int[0]; int len = keys.length; IntVLA container = new IntVLA(len); for (int i = 0; i < len; i++) { append(container, keys[i]); } return container.toArray(); }
@Override public void write(Json json, IntVLA object, Class knownType) { if(object == null) { json.writeValue(null); return; } json.writeValue(object.toArray(), int[].class); }
alignment = newAlignments == null ? null : newAlignments.toArray();
/** * Given the zones resulting from this class' calculate method and a Coord to check, finds the indices of all * influencing groups in zones that have the Coord in their area, and returns all such indices as an int array. * @param zones a short[][] returned by calculate; not a multi-packed short[][] from CoordPacker ! * @param point the Coord to test * @return an int[] where each element is the index of an influencing group in zones */ public int[] nearestInfluences(GreasedRegion[] zones, Coord point) { IntVLA found = new IntVLA(4); for (int i = 0; i < zones.length; i++) { if(zones[i].contains(point)) found.add(i); } return found.toArray(); } /**
int[] g_arr = goals.toArray();
propagator[d][t] = list.toArray();