MCPcopy Create free account
hub / github.com/MenoData/Time4J / withDayOfWeek

Method withDayOfWeek

base/src/main/java/net/time4j/PlainDate.java:1958–1973  ·  view source on GitHub ↗
(Weekday dayOfWeek)

Source from the content-addressed store, hash-verified

1956 }
1957
1958 private PlainDate withDayOfWeek(Weekday dayOfWeek) {
1959
1960 Weekday old = this.getDayOfWeek();
1961
1962 PlainDate date = (
1963 (this.weekday == null)
1964 ? new PlainDate(this.year, this.month, this.dayOfMonth, old)
1965 : this);
1966
1967 if (old == dayOfWeek) {
1968 return date;
1969 }
1970
1971 return PlainDate.addDays(date, dayOfWeek.getValue() - old.getValue());
1972
1973 }
1974
1975 private PlainDate withDayOfYear(int dayOfYear) {
1976

Callers 1

withValueMethod · 0.45

Calls 4

getDayOfWeekMethod · 0.95
addDaysMethod · 0.95
getValueMethod · 0.95
getValueMethod · 0.65

Tested by

no test coverage detected