対象者
ドキュメントを読みたい人
ドキュメントを読もうとしても英語の羅列でなんの情報かが分からないという人
構成について
みんな大好きAlertDialogのドキュメントを元に解説していきます。
AlertDialog
public class AlertDialog extends Dialog implements DialogInterface
これは、クラスの定義です。
Dialogクラスを継承し、DialogInterfaceを実装していることがわかりますね。
java.lang.Object
↳ android.app.Dialog
↳ android.app.AlertDialog
これは、継承の家系図的なものがパッケージまで書かれています。
Known direct subclasses
これは、AlertDialogのサブクラスについて紹介されています。
A subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method. If you want to display a more complex view, look up the FrameLayout called "custom" and add your view to it:〜
この細かく書かれている部分がAlertDialogについての詳細です。
何をするクラスなのかが、書いてあります。
Summary
続いて、概要(メンバについての)です。
Nested classes
これは、内部で定義しているクラスについて書かれています。
ここでは、AlertDialog.Builderクラスが定義されているみたいです。
裏のコードを見ると・・、確かにある。
public static class Builder {
private final AlertController.AlertParams P;
private final int mTheme;
※(コード内の抜粋です)
Constants
これは、定数です。
今回のは、API23から非推奨になっているみたいですが。。
Inherited constants
継承しているクラスの定数です。
またまた、非推奨に・・(例として悪いかったですね)
Protected constructors
こちらは、AlertDialogで定義されている、protectedのアクセス修飾子のついたコンストラクタです。
protectedは、継承関係にあるもの同士であれば、アクセスできます。
定義の仕方と、それがなんなのか?と、引数について書かれています。
Public methods
こちらは、クラス内で定義されたメソッドです。
構成は、コンストラクタとほとんど同じです。
加えて、返り値の詳細まで書かれています。
終わりに
こんな感じです。
気になることがあれば、質問&ツッコミお待ちしていおります!
ちゃんと読めば、これ以上に質の高い情報ない!って思えますよ!