JP4873620B2 - Method, program, and information processing apparatus for manipulating character strings - Google Patents

Method, program, and information processing apparatus for manipulating character strings Download PDF

Info

Publication number
JP4873620B2
JP4873620B2 JP2006115275A JP2006115275A JP4873620B2 JP 4873620 B2 JP4873620 B2 JP 4873620B2 JP 2006115275 A JP2006115275 A JP 2006115275A JP 2006115275 A JP2006115275 A JP 2006115275A JP 4873620 B2 JP4873620 B2 JP 4873620B2
Authority
JP
Japan
Prior art keywords
character string
char
data
string
information processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2006115275A
Other languages
Japanese (ja)
Other versions
JP2007183905A (en
Inventor
清久仁 河内谷
一則 緒方
民也 小野寺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to JP2006115275A priority Critical patent/JP4873620B2/en
Publication of JP2007183905A publication Critical patent/JP2007183905A/en
Application granted granted Critical
Publication of JP4873620B2 publication Critical patent/JP4873620B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、文字列を操作する方法、プログラム、および、情報処理装置に関する。   The present invention relates to a method for operating a character string, a program, and an information processing apparatus.

従来より、情報処理装置であるコンピュータは、C言語やJava(登録商標)言語といったプログラミング言語で書かれたプログラムに基づいて動作する。このコンピュータは、演算に用いる数値や文字列(ストリング)といったデータを記憶部としてのメモリに記憶する。   Conventionally, a computer that is an information processing apparatus operates based on a program written in a programming language such as C language or Java (registered trademark) language. This computer stores data such as numerical values and character strings (strings) used for calculation in a memory as a storage unit.

例えば、オブジェクト指向言語であるJava(登録商標)言語で書かれたJava(登録商標)プログラムに基づいて動作するコンピュータでは、プログラマが指定することなく、不要となったデータを記憶しているメモリのメモリ領域を自動的に解放するガベージ・コレクション(以下、GCと呼ぶ)が用いられている(例えば、特許文献1参照)。特許文献1に記載のGCによれば、メモリを、ライフタイムの比較的短い第1の種類のデータ群を記憶する第1のメモリ領域と、ライフタイムの比較的長い第2の種類のデータ群を記憶する第2のメモリ領域と、に分割し、第1のメモリ領域に対するGCの実行頻度を高くするとともに、第2のメモリ領域に対するGCの実行頻度を低くする。このため、データの特性を考慮に入れつつGC対象となるメモリ領域を限定して、効率的にメモリ領域を解放できる。   For example, in a computer that operates based on a Java (registered trademark) program written in a Java (registered trademark) language that is an object-oriented language, a memory that stores unnecessary data without a programmer specifying it. Garbage collection (hereinafter referred to as GC) that automatically releases a memory area is used (see, for example, Patent Document 1). According to the GC described in Patent Document 1, the memory includes a first memory area for storing a first type of data group having a relatively short lifetime and a second type of data group having a relatively long lifetime. Is divided into a second memory area for storing the data, and the GC execution frequency for the first memory area is increased, and the GC execution frequency for the second memory area is decreased. Therefore, it is possible to efficiently release the memory area by limiting the memory area to be GC-targeted while taking the data characteristics into consideration.

以上のように、Java(登録商標)プログラムに基づいて動作するコンピュータでは、GCを行ってメモリ領域を解放することで、コンピュータが用いるメモリのメモリ容量を縮小する。
特開2002−278828号公報
As described above, in a computer that operates based on the Java (registered trademark) program, the memory capacity of the memory used by the computer is reduced by performing GC and releasing the memory area.
JP 2002-278828 A

上述のJava(登録商標)プログラムの実行環境の典型的な実装では、Stringオブジェクトの表す文字列は、char配列オブジェクトの中から参照される。このchar配列オブジェクトは、以下の2つの特徴を備えている。   In a typical implementation of the execution environment of the Java (registered trademark) program described above, a character string represented by a String object is referenced from within a char array object. This char array object has the following two features.

第1の特徴として、char配列オブジェクトは、Stringオブジェクトの文字列として参照されないcharデータを含む場合がある。この場合、もしそのchar配列オブジェクトがStringオブジェクト以外から参照されていないのなら、Stringオブジェクトの文字列として参照されないcharデータを記憶しているメモリ領域を解放して、コンピュータが用いるメモリのメモリ容量を縮小することが望ましい。   As a first feature, a char array object may include char data that is not referred to as a character string of a String object. In this case, if the char array object is not referenced by anything other than the String object, the memory area that stores the char data that is not referenced as the string of the String object is released, and the memory capacity used by the computer is reduced. It is desirable to reduce.

第2の特徴として、同じ文字列データを持つchar配列オブジェクトが複数存在している場合がある。Java(登録商標)においてはStringオブジェクトの文字列は操作不能であり、上述の場合、2つの同一のchar配列オブジェクトをひとつにまとめ、片方を記憶しているメモリ領域を解放して、コンピュータが用いるメモリのメモリ容量を縮小することが望ましい。   As a second feature, there may be a plurality of char array objects having the same character string data. In Java (registered trademark), the character string of the String object cannot be manipulated. In the above case, two identical char array objects are combined into one, and the memory area storing one is released to be used by the computer. It is desirable to reduce the memory capacity of the memory.

しかしながら、Java(登録商標)プログラムに基づいて動作するコンピュータにおいて、特許文献1に記載のものをはじめとする従来のGCでは、char配列オブジェクト群の中から、上述の参照されないcharデータや、上述の重複するchar配列オブジェクトを検出できず、これらを記憶しているメモリ領域を解放できない。このため、コンピュータが用いるメモリのメモリ容量を十分に縮小できない場合があり、問題であった。   However, in a computer that operates based on the Java (registered trademark) program, in the conventional GC including the one described in Patent Document 1, the above-mentioned char data that is not referenced or the above-mentioned char data from the char array object group. Duplicate char array objects cannot be detected, and the memory area that stores them cannot be released. For this reason, the memory capacity of the memory used by the computer may not be sufficiently reduced, which is a problem.

本発明の目的は、記憶部の記憶容量を縮小する文字列操作方法、プログラム、および、情報処理装置を提供することである。   The objective of this invention is providing the character string operation method, program, and information processing apparatus which reduce the memory capacity of a memory | storage part.

本発明の第1の形態によると、Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群について記憶する記憶部を備える情報処理装置において、char配列を操作する文字列操作方法であって、char配列オブジェクト群の中からStringオブジェクトの文字列を参照する手順と、ガベージ・コレクションを行う際に、char配列オブジェクト群の中から所定のcharデータおよびchar配列オブジェクトを削除する手順と、を含むことを特徴とする文字列操作方法を提供する。   According to the first aspect of the present invention, a char array is manipulated in an information processing apparatus that operates based on a Java (registered trademark) program and includes a storage unit that stores a char array object group composed of a plurality of char data. The string operation method to be used, the procedure for referring to the character string of the String object from the char array object group, and the specified char data and char array object from the char array object group at the time of garbage collection And a procedure for deleting a character string.

本発明の第2の形態によると、複数の文字データで構成される文字列を複数含む文字列群について記憶する記憶部を備える情報処理装置において、文字列を操作する文字列操作方法であって、文字列群の中から特定文字列を参照する手順と、文字列群の中から特定文字列として参照されない文字データを検出する手順と、文字列群から検出した文字データを削除する手順と、を含む文字列操作方法を提供する。   According to a second aspect of the present invention, there is provided a character string manipulation method for manipulating a character string in an information processing apparatus including a storage unit that stores a character string group including a plurality of character strings composed of a plurality of character data. , A procedure for referring to a specific character string from the character string group, a procedure for detecting character data that is not referred to as a specific character string from the character string group, a procedure for deleting character data detected from the character string group, A character string operation method including

本発明の第3の形態によると、複数の文字データで構成される文字列を複数含む文字列群について記憶する記憶部を備える情報処理装置において、文字列を操作する文字列操作方法であって、文字列群の中から特定文字列を参照する手順と、複数の文字データに応じて、複数の文字列を並べ替える手順と、並べ替えた複数の文字列を含む文字列群の中から、第1の文字列、および、第1の文字列と同一である第2の文字列を検出する手順と、並べ替えた複数の文字列を含む文字列群から第2の文字列を削除する手順と、を含む文字列操作方法を提供する。   According to a third aspect of the present invention, there is provided a character string manipulation method for manipulating a character string in an information processing apparatus including a storage unit that stores a character string group including a plurality of character strings composed of a plurality of character data. , A procedure for referring to a specific character string from a character string group, a procedure for rearranging a plurality of character strings according to a plurality of character data, and a character string group including a plurality of sorted character strings, A procedure for detecting a first character string and a second character string that is identical to the first character string, and a procedure for deleting the second character string from a character string group including a plurality of rearranged character strings And a character string manipulation method including:

本発明の第4の形態によると、複数の文字データで構成される文字列を複数含む文字列群について記憶する記憶部を備える情報処理装置において、文字列を操作する文字列操作方法であって、文字列群の中から特定文字列を参照する手順と、文字列群の中から、第1の文字列、および、第1の文字列の一部と同一である第2の文字列を検出する手順と、文字列群から第2の文字列を削除する手順と、を含む文字列操作方法を提供する。   According to a fourth aspect of the present invention, there is provided a character string manipulation method for manipulating a character string in an information processing apparatus including a storage unit that stores a character string group including a plurality of character strings composed of a plurality of character data. , A procedure for referring to a specific character string from the character string group, and a first character string and a second character string identical to a part of the first character string are detected from the character string group And a procedure for deleting the second character string from the character string group.

本発明の第5の形態によると、複数の文字データで構成される文字列を複数含む文字列群について記憶する記憶部を備える情報処理装置において、文字列を操作する文字列操作方法であって、文字列群の中から特定文字列を参照する手順と、文字列群の中から、第1の文字列、および、第1の文字列の最後の文字データを含む後部文字列を最初の文字データを含む前部文字列とする第2の文字列を検出する手順と、文字列群で、後部文字列および前部文字列を1つにまとめて、第1の文字列および第2の文字列を連結する手順と、を含む文字列操作方法を提供する。   According to a fifth aspect of the present invention, there is provided a character string manipulation method for manipulating a character string in an information processing apparatus including a storage unit that stores a character string group including a plurality of character strings composed of a plurality of character data. The procedure for referring to the specific character string from the character string group, and the first character string and the rear character string including the last character data of the first character string from the character string group as the first character In the procedure for detecting the second character string to be the front character string including data, and the character string group, the rear character string and the front character string are combined into one, the first character string and the second character And a string operation method including a procedure for concatenating columns.

本発明によれば、文字列群の中から、参照されない文字データや、重複する文字列を検出して削除することにより、これらを記憶している記憶領域を解放する。このため、char配列オブジェクト群の中から、参照されないcharデータや、重複するchar配列を検出して削除することにより、これらを記憶しているメモリ領域を解放できる。したがって、情報処理装置が用いる記憶部の記憶容量を縮小できる。   According to the present invention, by detecting and deleting unreferenced character data or duplicate character strings from the character string group, the storage area storing these is released. For this reason, by detecting and deleting unreferenced char data or overlapping char arrays from the char array object group, the memory area storing these can be released. Therefore, the storage capacity of the storage unit used by the information processing apparatus can be reduced.

以下、本発明の実施形態を図面に基づいて説明する。なお、以下の実施形態の説明にあたって、同一構成要件については同一符号を付し、その説明を省略もしくは簡略化する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description of the embodiments, the same constituent elements are denoted by the same reference numerals, and the description thereof is omitted or simplified.

<1.第1実施形態>
図1は、本発明の第1実施形態に係る情報処理装置1の機能ブロック図である。情報処理装置1は、情報処理を行う装置であり、コンピュータであってよい。また、情報処理装置1が、本発明のプログラムを実行されることで、本発明の効果を実現してもよい。情報処理装置1は、ユーザからの入力を受け付ける入力部10と、演算結果を出力する出力部20と、複数のcharデータで構成されるchar配列オブジェクト群について記憶する記憶部30と、情報を演算する制御部40と、を備えている。この情報処理装置1は、記憶部30に記憶しているchar配列オブジェクト群の中から、Stringオブジェクトの表す文字列を参照するとともに、Stringオブジェクトの文字列として参照されないcharデータを検出し、この検出したcharデータをchar配列オブジェクト群の中から削除する。
<1. First Embodiment>
FIG. 1 is a functional block diagram of an information processing apparatus 1 according to the first embodiment of the present invention. The information processing apparatus 1 is an apparatus that performs information processing, and may be a computer. Further, the information processing apparatus 1 may realize the effect of the present invention by executing the program of the present invention. The information processing apparatus 1 calculates an information, an input unit 10 that receives input from a user, an output unit 20 that outputs a calculation result, a storage unit 30 that stores a char array object group including a plurality of char data, and information And a control unit 40. The information processing apparatus 1 refers to the character string represented by the String object from the char array object group stored in the storage unit 30, and detects char data that is not referred to as the character string of the String object. Delete the char data from the char array object group.

入力部10は、ユーザからの入力を受け付けて、入力された情報を制御部40に伝える。この入力部10は、例えば、キーボードやマウス等であってよい。   The input unit 10 receives input from the user and transmits the input information to the control unit 40. The input unit 10 may be, for example, a keyboard or a mouse.

出力部20は、情報処理装置1の演算処理結果を出力する。この出力部20は、例えば、CRTディスプレイや液晶ディスプレイ等であってよい。   The output unit 20 outputs the calculation processing result of the information processing apparatus 1. The output unit 20 may be, for example, a CRT display or a liquid crystal display.

記憶部30は、OS(Operating System)、ミドルウェア、アプリケーション等を記憶するとともに、文字列群としてのchar配列オブジェクトを記憶する。この記憶部30は、コンピュータのメモリであってよい。   The storage unit 30 stores an OS (Operating System), middleware, applications, and the like, and stores a char array object as a character string group. The storage unit 30 may be a computer memory.

図2は、記憶部30に記憶するchar配列オブジェクト群CHARSの模式図である。char配列オブジェクト群CHARSには、複数のchar配列オブジェクトch_A[]、ch_B[]、ch_C[]、ch_D[]、ch_E[]が含まれている。char配列オブジェクトch_A[]〜ch_E[]は、それぞれ、ヘッダ部headerを備えている。   FIG. 2 is a schematic diagram of the char array object group CHARS stored in the storage unit 30. The char array object group CHARS includes a plurality of char array objects ch_A [], ch_B [], ch_C [], ch_D [], and ch_E []. Each of the char array objects ch_A [] to ch_E [] includes a header part header.

char配列オブジェクトch_A[]〜ch_E[]のヘッダ部headerは、情報処理装置1が内部的に用いる、各オブジェクトごとの情報を保持するための場所であり、これらのオブジェクトがchar配列であることを表すとともに、それぞれ、char配列オブジェクトch_A[]〜ch_E[]のサイズなどを記憶している。例えば、char配列オブジェクトch_A[]のヘッダ部headerは、サイズ情報として“16”を記憶している。   The header section header of the char array objects ch_A [] to ch_E [] is a place for storing information for each object used internally by the information processing apparatus 1, and indicates that these objects are char arrays. In addition, the size of the char array objects ch_A [] to ch_E [] is stored. For example, the header part header of the char array object ch_A [] stores “16” as size information.

char配列オブジェクトch_A[]は、文字データとしてのcharデータch_A[0]〜ch_A[15]を備えている。char配列オブジェクトch_B[]〜ch_E[]についても同様に、それぞれ、charデータch_B[0]〜ch_B[13]、ch_C[0]〜ch_C[6]、ch_D[0]〜ch_D[10]、ch_E[0]〜ch_E[12]を備えている。例えば、char配列オブジェクトch_B[]のcharデータch_B[8]は、“a”である。   The char array object ch_A [] includes char data ch_A [0] to ch_A [15] as character data. Similarly for the char array objects ch_B [] to ch_E [], the char data ch_B [0] to ch_B [13], ch_C [0] to ch_C [6], ch_D [0] to ch_D [10], ch_E, respectively. [0] to ch_E [12] are provided. For example, the char data ch_B [8] of the char array object ch_B [] is “a”.

図1に戻って、制御部40は、演算、制御等を行う中央処理装置であり、CPU(Central Processing Unit)であってよい。この制御部40は、参照部41および削除部42を備えている。   Returning to FIG. 1, the control unit 40 is a central processing unit that performs computation, control, and the like, and may be a CPU (Central Processing Unit). The control unit 40 includes a reference unit 41 and a deletion unit 42.

参照部41は、char配列オブジェクト群の中から特定文字列としてのStringオブジェクトの文字列を参照する。   The reference unit 41 refers to the character string of the String object as the specific character string from the char array object group.

図3は、後述する削除部42で文字列操作を行う前のStringオブジェクトst_Aの文字列およびchar配列オブジェクトch_A[]の関係を示す模式図である。図4は、後述する削除部42で文字列操作を行った後のStringオブジェクトst_Aの文字列およびchar配列オブジェクトch_A[]の関係を示す模式図である。   FIG. 3 is a schematic diagram showing the relationship between the character string of the String object st_A and the char array object ch_A [] before the character string operation is performed by the deletion unit 42 described later. FIG. 4 is a schematic diagram illustrating the relationship between the character string of the String object st_A and the char array object ch_A [] after the character string operation is performed by the deletion unit 42 described later.

図3に示すように、Stringオブジェクトst_Aの文字列は、charデータch_A[4]〜ch_A[13]の“importance”を参照している。このStringオブジェクトst_Aは、ヘッダ部headerと、データ部dataと、開始部startと、文字数部lengthと、を備えている。   As shown in FIG. 3, the character string of the String object st_A refers to “importance” of the char data ch_A [4] to ch_A [13]. The String object st_A includes a header part, a data part data, a start part start, and a character number part length.

Stringオブジェクトのヘッダ部headerは、このオブジェクトがStringオブジェクトであることなどを表す。   The header part header of the String object indicates that this object is a String object.

Stringオブジェクトのデータ部dataは、1つのchar配列オブジェクトを指す。具体的には、Stringオブジェクトst_Aのデータ部dataは、Stringオブジェクトst_Aの文字列“importance”を含むchar配列オブジェクトch_A[]を表す。Stringオブジェクトの表す文字列は、このchar配列オブジェクトの一部であり、残る2つの値でその位置が示される。   The data part data of the String object indicates one char array object. Specifically, the data part data of the String object st_A represents a char array object ch_A [] including the character string “importance” of the String object st_A. The character string represented by the String object is a part of this char array object, and its position is indicated by the remaining two values.

Stringオブジェクトの開始部startは、Stringオブジェクトの文字列を含むchar配列オブジェクトにおいて、Stringオブジェクトの文字列として参照を開始する位置を表す。具体的には、Stringオブジェクトst_Aの開始部startは、“4”である。   The start part start of the String object represents a position where the reference is started as the character string of the String object in the char array object including the character string of the String object. Specifically, the start part start of the String object st_A is “4”.

Stringオブジェクトの文字数部lengthは、Stringオブジェクトの文字列を含むchar配列オブジェクトにおいて、Stringオブジェクトの文字列として参照するcharデータの数を表す。具体的には、Stringオブジェクトst_Aの文字数部lengthは、charデータch_A[4]〜ch_A[13]の“10”を表す。   The number-of-characters part length of the String object represents the number of char data referred to as the character string of the String object in the char array object including the character string of the String object. Specifically, the character number portion length of the String object st_A represents “10” of the char data ch_A [4] to ch_A [13].

なお、段落番号0029〜0031は、char配列オブジェクトのcharデータの一部分がStringオブジェクトの表す文字列であることがわかるようにできれば、これ以外の実装であってもよい。例えば、lengthの値を保持する代わりに参照する最後のcharデータのインデックス値(st_Aの場合だと、“13”)を保持するのでもよい。   The paragraph numbers 0029 to 0031 may be implemented in other ways as long as it can be understood that a part of the char data of the char array object is a character string represented by the String object. For example, instead of holding the length value, the index value of the last char data to be referred to (in the case of st_A, “13”) may be held.

図1に戻って、削除部42は、char配列オブジェクトの中から、Stringオブジェクトの文字列として参照しないcharデータを削除する。この削除部42は、リスト作成部421と、文字データ検出部422と、文字データ削除部423と、文字列再編成部424と、を備えている。   Returning to FIG. 1, the deletion unit 42 deletes char data that is not referred to as a character string of the String object from the char array object. The deletion unit 42 includes a list creation unit 421, a character data detection unit 422, a character data deletion unit 423, and a character string reorganization unit 424.

リスト作成部421は、記憶部30内の各char配列がどのオブジェクトから参照されているかを調べ上げ、charデータのうちStringオブジェクトの表す文字列として使用されているものに印をつけ、char配列ごとの一覧表にまとめる。例えば、図3では、一覧表のchar配列オブジェクトch_A[]の部分には、Stringオブジェクトの表す文字列として使用されているcharデータがch_A[4]〜ch_A[13]の“importance”であることと、char配列オブジェクトch_A[]を参照しているStringオブジェクトがst_Aであることと、が記録される。   The list creation unit 421 checks from which object each char array in the storage unit 30 is referenced, and marks the char data that is used as the character string represented by the String object. Summarize in the list of For example, in FIG. 3, the char data used as the character string represented by the String object is “importance” of ch_A [4] to ch_A [13] in the char array object ch_A [] part of the list. Then, the fact that the String object referring to the char array object ch_A [] is st_A is recorded.

なお、char配列オブジェクトがStringオブジェクト以外から参照されていた場合、そのchar配列オブジェクトを変形することはできないので、一覧表からは取り除いてよい。   Note that if a char array object is referenced from something other than a String object, the char array object cannot be transformed, so it can be removed from the list.

文字データ検出部422は、上述の一覧表に基づいて、char配列オブジェクトの中からStringオブジェクトの文字列として参照されないcharデータを検出する。例えば、図3では、char配列オブジェクト群CHARSのchar配列オブジェクトch_A[]の中から、Stringオブジェクトst_Aの文字列“importance”として参照されないcharデータch_A[0]〜ch_A[3]と、charデータch_A[14]〜ch_A[15]と、を検出する。   The character data detection unit 422 detects char data that is not referred to as a character string of the String object from the char array object based on the above list. For example, in FIG. 3, the char data ch_A [0] to ch_A [3] that are not referred to as the character string “importance” of the String object st_A from the char array object ch_A [] of the char array object group CHARS, and the char data ch_A [14] to ch_A [15] are detected.

文字データ削除部423は、char配列オブジェクトの中から、上述の検出したcharデータを削除する。例えば、図3では、文字データ検出部422が検出した、charデータch_A[0]〜ch_A[3]と、charデータch_A[14]〜ch_A[15]と、を削除して、図4のようにchar配列オブジェクトch_A[]を変更する。これにより、char配列オブジェクトch_A[]のサイズは、“16”から“10”となり、char配列オブジェクトch_A[]が使用する記憶部30の記憶領域は、削減される。   The character data deleting unit 423 deletes the detected char data from the char array object. For example, in FIG. 3, the char data ch_A [0] to ch_A [3] and the char data ch_A [14] to ch_A [15] detected by the character data detection unit 422 are deleted as shown in FIG. Change char array object ch_A [] to. Accordingly, the size of the char array object ch_A [] is changed from “16” to “10”, and the storage area of the storage unit 30 used by the char array object ch_A [] is reduced.

文字列再編成部424は、文字データ削除部423でcharデータを削除したことに基づいて、char配列オブジェクトを作り直し、Stringオブジェクトを再編成する。例えば、図3では、char配列オブジェクトch_A[]のヘッダ部headerを、“10”を表すように作り直すとともに、図4のように、Stringオブジェクトst_Aのデータ部dataを、作り直されたchar配列オブジェクトch_A[]を参照するように修正し、開始部startを、charデータch_A[0]を表すように“0”に変更する。   The character string reorganization unit 424 recreates the char array object based on the deletion of the char data by the character data deletion unit 423, and reorganizes the String object. For example, in FIG. 3, the header part header of the char array object ch_A [] is recreated to represent “10”, and the data part data of the String object st_A is recreated as shown in FIG. [] Is modified so that the start part start is changed to “0” to represent the char data ch_A [0].

以上の情報処理装置1の動作について、図5に基づいて説明する。最初に、ステップS201では、Stringオブジェクトの文字列の参照を要求されているか否かを判別する。ステップS201の判別が“Yes”の場合、ステップS202に移る。ステップS201の判別が“No”の場合、ステップS203に移る。ステップS202では、char配列オブジェクトの中からStringオブジェクトの文字列を参照する。   The operation of the information processing apparatus 1 will be described with reference to FIG. First, in step S201, it is determined whether or not the character string reference of the String object is requested. If the determination in step S201 is “Yes”, the process moves to step S202. If the determination in step S201 is “No”, the process moves to step S203. In step S202, the character string of the String object is referenced from the char array object.

ステップS203では、char配列オブジェクトの中から、Stringオブジェクトの文字列として参照されないcharデータの削除を要求されているか否かを判別する。ステップS203の判別が“Yes”の場合、ステップS301に移る。ステップS203の判別が“No”の場合、ステップS201に戻る。   In step S203, it is determined whether or not deletion of char data that is not referred to as a character string of the String object is requested from among the char array objects. If the determination in step S203 is “Yes”, the process moves to step S301. If the determination in step S203 is “No”, the process returns to step S201.

ステップS301では、char配列ごとに、Stringオブジェクトの文字列として使用されているcharデータ群と、そのchar配列を参照しているStringオブジェクト群と、を調べて一覧表にまとめ、ステップS302に移る。なお、char配列オブジェクトがStringオブジェクト以外から参照されていた場合、そのchar配列オブジェクトは一覧表に含まれず以降の処理対象からは外される。   In step S301, for each char array, the char data group used as the character string of the String object and the String object group referring to the char array are checked and summarized into a list, and the process proceeds to step S302. When a char array object is referenced from other than a String object, the char array object is not included in the list and is excluded from the subsequent processing targets.

ステップS302では、ステップS301でまとめた一覧表に基づいて、char配列オブジェクトの中から、Stringオブジェクトの文字列として参照されないcharデータを検出し、ステップS303に移る。   In step S302, char data that is not referred to as a character string of the String object is detected from the char array object based on the list summarized in step S301, and the process proceeds to step S303.

ステップS303では、char配列オブジェクトの中からステップS302で検出したcharデータを削除してchar配列オブジェクトを作り直し、ステップS304に移る。ステップS304では、Stringオブジェクトを再編成する。   In step S303, the char data detected in step S302 is deleted from the char array object to recreate the char array object, and the process proceeds to step S304. In step S304, the String object is reorganized.

以上に説明したように、本実施形態に係る情報処理装置1は、参照部41を備えているので、記憶部30に記憶しているchar配列オブジェクトの中からStringオブジェクトの文字列を参照することが可能である。また、情報処理装置1は、削除部42を備えているので、記憶部30に記憶しているchar配列オブジェクトの中からStringオブジェクトの文字列として参照されないcharデータを検出して、この検出したcharデータを削除できる。このため、Stringオブジェクトの文字列として参照されないcharデータをchar配列オブジェクトから削除して、記憶部30の記憶容量を縮小することが可能である。   As described above, since the information processing apparatus 1 according to the present embodiment includes the reference unit 41, the character string of the String object is referred to from among the char array objects stored in the storage unit 30. Is possible. In addition, since the information processing apparatus 1 includes the deletion unit 42, the char information that is not referred to as the character string of the String object is detected from the char array objects stored in the storage unit 30, and the detected char is detected. Data can be deleted. For this reason, it is possible to reduce the storage capacity of the storage unit 30 by deleting char data that is not referred to as a character string of the String object from the char array object.

なお、GCでは、複数のオブジェクト同士の参照関係をまとめたマークテーブルを作成し、このマークテーブルに基づいて、いずれのオブジェクトからも参照されないオブジェクトを検出する場合がある。この処理の際に、Stringオブジェクトの文字列として参照されるcharデータを調査することで、ステップS301の一覧表の作成を効率よく行うことが可能である。   In GC, a mark table in which reference relationships among a plurality of objects are collected is created, and an object that is not referenced by any object may be detected based on the mark table. In this process, it is possible to efficiently create the list in step S301 by examining the char data referred to as the character string of the String object.

また、GCでは、回収されなかったオブジェクトを稼働させるために、そのオブジェクトを参照しているオブジェクト群を検索することができる仕組みを備えているのが通常である。これにはリバース・ポインタ・チェーシングなどの手法がある。ステップS301で作る一覧表において、char配列オブジェクトを参照しているStringオブジェクト群を記録する機構は、この仕組みを流用し効率的に行うことが可能である。   Moreover, in order to operate the object which was not collect | recovered in GC, it is normal to provide the mechanism which can search the object group which is referring to the object. This includes techniques such as reverse pointer chasing. In the list created in step S301, a mechanism for recording a String object group that refers to a char array object can be performed efficiently by using this mechanism.

また、上述のステップS301〜S304の、char配列オブジェクトからStringオブジェクトの文字列として参照されないcharデータを削除するための一連のステップは、全てのchar配列オブジェクトに対して一斉に行ってもよいし、各char配列オブジェクトごとに別々に行ってもよい。すなわち、上述の一連のステップは、各char配列オブジェクトに対して、独立に行うことができる。   In addition, a series of steps for deleting char data that is not referred to as a character string of a String object from the char array object in the above-described steps S301 to S304 may be performed simultaneously on all the char array objects. You may do this separately for each char array object. That is, the series of steps described above can be performed independently for each char array object.

また、上述のリスト作成部421で作成する一覧表について、char配列ごとの使用されているcharデータ群の情報は、そのchar配列オブジェクトのcharデータのうち、最初のcharデータのインデックス値および最後のcharデータのインデックス値のみに簡略化してもよい。これによれば、途中に使用されないcharデータがあっても削除できない反面、一覧表にまとめるデータ量が減るので、この一覧表を記憶するための記憶容量を縮小することが可能である。   In addition, regarding the list created by the list creation unit 421 described above, the information on the char data group used for each char array includes the index value of the first char data and the last char data of the char array object. You may simplify only to the index value of char data. According to this, even if there is char data that is not used in the middle, it cannot be deleted. However, since the amount of data collected in the list is reduced, the storage capacity for storing this list can be reduced.

<2.第2実施形態>
図6は、本発明の第2実施形態に係る情報処理装置1Aの機能ブロック図である。情報処理装置1Aは、制御部の構成が図1の情報処理装置1と異なる。この情報処理装置1Aは、記憶部30に記憶しているchar配列オブジェクトの中から、Stringオブジェクトの文字列を参照するとともに、第1の文字列と、第1の文字列と同一である第2の文字列と、を検出し、第2の文字列を構成するchar配列オブジェクトを削除する。
<2. Second Embodiment>
FIG. 6 is a functional block diagram of an information processing apparatus 1A according to the second embodiment of the present invention. The information processing apparatus 1A is different from the information processing apparatus 1 in FIG. The information processing apparatus 1A refers to the character string of the String object from among the char array objects stored in the storage unit 30, and the first character string is the same as the first character string. And the char array object constituting the second character string is deleted.

情報処理装置1Aの有する制御部40Aは、参照部41および削除部42Aを備えている。削除部42Aは、文字列整列部425と、文字列検出部426と、文字列削除部427と、文字列再編成部424Aと、を備えている。   The control unit 40A included in the information processing apparatus 1A includes a reference unit 41 and a deletion unit 42A. The deletion unit 42A includes a character string alignment unit 425, a character string detection unit 426, a character string deletion unit 427, and a character string reorganization unit 424A.

図7は、削除部42Aで文字列操作を行う前のStringオブジェクトst_E、st_Fの文字列と、char配列オブジェクトch_A[]、ch_B[]と、の関係を示す模式図である。図8は、削除部42Aで文字列操作を行った後のStringオブジェクトst_E、st_Fの文字列と、char配列オブジェクトch_A[]と、の関係を示す模式図である。   FIG. 7 is a schematic diagram showing the relationship between the character strings of the String objects st_E and st_F and the char array objects ch_A [] and ch_B [] before the character string operation is performed by the deletion unit 42A. FIG. 8 is a schematic diagram showing the relationship between the character strings of the String objects st_E and st_F after the character string operation is performed by the deleting unit 42A and the char array object ch_A [].

図6に戻って、文字列整列部425は、char配列オブジェクトのStringオブジェクトの文字列として使われている部分のデータに応じて、char配列を並べた一覧表を作る。例えば、複数のchar配列を、各char配列を構成するcharデータに応じて、昇順に並べる。   Returning to FIG. 6, the character string aligning unit 425 creates a list in which the char arrays are arranged according to the data of the part used as the character string of the String object of the char array object. For example, a plurality of char arrays are arranged in ascending order according to the char data constituting each char array.

文字列検出部426は、char配列オブジェクト群の中から、第1の文字列と、第1の文字列と同一である第2の文字列と、を検出する。例えば、図7では、char配列オブジェクト群CHARSの中から、第1の文字列としてのchar配列オブジェクトch_A[]の文字列“importance”と、第2の文字列としてのchar配列オブジェクトch_B[]の文字列“importance”と、を検出する。なお、同一の文字列を複数検出した場合には、複数の同一の文字列のうちの1つを第1の文字列とし、複数の同一の文字列のうち第1の文字列を除くものを第2の文字列とする。例えば、同一の文字列を4つ検出した場合、4つの同一の文字列のうちの1つを第1の文字列とし、4つの同一の文字列のうち第1の文字列を除く3つを第2の文字列とする。   The character string detection unit 426 detects a first character string and a second character string that is the same as the first character string from the char array object group. For example, in FIG. 7, the character array “importance” of the char array object ch_A [] as the first character string and the char array object ch_B [] as the second character string are selected from the char array object group CHARS. The character string “importance” is detected. When a plurality of the same character strings are detected, one of the plurality of the same character strings is set as a first character string, and a plurality of the same character strings excluding the first character string are This is the second character string. For example, when four identical character strings are detected, one of the four identical character strings is a first character string, and three of the four identical character strings excluding the first character string are This is the second character string.

文字列削除部427は、char配列オブジェクト群の中から、上述の第2の文字列を含むchar配列オブジェクトを削除する。例えば、図7では、同一の文字列“importance”について、第2の文字列としてのchar配列オブジェクトch_B[]を削除する。   The character string deletion unit 427 deletes the char array object including the second character string described above from the char array object group. For example, in FIG. 7, for the same character string “importance”, the char array object ch_B [] as the second character string is deleted.

文字列再編成部424Aは、文字列削除部427で第2の文字列を削除したことに基づいて、Stringオブジェクトを再編成する。例えば、図7では、Stringオブジェクトst_Fのデータ部dataを、図8のように、char配列オブジェクトch_A[]を参照するように修正し、開始部startを、図8のように、char配列オブジェクトch_A[]のcharデータch_A[4]を表すように“4”に変更する。   The character string reorganization unit 424A reorganizes the String object based on the deletion of the second character string by the character string deletion unit 427. For example, in FIG. 7, the data part data of the String object st_F is modified to refer to the char array object ch_A [] as shown in FIG. 8, and the start part start is changed to the char array object ch_A as shown in FIG. Change to “4” to represent char data ch_A [4] of [].

以上の情報処理装置1Aの動作について、図9に基づいて説明する。ステップS401では、Stringオブジェクトから使用されているcharデータに応じて、char配列を並べ替えた一覧表を作り、ステップS402に移る。ステップS402では、複数のchar配列オブジェクトの中から、第1の文字列と、第1の文字列と同一である第2の文字列と、を検出し、ステップS403に移る。なお、ステップS401で、charデータに応じて、char配列を並べ替えた一覧表を作っているので、char配列を並べていない場合と比べて、第1の文字列および第2の文字列を検出しやすい。   The operation of the information processing apparatus 1A will be described with reference to FIG. In step S401, a list in which the char array is rearranged according to the char data used from the String object is created, and the process proceeds to step S402. In step S402, a first character string and a second character string that is the same as the first character string are detected from the plurality of char array objects, and the process proceeds to step S403. In step S401, since a list in which the char array is rearranged according to the char data is created, the first character string and the second character string are detected as compared with the case where the char array is not arranged. Cheap.

ステップS403では、char配列オブジェクト群の中から第2の文字列を含むchar配列オブジェクトを削除し、ステップS404に移る。ステップS404では、Stringオブジェクトを再編成する。   In step S403, the char array object including the second character string is deleted from the char array object group, and the process proceeds to step S404. In step S404, the String object is reorganized.

なお、ステップS403で第2の文字列を含むchar配列オブジェクトの削除を行わず、S404でのStringオブジェクトの再編成だけを行ってもよい。これにより第2の文字列を含むchar配列オブジェクトを参照するオブジェクトが無くなるので、このオブジェクトは従来のGCによっても回収可能となる。   Note that the char array object including the second character string is not deleted in step S403, and only the reorganization of the String object in S404 may be performed. As a result, there is no object that refers to the char array object including the second character string, and this object can also be collected by the conventional GC.

以上に説明したように、本実施形態に係る情報処理装置1Aは、削除部42Aを備えているので、記憶部30に記憶しているchar配列オブジェクト群の中から、第1の文字列と、第1の文字列と同一である第2の文字列と、を検出して、第2の文字列を含むchar配列オブジェクトを削除できる。このため、重複する文字列を減少させて、記憶部30の記憶容量を縮小することが可能である。   As described above, since the information processing apparatus 1A according to the present embodiment includes the deletion unit 42A, the first character string from the char array object group stored in the storage unit 30; The second character string that is the same as the first character string is detected, and the char array object including the second character string can be deleted. Therefore, it is possible to reduce the storage capacity of the storage unit 30 by reducing overlapping character strings.

<3.第3実施形態>
図10は、本発明の第3実施形態に係る情報処理装置1Bの機能ブロック図である。情報処理装置1Bは、文字列検出部の機能が図6の情報処理装置1Aと異なる。この情報処理装置1Bは、記憶部30に記憶しているchar配列オブジェクト群の中から、Stringオブジェクトの文字列を参照するとともに、第1の文字列と、第1の文字列の一部と同一である第2の文字列と、を検出し、第2の文字列を削除する。
<3. Third Embodiment>
FIG. 10 is a functional block diagram of an information processing apparatus 1B according to the third embodiment of the present invention. The information processing apparatus 1B is different from the information processing apparatus 1A in FIG. 6 in the function of the character string detection unit. The information processing apparatus 1B refers to the character string of the String object from the char array object group stored in the storage unit 30, and is identical to the first character string and a part of the first character string. Is detected, and the second character string is deleted.

情報処理装置1Bの有する制御部40Bは、参照部41および削除部42Bを備えている。削除部42Bは、文字列検出部426Aと、文字列削除部427と、文字列再編成部424Aと、を備えている。   The control unit 40B included in the information processing apparatus 1B includes a reference unit 41 and a deletion unit 42B. The deletion unit 42B includes a character string detection unit 426A, a character string deletion unit 427, and a character string reorganization unit 424A.

図11は、削除部42Bで文字列操作を行う前のStringオブジェクトst_G、st_Hの文字列と、char配列オブジェクトch_A[]、ch_C[]と、の関係を示す模式図である。図12は、削除部42Bで文字列操作を行った後のStringオブジェクトst_G、st_Hの文字列と、char配列オブジェクトch_A[]と、の関係を示す模式図である。   FIG. 11 is a schematic diagram illustrating the relationship between the character strings of the String objects st_G and st_H and the char array objects ch_A [] and ch_C [] before the character string operation is performed by the deletion unit 42B. FIG. 12 is a schematic diagram illustrating a relationship between the character strings of the String objects st_G and st_H after the character string operation is performed by the deletion unit 42B and the char array object ch_A [].

図10に戻って、文字列検出部426Aは、char配列オブジェクトの中から、第1の文字列と、第1の文字列の一部と同一である第2の文字列と、を検出する。例えば、図11では、char配列オブジェクト群CHARSの中から、第1の文字列としてのchar配列オブジェクトch_A[]の文字列“importance”と、第2の文字列としてのchar配列オブジェクトch_C[]の文字列“port”と、を検出する。   Returning to FIG. 10, the character string detection unit 426A detects a first character string and a second character string that is the same as a part of the first character string from the char array object. For example, in FIG. 11, the character array “importance” of the char array object ch_A [] as the first character string and the char array object ch_C [] as the second character string are selected from the char array object group CHARS. The character string “port” is detected.

文字列削除部427は、上述の第2の文字列を削除する。例えば、図11では、第2の文字列としてのchar配列オブジェクトch_C[]を削除する。   The character string deletion unit 427 deletes the second character string described above. For example, in FIG. 11, the char array object ch_C [] as the second character string is deleted.

文字列再編成部424Aは、文字列削除部427で第2の文字列を削除したことに基づいて、Stringオブジェクトを再編成する。例えば、図11では、Stringオブジェクトst_Hのデータ部dataを、図12のように、char配列オブジェクトch_A[]を参照するように修正し、開始部startを、図12のように、char配列オブジェクトch_A[]のcharデータch_A[6]を表すように“6”に変更する。   The character string reorganization unit 424A reorganizes the String object based on the deletion of the second character string by the character string deletion unit 427. For example, in FIG. 11, the data part data of the String object st_H is modified to refer to the char array object ch_A [] as shown in FIG. 12, and the start part start is changed to the char array object ch_A as shown in FIG. Change to [6] to represent char data ch_A [6] of [].

以上の情報処理装置1Bの動作について、図13に基づいて説明する。ステップS501では、char配列ごとに、Stringオブジェクトから使用されている文字列と、そのchar配列を参照しているStringオブジェクト群を示した一覧表を作り、ステップS502に移る。ステップS502では、一覧表のchar配列オブジェクト群の中から、第1の文字列と、第1の文字列の一部と同一である第2の文字列と、を検出し、ステップS503に移る。   The operation of the information processing apparatus 1B will be described with reference to FIG. In step S501, for each char array, a list showing a character string used from the String object and a String object group referring to the char array is created, and the process proceeds to step S502. In step S502, a first character string and a second character string that is the same as part of the first character string are detected from the char array object group in the list, and the process proceeds to step S503.

ステップS503では、char配列オブジェクト群の中から第2の文字列を含むchar配列オブジェクトを削除し、ステップS504に移る。ステップS504では、Stringオブジェクトを再編成する。   In step S503, the char array object including the second character string is deleted from the char array object group, and the process proceeds to step S504. In step S504, the String object is reorganized.

なお、ステップS503で第2の文字列を含むchar配列オブジェクトの削除を行わず、S504でのStringオブジェクトの再編成だけを行ってもよい。これにより第2の文字列を含むchar配列オブジェクトを参照するオブジェクトが無くなるので、このオブジェクトは従来のGCによっても回収可能となる。   Note that the char array object including the second character string may not be deleted in step S503, and only the reorganization of the String object in S504 may be performed. As a result, there is no object that refers to the char array object including the second character string, and this object can also be collected by the conventional GC.

以上に説明したように、本実施形態に係る情報処理装置1Bは、削除部42Bを備えているので、記憶部30に記憶しているchar配列オブジェクトの中から、第1の文字列と、第1の文字列の一部と同一である第2の文字列と、を検出して、第2の文字列を含むchar配列オブジェクトを削除できる。このため、重複する文字列を減少させて、記憶部30の記憶容量を縮小することが可能である。   As described above, since the information processing apparatus 1B according to the present embodiment includes the deletion unit 42B, the first character string and the first character string are stored in the char array object stored in the storage unit 30. By detecting a second character string that is the same as a part of one character string, a char array object including the second character string can be deleted. Therefore, it is possible to reduce the storage capacity of the storage unit 30 by reducing overlapping character strings.

<4.第4実施形態>
図14は、本発明の第4実施形態に係る情報処理装置1Cの機能ブロック図である。情報処理装置1Cは、制御部の構成が図6の情報処理装置1Aと異なる。この情報処理装置1Cは、記憶部30に記憶しているchar配列オブジェクト群の中から、Stringオブジェクトの文字列を参照するとともに、第1の文字列と、第1の文字列の最後のcharデータを含む後部文字列を、最初のcharデータを含む前部文字列とする第2の文字列と、を検出し、後部文字列および前部文字列を1つにまとめて、第1の文字列および第2の文字列を連結する。
<4. Fourth Embodiment>
FIG. 14 is a functional block diagram of an information processing apparatus 1C according to the fourth embodiment of the present invention. The information processing apparatus 1C is different from the information processing apparatus 1A in FIG. 6 in the configuration of the control unit. The information processing apparatus 1C refers to the character string of the String object from the char array object group stored in the storage unit 30, and also includes the first character string and the last char data of the first character string. , A second character string that is a front character string that includes the first char data, and the rear character string and the front character string are combined into a first character string. And the second character string are concatenated.

情報処理装置1Cの有する制御部40Cは、参照部41および削除部42Cを備えている。削除部42Cは、文字列検出部426Bと、文字列連結部428と、文字列再編成部424Aと、を備えている。   The control unit 40C included in the information processing apparatus 1C includes a reference unit 41 and a deletion unit 42C. The deletion unit 42C includes a character string detection unit 426B, a character string connection unit 428, and a character string reorganization unit 424A.

図15は、削除部42Cで文字列操作を行う前のStringオブジェクトst_I、st_Jの文字列と、char配列オブジェクトch_D[]、ch_E[]と、の関係を示す模式図である。図16は、削除部42Cで文字列操作を行った後のStringオブジェクトst_I、st_Jの文字列と、char配列オブジェクトch_F[]と、の関係を示す模式図である。   FIG. 15 is a schematic diagram illustrating the relationship between the character strings of the String objects st_I and st_J and the char array objects ch_D [] and ch_E [] before the character string operation is performed by the deletion unit 42C. FIG. 16 is a schematic diagram illustrating the relationship between the character strings of the String objects st_I and st_J after the character string operation is performed by the deleting unit 42C and the char array object ch_F [].

図14に戻って、文字列検出部426Bは、char配列オブジェクトの中から、第1の文字列と、第1の文字列の最後の文字データを含む後部文字列を、最初の文字データを含む前部文字列とする第2の文字列と、を検出する。例えば、文字列“import”の後部文字列“port”は、文字列“portal”の前部文字列“port”と同一である。このため、図15では、char配列オブジェクト群CHARSの中から、第1の文字列としてのchar配列オブジェクトch_D[]の文字列“import”と、第2の文字列としてのchar配列オブジェクトch_E[]の文字列“portal”と、を検出する。   Returning to FIG. 14, the character string detection unit 426B includes, from the char array object, the first character string and the rear character string including the last character data of the first character string, and the first character data. The second character string as the front character string is detected. For example, the rear character string “port” of the character string “import” is the same as the front character string “port” of the character string “portal”. Therefore, in FIG. 15, from the char array object group CHARS, the character string “import” of the char array object ch_D [] as the first character string and the char array object ch_E [] as the second character string The character string “portal” is detected.

文字列連結部428は、上述の前部文字列および後部文字列を1つにまとめて、第1の文字列および第2の文字列を連結する。例えば、図15では、char配列オブジェクトch_D[]の文字列“import”の後部文字列“port”と、char配列オブジェクトch_E[]の文字列“portal”の前部文字列“port”と、を1つにまとめて、図16のように、char配列オブジェクトch_D[]の文字列“import”と、char配列オブジェクトch_E[]の文字列“portal”と、を連結して、char配列オブジェクトch_F[]の文字列“importal”とする。   The character string concatenation unit 428 combines the above-mentioned front character string and rear character string into one, and concatenates the first character string and the second character string. For example, in FIG. 15, the rear character string “port” of the character string “import” of the char array object ch_D [] and the front character string “port” of the character string “portal” of the char array object ch_E [] Collectively, as shown in FIG. 16, the character array “import” of the char array object ch_D [] and the character string “portal” of the char array object ch_E [] are concatenated, and the char array object ch_F [ ] Character string "importal".

文字列再編成部424Aは、文字列連結部428で文字列を連結したことに基づいて、char配列オブジェクトを再編成する。例えば、図15では、Stringオブジェクトst_I、st_Jのデータ部dataを、図16のように、char配列オブジェクトch_F[]を参照するように修正し、開始部startを、図16のように、それぞれ、char配列オブジェクトch_F[]のcharデータch_F[4]、ch_F[6]を表すように“4”と“6”に変更する。   The character string reorganization unit 424A reorganizes the char array object based on the concatenation of the character strings by the character string concatenation unit 428. For example, in FIG. 15, the data part data of the String objects st_I and st_J is modified so as to refer to the char array object ch_F [] as shown in FIG. 16, and the start part start is changed as shown in FIG. It is changed to “4” and “6” to represent the char data ch_F [4] and ch_F [6] of the char array object ch_F [].

以上の情報処理装置1Cの動作について、図17に基づいて説明する。ステップS601では、char配列ごとに、Stringオブジェクトから使用されている文字列と、そのchar配列を参照しているStringオブジェクト群を示した一覧表を作り、ステップS602に移る。ステップS602では、一覧表のchar配列オブジェクト群の中から、第1の文字列と、第1の文字列の最後のcharデータを含む後部文字列を、最初のcharデータを含む前部文字列とする第2の文字列と、を検出し、ステップS603に移る。   The operation of the information processing apparatus 1C will be described with reference to FIG. In step S601, for each char array, a list showing a character string used from the String object and a String object group referring to the char array is created, and the process proceeds to step S602. In step S602, a first character string, a rear character string including the last char data of the first character string, and a front character string including the first char data are selected from the char array object group of the list. The second character string to be detected is detected, and the process proceeds to step S603.

ステップS603では、上述の前部文字列および後部文字列を1つにまとめて、第1の文字列および第2の文字列を連結し、ステップS604に移る。ステップS604では、Stringオブジェクトを再編成する。   In step S603, the above-mentioned front character string and rear character string are combined into one, the first character string and the second character string are connected, and the process proceeds to step S604. In step S604, the String object is reorganized.

以上に説明したように、本実施形態に係る情報処理装置1Cは、削除部42Cを備えているので、記憶部30に記憶しているchar配列オブジェクト群の中から、第1の文字列と、第1の文字列の後部文字列を前部文字列とする第2の文字列と、を検出して、前部文字列および後部文字列を1つにまとめて、第1の文字列および第2の文字列を連結できる。このため、重複する文字列を減少させて、記憶部30の記憶容量を縮小することが可能である。   As described above, the information processing apparatus 1 </ b> C according to the present embodiment includes the deletion unit 42 </ b> C, and therefore, from the char array object group stored in the storage unit 30, the first character string, A second character string having the rear character string of the first character string as a front character string, and the front character string and the rear character string are combined into one, Two character strings can be concatenated. Therefore, it is possible to reduce the storage capacity of the storage unit 30 by reducing overlapping character strings.

以上、本発明の好適な実施例を用いて説明したが、本発明の技術的範囲は、上記実施形態に記載の範囲には限定されない。上記実施形態に、多様な変更または改良を加えることができる。そのような変更または改良を加えた形態も、本発明の技術的範囲に含まれ得ることが、特許請求の範囲の記載から明らかである。例えば、本発明は、上述の実施形態の特徴部分を組み合わせたものであってもよい。   As mentioned above, although demonstrated using the suitable Example of this invention, the technical scope of this invention is not limited to the range as described in the said embodiment. Various modifications or improvements can be added to the above embodiment. It is apparent from the scope of the claims that the embodiments added with such changes or improvements can also be included in the technical scope of the present invention. For example, the present invention may be a combination of the features of the above-described embodiments.

図18は、各実施形態を組み合わせて適用した場合の例で、(a)が適用前の記憶部30の状態、(b)が適用後の状態を表している。   FIG. 18 is an example in which the embodiments are applied in combination, and (a) shows the state of the storage unit 30 before application, and (b) shows the state after application.

また、本発明は、情報処理装置1、1A、1B、1C上のプログラムによって、実現可能である。上述のプログラムを格納する記憶媒体は、電子的、磁気的、光学的、電磁的、赤外線または半導体システム(または、装置または機器)あるいは伝搬媒体であることができる。コンピュータ可読の媒体の例には、半導体またはソリッド・ステート記憶装置、磁気テープ、取り外し可能なコンピュータ・ディスケット、ランダム・アクセス・メモリ(RAM)、リードオンリー・メモリ(ROM)、リジッド磁気ディスクおよび光ディスクが含まれる。現時点における光ディスクの例には、コンパクト・ディスク−リードオンリー・メモリ(CD−ROM)、コンパクト・ディスク−リード/ライト(CD−R/W)およびDVDが含まれる。   The present invention can be realized by a program on the information processing apparatuses 1, 1A, 1B, 1C. The storage medium storing the above program can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of computer readable media include semiconductor or solid state storage devices, magnetic tape, removable computer diskettes, random access memory (RAM), read only memory (ROM), rigid magnetic disks and optical disks. included. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read / write (CD-R / W) and DVD.

本発明の第1実施形態に係る情報処理装置の機能ブロック図である。It is a functional block diagram of the information processor concerning a 1st embodiment of the present invention. 前記情報処理装置の記憶媒体に記憶する文字列群の模式図である。It is a schematic diagram of the character string group memorize | stored in the storage medium of the said information processing apparatus. 前記情報処理装置の削除部で文字列操作を行う前の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group before performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の削除部で文字列操作を行った後の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group after performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the said information processing apparatus. 本発明の第2実施形態に係る情報処理装置の機能ブロック図である。It is a functional block diagram of the information processing apparatus which concerns on 2nd Embodiment of this invention. 前記情報処理装置の削除部で文字列操作を行う前の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group before performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の削除部で文字列操作を行った後の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group after performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the said information processing apparatus. 本発明の第3実施形態に係る情報処理装置の機能ブロック図である。It is a functional block diagram of the information processing apparatus which concerns on 3rd Embodiment of this invention. 前記情報処理装置の削除部で文字列操作を行う前の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group before performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の削除部で文字列操作を行った後の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group after performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the said information processing apparatus. 本発明の第4実施形態に係る情報処理装置の機能ブロック図である。It is a functional block diagram of the information processing apparatus which concerns on 4th Embodiment of this invention. 前記情報処理装置の削除部で文字列操作を行う前の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group before performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の削除部で文字列操作を行った後の特定文字列および文字列群の関係を示す模式図である。It is a schematic diagram which shows the relationship between the specific character string and character string group after performing a character string operation in the deletion part of the said information processing apparatus. 前記情報処理装置の動作を示すフローチャート図である。It is a flowchart figure which shows operation | movement of the said information processing apparatus. 本発明の実施形態を組み合わせて適用した模式図である。It is the schematic diagram which applied combining the embodiment of this invention.

符号の説明Explanation of symbols

1、1A〜1C 情報処理装置
10 入力部
20 出力部
30 記憶部
40、40A〜40C 制御部
41 参照部
42、42A〜42C 削除部
421 リスト作成部
422、422A 文字データ検出部
423 文字データ削除部
424、424A 文字列再編成部
425 文字列整列部
426、426A〜426B 文字列検出部
427 文字列削除部
428 文字列連結部
DESCRIPTION OF SYMBOLS 1, 1A-1C Information processing apparatus 10 Input part 20 Output part 30 Storage part 40, 40A-40C Control part 41 Reference part 42, 42A-42C Deletion part 421 List creation part 422, 422A Character data detection part 423 Character data deletion part 424, 424A Character string reorganization unit 425 Character string alignment unit 426, 426A to 426B Character string detection unit 427 Character string deletion unit 428 Character string connection unit

Claims (10)

Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行する情報処理装置において、char配列を操作する文字列操作方法であって、
前記情報処理装置が備える参照部が、前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からStringオブジェクトの文字列を参照する手順を行い
前記情報処理装置が備える検出部が、前記Stringオブジェクトの文字列として参照されないcharデータを検出する手順を行い、
前記情報処理装置が備える削除部が、当該検出されたcharデータを削除する手順を行うことを特徴とする文字列操作方法。
An information processing apparatus that operates based on a Java (registered trademark) program and that stores a char array object group composed of a plurality of char data, and performs garbage collection on the storage unit. A string operation method to be operated,
A reference unit provided in the information processing apparatus performs a procedure of referring to a character string of a String object from the char array object group stored in the storage unit at the time of the garbage collection ,
The detection unit included in the information processing apparatus performs a procedure of detecting char data that is not referred to as a character string of the String object.
A character string operation method , wherein a deletion unit included in the information processing apparatus performs a procedure of deleting the detected char data .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行する情報処理装置において、char配列を操作する文字列操作方法であって、
前記情報処理装置が備える参照部が、前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からcharデータの特定の文字列を参照する手順を行い
前記情報処理装置が備える文字列整列部が、char配列オブジェクトのStringオブジェクトの文字列として用いられる部分のデータに応じて、char配列を昇順に並べる手順を行い、
前記情報処理装置が備える検出部が、char配列オブジェクト群の中から第1の文字列と該第1の文字列と少なくとも1部が同一である第2の文字列とを検出する手順を行い、
前記情報処理装置が備える削除部が、char配列オブジェクト群の中から前記第2の文字列を含むchar配列オブジェクトを削除する手順を行うことを特徴とする文字列操作方法。
An information processing apparatus that operates based on a Java (registered trademark) program and that stores a char array object group composed of a plurality of char data, and performs garbage collection on the storage unit. A string operation method to be operated,
The reference unit included in the information processing apparatus performs a procedure of referring to a specific character string of char data from the char array object group stored in the storage unit during the garbage collection ,
The character string aligning unit included in the information processing apparatus performs a procedure of arranging the char array in ascending order according to the data of the part used as the character string of the String object of the char array object,
The detection unit included in the information processing apparatus performs a procedure of detecting a first character string and a second character string having at least one part identical to the first character string from the char array object group,
A character string operating method, wherein a deletion unit included in the information processing apparatus performs a procedure of deleting a char array object including the second character string from a char array object group .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行する情報処理装置において、char配列を操作する文字列操作方法であって、
前記情報処理装置が備える参照部が、前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からcharデータの特定の文字列を参照する手順を行い
前記情報処理装置が備える検出部が、char配列オブジェクトの中から第1の文字列、および、前記第1の文字列の最後の文字データを含む後部文字列を最初の文字データを含む前部文字列とする第2の文字列を検出する手順を行い
前記情報処理装置が備える連結部が、前記前部文字列および前記後部文字列を1つにまとめて、第1の文字列および第2の文字列を連結する手順を行うことを特徴とする文字列操作方法。
An information processing apparatus that operates based on a Java (registered trademark) program and that stores a char array object group composed of a plurality of char data, and performs garbage collection on the storage unit. A string operation method to be operated,
The reference unit included in the information processing apparatus performs a procedure of referring to a specific character string of char data from the char array object group stored in the storage unit during the garbage collection ,
The detection unit included in the information processing apparatus includes a first character string and a rear character string including the last character data of the first character string as a front character including the first character data from the char array object. Perform the procedure to detect the second character string as a column,
Characters characterized in that a connecting unit included in the information processing apparatus performs a procedure of combining the first character string and the second character string by combining the front character string and the rear character string into one. Column operation method.
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行するコンピュータで用いられるコンピュータ・プログラムであって、
前記コンピュータに、
前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からStringオブジェクトの文字列を参照するステップと、
前記Stringオブジェクトの文字列として参照されないcharデータを検出するステップと、
当該検出されたcharデータを削除するステップとを実行させるコンピュータ・プログラム。
A computer program that operates based on a Java (registered trademark) program and includes a storage unit that stores a char array object group composed of a plurality of char data, and is used in a computer that performs garbage collection on the storage unit. There,
In the computer,
A step of referring to a character string of a String object from the char array object group stored in the storage unit during the garbage collection ;
Detecting char data that is not referred to as a string of the String object;
A computer program for executing the step of deleting the detected char data .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行するコンピュータで用いられるコンピュータ・プログラムであって、
前記コンピュータに、
前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からcharデータの特定の文字列を参照するステップと、
char配列オブジェクトのStringオブジェクトの文字列として用いられる部分のデータに応じて、char配列を昇順に並べるステップと、
char配列オブジェクト群の中から第1の文字列と該第1の文字列と少なくとも1部が同一である第2の文字列とを検出するステップと、
char配列オブジェクト群の中から前記第2の文字列を含むchar配列オブジェクトを削除するステップとを実行させるコンピュータ・プログラム。
A computer program that operates based on a Java (registered trademark) program and includes a storage unit that stores a char array object group composed of a plurality of char data, and is used in a computer that performs garbage collection on the storage unit. There,
In the computer,
Referring to a specific character string of char data from the char array object group stored in the storage unit during the garbage collection ;
arranging the char array in ascending order according to the data of the portion used as the character string of the String object of the char array object;
detecting from the char array object group a first character string and a second character string having at least one part identical to the first character string;
and a step of deleting a char array object including the second character string from the char array object group .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行するコンピュータで用いられるコンピュータ・プログラムであって、
前記コンピュータに、
前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からcharデータの特定の文字列を参照するステップと、
char配列オブジェクトの中から第1の文字列、および、前記第1の文字列の最後の文字データを含む後部文字列を最初の文字データを含む前部文字列とする第2の文字列を検出するステップと、
前記前部文字列および前記後部文字列を1つにまとめて、第1の文字列および第2の文字列を連結するステップとを実行させるコンピュータ・プログラム。
A computer program that operates based on a Java (registered trademark) program and includes a storage unit that stores a char array object group composed of a plurality of char data, and is used in a computer that performs garbage collection on the storage unit. There,
In the computer,
Referring to a specific character string of char data from the char array object group stored in the storage unit during the garbage collection ;
From the char array object, a first character string and a second character string having a rear character string including the last character data of the first character string as a front character string including the first character data are detected. And steps to
A computer program for causing the front character string and the rear character string to be combined into a first character string and a second character string .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行する情報処理装置であって、
前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からStringオブジェクトの文字列を参照する参照部と、
前記情報処理装置が備える検出部が、前記Stringオブジェクトの文字列として参照されないcharデータを検出する検出部と、
前記情報処理装置が備える削除部が、当該検出されたcharデータを削除する削除部とを備えることを特徴とする情報処理装置。
An information processing apparatus that operates based on a Java (registered trademark) program, includes a storage unit that stores a char array object group including a plurality of char data, and performs garbage collection on the storage unit ,
A reference unit that refers to a character string of a String object from the char array object group stored in the storage unit during the garbage collection ;
A detection unit included in the information processing apparatus that detects char data that is not referred to as a character string of the String object;
An information processing apparatus comprising: a deletion unit included in the information processing apparatus; and a deletion unit that deletes the detected char data .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行する情報処理装置であって、
前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からcharデータの特定の文字列を参照する参照部と、
char配列オブジェクトのStringオブジェクトの文字列として用いられる部分のデータに応じて、char配列を昇順に並べる文字列整列部と、
前記情報処理装置が備える検出部が、char配列オブジェクト群の中から第1の文字列と該第1の文字列と少なくとも1部が同一である第2の文字列とを検出する検出部と、
前記情報処理装置が備える削除部が、char配列オブジェクト群の中から前記第2の文字列を含むchar配列オブジェクトを削除する削除部とを備えることを特徴とする情報処理装置。
An information processing apparatus that operates based on a Java (registered trademark) program, includes a storage unit that stores a char array object group including a plurality of char data, and performs garbage collection on the storage unit,
A reference unit that refers to a specific character string of char data from the char array object group stored in the storage unit during the garbage collection ;
a character string aligning unit that arranges the char array in ascending order according to the data of the portion used as the character string of the String object of the char array object;
A detection unit included in the information processing apparatus that detects a first character string and a second character string at least one part of which is the same as the first character string from the char array object group;
An information processing apparatus comprising: a deletion unit included in the information processing apparatus; and a deletion unit that deletes a char array object including the second character string from a char array object group .
Java(登録商標)プログラムに基づいて動作し、複数のcharデータで構成されるchar配列オブジェクト群を記憶する記憶部を備え、前記記憶部についてガベージ・コレクションを実行する情報処理装置であって、
前記ガベージ・コレクションの際、前記記憶部に記憶された前記char配列オブジェクト群の中からcharデータの特定の文字列を参照する参照部と、
char配列オブジェクトの中から第1の文字列、および、前記第1の文字列の最後の文字データを含む後部文字列を最初の文字データを含む前部文字列とする第2の文字列を検出する検出部と、
前記情報処理装置が備える連結部が、前記前部文字列および前記後部文字列を1つにまとめて、第1の文字列および第2の文字列を連結する連結部とを備えることを特徴とする情報処理装置。
An information processing apparatus that operates based on a Java (registered trademark) program, includes a storage unit that stores a char array object group including a plurality of char data, and performs garbage collection on the storage unit,
A reference unit that refers to a specific character string of char data from the char array object group stored in the storage unit during the garbage collection;
From the char array object, a first character string and a second character string having a rear character string including the last character data of the first character string as a front character string including the first character data are detected. A detector to perform,
The connecting unit included in the information processing apparatus includes a connecting unit that combines the first character string and the second character string by combining the front character string and the rear character string into one. Information processing apparatus.
請求項4乃至6のいずれか1項に記載のコンピュータ・プログラムを記録する記録媒体。 The recording medium which records the computer program of any one of Claims 4 thru | or 6 .
JP2006115275A 2005-12-09 2006-04-19 Method, program, and information processing apparatus for manipulating character strings Expired - Fee Related JP4873620B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006115275A JP4873620B2 (en) 2005-12-09 2006-04-19 Method, program, and information processing apparatus for manipulating character strings

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2005356226 2005-12-09
JP2005356226 2005-12-09
JP2006115275A JP4873620B2 (en) 2005-12-09 2006-04-19 Method, program, and information processing apparatus for manipulating character strings

Publications (2)

Publication Number Publication Date
JP2007183905A JP2007183905A (en) 2007-07-19
JP4873620B2 true JP4873620B2 (en) 2012-02-08

Family

ID=38339920

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006115275A Expired - Fee Related JP4873620B2 (en) 2005-12-09 2006-04-19 Method, program, and information processing apparatus for manipulating character strings

Country Status (1)

Country Link
JP (1) JP4873620B2 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003241967A (en) * 2002-02-15 2003-08-29 Matsushita Electric Ind Co Ltd Program execution device, its method and program executed therein

Also Published As

Publication number Publication date
JP2007183905A (en) 2007-07-19

Similar Documents

Publication Publication Date Title
CN100452029C (en) Method and system for managing media file database
JP4477689B2 (en) Annotating documents in collaborative applications with data from different information systems
EP0487331B1 (en) Directory management system
KR100880531B1 (en) File creating method for searching of single data, searching method of single data file and storage medium storing rat file for searching of single data file
CN101727950B (en) Playlist search device, playlist search method and program
JP2006313548A (en) Device and method for storing and managing additional information in file system
US8275812B2 (en) Method to reduce wasted character data areas of java strings
JP2008152585A (en) Display image control apparatus and its control method
JP2008269503A5 (en)
JP2006236142A (en) Position information display program and position information display device
JP5108252B2 (en) Index updating method and system
JP4873620B2 (en) Method, program, and information processing apparatus for manipulating character strings
JP2007531176A (en) Recording system, recording apparatus, recording method, recording program, and recording medium
JP4561872B2 (en) Recording / reproducing apparatus and information processing method
JP6260339B2 (en) Information processing apparatus, data conversion program, and data conversion method
JP2011086023A (en) Computer capable of retrieving ambiguous information
CN101807194A (en) Method, system, and article for locating resource in a data structure hierarchy
US20130318082A1 (en) Generation apparatus, generation method, searching apparatus, and searching method
JPH06231030A (en) Multi-media authoring system
JP4148250B2 (en) Content information display device and program thereof
JPH0756651B2 (en) Document file search method
US11789700B2 (en) Information processing device, information processing system, and non-transitory computer-readable storage medium for storing program
KR102385867B1 (en) Data compression method and apparatus for data visualization
JP2007115012A (en) Content reproducing device, control method, musical composition retrieval device and program
JP2005284417A (en) Random access method for xml document of table format, and its program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080611

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110712

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110913

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20111108

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

RD14 Notification of resignation of power of sub attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7434

Effective date: 20111109

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111118

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20141202

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees