Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Lamp::ArrayList< Type > Class Template Reference

アレイリスト More...

#include <ArrayList.h>

List of all members.

Public Member Functions

 ArrayList ()
 コンストラクタ

 ArrayList (int capacity)
 コンストラクタ

 ~ArrayList ()
 デストラクタ

void clone (ArrayList &destination) const
 クローン

int getCount () const
 要素数の取得

bool isEmpty () const
 空かどうか

Type & get (int index) const
 要素の取得

Type & operator[] (int index) const
 要素の取得

int getCapacity () const
 キャパシティの取得

int indexOf (const Type &searchValue) const
 値の検索

int lastIndexOf (const Type &searchValue) const
 後ろからの値の検索

void add (const Type &value)
 要素の追加

void set (int index, const Type &value) const
 要素の設定

Type remove (int index)
 要素の削除

int removeByValue (const Type &removeValue)
 値による要素の削除

void clear ()
 全要素を削除

void clear (int capacity)
 全要素を削除

void setCapacity (int newCapacity)
 キャパシティの設定

void trim ()
 トリム

void sort (int(*compare)(const Type *, const Type *))
 ソート

Type * search (Type key, int(*compare)(const Type *, const Type *))
 サーチ


Detailed Description

template<typename Type>
class Lamp::ArrayList< Type >

アレイリスト

このクラスは継承しないで下さい。

Definition at line 37 of file ArrayList.h.


Constructor & Destructor Documentation

template<typename Type>
Lamp::ArrayList< Type >::ArrayList int  capacity  )  [inline, explicit]
 

コンストラクタ

Parameters:
capacity 初期キャパシティ。2の累乗が好ましい。

Definition at line 55 of file ArrayList.h.


Member Function Documentation

template<typename Type>
void Lamp::ArrayList< Type >::add const Type &  value  )  [inline]
 

要素の追加

Parameters:
value 要素

Definition at line 158 of file ArrayList.h.

Referenced by Lamp::Scene::getMeshList(), and Lamp::InformationRenderer::setupBone().

template<typename Type>
void Lamp::ArrayList< Type >::clear int  capacity  )  [inline]
 

全要素を削除

Parameters:
capacity クリア後のキャパシティ

Definition at line 217 of file ArrayList.h.

template<typename Type>
void Lamp::ArrayList< Type >::clone ArrayList< Type > &  destination  )  const [inline]
 

クローン

Parameters:
destination クローン先アレイリスト

Definition at line 71 of file ArrayList.h.

template<typename Type>
Type& Lamp::ArrayList< Type >::get int  index  )  const [inline]
 

要素の取得

Parameters:
index 取得する要素のインデックス
Returns:
要素

Definition at line 100 of file ArrayList.h.

template<typename Type>
int Lamp::ArrayList< Type >::getCapacity  )  const [inline]
 

キャパシティの取得

Returns:
キャパシティ

Definition at line 121 of file ArrayList.h.

template<typename Type>
int Lamp::ArrayList< Type >::getCount  )  const [inline]
 

要素数の取得

Returns:
要素数

Definition at line 87 of file ArrayList.h.

Referenced by Lamp::InformationRenderer::setupBone().

template<typename Type>
int Lamp::ArrayList< Type >::indexOf const Type &  searchValue  )  const [inline]
 

値の検索

アレイリストの前から値を検索し、発見できればそのインデックスを返します。

Parameters:
searchValue 検索する値
Returns:
値のインデックス。値が無ければ-1を返す。

Definition at line 130 of file ArrayList.h.

template<typename Type>
bool Lamp::ArrayList< Type >::isEmpty  )  const [inline]
 

空かどうか

Returns:
空ならtrueを返す

Definition at line 93 of file ArrayList.h.

template<typename Type>
int Lamp::ArrayList< Type >::lastIndexOf const Type &  searchValue  )  const [inline]
 

後ろからの値の検索

アレイリストの後ろから値を検索し、発見できればそのインデックスを返します。

Parameters:
searchValue 検索する値
Returns:
値のインデックス。値が無ければ-1を返す。

Definition at line 144 of file ArrayList.h.

template<typename Type>
Type& Lamp::ArrayList< Type >::operator[] int  index  )  const [inline]
 

要素の取得

Parameters:
index 取得する要素のインデックス
Returns:
要素

Definition at line 111 of file ArrayList.h.

template<typename Type>
Type Lamp::ArrayList< Type >::remove int  index  )  [inline]
 

要素の削除

Parameters:
index 削除する要素のインデックス
Returns:
アレイリストから削除した要素

Definition at line 181 of file ArrayList.h.

Referenced by Lamp::ArrayList< Material * >::removeByValue().

template<typename Type>
int Lamp::ArrayList< Type >::removeByValue const Type &  removeValue  )  [inline]
 

値による要素の削除

アレイリストの後ろから削除する値を検索し、同じ要素があれば削除します。

Parameters:
removeValue 削除する要素の値
Returns:
削除したインデックス。-1なら該当する要素無し。

Definition at line 198 of file ArrayList.h.

template<typename Type>
Type* Lamp::ArrayList< Type >::search Type  key,
int(*  compare)(const Type *, const Type *)
[inline]
 

サーチ

バイナリサーチでアレイリストを検索します。
アレイリストは昇順にソートされている必要があります。
要素が見つからなかった場合はNULLを返します。 compareは以下のような返り値を返してください。
第一引数が第二引数より大きいときは1以上
第一引数と大に引数が同じ場合は0
第一引数が第二引数より小さいときは-1以下

Parameters:
key 検索する値
compare 比較関数
Returns:
検索結果、見つからなければNULL

Definition at line 277 of file ArrayList.h.

template<typename Type>
void Lamp::ArrayList< Type >::set int  index,
const Type &  value
const [inline]
 

要素の設定

Parameters:
index 要素を設定するインデックス
value 要素
Returns:
要素

Definition at line 170 of file ArrayList.h.

template<typename Type>
void Lamp::ArrayList< Type >::setCapacity int  newCapacity  )  [inline]
 

キャパシティの設定

Parameters:
newCapacity 新しいキャパシティ

Definition at line 230 of file ArrayList.h.

template<typename Type>
void Lamp::ArrayList< Type >::sort int(*  compare)(const Type *, const Type *)  )  [inline]
 

ソート

クイックソートでアレイリストをソートします。
compareの返り値を以下のようにすると昇順にソートされます。
第一引数が第二引数より大きいときは1以上
第一引数と大に引数が同じ場合は0
第一引数が第二引数より小さいときは-1以下

Parameters:
compare 比較関数。

Definition at line 258 of file ArrayList.h.

template<typename Type>
void Lamp::ArrayList< Type >::trim  )  [inline]
 

トリム

現在のサイズに合わせて使用メモリを最小にします。

Definition at line 240 of file ArrayList.h.


The documentation for this class was generated from the following file:
Generated on Wed Mar 16 10:29:43 2005 for Lamp by doxygen 1.3.2