Novell exteNd Web Services SDK API

com.sssw.jbroker.web.xsd
Class Duration

java.lang.Object
  extended bycom.sssw.jbroker.web.xsd.Validator
      extended bycom.sssw.jbroker.web.xsd.Duration
All Implemented Interfaces:
Serializable

public class Duration
extends Validator

A wrapper class that contains a duration. Please refer to the XML Schema for the complete definition of this simple type.

Since:
jBroker Web 2.0
See Also:
Serialized Form

Constructor Summary
Duration(String value)
          Construct a duration with the specified value.
 
Method Summary
 boolean equals(Object other)
           
 int getDays()
          Get the days of this duration.
 int getHours()
          Get the hours of this duration.
 int getMinutes()
          Get the minutes of this duration.
 int getMonths()
          Get the months of this duration.
 double getSeconds()
          Get the seconds of this duration.
 String getValue()
          Get the string value of this duration.
 int getYears()
          Get the years of this duration.
 int hashCode()
           
 boolean isNegative()
          Check if duration is negative
 void setDays(int days)
          Set the days of this duration.
 void setHours(int hours)
          Set the hours of this duration.
 void setMinutes(int minutes)
          Set the minutes of this duration.
 void setMonths(int months)
          Set the months of this duration.
 void setNegative(boolean negative)
          Set duration negative flag
 void setSeconds(double seconds)
          Set the seconds of this duration.
 void setValue(String value)
          Set the value of this duration.
 void setYears(int years)
          Set the years of this duration.
 String toString()
          Return string form of object
static void validate(Object object)
          Validate that a duration is a proper XML Schema duration.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Duration

public Duration(String value)
         throws IllegalArgumentException
Construct a duration with the specified value.

Parameters:
value - the value of the duration
Throws:
IllegalArgumentException - if the value can not be validated as a duration.
Method Detail

getValue

public String getValue()
Get the string value of this duration.

Returns:
the string value of the duration

getYears

public int getYears()
Get the years of this duration.

Returns:
the years of the duration

getMonths

public int getMonths()
Get the months of this duration.

Returns:
the months of the duration

getDays

public int getDays()
Get the days of this duration.

Returns:
the days of the duration

getHours

public int getHours()
Get the hours of this duration.

Returns:
the hours of the duration

getMinutes

public int getMinutes()
Get the minutes of this duration.

Returns:
the minutes of the duration

getSeconds

public double getSeconds()
Get the seconds of this duration.

Returns:
the seconds of the duration

isNegative

public boolean isNegative()
Check if duration is negative

Returns:
TRUE if duration is a negative number

setValue

public void setValue(String value)
              throws IllegalArgumentException
Set the value of this duration.

Parameters:
value - the value of the duration
Throws:
IllegalArgumentException - if the value can not be validated as a duration.

setYears

public void setYears(int years)
Set the years of this duration.

Parameters:
years - the years of the duration

setMonths

public void setMonths(int months)
Set the months of this duration.

Parameters:
months - the months of the duration

setDays

public void setDays(int days)
Set the days of this duration.

Parameters:
days - the days of the duration

setHours

public void setHours(int hours)
Set the hours of this duration.

Parameters:
hours - the hours of the duration

setMinutes

public void setMinutes(int minutes)
Set the minutes of this duration.

Parameters:
minutes - the minutes of the duration

setSeconds

public void setSeconds(double seconds)
Set the seconds of this duration.

Parameters:
seconds - the seconds of the duration

setNegative

public void setNegative(boolean negative)
Set duration negative flag

Parameters:
negative - boolean indicating if duration is negative

toString

public String toString()
Return string form of object

Returns:
the value of the string

equals

public boolean equals(Object other)

hashCode

public int hashCode()

validate

public static void validate(Object object)
                     throws IllegalArgumentException
Validate that a duration is a proper XML Schema duration.

Throws:
IllegalArgumentException - if the value can not be validated as a duration.

Novell exteNd Web Services SDK API

exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2003 Novell, Inc. All Rights Reserved.