JavaTM Platform
Standard Ed. 6

java.text
クラス DateFormat.Field

java.lang.Object
  上位を拡張 java.text.AttributedCharacterIterator.Attribute
      上位を拡張 java.text.Format.Field
          上位を拡張 java.text.DateFormat.Field
すべての実装されたインタフェース:
Serializable
含まれているクラス:
DateFormat

public static class DateFormat.Field
extends Format.Field

DateFormat.formatToCharacterIterator から返された AttributedCharacterIterator 内の属性キー、および FieldPosition 内のフィールド識別子として使用する定数を定義します。  

また、クラスの定数と対応する Calendar 定数との間にマップする 2 つのメソッドを提供します。

導入されたバージョン:
1.4
関連項目:
Calendar, 直列化された形式

フィールドの概要
static DateFormat.Field AM_PM
          1 日の中の時刻のインジケータ (「a.m.」または「p.m.」) フィールドを識別する定数です。
static DateFormat.Field DAY_OF_MONTH
          月の日のフィールドを識別する定数です。
static DateFormat.Field DAY_OF_WEEK
          曜日のフィールドを識別する定数です。
static DateFormat.Field DAY_OF_WEEK_IN_MONTH
          曜日のフィールドを識別する定数です。
static DateFormat.Field DAY_OF_YEAR
          年の日のフィールドを識別する定数です。
static DateFormat.Field ERA
          紀元のフィールドを識別する定数です。
static DateFormat.Field HOUR_OF_DAY0
          1 日の中の時刻のフィールドを識別する定数です。
static DateFormat.Field HOUR_OF_DAY1
          1 日の中の時刻のフィールドを識別する定数です。
static DateFormat.Field HOUR0
          時刻のフィールドを識別する定数です。
static DateFormat.Field HOUR1
          時刻のフィールドを識別する定数です。
static DateFormat.Field MILLISECOND
          ミリ秒のフィールドを識別する定数です。
static DateFormat.Field MINUTE
          分のフィールドを識別する定数です。
static DateFormat.Field MONTH
          月のフィールドを識別する定数です。
static DateFormat.Field SECOND
          秒のフィールドを識別する定数です。
static DateFormat.Field TIME_ZONE
          タイムゾーンのフィールドを識別する定数です。
static DateFormat.Field WEEK_OF_MONTH
          1 月の中の週のフィールドを識別する定数です。
static DateFormat.Field WEEK_OF_YEAR
          年の週のフィールドを識別する定数です。
static DateFormat.Field YEAR
          年のフィールドを識別する定数です。
 
クラス java.text.AttributedCharacterIterator.Attribute から継承されたフィールド
INPUT_METHOD_SEGMENT, LANGUAGE, READING
 
コンストラクタの概要
protected DateFormat.Field(String name, int calendarField)
          Field を作成します。
 
メソッドの概要
 int getCalendarField()
          この属性に関連した Calendar フィールドを返します。
static DateFormat.Field ofCalendarField(int calendarField)
          calendarFieldCalendar 定数に対応する Field を返します。
protected  Object readResolve()
          直列化復元されるインスタンスを定義済み定数に解決します。
 
クラス java.text.AttributedCharacterIterator.Attribute から継承されたメソッド
equals, getName, hashCode, toString
 
クラス java.lang.Object から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

フィールドの詳細

ERA

public static final DateFormat.Field ERA
紀元のフィールドを識別する定数です。


YEAR

public static final DateFormat.Field YEAR
年のフィールドを識別する定数です。


MONTH

public static final DateFormat.Field MONTH
月のフィールドを識別する定数です。


DAY_OF_MONTH

public static final DateFormat.Field DAY_OF_MONTH
月の日のフィールドを識別する定数です。


HOUR_OF_DAY1

public static final DateFormat.Field HOUR_OF_DAY1
1 日の中の時刻のフィールドを識別する定数です。正当な値は 1 〜 24 です。


HOUR_OF_DAY0

public static final DateFormat.Field HOUR_OF_DAY0
1 日の中の時刻のフィールドを識別する定数です。正当な値は 0 〜 23 です。


MINUTE

public static final DateFormat.Field MINUTE
分のフィールドを識別する定数です。


SECOND

public static final DateFormat.Field SECOND
秒のフィールドを識別する定数です。


MILLISECOND

public static final DateFormat.Field MILLISECOND
ミリ秒のフィールドを識別する定数です。


DAY_OF_WEEK

public static final DateFormat.Field DAY_OF_WEEK
曜日のフィールドを識別する定数です。


DAY_OF_YEAR

public static final DateFormat.Field DAY_OF_YEAR
年の日のフィールドを識別する定数です。


DAY_OF_WEEK_IN_MONTH

public static final DateFormat.Field DAY_OF_WEEK_IN_MONTH
曜日のフィールドを識別する定数です。


WEEK_OF_YEAR

public static final DateFormat.Field WEEK_OF_YEAR
年の週のフィールドを識別する定数です。


WEEK_OF_MONTH

public static final DateFormat.Field WEEK_OF_MONTH
1 月の中の週のフィールドを識別する定数です。


AM_PM

public static final DateFormat.Field AM_PM
1 日の中の時刻のインジケータ (「a.m.」または「p.m.」) フィールドを識別する定数です。


HOUR1

public static final DateFormat.Field HOUR1
時刻のフィールドを識別する定数です。正当な値は 1 〜 12 です。


HOUR0

public static final DateFormat.Field HOUR0
時刻のフィールドを識別する定数です。正当な値は 0 〜 11 です。


TIME_ZONE

public static final DateFormat.Field TIME_ZONE
タイムゾーンのフィールドを識別する定数です。

コンストラクタの詳細

DateFormat.Field

protected DateFormat.Field(String name,
                           int calendarField)
Field を作成します。

パラメータ:
name - Field の名前
calendarField - この Field が対応する Calendar 定数。任意の値を使用でき、 正当な Calendar 値の範囲外の値も使用できる。 ただし、正当な Calendar 値に対応しない値には、 -1 を使用する必要がある
メソッドの詳細

ofCalendarField

public static DateFormat.Field ofCalendarField(int calendarField)
calendarFieldCalendar 定数に対応する Field を返します。Calendar 定数と Field との間に直接のマッピングがない場合は、null が返されます。

パラメータ:
calendarField - Calendar フィールド定数
戻り値:
calendarField を表すフィールドインスタンス
例外:
IllegalArgumentException - calendarFieldCalendar フィールド定数の値でない場合
関連項目:
Calendar

getCalendarField

public int getCalendarField()
この属性に関連した Calendar フィールドを返します。たとえば、Calendar の hours フィールドを表す場合は、Calendar.HOUR を返します。対応する Calendar 定数がない場合は、-1 を返します。

戻り値:
このフィールドの Calendar 定数
関連項目:
Calendar

readResolve

protected Object readResolve()
                      throws InvalidObjectException
直列化復元されるインスタンスを定義済み定数に解決します。

オーバーライド:
クラス AttributedCharacterIterator.Attribute 内の readResolve
戻り値:
解決された DateFormat.Field 定数
例外:
InvalidObjectException - 定数が解決できない 場合

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。