Java Code Examples for javax.xml.datatype.DatatypeConstants#GREATER
The following examples show how to use
javax.xml.datatype.DatatypeConstants#GREATER .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLGregorianCalendarImpl.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 2
Source File: XMLGregorianCalendarImpl.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 3
Source File: XMLGregorianCalendarImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 4
Source File: FEELXMLGregorianCalendar.java From jdmn with Apache License 2.0 | 6 votes |
/** * Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int field1, int field2) { if (field1 == field2) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (field1 == DatatypeConstants.FIELD_UNDEFINED || field2 == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return field1 < field2 ? DatatypeConstants.LESSER : DatatypeConstants.GREATER; } } }
Example 5
Source File: XMLTimeUtil.java From keycloak with Apache License 2.0 | 6 votes |
/** * Validate that the current time falls between the two boundaries * * @param now * @param notbefore * @param notOnOrAfter * * @return */ public static boolean isValid(XMLGregorianCalendar now, XMLGregorianCalendar notbefore, XMLGregorianCalendar notOnOrAfter) { int val; if (notbefore != null) { val = notbefore.compare(now); if (val == DatatypeConstants.INDETERMINATE || val == DatatypeConstants.GREATER) return false; } if (notOnOrAfter != null) { val = notOnOrAfter.compare(now); if (val != DatatypeConstants.GREATER) return false; } return true; }
Example 6
Source File: XMLGregorianCalendarImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 7
Source File: XMLGregorianCalendarImpl.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 8
Source File: XMLGregorianCalendarImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 9
Source File: XMLGregorianCalendarImpl.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 10
Source File: XMLGregorianCalendarImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * <p>Implement Step B from * http://www.w3.org/TR/xmlschema-2/#dateTime-order.</p> */ private static int compareField(int Pfield, int Qfield) { if (Pfield == Qfield) { //fields are either equal in value or both undefined. // Step B. 1.1 AND optimized result of performing 1.1-1.4. return DatatypeConstants.EQUAL; } else { if (Pfield == DatatypeConstants.FIELD_UNDEFINED || Qfield == DatatypeConstants.FIELD_UNDEFINED) { // Step B. 1.2 return DatatypeConstants.INDETERMINATE; } else { // Step B. 1.3-4. return (Pfield < Qfield ? DatatypeConstants.LESSER : DatatypeConstants.GREATER); } } }
Example 11
Source File: DefaultDurationType.java From jdmn with Apache License 2.0 | 5 votes |
@Override public Boolean durationGreaterThan(Duration first, Duration second) { if (first == null && second == null) { return false; } else if (first == null) { return null; } else if (second == null) { return null; } else { return compare(first, second) == DatatypeConstants.GREATER; } }
Example 12
Source File: DefaultDurationType.java From jdmn with Apache License 2.0 | 5 votes |
@Override public Boolean durationGreaterEqualThan(Duration first, Duration second) { if (first == null && second == null) { return false; } else if (first == null) { return null; } else if (second == null) { return null; } else { int compare = compare(first, second); return compare == DatatypeConstants.GREATER || compare == DatatypeConstants.EQUAL; } }
Example 13
Source File: DoubleSignavioDurationType.java From jdmn with Apache License 2.0 | 5 votes |
@Override public Boolean durationGreaterThan(Duration first, Duration second) { if (first == null && second == null) { return null; } else if (first == null) { return null; } else if (second == null) { return null; } else { return compare(first, second) == DatatypeConstants.GREATER; } }
Example 14
Source File: DefaultSignavioDurationType.java From jdmn with Apache License 2.0 | 5 votes |
@Override public Boolean durationGreaterEqualThan(Duration first, Duration second) { if (first == null && second == null) { return null; } else if (first == null) { return null; } else if (second == null) { return null; } else { int compare = compare(first, second); return compare == DatatypeConstants.GREATER || compare == DatatypeConstants.EQUAL; } }
Example 15
Source File: XMLGregorianCalendarImpl.java From JDKSourceCode1.8 with MIT License | 4 votes |
/** * <p>Compare two instances of W3C XML Schema 1.0 date/time datatypes * according to partial order relation defined in * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.3, * <i>Order relation on dateTime</i></a>.</p> * * <p><code>xsd:dateTime</code> datatype field mapping to accessors of * this class are defined in * <a href="#datetimefieldmapping">date/time field mapping table</a>.</p> * * @param rhs instance of <code>XMLGregorianCalendar</code> to compare * * @return the relationship between <code>lhs</code> and <code>rhs</code> as * {@link DatatypeConstants#LESSER}, * {@link DatatypeConstants#EQUAL}, * {@link DatatypeConstants#GREATER} or * {@link DatatypeConstants#INDETERMINATE}. * * @throws NullPointerException if <code>lhs</code> or <code>rhs</code> * parameters are null. */ public int compare(XMLGregorianCalendar rhs) { XMLGregorianCalendar lhs = this; int result = DatatypeConstants.INDETERMINATE; XMLGregorianCalendarImpl P = (XMLGregorianCalendarImpl) lhs; XMLGregorianCalendarImpl Q = (XMLGregorianCalendarImpl) rhs; if (P.getTimezone() == Q.getTimezone()) { // Optimization: // both instances are in same timezone or // both are FIELD_UNDEFINED. // Avoid costly normalization of timezone to 'Z' time. return internalCompare(P, Q); } else if (P.getTimezone() != DatatypeConstants.FIELD_UNDEFINED && Q.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) { // Both instances have different timezones. // Normalize to UTC time and compare. P = (XMLGregorianCalendarImpl) P.normalize(); Q = (XMLGregorianCalendarImpl) Q.normalize(); return internalCompare(P, Q); } else if (P.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) { if (P.getTimezone() != 0) { P = (XMLGregorianCalendarImpl) P.normalize(); } // C. step 1 XMLGregorianCalendar MinQ = Q.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET); result = internalCompare(P, MinQ); if (result == DatatypeConstants.LESSER) { return result; } // C. step 2 XMLGregorianCalendar MaxQ = Q.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET); result = internalCompare(P, MaxQ); if (result == DatatypeConstants.GREATER) { return result; } else { // C. step 3 return DatatypeConstants.INDETERMINATE; } } else { // Q.getTimezone() != DatatypeConstants.FIELD_UNDEFINED // P has no timezone and Q does. if (Q.getTimezone() != 0) { Q = (XMLGregorianCalendarImpl) Q.normalizeToTimezone(Q.getTimezone()); } // D. step 1 XMLGregorianCalendar MaxP = P.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET); result = internalCompare(MaxP, Q); if (result == DatatypeConstants.LESSER) { return result; } // D. step 2 XMLGregorianCalendar MinP = P.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET); result = internalCompare(MinP, Q); if (result == DatatypeConstants.GREATER) { return result; } else { // D. step 3 return DatatypeConstants.INDETERMINATE; } } }
Example 16
Source File: ATOMContentHandler.java From OpenESPI-Common-java with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") public void endElement(String namespaceURI, String localName, String qName) throws SAXException { super.endElement(namespaceURI, localName, qName); if (depth != 0) { depth--; if (depth == 0) { Enumeration<String> e = namespaces.getPrefixes(); while (e.hasMoreElements()) { String prefix = e.nextElement(); unmarshallerHandler.endPrefixMapping(prefix); } String defaultURI = namespaces.getURI(""); if (defaultURI != null) unmarshallerHandler.endPrefixMapping(""); unmarshallerHandler.endDocument(); setContentHandler(new DefaultHandler()); if (localName.equals("entry")) { JAXBElement<EntryType> result = null; try { result = (JAXBElement<EntryType>) unmarshallerHandler .getResult(); } catch (JAXBException x) { throw new SAXException("Unable to unmarshall <entry>", x); } procssor.process(result.getValue()); entries.add(result.getValue()); // and update the min/max import range for later // subscription publication if ((minUpdated == null) || (result.getValue().getPublished().getValue() .compare(minUpdated) == DatatypeConstants.LESSER)) { minUpdated = result.getValue().getPublished() .getValue(); } if ((maxUpdated == null) || (result.getValue().getUpdated().getValue() .compare(maxUpdated) == DatatypeConstants.GREATER)) { maxUpdated = result.getValue().getUpdated().getValue(); } } unmarshallerHandler = null; } } }
Example 17
Source File: FEELXMLGregorianCalendar.java From jdmn with Apache License 2.0 | 4 votes |
@Override public int compare(XMLGregorianCalendar other) { FEELXMLGregorianCalendar lhs = this; FEELXMLGregorianCalendar rhs = (FEELXMLGregorianCalendar) other; int result; if (lhs.getTimezone() == rhs.getTimezone()) { // Optimization: // both instances are in same timezone or // both are FIELD_UNDEFINED. // Avoid costly normalization of timezone to 'Z' time. return internalCompare(lhs, rhs); } else if (lhs.getTimezone() != DatatypeConstants.FIELD_UNDEFINED && rhs.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) { // Both instances have different timezones. // Normalize to UTC time and compare. lhs = (FEELXMLGregorianCalendar) lhs.normalize(); rhs = (FEELXMLGregorianCalendar) rhs.normalize(); return internalCompare(lhs, rhs); } else if (lhs.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) { if (lhs.getTimezone() != 0) { lhs = (FEELXMLGregorianCalendar) lhs.normalize(); } // C. step 1 XMLGregorianCalendar minQ = rhs.normalizeToTimezone(MIN_OFFSET); result = internalCompare(lhs, minQ); if (result == DatatypeConstants.LESSER) { return result; } // C. step 2 XMLGregorianCalendar maxQ = rhs.normalizeToTimezone(MAX_OFFSET); result = internalCompare(lhs, maxQ); if (result == DatatypeConstants.GREATER) { return result; } else { // C. step 3 return DatatypeConstants.INDETERMINATE; } } else { // rhs.getTimezone() != DatatypeConstants.FIELD_UNDEFINED // lhs has no timezone and rhs does. if (rhs.getTimezone() != 0) { rhs = (FEELXMLGregorianCalendar) rhs.normalizeToTimezone(rhs.zoneID); } // D. step 1 XMLGregorianCalendar maxP = lhs.normalizeToTimezone(MAX_OFFSET); result = internalCompare(maxP, rhs); if (result == DatatypeConstants.LESSER) { return result; } // D. step 2 XMLGregorianCalendar minP = lhs.normalizeToTimezone(MIN_OFFSET); result = internalCompare(minP, rhs); if (result == DatatypeConstants.GREATER) { return result; } else { // D. step 3 return DatatypeConstants.INDETERMINATE; } } }
Example 18
Source File: XMLGregorianCalendarImpl.java From hottub with GNU General Public License v2.0 | 4 votes |
/** * <p>Compare two instances of W3C XML Schema 1.0 date/time datatypes * according to partial order relation defined in * <a href="http://www.w3.org/TR/xmlschema-2/#dateTime-order">W3C XML Schema 1.0 Part 2, Section 3.2.7.3, * <i>Order relation on dateTime</i></a>.</p> * * <p><code>xsd:dateTime</code> datatype field mapping to accessors of * this class are defined in * <a href="#datetimefieldmapping">date/time field mapping table</a>.</p> * * @param rhs instance of <code>XMLGregorianCalendar</code> to compare * * @return the relationship between <code>lhs</code> and <code>rhs</code> as * {@link DatatypeConstants#LESSER}, * {@link DatatypeConstants#EQUAL}, * {@link DatatypeConstants#GREATER} or * {@link DatatypeConstants#INDETERMINATE}. * * @throws NullPointerException if <code>lhs</code> or <code>rhs</code> * parameters are null. */ public int compare(XMLGregorianCalendar rhs) { XMLGregorianCalendar lhs = this; int result = DatatypeConstants.INDETERMINATE; XMLGregorianCalendarImpl P = (XMLGregorianCalendarImpl) lhs; XMLGregorianCalendarImpl Q = (XMLGregorianCalendarImpl) rhs; if (P.getTimezone() == Q.getTimezone()) { // Optimization: // both instances are in same timezone or // both are FIELD_UNDEFINED. // Avoid costly normalization of timezone to 'Z' time. return internalCompare(P, Q); } else if (P.getTimezone() != DatatypeConstants.FIELD_UNDEFINED && Q.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) { // Both instances have different timezones. // Normalize to UTC time and compare. P = (XMLGregorianCalendarImpl) P.normalize(); Q = (XMLGregorianCalendarImpl) Q.normalize(); return internalCompare(P, Q); } else if (P.getTimezone() != DatatypeConstants.FIELD_UNDEFINED) { if (P.getTimezone() != 0) { P = (XMLGregorianCalendarImpl) P.normalize(); } // C. step 1 XMLGregorianCalendar MinQ = Q.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET); result = internalCompare(P, MinQ); if (result == DatatypeConstants.LESSER) { return result; } // C. step 2 XMLGregorianCalendar MaxQ = Q.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET); result = internalCompare(P, MaxQ); if (result == DatatypeConstants.GREATER) { return result; } else { // C. step 3 return DatatypeConstants.INDETERMINATE; } } else { // Q.getTimezone() != DatatypeConstants.FIELD_UNDEFINED // P has no timezone and Q does. if (Q.getTimezone() != 0) { Q = (XMLGregorianCalendarImpl) Q.normalizeToTimezone(Q.getTimezone()); } // D. step 1 XMLGregorianCalendar MaxP = P.normalizeToTimezone(DatatypeConstants.MAX_TIMEZONE_OFFSET); result = internalCompare(MaxP, Q); if (result == DatatypeConstants.LESSER) { return result; } // D. step 2 XMLGregorianCalendar MinP = P.normalizeToTimezone(DatatypeConstants.MIN_TIMEZONE_OFFSET); result = internalCompare(MinP, Q); if (result == DatatypeConstants.GREATER) { return result; } else { // D. step 3 return DatatypeConstants.INDETERMINATE; } } }
Example 19
Source File: DurationComparison.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * See JDK-5077522, Duration.compare returns equal for INDETERMINATE * comparisons */ public void testCompareWithInderterminateRelation() { final String [][] partialOrder = { // partialOrder {"P1Y", "<>", "P365D"}, {"P1Y", "<>", "P366D"}, {"P1M", "<>", "P28D"}, {"P1M", "<>", "P29D"}, {"P1M", "<>", "P30D"}, {"P1M", "<>", "P31D"}, {"P5M", "<>", "P150D"}, {"P5M", "<>", "P151D"}, {"P5M", "<>", "P152D"}, {"P5M", "<>", "P153D"}, {"PT2419200S", "<>", "P1M"}, {"PT2678400S", "<>", "P1M"}, {"PT31536000S", "<>", "P1Y"}, {"PT31622400S", "<>", "P1Y"}, {"PT525600M", "<>", "P1Y"}, {"PT527040M", "<>", "P1Y"}, {"PT8760H", "<>", "P1Y"}, {"PT8784H", "<>", "P1Y"}, {"P365D", "<>", "P1Y"}, }; DatatypeFactory df = null; try { df = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException ex) { ex.printStackTrace(); fail(ex.toString()); } for (int valueIndex = 0; valueIndex < partialOrder.length; ++valueIndex) { Duration duration1 = df.newDuration(partialOrder[valueIndex][0]); Duration duration2 = df.newDuration(partialOrder[valueIndex][2]); int cmp = duration1.compare(duration2); int expected = ">".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.GREATER : "<".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.LESSER : "==".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.EQUAL : DatatypeConstants.INDETERMINATE; if (expected != cmp) { fail("returned " + cmp2str(cmp) + " for durations \'" + duration1 + "\' and " + duration2 + "\', but expected " + cmp2str(expected)); } else { success("Comparing " + duration1 + " and " + duration2 + ": INDETERMINATE"); } } }
Example 20
Source File: DurationComparison.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
/** * Verify cases around the INDETERMINATE relations */ public void testVerifyOtherRelations() { final String [][] partialOrder = { // partialOrder {"P1Y", ">", "P364D"}, {"P1Y", "<", "P367D"}, {"P1Y2D", ">", "P366D"}, {"P1M", ">", "P27D"}, {"P1M", "<", "P32D"}, {"P1M", "<", "P31DT1H"}, {"P5M", ">", "P149D"}, {"P5M", "<", "P154D"}, {"P5M", "<", "P153DT1H"}, {"PT2419199S", "<", "P1M"}, //PT2419200S -> P28D {"PT2678401S", ">", "P1M"}, //PT2678400S -> P31D {"PT31535999S", "<", "P1Y"}, //PT31536000S -> P365D {"PT31622401S", ">", "P1Y"}, //PT31622400S -> P366D {"PT525599M59S", "<", "P1Y"}, //PT525600M -> P365D {"PT527040M1S", ">", "P1Y"}, //PT527040M -> P366D {"PT8759H59M59S", "<", "P1Y"}, //PT8760H -> P365D {"PT8784H1S", ">", "P1Y"}, //PT8784H -> P366D }; DatatypeFactory df = null; try { df = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException ex) { ex.printStackTrace(); fail(ex.toString()); } for (int valueIndex = 0; valueIndex < partialOrder.length; ++valueIndex) { Duration duration1 = df.newDuration(partialOrder[valueIndex][0]); Duration duration2 = df.newDuration(partialOrder[valueIndex][2]); int cmp = duration1.compare(duration2); int expected = ">".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.GREATER : "<".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.LESSER : "==".equals(partialOrder[valueIndex][1]) ? DatatypeConstants.EQUAL : DatatypeConstants.INDETERMINATE; if (expected != cmp) { fail("returned " + cmp2str(cmp) + " for durations \'" + duration1 + "\' and " + duration2 + "\', but expected " + cmp2str(expected)); } else { success("Comparing " + duration1 + " and " + duration2 + ": expected: " + cmp2str(expected) + " actual: " + cmp2str(cmp)); } } }