Home | History | Annotate | Download | only in time

Lines Matching defs:of

6  * under the terms of the GNU General Public License version 2 only, as
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * You should have received a copy of the GNU General Public License version
29 * However, the following notice accompanied the original version of this
39 * * Redistributions of source code must retain the above copyright notice,
40 * this list of conditions and the following disclaimer.
43 * this list of conditions and the following disclaimer in the documentation
46 * * Neither the name of JSR-310 nor the names of its contributors
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
56 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
57 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
59 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
60 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94 * of a month and day-of-month. Any field that can be derived from a month and day,
95 * such as quarter-of-year, can be obtained.
100 * Since a {@code MonthDay} does not possess a year, the leap day of
105 * without external information, preventing the implementation of plus/minus.
110 * in most of the world. It is equivalent to the proleptic Gregorian calendar
113 * However, any application that makes use of historical dates, and requires them
139 * The month-of-year, not null.
143 * The day-of-month.
183 * Using this method allows the use of an alternate clock for testing.
191 return MonthDay.of(now.getMonth(), now.getDayOfMonth());
196 * Obtains an instance of {@code MonthDay}.
198 * The day-of-month must be valid for the month within a leap year.
205 * @param month the month-of-year to represent, not null
206 * @param dayOfMonth the day-of-month to represent, from 1 to 31
208 * @throws DateTimeException if the value of any field is out of range,
209 * or if the day-of-month is invalid for the month
211 public static MonthDay of(Month month, int dayOfMonth) {
222 * Obtains an instance of {@code MonthDay}.
224 * The day-of-month must be valid for the month within a leap year.
231 * @param month the month-of-year to represent, from 1 (January) to 12 (December)
232 * @param dayOfMonth the day-of-month to represent, from 1 to 31
234 * @throws DateTimeException if the value of any field is out of range,
235 * or if the day-of-month is invalid for the month
237 public static MonthDay of(int month, int dayOfMonth) {
238 return of(Month.of(month), dayOfMonth);
243 * Obtains an instance of {@code MonthDay} from a temporal object.
246 * A {@code TemporalAccessor} represents an arbitrary set of date and time information,
247 * which this factory converts to an instance of {@code MonthDay}.
254 * This method matches the signature of the functional interface {@link TemporalQuery}
269 return of(temporal.get(MONTH_OF_YEAR), temporal.get(DAY_OF_MONTH));
272 temporal + " of type " + temporal.getClass().getName(), ex);
278 * Obtains an instance of {@code MonthDay} from a text string such as {@code --12-03}.
292 * Obtains an instance of {@code MonthDay} from a text string using a specific formatter.
310 * @param month the month-of-year to represent, validated from 1 to 12
311 * @param dayOfMonth the day-of-month to represent, validated from 1 to 29-31
334 * If the field is not a {@code ChronoField}, then the result of this method
351 * Gets the range of valid values for the specified field.
354 * This month-day is used to enhance the accuracy of the returned range.
363 * If the field is not a {@code ChronoField}, then the result of this method
369 * @return the range of valid values for the field, not null
378 return ValueRange.of(1, getMonth().minLength(), getMonth().maxLength());
384 * Gets the value of the specified field from this month-day as an {@code int}.
386 * This queries this month-day for the value of the specified field.
387 * The returned value will always be within the valid range of values for the field.
396 * If the field is not a {@code ChronoField}, then the result of this method
404 * the value is outside the range of valid values for the field
406 * the range of values exceeds an {@code int}
415 * Gets the value of the specified field from this month-day as a {@code long}.
417 * This queries this month-day for the value of the specified field.
426 * If the field is not a {@code ChronoField}, then the result of this method
452 * Gets the month-of-year field from 1 to 12.
458 * @return the month-of-year, from 1 to 12
466 * Gets the month-of-year field using the {@code Month} enum.
473 * @return the month-of-year, not null
477 return Month.of(month);
481 * Gets the day-of-month field.
483 * This method returns the primitive {@code int} value for the day-of-month.
485 * @return the day-of-month, from 1 to 31
508 * Returns a copy of this {@code MonthDay} with the month-of-year altered.
511 * If the day-of-month is invalid for the specified month, the day will
512 * be adjusted to the last valid day-of-month.
516 * @param month the month-of-year to set in the returned month-day, from 1 (January) to 12 (December)
518 * @throws DateTimeException if the month-of-year value is invalid
521 return with(Month.of(month));
525 * Returns a copy of this {@code MonthDay} with the month-of-year altered.
528 * If the day-of-month is invalid for the specified month, the day will
529 * be adjusted to the last valid day-of-month.
533 * @param month the month-of-year to set in the returned month-day, not null
546 * Returns a copy of this {@code MonthDay} with the day-of-month altered.
548 * This returns a month-day with the specified day-of-month.
549 * If the day-of-month is invalid for the month, an exception is thrown.
553 * @param dayOfMonth the day-of-month to set in the return month-day, from 1 to 31
555 * @throws DateTimeException if the day-of-month value is invalid,
556 * or if the day-of-month is invalid for the month
562 return of(month, dayOfMonth);
571 * obtain the result. Read the documentation of the query to understand
572 * what the result of this method will be.
574 * The result of this method is obtained by invoking the
578 * @param <R> the type of the result
596 * This returns a temporal object of the same observable type as the input
597 * with the month and day-of-month changed to be the same as this.
649 * A month-day of February 29th will be adjusted to February 28th in the resulting
656 * @throws DateTimeException if the year is outside the valid range of years
659 return LocalDate.of(year, month, isValidYear(year) ? day : 28);
666 * The comparison is based first on value of the month, then on the value of the day.
705 * The comparison is based on the time-line position of the month-day within a year.
738 * @return a string representation of this month-day, not null
759 * @return the instance of {@code Ser}, not null
783 return MonthDay.of(month, day);