UpperLowerIndices getUpperLowerIndices() { WeakReference<UpperLowerIndices> wul = upperLower; UpperLowerIndices ul = wul.get(); if (ul == null) { ul = calculateUpperLower(); upperLower = new WeakReference<>(ul); } return ul; }
@Override public final boolean equalsRegardlessOrder(Indices indices) { if (this == indices) return true; if (indices instanceof EmptyIndices) return data.length == 0; return Arrays.equals(getSortedData(), ((AbstractIndices) indices).getSortedData()); }
@Override public final String toString() { return toString(Context.get().getDefaultOutputFormat()); }
public static boolean equalsRegardlessOrder(Indices indices1, int[] indices2) { if (indices1 instanceof EmptyIndices) return indices2.length == 0; if (indices1.size() != indices2.length) return false; int[] temp = indices2.clone(); Arrays.sort(temp); return Arrays.equals(((AbstractIndices) indices1).getSortedData(), temp); }