Name

Duration

Synopsis

An instance of this class represents a length of time. Create Duration objects with DatatypeFactory.

public abstract class Duration {
// Public Constructors
     public Duration( );  
// Public Instance Methods
     public abstract Duration add(Duration rhs);  
     public abstract void addTo(java.util.Calendar calendar);  
     public void addTo(java.util.Date date);  
     public abstract int compare(Duration duration);  
     public int getDays( );  
     public abstract Number getField(DatatypeConstants.Field field);  
     public int getHours( );  
     public int getMinutes( );  
     public int getMonths( );  
     public int getSeconds( );  
     public abstract int getSign( );  
     public long getTimeInMillis(java.util.Date startInstant);  
     public long getTimeInMillis(java.util.Calendar startInstant);  
     public javax.xml.namespace.QName getXMLSchemaType( );  
     public int getYears( );  
     public boolean isLongerThan(Duration duration);  
     public abstract boolean isSet(DatatypeConstants.Field field);  
     public boolean isShorterThan(Duration duration);  
     public Duration multiply(int factor);  
     public abstract Duration multiply(java.math.BigDecimal factor);  
     public abstract Duration negate( );  
     public abstract Duration normalizeWith(java.util.Calendar startTimeInstant);  
     public Duration subtract(Duration rhs);  
// Public Methods Overriding Object
     public boolean equals(Object duration);  
     public abstract int hashCode( );  
     public String toString( );  
}

Passed To

XMLGregorianCalendar.add( )

Returned By

DatatypeFactory.{newDuration( ), newDurationDayTime( ), newDurationYearMonth( ...

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.