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

Method withYear

base/src/main/java/net/time4j/PlainDate.java:1916–1930  ·  view source on GitHub ↗
(int year)

Source from the content-addressed store, hash-verified

1914 }
1915
1916 private PlainDate withYear(int year) {
1917
1918 if (this.year == year) {
1919 return this;
1920 }
1921
1922 int mlen = GregorianMath.getLengthOfMonth(year, this.month);
1923
1924 return PlainDate.of(
1925 year,
1926 this.month,
1927 Math.min(mlen, this.dayOfMonth)
1928 );
1929
1930 }
1931
1932 private PlainDate withMonth(int month) {
1933

Callers 1

withValueMethod · 0.45

Calls 3

getLengthOfMonthMethod · 0.95
ofMethod · 0.95
minMethod · 0.45

Tested by

no test coverage detected