org.boxed_economy.besp.model.fmfw
クラス RelationManager

java.lang.Object
  拡張org.boxed_economy.besp.model.fmfw.RelationManager
すべての実装インタフェース:
java.io.Serializable

public class RelationManager
extends java.lang.Object
implements java.io.Serializable

エージェントの持つrelationを管理するrelationManagerを定義します。 (概念的にはエージェントに含まれます。) relationをTypeで追加・削除・検索するインターフェースを持ちます。 同じRelationTypeでも異なるインスタンスのRelationを区別して格納します。

バージョン:
$Id: RelationManager.java,v 1.1 2004/03/21 12:07:47 macchan Exp $
作成者:
macchan
関連項目:
直列化された形式

コンストラクタの概要
protected RelationManager(Agent agent)
           
 
メソッドの概要
 void addRelation(Relation relation)
          Relationを追加します。
 java.util.List getAllRelations()
          Method getAllRelations.
 Relation getRelation(RelationType type)
          引数のTypeであるRelationを返します。
 Relation getRelation(RelationType type, Agent agent)
          引数のType、かつ関係先が引数のAgentであるRelationを返します 存在しない場合、Exceptionを投げます
 java.util.Collection getRelations(RelationType type)
          引数のTypeであるrelationをリストとして全て返します。
 java.util.Collection getRelationsRecursively(RelationType type)
          引数のType及びそのTypeの子のTypeである全てのrelationを返します。
 java.util.Collection getRelationTypes()
          このRelaitonManagerの持つRelationのTypeを返します。
 void removeRelation(Relation relation)
          引数のRelationを削除します。
 java.util.Collection removeRelations(RelationType type)
          引数のTypeのRelation全てを削除します。
 void removeRelationsByAgent(Agent agent)
          引数のAgentへのRelationを削除します。
 java.util.Collection removeRelationsRecursively(RelationType type)
          引数のType及びその子TypeのRelation全てを削除します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

RelationManager

protected RelationManager(Agent agent)
メソッドの詳細

addRelation

public void addRelation(Relation relation)
Relationを追加します。 同じTypeがある場合、既存のlistに入れます 同じtypeがない場合、新しくlistを作って、引数のrelationを入れます

パラメータ:
relation - 追加するRelation

removeRelation

public void removeRelation(Relation relation)
引数のRelationを削除します。 typeが含まれない場合およびlist内に含まれない場合にExceptionを投げます

パラメータ:
relation - 削除対象のRelation

removeRelations

public java.util.Collection removeRelations(RelationType type)
引数のTypeのRelation全てを削除します。 Typeが見つからない場合にExceptionを投げます

パラメータ:
type - 削除対象のType

removeRelationsByAgent

public void removeRelationsByAgent(Agent agent)
引数のAgentへのRelationを削除します。 Agentの削除時に、Agentから呼ばれます。

パラメータ:
agent - 削除対象のRelationの先のAgent

removeRelationsRecursively

public java.util.Collection removeRelationsRecursively(RelationType type)
引数のType及びその子TypeのRelation全てを削除します。

パラメータ:
type - 削除対象のType

getRelationTypes

public java.util.Collection getRelationTypes()
このRelaitonManagerの持つRelationのTypeを返します。 もし、存在しなければExceptionが投げられます。

戻り値:
Collection Relationの持つTypeのリスト

getRelation

public Relation getRelation(RelationType type)
引数のTypeであるRelationを返します。(複数ある場合、最初のRelationを返します。) もし、存在しなければExceptionが投げられます。

パラメータ:
type - 検索対象のType
戻り値:
Relation 該当するRelation

getRelation

public Relation getRelation(RelationType type,
                            Agent agent)
引数のType、かつ関係先が引数のAgentであるRelationを返します 存在しない場合、Exceptionを投げます


getRelations

public java.util.Collection getRelations(RelationType type)
引数のTypeであるrelationをリストとして全て返します。 もし、存在しない、あるいは空である場合は空のリストが返されます。

パラメータ:
type - 検索対象のType
戻り値:
Collection 該当するRelationのリスト

getRelationsRecursively

public java.util.Collection getRelationsRecursively(RelationType type)
引数のType及びそのTypeの子のTypeである全てのrelationを返します。 もし、存在しなければ空のリストが返されます。

パラメータ:
type - 検索対象のType
戻り値:
Collection 該当するRelationのリスト

getAllRelations

public java.util.List getAllRelations()
Method getAllRelations.

戻り値: