Java DOC学習ノート

7066 ワード

Java DOC学習ノート
1、Interface Commparable<T>
このインターフェースを実装するオブジェクトのリストまたは配列のみが、Collection.sort()方法を呼び出すことができる。
実施中int compareTo(T o) , :1、 , 0;2、 null , NullPointerException。3、 sgn(x.compareTo(y)) == -sgn(y.compareTo(x))、(x.compareTo(y)==0) == (x.equals(y)) 、(x.compareTo(y)>0 && y.compareTo(z)>0) impliesx.compareTo(z)>0 。 x.compareTo(y) ,y.compareTo(x) 。2、インターフェースIterable<T>Iterator<T> iterator() foreach 。上記の方法は、java.util.Interface Iterator<E>に戻ります。
has Next()next()remove()
3、Interface Readable
java.lang.Interface Readable
      一つのReadableは文字列のソースです。このインターフェースを実現するために必要な方法は:int read(CharBuffer cb)4、 java.lang  Interface Runnable
もちろん、これは誰でも知っています。単独のスレッドで実行するには、このインターフェースを実現する必要があります。
5、java.lang Interface Thread.Uncaght Exception Handler
       名前から判断できますが、スレッドがキャプチャされていない異常を投げた場合、このインターフェースを実現するクラスのオブジェクトは1フィールドに対して処理できます。
      公式文書:スレッドが捕獲されていない異常に中断された場合、このインターフェースが起動されます。
      スレッドが捕獲異常に中断される場合、JVMはThread.getUncaughtExceptionHandler(), , , ThreadGroup UncaughtExceptionHandler, , 。を使用する。void uncaughtException(Thread t, Throwable e)          Method invoked when the given thread terminates due to the given uncagt exception.
6、包装タイプの対象:Boolean Byte Charter Double Float Long Shott Integer
    これらはもちろん、中の静的な方法と常量を主に使えばいいです。
7、Class Charcter.Subset
   このクラスの例はUnicode文字セットの特別なサブセットを表しています。Charracterで定義されている唯一のサブセットはUnicode Blockであり、他のJava APIは、自分のユーザーが他のサブセットを定義しているからかもしれない。static Character.UnicodeBlock AEGEAN_NUMBERS          Content for the「Aegen Numbers」Unicode character block.static Character.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS          Content for the「Alphabeetic Presentation Forms」Unicode character block.static Character.UnicodeBlock ARABIC          Content for the「Arboic」Unicode character block.static Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_A          Content for the「Arabic Presentation Forms-A」Unicode character block.static Character.UnicodeBlock ARABIC_PRESENTATION_FORMS_B          Content for the「Arabic Presentation Forms-B」ユニックode character block.static Character.UnicodeBlock ARMENIAN          Content for the「Armmenian」Unicode character block.static Character.UnicodeBlock ARROWS          Content for the「Arrows」Unicode character block.static Character.UnicodeBlock BASIC_LATIN          Content for the「Baic Latin」Unicode character block.static Character.UnicodeBlock BENGALI          Content for the「Bengali」Unicode character block.static Character.UnicodeBlock BLOCK_ELEMENTS          Content for the「Block Elements」Unicode character block.static Character.UnicodeBlock BOPOMOFO          Content for the「Bopomofo」Unicode character block.static Character.UnicodeBlock BOPOMOFO_EXTENDED          Content for the「Bopomofo Exteded」Unicode character block.static Character.UnicodeBlock BOX_DRAWING          Content for the「Box Drawing」Unicode character block.
……
java.lang Class Chracter.Unicode Blockの定義を参照してください。
8、java.langクラス<T>
このクラスの実力はJava実行プログラムのクラスとインターフェイスを表しています。Enumはクラスで、Annotationはインターフェースです。Every array also belongs to a class that is refreted as a Class object that is sharred by all arrays with the same element type and number of dimensions.
クラスのオブジェクトはプログラムでクラスの詳細情報を取得できます。
9、Java.lang.lass Class Loader
Class Loaderはいいものです。以下は公式文書の簡単な翻訳と注釈です。
1、クラスリーダーはクラスのオブジェクトをロードするために使用されます。Class Loaderは抽象的なクラスです。クラスのバイナリ名を与えます。
  "java.lang.String"
   "javax.swing.JSpinner$DefaultEditor"
   "java.security.KeyStore$Builder$FileBuilder$1"
   "java.net.URLClassLoader$3$1"
」)Class Loaderは位置決めと生成クラスを使用します。典型的な戦略は、バイナリ名をファイル名に変換し、ファイルシステムからこのクラスのファイルを読み込むことです。
各クラスのオブジェクトには作成された参照が含まれています。
配列のクラスオブジェクトはクラスLoaderによって作成できませんが、Java実行時に動的に作成できます。配列類のクラスクラスクラスクラスのクラスリーダーと彼の要素のクラスリーダーは同じです。要素が基本タイプの場合、配列クラスにはクラスリーダーがありません。
アプリケーションは、Class Loaderのサブクラスを実現して、行動を拡張します。このようにJVMでダイナミックなクラスを作成することができます。
Class Loaderは主に安全管理器によって使用され、安全エリアを確保するために使用されます。
クラスリーダーはdelegation(委託)モデルを使用してクラスとリソースを検索します。各クラスのLoaderには父クラスクラスのクラスクラスクラスのLoaderがあります。一つのリソースまたはクラスを検索することを要求した場合、クラスLoaderのインスタンスは、検索クラスとリソースを依頼します。
内に建てられたClass Loaderは、bootstrap class loaderといいます。父がいません。
正常には、Class Loaderはローカルファイルシステムからデータをロードします。クラスパスを通して
もちろん、ネットワーキングを通じてサーバーからバイトコードをダウンロードすることもできます。を選択します
ClassLoader loader = new NetworkClassLoader(host, port);
Object main = loader.loadClass("Main", true).newInstance();
Network ClassLoader         FindClass  loadClassData           。        ,   defineClass        。
class NetworkClassLoader extends ClassLoader {
         String host;
         int port;

         public Class findClass(String name) {
             byte[] b = loadClassData(name);
             return defineClass(name, b, 0, b.length);
         }

         private byte[] loadClassData(String name) {
             // load the class data from the connection  . . .
         }
     }
個人的な理解:
Class Loaderはクラスのキャリアであり、クラスパスパスPathからクラスをロードする以外に、クラスパスパスパスパスパスからリソースをロードすることができます。InputStream getResourceAsStream(String name)          Returns an input stream for reading the specified reource.Enumeration<URL> getResources(String name)          Finds all the resource with the given name.static URL getSystemResource(String name)          Find a resource of the specified name from the search path used to load clases.static InputStream getSystemResourceAsStream(String name)          Open for reading、a reource of the specified name from the search path used to load clases.static Enumeration<URL> getSystemResources(String name)          Finds all resource of the specified name from the search path used to load clases.protected  Class<?> findClass(String name)          Finds the class with the specified binary name.
10、Commpiler類3
コンパイラクラスはJavaをサポートするローカルコードコンパイラと関連サービスです。デザインによって、コンパイラ類は何もしません。実行時の技術をコンパイルするためのプレースホルダとして使用します。
JVMが初めて起動した時、彼はjava.com mpilerが存在するかどうかを判断しました。存在するなら、彼は3