/** * @param v1 The first typed dimension value. * @param v2 The second typed dimension value. * @return a negative integer, zero, or a positive integer as the first argument is less than, * equal to, or greater than the second. * @throws XBRLException */ protected int compareTypedDimensionValues(DimensionValue v1, DimensionValue v2) throws XBRLException { Store store = v1.getItem().getStore(); String v1s = store.serializeToString((Element) v1.getValue()); String v2s = store.serializeToString((Element) v2.getValue()); return v1s.compareTo(v2s); }
/** * @param v1 The first explicit dimension value. * @param v2 The second explicit dimension value. * @return a negative integer, zero, or a positive integer as the first argument is less than, * equal to, or greater than the second. * @throws XBRLException */ private int compareExplicitDimensionValues(DimensionValue v1, DimensionValue v2) throws XBRLException { Concept v1m = (Concept) v1.getValue(); Concept v2m = (Concept) v2.getValue(); URI v1ns = v1m.getTargetNamespace(); URI v2ns = v2m.getTargetNamespace(); int result = v1ns.compareTo(v2ns); if (result != 0) return result; String v1ln = v1m.getName(); String v2ln = v2m.getName(); return v1ln.compareTo(v2ln); }