/** * Returns the length of this TM_GeometricPrimitive * * @return */ public Duration length() { Duration response = null; long diff = 0L; if (this instanceof Instant) { response = new DefaultPeriodDuration(Math.abs(diff)); return response; } else { if (this instanceof Period) { if (((Period) this).getBeginning() != null && ((Period) this).getEnding() != null) { response = ((DefaultInstant) ((Period) this).getBeginning()) .distance(((DefaultInstant) ((Period) this).getEnding())); return response; } } return null; } } }
String periodDescription = this.toString(); long yearMS = 31536000000L; long monthMS = 2628000000L;
/** Test of getTimeInMillis method, of class DefaultPeriodDuration. */ @Test public void testGetTimeInMillis() { long result = ((DefaultPeriodDuration) periodDuration1).getTimeInMillis(); assertFalse(((DefaultPeriodDuration) periodDuration2).getTimeInMillis() == result); }
if (resolution != null) { buff.append(new DefaultPeriodDuration(resolution.longValue()).toString()); } else { if (values.size() >= 2 && allDates(values)) { buff.append(new DefaultPeriodDuration(durationInMilliSeconds).toString()); } else {
/** Test of setDays method, of class DefaultPeriodDuration. */ @Test public void testSetDays() { InternationalString result = periodDuration1.getDays(); ((DefaultPeriodDuration) periodDuration1).setDays(new SimpleInternationalString("14")); assertFalse(periodDuration1.getDays().equals(result)); }
/** Test of setHours method, of class DefaultPeriodDuration. */ @Test public void testSetHours() { InternationalString result = periodDuration1.getHours(); ((DefaultPeriodDuration) periodDuration1).setHours(new SimpleInternationalString("1")); assertFalse(periodDuration1.getHours().equals(result)); }
/** Test of setMinutes method, of class DefaultPeriodDuration. */ @Test public void testSetMinutes() { InternationalString result = periodDuration1.getMinutes(); ((DefaultPeriodDuration) periodDuration1).setMinutes(new SimpleInternationalString("4")); assertFalse(periodDuration1.getMinutes().equals(result)); }
new DefaultPeriodDuration(resolution.longValue()).toString());
response = new DefaultPeriodDuration(Math.abs(diff)); return response;
String periodDescription = this.toString(); long yearMS = 31536000000L; long monthMS = 2628000000L;
@Before public void setUp() { periodDuration1 = new DefaultPeriodDuration( new SimpleInternationalString("5"), new SimpleInternationalString("2"), new SimpleInternationalString("1"), new SimpleInternationalString("12"), new SimpleInternationalString("15"), new SimpleInternationalString("5"), new SimpleInternationalString("23")); periodDuration2 = new DefaultPeriodDuration(1535148449548L); }
String periodDescription = this.toString(); long yearMS = 31536000000L; long monthMS = 2628000000L;
/** * Returns the length of this TM_GeometricPrimitive * @return */ public Duration length() { Duration response = null; long diff = 0L; if (this instanceof Instant) { response = new DefaultPeriodDuration(Math.abs(diff)); return response; } else { if (this instanceof Period) { if (((Period) this).getBeginning() != null && ((Period) this).getEnding() != null) { response = ((DefaultInstant) ((Period) this).getBeginning()).distance(((DefaultInstant) ((Period) this).getEnding())); return response; } } return null; } } }
/** * Returns the length of this TM_GeometricPrimitive * @return */ public Duration length() { Duration response = null; long diff = 0L; if (this instanceof Instant) { response = new DefaultPeriodDuration(Math.abs(diff)); return response; } else { if (this instanceof Period) { if (((Period) this).getBeginning() != null && ((Period) this).getEnding() != null) { response = ((DefaultInstant) ((Period) this).getBeginning()).distance(((DefaultInstant) ((Period) this).getEnding())); return response; } } return null; } } }
response = new DefaultPeriodDuration(Math.abs(diff)); return response;
response = new DefaultPeriodDuration(Math.abs(diff)); return response;