|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--roles.ObjectWithRoles
This class is the root for entity classes, which should have the ability to play different independent roles.
Field Summary | |
protected java.util.Hashtable |
qualifiedRoles
Contains collections of qualified role objects identified by their role type name. |
protected java.util.Hashtable |
roles
Contains (unqualified) role objects indentified by their role type name. |
Constructor Summary | |
ObjectWithRoles()
|
Method Summary | |
java.util.Enumeration |
allAs(java.lang.String qualifiedRoleTypeName)
Returns an enumeration of qualified role objects whose class is the qualified role type with name qualifiedRoleTypeName. |
RoleType |
as(java.lang.String roleTypeName)
Returns an (unqualified) role object whose class is the role type with name roleTypeName. |
QualifiedRoleType |
as(java.lang.String qualifiedRoleTypeName,
java.lang.Object qualifyingObject)
Returns an instance of the qualified role type with name qualifiedRoleTypeName whose qualifier is identical with qualifyingObject. |
protected void |
cancelQualifiedRole(QualifiedRoleType role)
Deregisters a qualified role that the receiver is currently playing. |
protected void |
cancelRole(RoleType role)
Deregisters an (unqualified) role that the receiver is currently playing. |
boolean |
existsAs(java.lang.String roleTypeName)
Examines whether an instance of a particular role type has been registered as a role of the receiver. |
boolean |
existsAs(java.lang.String qualifiedRoleTypeName,
java.lang.Object qualifyingObj)
Examines whether an instance of the qualified role type with name qualifiedRoleTypeName has been registered by the receiver using qualifier qualifyingObj. |
protected java.util.Enumeration |
getRegisteredQualifiedRoleTypeNames()
Returns an enumeration of qualified role type names, of which instances are currently registered with the receiver. |
protected java.util.Enumeration |
getRegisteredRoleTypeNames()
Returns an enumeration of (unqualified) role type names, of which instances are currently registered with the receiver. |
ObjectWithRoles |
getRoot()
Returns the root (=this) of the role hierarchy. |
boolean |
isEntityEquivalentWith(RoleProtocol anotherObject)
Examines whether the receiver represents the same role player as another object. |
protected void |
recordNewQualifiedRole(QualifiedRoleType role)
Registers a new qualified role that the receiver should play. |
protected void |
recordNewRole(RoleType role)
Registers a new (unqualified) role that the receiver's should play. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.util.Hashtable roles
protected java.util.Hashtable qualifiedRoles
Constructor Detail |
public ObjectWithRoles()
Method Detail |
public ObjectWithRoles getRoot()
protected java.util.Enumeration getRegisteredRoleTypeNames()
protected java.util.Enumeration getRegisteredQualifiedRoleTypeNames()
public RoleType as(java.lang.String roleTypeName) throws NoSuchRoleException
roleTypeName
- fully qualified class name of the intended
role type.
The class name must be qualified by the package name, e.g., if class
Employee belongs to package persons then "persons.Employee"
would be the correct class name of that role type.public java.util.Enumeration allAs(java.lang.String qualifiedRoleTypeName) throws NoSuchRoleException
qualifiedRoleTypeName
- fully qualified class name of the intended
qualified role type.
The class name must be qualified by the package name, e.g., if class
Customer belongs to package persons then "persons.Customer"
would be the correct class name of that qualified role type.public QualifiedRoleType as(java.lang.String qualifiedRoleTypeName, java.lang.Object qualifyingObject) throws NoSuchRoleException
qualifiedRoleTypeName
- fully qualified class name of the intended
qualified role type. The class name must be qualified by the package name, e.g., if class
Customer belongs to package persons then "persons.Customer"
would be the correct class name of that qualified role type.qualifyingObject
- represents the qualifierpublic boolean existsAs(java.lang.String roleTypeName)
roleTypeName
- Represents the Java class name of the role
type. The class name must
be fully qualified with the package name, e.g., if class
Person belongs to package persons then
"persons.Person"
would be the correct class name.public boolean existsAs(java.lang.String qualifiedRoleTypeName, java.lang.Object qualifyingObj)
public boolean isEntityEquivalentWith(RoleProtocol anotherObject)
anotherObject
- represent the object to be compared withprotected void cancelQualifiedRole(QualifiedRoleType role)
role
- represents the role object to cancelprotected void cancelRole(RoleType role)
role
- represents the role object to cancelprotected void recordNewQualifiedRole(QualifiedRoleType role) throws DuplicateRoleException
role
- represents the new qualified role objectprotected void recordNewRole(RoleType role) throws DuplicateRoleException
role
- represents the new role object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |