2016-04-21 6 views
0

私たちはJavadocで命令を実行しようとしています。これまでのところ、我々はこれを持っているが、実際のRLE圧縮機能ではありませんインデックスPARAMTERこれは、パートナー割り当てのランレングスエンコードプログラムです。

* Read the next run (or single character) and return the index of the symbol following the run (or symbol read). 
    * Store the count and symbol for the run in the run parameter. 
    * @param line - the input line being processed 
    * @param index - the index of the first character in the next "run" (which might be just a single character) 
    * @param run - where to store the symbol and count for the Run 
    * @return the index of the symbol following the run just read 
    */ 
    static int getNext(String line, int index, Run run) { 
    line.charAt(index); //char first, something about a line 
    return ?.symbol;//Store values 
    run.count= ?.count; //the given number of that specific symbol or repetition 
    enter code here 
    run.symbol= ?.symbol; //whatever symbol you first see 
    // TO BE COMPLETED 

    return index+1;// just to make it advance so starter program doesn't loop infinitely 
    } 
} 
+0

「実行」とは何ですか? – Natecat

+0

質問は何ですか? –

答えて

0

で混乱しているのではなく、ヘルパー関数は、メインRLEによって処理されている現在の文字の繰り返しをカウントします圧縮機能。

  • 文字列lineのインデックスindexの文字を取り、実行オブジェクトの適切なプロパティに格納します。これを行うために必要のようです何

    はこれです。

  • インデックスindexに続いてlineの文字を、最初に取ったものと等しくない文字に遭遇するまで繰り返します。
  • 繰り返しの量をRunオブジェクトの適切なプロパティに格納します。
  • 等しくない文字が検出された文字列内の位置を返します。
関連する問題