gov.nasa.arc.brahms.vm.api.common
Class BrahmsGroupDescriptor

java.lang.Object
  extended by gov.nasa.arc.brahms.vm.api.common.BrahmsGroupDescriptor

public class BrahmsGroupDescriptor
extends java.lang.Object

BrahmsGroupDescriptor maintains a record of a Brahms group and its attributes and relations.

Version:
$Revision: 1.6 $ $Date: 2009/11/23 21:08:33 $ $Author: rnado $
Author:
Ron van Hoof

Constructor Summary
BrahmsGroupDescriptor(java.lang.String qualifiedname)
          Constructors, creates a new record about a Brahms Group with the specified qualified name.
 
Method Summary
 IAttribute getBrahmsAttribute(java.lang.String name)
          Returns the Brahms attribute with the specified name.
 java.util.Collection<IAttribute> getBrahmsAttributes()
          Returns the list of Brahms attributes declared for this group.
 IGroup getBrahmsGroup()
          Returns the Brahms group.
 IRelation getBrahmsRelation(java.lang.String name)
          Returns the Brahms relation with the specified name.
 java.util.Collection<IRelation> getBrahmsRelations()
          Returns the list of Brahms relations declared for this group.
 java.lang.String getQualifiedName()
          Returns the group's qualified name.
 java.lang.String getSimpleName()
          Returns the group's simple name.
 java.lang.Object getValue(IAgent agt, IAttribute lhsAttribute, IContext brahmsCtx)
          Returns the value for the attribute of the specified agent.
 java.lang.Object getValue(IAgent source, IConcept lhsConcept, IAttribute lhsAttribute, IContext brahmsCtx)
          Returns the value for the attribute of the specified agent.
 java.lang.Object getValue(IAgent source, IConcept lhsConcept, IRelation rel, IContext brahmsCtx)
          Returns the values for the relation of the specified agent.
 java.lang.Object getValue(IAgent agt, IRelation rel, IContext brahmsCtx)
          Returns the values for the relation of the specified agent.
 void setValue(IAgent agt, IAttribute att, java.lang.Object value, IContext brahmsCtx)
          Sets the value for the attribute of the specified agent.
 void setValue(IAgent destination, IConcept lhsConcept, IAttribute lhsAttribute, java.lang.Object value, IContext brahmsCtx)
          Sets the value for the attribute of the specified agent.
 void setValue(IAgent destination, IConcept lhsConcept, IRelation rel, java.lang.Object value, IContext brahmsCtx)
          Sets the value for the relation of the specified agent.
 void setValue(IAgent agt, IRelation rel, java.lang.Object value, IContext brahmsCtx)
          Sets the value for the relation of the specified agent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BrahmsGroupDescriptor

public BrahmsGroupDescriptor(java.lang.String qualifiedname)
Constructors, creates a new record about a Brahms Group with the specified qualified name.

Parameters:
qualifiedname - the group's qualified name
Method Detail

getSimpleName

public java.lang.String getSimpleName()
Returns the group's simple name.

Returns:
String the simple name

getQualifiedName

public java.lang.String getQualifiedName()
Returns the group's qualified name.

Returns:
String the qualified name

getBrahmsGroup

public IGroup getBrahmsGroup()
                      throws ExternalException
Returns the Brahms group.

Returns:
IGroup the Brahms group
Throws:
ExternalException - if the group could not be found

getBrahmsAttributes

public java.util.Collection<IAttribute> getBrahmsAttributes()
                                                     throws ExternalException
Returns the list of Brahms attributes declared for this group.

Returns:
Collection the Brahms attributes declared for the group
Throws:
ExternalException - if there was a problem obtaining the attribute list

getBrahmsAttribute

public IAttribute getBrahmsAttribute(java.lang.String name)
                              throws ExternalException
Returns the Brahms attribute with the specified name.

Parameters:
name - the attribute name
Returns:
IAttribute the Brahms attribute
Throws:
ExternalException - if the attribute could not be found

getBrahmsRelations

public java.util.Collection<IRelation> getBrahmsRelations()
                                                   throws ExternalException
Returns the list of Brahms relations declared for this group.

Returns:
Collection the Brahms relations declared for the group
Throws:
ExternalException - if there was a problem obtaining the relation list

getBrahmsRelation

public IRelation getBrahmsRelation(java.lang.String name)
                            throws ExternalException
Returns the Brahms relation with the specified name.

Parameters:
name - the relation name
Returns:
IRelation the Brahms relation
Throws:
ExternalException - if the relation could not be found

getValue

public java.lang.Object getValue(IAgent agt,
                                 IAttribute lhsAttribute,
                                 IContext brahmsCtx)
                          throws ExternalException
Returns the value for the attribute of the specified agent. If the attribute is of a map type, a Map is returned with keys being one of String or Integer type.

Parameters:
agt - the IAgent holding the belief and also the left hand side concept of the belief from which to obtain the value
lhsAttribute - the IAttribute to obtain the value for
brahmsCtx - the IContext used to obtain the value
Returns:
Object the value, null if no value set or the value is IUnknown
Throws:
ExternalException - if there was a problem obtaining the value

getValue

public java.lang.Object getValue(IAgent source,
                                 IConcept lhsConcept,
                                 IAttribute lhsAttribute,
                                 IContext brahmsCtx)
                          throws ExternalException
Returns the value for the attribute of the specified agent. If the attribute is of a map type, a Map is returned with keys being one of String or Integer type.

Parameters:
source - the IAgent to obtain the belief and value from
lhsConcept - the left hand side IConcept in the belief from which to obtain the value
lhsAttribute - the IAttribute to obtain the value for
brahmsCtx - the IContext used to obtain the value
Returns:
Object the value, null if no value set or the value is IUnknown
Throws:
ExternalException - if there was a problem obtaining the value

getValue

public java.lang.Object getValue(IAgent agt,
                                 IRelation rel,
                                 IContext brahmsCtx)
                          throws ExternalException
Returns the values for the relation of the specified agent. The values are returned as a List, if the relation's value is IUnknown an empty List is returned. The list only contains those values for which the truth value is set to true.

Parameters:
agt - the IAgent holding the belief and also the left hand side concept of the belief from which to obtain the value
rel - the IRelation to obtain the values for
brahmsCtx - the IContext used to obtain the values
Returns:
Object the values, null if no value set
Throws:
ExternalException - if there was a problem obtaining the values

getValue

public java.lang.Object getValue(IAgent source,
                                 IConcept lhsConcept,
                                 IRelation rel,
                                 IContext brahmsCtx)
                          throws ExternalException
Returns the values for the relation of the specified agent. The values are returned as a List, if the relation's value is IUnknown an empty List is returned. The list only contains those values for which the truth value is set to true.

Parameters:
source - the IAgent holding the belief from which to obtain the value
lhsConcept - the left hand side IConcept in the belief from which to obtain the value
rel - the IRelation to obtain the values for
brahmsCtx - the IContext used to obtain the values
Returns:
Object the values, null if no value set
Throws:
ExternalException - if there was a problem obtaining the values

setValue

public void setValue(IAgent agt,
                     IAttribute att,
                     java.lang.Object value,
                     IContext brahmsCtx)
              throws ExternalException
Sets the value for the attribute of the specified agent.

Note: Assumes that the specified value is a valid Brahms value. If a Map is passes as a value its keys must be either of type String or Integer and its values must be valid Brahms values.

Parameters:
agt - the IAgent in which to assert the belief with the value and serving as the lhs concept in the belief to set the value for
att - the IAttribute to set the value for
value - the value
brahmsCtx - the IContext used to set the value
Throws:
ExternalException - if the value could not be set

setValue

public void setValue(IAgent destination,
                     IConcept lhsConcept,
                     IAttribute lhsAttribute,
                     java.lang.Object value,
                     IContext brahmsCtx)
              throws ExternalException
Sets the value for the attribute of the specified agent.

Note: Assumes that the specified value is a valid Brahms value. If a Map is passes as a value its keys must be either of type String or Integer and its values must be valid Brahms values.

Parameters:
destination - the IAgent to assert the belief with the value into
lhsConcept - the left hand side IConcept in the belief for which to setthe value
lhsAttribute - the IAttribute to set the value for
value - the value
brahmsCtx - the IContext used to set the value
Throws:
ExternalException - if the value could not be set

setValue

public void setValue(IAgent agt,
                     IRelation rel,
                     java.lang.Object value,
                     IContext brahmsCtx)
              throws ExternalException
Sets the value for the relation of the specified agent.

Note: Assumes that the specified value is a valid Brahms value. If a Collection is passed as a value its values must be valid Brahms values (all of type IConcept).

Parameters:
agt - the IAgent in which to assert the belief with the value and serving as the lhs concept in the belief to set the value for
rel - the IRelation to set the value for
value - the value
brahmsCtx - the IContext used to set the value
Throws:
ExternalException - if the value could not be set

setValue

public void setValue(IAgent destination,
                     IConcept lhsConcept,
                     IRelation rel,
                     java.lang.Object value,
                     IContext brahmsCtx)
              throws ExternalException
Sets the value for the relation of the specified agent.

Note: Assumes that the specified value is a valid Brahms value. If a Collection is passed as a value its values must be valid Brahms values (all of type IConcept).

Parameters:
destination - the IAgent to assert the belief with the value into
lhsConcept - the left hand side IConcept in the belief for which to set the value
rel - the IRelation to set the value for
value - the value
brahmsCtx - the IContext used to set the value
Throws:
ExternalException - if the value could not be set


Copyright © 1997-2012 All Rights Reserved.