/** * parse a String and convert it into a Date. * * @param str the string to parse * @return the Date represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * right format (see the description of this class) */ public static Date parseDate(String str) throws ParseException { Date result = new Date(); return parseDateInternal(str, result); }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new Date(); } // -- newInstance
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new TimeDuration(); } // -- newInstance
/** * parse a String and convert it into a GDay. * @param str the string to parse * @return the Date represented by the string * @throws ParseException a parse exception is thrown if the string to parse * does not follow the rigth format (see the description * of this class) */ public static GDay parseGDay(String str) throws ParseException { GDay result = new GDay(); return parseGDayInternal(str, result); }
/** * parse a String and convert it into a java.lang.Object * * @param str the string to parse * @return the java.lang.Object represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static Object parse(String str) throws ParseException { return parseTimeDuration(str); }
/** * Constructs a GMonth from a string value. * * @param gmonth the string representation of the GMonth to instantiate * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public GMonth(String gmonth) throws ParseException { parseGMonthInternal(gmonth, this); }
/** * Helper function defined in W3C XML Schema Recommendation part 2. * * @see <a href="http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes"> W3C XML Schema * Recommendation part 2</a> */ private int modulo(int a, int b) { return a - fQuotient(a, b) * b; }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new GYearMonth(); } // -- newInstance
/** * parse a String and convert it into a gMonthDay. * * @param str the string to parse * @return the Date represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static GMonthDay parseGMonthDay(String str) throws ParseException { return parseGMonthDayInternal(str, null); }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new Month(); } // -- newInstance
/** * Parses a String into a new DateTime instance. * * @param str the string to parse * @return a new DateTime instance with the value of the parsed string. * @throws ParseException If the string to parse does not follow the right format */ public static DateTime parse(String str) throws ParseException { return parseDateTime(str); }
/** * Returns an array of short with all the fields that describe this gDay type. * <p> * Note:the time zone is not included. * * @return an array of short with all the fields that describe this Date type. */ public short[] getValues() { short[] result = new short[1]; result[0] = this.getDay(); return result; } // getValues
/** * parse a String and convert it into an java.lang.Object * * @param str the string to parse * @return an Object represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static Object parse(String str) throws ParseException { return parseGDay(str); }
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new Century(); } // -- newInstance
/** * parse a String and convert it into a java.lang.Object * * @param str the string to parse * @return the java.lang.Object represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static Object parse(String str) throws ParseException { return parseYear(str); }
/** * parses a String and converts it into a Time. * * @param str the string to parse * @return the Time represented by the string * @throws ParseException a parse exception is thrown if the string to parse does not follow the * rigth format (see the description of this class) */ public static Time parseTime(String str) throws ParseException { return parseTimeInternal(str, null); }
/** * Constructs a DateTime from a String. The String is expected to be in W3C * Schema DateTime format. * * @param date * the string representing the date * @throws java.text.ParseException * if we are passed an illegal value */ public DateTime(String date) throws java.text.ParseException { parseDateTimeInternal(date, this); }
/** * Constructs a date from a string. * @param date the string representing the date * @throws ParseException a parse exception is thrown if the string to parse * does not follow the right format (see the description * of this class) */ public Date(String date) throws java.text.ParseException { parseDateInternal(date, this); }
/** * Returns an array of short with all the fields that describe * this gDay type. * <p>Note:the time zone is not included. * @return an array of short with all the fields that describe * this Date type. */ public short[] getValues() { short[] result = new short[1]; result[0] = this.getMonth(); return result; } //getValues
/** * Creates a new instance of the object described by this field. * * @param parent The object for which the field is created * @return A new instance of the field's value * @throws IllegalStateException This field is a simple type and * cannot be instantiated */ public Object newInstance(Object parent) throws IllegalStateException { return new GDay(); } //-- newInstance