Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Sep 30, 2011
1 parent fa5a633 commit 506c744
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/main/java/javax/time/calendar/LocalDate.java
Expand Up @@ -471,15 +471,14 @@ private LocalDate resolveDate(DateResolver dateResolver, int year, MonthOfYear m
/**
* Returns a copy of this {@code LocalDate} with the date altered using the adjuster.
* <p>
* Adjusters can be used to alter the date in various ways.
* This adjusts the date according to the rules of the specified adjuster.
* A simple adjuster might simply set the one of the fields, such as the year field.
* A more complex adjuster might set the date to the last day of the month.
* <p>
* This instance is immutable and unaffected by this method call.
*
* @param adjuster the adjuster to use, not null
* @return a {@code LocalDate} based on this date adjusted as necessary, not null
* @throws NullPointerException if the adjuster returned null
*/
public LocalDate with(DateAdjuster adjuster) {
ISOChronology.checkNotNull(adjuster, "DateAdjuster must not be null");
Expand Down
20 changes: 8 additions & 12 deletions src/main/java/javax/time/calendar/LocalDateTime.java
Expand Up @@ -631,17 +631,15 @@ public boolean isLeapYear() {
/**
* Returns a copy of this {@code LocalDateTime} with the date altered using the adjuster.
* <p>
* Adjusters can be used to alter the date in various ways.
* A simple adjuster might simply set the one of the fields, such as the year field.
* A more complex adjuster might set the date to the last day of the month.
* <p>
* The time does not affect the calculation and will be the same in the result.
* This adjusts the date according to the rules of the specified adjuster.
* The time is not part of the calculation and will be unchanged in the result.
* Note that {@link LocalDate} implements {@code DateAdjuster}, thus this method
* can be used to change the entire date.
* <p>
* This instance is immutable and unaffected by this method call.
*
* @param adjuster the adjuster to use, not null
* @return a {@code LocalDateTime} based on this date-time with the date adjusted, not null
* @throws NullPointerException if the adjuster returned null
*/
public LocalDateTime with(DateAdjuster adjuster) {
return with(date.with(adjuster), time);
Expand All @@ -650,17 +648,15 @@ public LocalDateTime with(DateAdjuster adjuster) {
/**
* Returns a copy of this {@code LocalDateTime} with the time altered using the adjuster.
* <p>
* Adjusters can be used to alter the time in various ways.
* A simple adjuster might simply set the one of the fields, such as the hour field.
* A more complex adjuster might set the time to end of the working day.
* <p>
* The date does not affect the calculation and will be the same in the result.
* This adjusts the time according to the rules of the specified adjuster.
* The date is not part of the calculation and will be unchanged in the result.
* Note that {@link LocalTime} implements {@code TimeAdjuster}, thus this method
* can be used to change the entire time.
* <p>
* This instance is immutable and unaffected by this method call.
*
* @param adjuster the adjuster to use, not null
* @return a {@code LocalDateTime} based on this date-time with the time adjusted, not null
* @throws IllegalArgumentException if the adjuster returned null
*/
public LocalDateTime with(TimeAdjuster adjuster) {
return with(date, time.with(adjuster));
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/javax/time/calendar/LocalTime.java
Expand Up @@ -493,7 +493,7 @@ public int getNanoOfSecond() {
/**
* Returns a copy of this {@code LocalTime} with the time altered using the adjuster.
* <p>
* Adjusters can be used to alter the time in various ways.
* This adjusts the time according to the rules of the specified adjuster.
* A simple adjuster might simply set the one of the fields, such as the hour field.
* A more complex adjuster might set the time to end of the working day.
* <p>
Expand All @@ -505,7 +505,7 @@ public int getNanoOfSecond() {
public LocalTime with(TimeAdjuster adjuster) {
LocalTime time = adjuster.adjustTime(this);
if (time == null) {
throw new NullPointerException("The implementation of TimeAdjuster must not return null");
throw new NullPointerException("TimeAdjuster implementation must not return null");
}
return time;
}
Expand Down

0 comments on commit 506c744

Please sign in to comment.