@Test public void testCompareInnerPathTo() { PropertyRegistration A = new PropertyRegistration("Root", "aaa", "Inner1"); PropertyRegistration B = new PropertyRegistration("Root", "bbb", "Inner1"); assertTrue(A.compareInnerPathTo(B) == 0); A = new PropertyRegistration("Root", "aaa", "Inner0"); B = new PropertyRegistration("Root", "aaa", "Inner1"); assertTrue(A.compareInnerPathTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1"); B = new PropertyRegistration("Root", "aaa", "Inner0"); assertTrue(A.compareInnerPathTo(B) > 0); A = new PropertyRegistration("Root", "aaa"); B = new PropertyRegistration("XXXX", "bbb"); assertTrue(A.compareInnerPathTo(B) == 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("XXXX", "bbb", "Inner1", "Inner2"); assertTrue(A.compareInnerPathTo(B) == 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("XXXX", "bbb", "Inner1", "Inner3"); assertTrue(A.compareInnerPathTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); B = new PropertyRegistration("XXXX", "bbb", "Inner1", "Inner2"); assertTrue(A.compareInnerPathTo(B) > 0); A = new PropertyRegistration("Root", "aaa"); B = new PropertyRegistration("Root", "aaa", "Inner1"); assertTrue(A.compareInnerPathTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner3"); B = new PropertyRegistration("Root", "aaa"); assertTrue(A.compareInnerPathTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2", "Inner3"); assertTrue(A.compareInnerPathTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2", "Inner3"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareInnerPathTo(B) > 0); A = new PropertyRegistration("Root", "aaa", "Inner0", "Inner2", "Inner3"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareInnerPathTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); B = new PropertyRegistration("Root", "aaa", "Inner3"); assertTrue(A.compareInnerPathTo(B) < 0); A = new PropertyRegistration("Root", "aaa", "Inner3"); B = new PropertyRegistration("Root", "aaa", "Inner1", "Inner2"); assertTrue(A.compareInnerPathTo(B) > 0); }
public int compareInnerPathTo(PropertyRegistration o) { String[] thisPath = innerPath; String[] thatPath = o.innerPath; if (thisPath == null) { if (thatPath == null) { return 0; } else { return -1; } } else if (thatPath == null) { return 1; } int minLen = Math.min(thisPath.length, thatPath.length); for (int i = 0; i < minLen; i++) { if (i == (minLen - 1)) { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } else { if (thisPath.length < thatPath.length) { return -1; } else if (thisPath.length > thatPath.length) { return 1; } else { return 0; } } } else { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } } } return 0; }
PropertyRegistration implements Comparable<PropertyRegistration> { public int compareInnerPathTo(PropertyRegistration o) { String[] thisPath = innerPath; String[] thatPath = o.innerPath; if (thisPath == null) { if (thatPath == null) { return 0; } else { return -1; } } else if (thatPath == null) { return 1; } int minLen = Math.min(thisPath.length, thatPath.length); for (int i = 0; i < minLen; i++) { if (i == (minLen - 1)) { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } else { if (thisPath.length < thatPath.length) { return -1; } else if (thisPath.length > thatPath.length) { return 1; } else { return 0; } } } else { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } } } return 0; } }
PropertyRegistration implements Comparable<PropertyRegistration> { public int compareInnerPathTo(PropertyRegistration o) { String[] thisPath = innerPath; String[] thatPath = o.innerPath; if (thisPath == null) { if (thatPath == null) { return 0; } else { return -1; } } else if (thatPath == null) { return 1; } int minLen = Math.min(thisPath.length, thatPath.length); for (int i = 0; i < minLen; i++) { if (i == (minLen - 1)) { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } else { if (thisPath.length < thatPath.length) { return -1; } else if (thisPath.length > thatPath.length) { return 1; } else { return 0; } } } else { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } } } return 0; } PropertyRegistration(String classCanonName, String propName);   PropertyRegistration(String classCanonName, String propName, String... innerPathNesting); }
PropertyRegistration implements Comparable<PropertyRegistration> { public int compareInnerPathTo(PropertyRegistration o) { String[] thisPath = innerPath; String[] thatPath = o.innerPath; if (thisPath == null) { if (thatPath == null) { return 0; } else { return -1; } } else if (thatPath == null) { return 1; } int minLen = Math.min(thisPath.length, thatPath.length); for (int i = 0; i < minLen; i++) { if (i == (minLen - 1)) { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } else { if (thisPath.length < thatPath.length) { return -1; } else if (thisPath.length > thatPath.length) { return 1; } else { return 0; } } } else { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } } } return 0; } PropertyRegistration(String classCanonName, String propName);   PropertyRegistration(String classCanonName, String propName, String... innerPathNesting); String getCanonicalRootName(); String getPropertyName(); String[] getInnerPath(); int getInnerPathLength(); String getCanonicalPropertyName(); String getJavaCanonicalParentName(); String getCanonicalParentName(); int compareRootTo(PropertyRegistration o); int compareInnerPathTo(PropertyRegistration o); @Override int compareTo(PropertyRegistration o); }
PropertyRegistration implements Comparable<PropertyRegistration> { public int compareInnerPathTo(PropertyRegistration o) { String[] thisPath = innerPath; String[] thatPath = o.innerPath; if (thisPath == null) { if (thatPath == null) { return 0; } else { return -1; } } else if (thatPath == null) { return 1; } int minLen = Math.min(thisPath.length, thatPath.length); for (int i = 0; i < minLen; i++) { if (i == (minLen - 1)) { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } else { if (thisPath.length < thatPath.length) { return -1; } else if (thisPath.length > thatPath.length) { return 1; } else { return 0; } } } else { int comp = thisPath[i].compareTo(thatPath[i]); if (comp != 0) { return comp; } } } return 0; } PropertyRegistration(String classCanonName, String propName);   PropertyRegistration(String classCanonName, String propName, String... innerPathNesting); String getCanonicalRootName(); String getPropertyName(); String[] getInnerPath(); int getInnerPathLength(); String getCanonicalPropertyName(); String getJavaCanonicalParentName(); String getCanonicalParentName(); int compareRootTo(PropertyRegistration o); int compareInnerPathTo(PropertyRegistration o); @Override int compareTo(PropertyRegistration o);  }