1. 線形テーブル
原則: 0 個以上の類似したデータ要素の有限シーケンス
特徴:
アルゴリズム原理:
1. 要素を格納するためのストレージサイズの固定長配列空間を初期化します
1 package online.jfree.base; 2 3 /** 4 * author : Guo LiXiao 5 * date : 2017-6-14 11:46 6 */ 7 8 public interface LineList <e>{ 9 10 /**11 * lineList 是否为空12 * @return13 */14 boolean isEmpty();15 16 /**17 * 清空 lineList18 */19 void clear();20 21 /**22 * 获取指定位置元素23 * @param index24 * @return25 */26 E get(int index);27 28 /**29 * 获取元素第一次出现的位置30 * @param e31 * @return32 */33 int indexOf(E e);34 35 /**36 * 判断 lineList是否包含指定元素37 * @param e38 * @return39 */40 boolean contains(E e);41 42 /**43 * 设置指定位置数据,如数据已存在 则覆盖原数据44 * @param index45 * @param e46 * @return47 */48 E set(int index, E e);49 50 /**51 * 移除指定位置元素52 * @param index53 * @return54 */55 E remove(int index);56 57 /**58 * 在lineList结尾插入元素59 * @param e60 * @return61 */62 E add(E e);63 64 /**65 * 在index后面插入元素66 * @param index67 * @param e68 * @return69 */70 E add(int index, E e);71 72 /**73 * 返回lineList长度74 * @return75 */76 int size();77 78 79 80 }</e>


1 package online.jfree.base; 2 3 /** 4 * author : Guo LiXiao 5 * date : 2017-6-15 13:44 6 */ 7 8 public class OrderedLineList<e> implements LineList<e> { 9 10 private static final int INIT_CAPACITY = 10; 11 12 private transient E[] elementData; 13 14 private transient int elementLength; 15 16 private int size; 17 18 public OrderedLineList() { 19 this(0); 20 } 21 22 public OrderedLineList(int initCapacity) { 23 init(initCapacity); 24 } 25 26 private void init(int initCapacity) { 27 if (initCapacity >= 0) { 28 this.elementData = (E[]) new Object[initCapacity]; 29 this.elementLength = initCapacity; 30 } else { 31 throw new IllegalArgumentException("Illegal Capacity: " + 32 initCapacity); 33 } 34 this.size = 0; 35 } 36 37 /** 38 * 扩容 39 */ 40 private void dilatation() { 41 int oldCapacity = this.elementLength; 42 int newCapacity = oldCapacity; 43 if (oldCapacity this.size){ 46 newCapacity = oldCapacity - INIT_CAPACITY; 47 } 48 if (oldCapacity != newCapacity){ 49 E[] newElementData = (E[]) new Object[newCapacity]; 50 System.arraycopy(elementData, 0, newElementData, 0, oldCapacity); 51 this.elementLength = newCapacity; 52 this.elementData = newElementData; 53 } 54 } 55 56 /** 57 * 校验列表索引越界 58 * @param index 59 */ 60 private void checkCapacity(int index){ 61 if (index > this.size - 1 || index 0; 94 } 95 96 @Override 97 public E set(int index, E e) { 98 this.checkCapacity(index); 99 this.dilatation();100 E oldElement = this.elementData[index];101 this.elementData[index] = e;102 return oldElement;103 }104 105 @Override106 public E remove(int index) {107 this.dilatation();108 E e = elementData[index];109 if (index == size - 1) elementData[index] = null;110 else {111 int length = size - index - 1;112 System.arraycopy(elementData, index + 1, elementData, index, length);113 }114 size --;115 return e;116 }117 118 @Override119 public E add(E e) {120 return this.add(size, e);121 }122 123 @Override124 public E add(int index, E e) {125 this.dilatation();126 if (index == size) elementData[index] = e;127 else {128 index++;129 int lastLength = size - index;130 E[] lastElementData = (E[]) new Object[lastLength];131 System.arraycopy(elementData, index, lastElementData, 0, lastLength);132 elementData[index] = e;133 System.arraycopy(lastElementData, 0, elementData, index + 1, lastLength);134 }135 size ++ ;136 return e;137 }138 139 @Override140 public int size() {141 return this.size;142 }143 144 }</e></e>


以上が線形テーブルの原理と簡単な実装の簡単な分析の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

JVMは、JavanativeInterface(JNI)およびJava Standard Libraryを介してオペレーティングシステムのAPIの違いを処理します。1。JNIでは、Javaコードがローカルコードを呼び出し、オペレーティングシステムAPIと直接対話できます。 2. Java Standard Libraryは統一されたAPIを提供します。これは、異なるオペレーティングシステムAPIに内部的にマッピングされ、コードがプラットフォーム間で実行されるようにします。

modularitydoesnotdirectlyectlyectjava'splatformindepensence.java'splatformendepenceismaindainededainededainededaindainedaindained bythejvm、butmodularityinfluencesApplucationStructure andmanagement、間接的なインパクチャプラット形成依存性.1)

bytecodeinjavaisthe intermediaterepresentationthateNablesplatformindepence.1)javacodeis compiledintobytecodestoredin.classfiles.2)thejvminterpretsorcompilesthisbytecodeintomachinecodeatime、

javaachievesplatformedenceTheTheTheJavavirtualMachine(JVM)、これは、javacodeisisisisisissompiledIntobytecode.2)javaCodeisisisisissompiledevedevicetecode.2)

Javagui開発におけるプラットフォームの独立性は課題に直面していますが、Swing、Javafx、統一外観、パフォーマンス最適化、サードパーティライブラリ、クロスプラットフォームテストを使用することで対処できます。 Javaguiの開発は、クロスプラットフォームの一貫性を提供することを目的としたAWTとSwingに依存していますが、実際の効果はオペレーティングシステムごとに異なります。ソリューションには以下が含まれます。1)SwingおよびJavafxをGUIツールキットとして使用します。 2)uimanager.setlookandfeel()を介して外観を統合します。 3)さまざまなプラットフォームに合わせてパフォーマンスを最適化します。 4)ApachepivotやSWTなどのサードパーティライブラリを使用する。 5)一貫性を確保するために、クロスプラットフォームテストを実施します。

javadevelopmentisnotentirelylylypratform-IndopentDuetoseveralfactors.1)jvmvariationsaffectperformanceandbehavioracrossdifferentos.2)nativeLibrariesviajniintroducePlatform-specificissues.3)giaiasystemsdifferbeTioneplateplatifflics.4)

Javaコードは、さまざまなプラットフォームで実行するときにパフォーマンスの違いがあります。 1)JVMの実装と最適化戦略は、OracleJDKやOpenJDKなどとは異なります。 2)メモリ管理やスレッドスケジューリングなどのオペレーティングシステムの特性もパフォーマンスに影響します。 3)適切なJVMを選択し、JVMパラメーターとコード最適化を調整することにより、パフォーマンスを改善できます。

java'splatformindepentedencehaslimitationsincludingporformanceoverhead、versioncompatibulisisues、changleSwithnativeLibraryIntegration、プラットフォーム固有の機能、およびjvminStallation/maintenation。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

Safe Exam Browser
Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

WebStorm Mac版
便利なJavaScript開発ツール

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

ホットトピック









