クラス
java.time.YearMonthの使用

YearMonthを使用しているパッケージ 
パッケージ 説明
java.time
日付、時間、インスタント、デュレーションのメインAPI。
  • java.timeでのYearMonthの使用

    YearMonthを返すjava.timeのメソッド 
    修飾子と型 メソッド 説明
    YearMonth Year.atMonth​(int month)
    この年を月と組み合せてYearMonthを作成します。
    YearMonth Year.atMonth​(Month month)
    この年を月と組み合せてYearMonthを作成します。
    static YearMonth YearMonth.from​(TemporalAccessor temporal)
    時間的オブジェクトからYearMonthのインスタンスを取得します。
    YearMonth YearMonth.minus​(long amountToSubtract, TemporalUnit unit)
    指定された量を減算した、この年-月のコピーを返します。
    YearMonth YearMonth.minus​(TemporalAmount amountToSubtract)
    指定された量を減算した、この年-月のコピーを返します。
    YearMonth YearMonth.minusMonths​(long monthsToSubtract)
    指定された月数を減算した、このYearMonthのコピーを返します。
    YearMonth YearMonth.minusYears​(long yearsToSubtract)
    指定された年数を減算した、このYearMonthのコピーを返します。
    static YearMonth YearMonth.now()
    デフォルトのタイムゾーンのシステム・クロックから現在の年-月を取得します。
    static YearMonth YearMonth.now​(Clock clock)
    指定されたクロックから現在の年-月を取得します。
    static YearMonth YearMonth.now​(ZoneId zone)
    指定されたタイムゾーンのシステム・クロックから現在の年-月を取得します。
    static YearMonth YearMonth.of​(int year, int month)
    年および月からYearMonthのインスタンスを取得します。
    static YearMonth YearMonth.of​(int year, Month month)
    年および月からYearMonthのインスタンスを取得します。
    static YearMonth YearMonth.parse​(CharSequence text)
    2007-12などのテキスト文字列からYearMonthのインスタンスを取得します。
    static YearMonth YearMonth.parse​(CharSequence text, DateTimeFormatter formatter)
    特定のフォーマッタを使用して、テキスト文字列からYearMonthのインスタンスを取得します。
    YearMonth YearMonth.plus​(long amountToAdd, TemporalUnit unit)
    この年月のコピーに指定された時間を追加したものを返します。
    YearMonth YearMonth.plus​(TemporalAmount amountToAdd)
    この年月のコピーに指定された時間を追加したものを返します。
    YearMonth YearMonth.plusMonths​(long monthsToAdd)
    指定された月数を加算した、このYearMonthのコピーを返します。
    YearMonth YearMonth.plusYears​(long yearsToAdd)
    指定された年数を加算した、このYearMonthのコピーを返します。
    YearMonth YearMonth.with​(TemporalAdjuster adjuster)
    この年と月の調整済のコピーを返します。
    YearMonth YearMonth.with​(TemporalField field, long newValue)
    指定されたフィールドを新しい値に設定して、この年と月のコピーを返します。
    YearMonth YearMonth.withMonth​(int month)
    月を変更して、このYearMonthのコピーを返します。
    YearMonth YearMonth.withYear​(int year)
    年を変更して、このYearMonthのコピーを返します。
    YearMonth型のパラメータを持つjava.timeのメソッド 
    修飾子と型 メソッド 説明
    int YearMonth.compareTo​(YearMonth other)
    この年-月を別の年-月と比較します。
    boolean YearMonth.isAfter​(YearMonth other)
    この年/月が、指定された年/月より後にあるかどうかをチェックします。
    boolean YearMonth.isBefore​(YearMonth other)
    この年/月が、指定された年/月より前にあるかどうかをチェックします。