|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--roles.RoleType
This class is the root for any class representing a particular (unqualified) role type. An instance of this class r1 can be the role of a role playing object o, if there exists no other instance of this class r2, whose role player is o too. If this constraint is violated, a DuplicateRoleException is thrown by the constructor. Multiple occurrences of the same role type for a particular role player must be defined using QualifiedRoleType as the superclass.
Field Summary | |
protected RoleProtocol |
roleOf
References the role player. |
protected ObjectWithRoles |
root
References the root of the role hierarchy. |
protected java.util.Vector |
subroles
Represents all role objects that refer to this object by their roleOf instance variable. |
Constructor Summary | |
protected |
RoleType()
|
|
RoleType(RoleProtocol ancestor)
This constructor establishes the roleOf relationship between the newly created role object and the role player. |
Method Summary | |
void |
abandon()
Abandons the roleOf relationship between the receiver and its role player. |
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. |
void |
cancelRole(RoleType role)
Removes a role from the receiver's subroles and informs the root to cancel that role. |
boolean |
existsAs(java.lang.String roleTypeName)
Examines whether an instance of the role type with name roleTypeName has been registered by the receiver. |
boolean |
existsAs(java.lang.String qualifiedRoleTypeName,
java.lang.Object qualifyingObj)
Examines whether an instance of a particular qualified role type has been registered by the receiver using a particular qualifier |
protected static boolean |
existsInheritance(java.lang.String className1,
java.lang.String className2)
Examines whether there exists any kind of inheritance relationship between two classes with names className1 and className2. |
protected static boolean |
existsSubclassInheritance(java.lang.String superClassName,
java.lang.String subClassName)
Examines whether class with name superClassName is a superclass of class with name subClassName. |
RoleProtocol |
getRoleOf()
Returns the ancestor of this role object (may be an ObjectWithRoles or another RoleType). |
java.lang.String |
getRoleTypeName()
Returns the fully qualified Java class name as the role type name. |
ObjectWithRoles |
getRoot()
Returns the root of the role hierarchy (must be an ObjectWithRoles). |
boolean |
isEntityEquivalentWith(RoleProtocol anotherObject)
Examines whether the receiver and anotherObject represent the same role player. |
protected void |
nullify()
Unsets the references to the root, the ancestor, and all subroles. |
protected void |
recordNewQualifiedRole(QualifiedRoleType role)
Adds a newly created qualified role object to the vector representing the receiver's subroles. |
protected void |
recordNewRole(RoleType role)
Adds a newly created role object to the vector representing the receiver's subroles. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected RoleProtocol roleOf
protected java.util.Vector subroles
protected ObjectWithRoles root
Constructor Detail |
protected RoleType() throws DuplicateRoleException
public RoleType(RoleProtocol ancestor) throws DuplicateRoleException
ancestor
- represents the role player, this parameter may be
either an instance of a subclass of ObjectWithRoles
or an instance of a subclass of RoleType (both classes
implement RoleProtocol)Method Detail |
protected void recordNewQualifiedRole(QualifiedRoleType role) throws DuplicateRoleException
protected void recordNewRole(RoleType role) throws DuplicateRoleException
role
- represents the newly created role to be recordedpublic java.lang.String getRoleTypeName()
public void cancelRole(RoleType role)
role
- represents the role object to be canceledprotected void nullify()
protected static boolean existsSubclassInheritance(java.lang.String superClassName, java.lang.String subClassName)
superClassName
- fully qualified class name of assumed superclasssubClassName
- fully qualified class name of assumed subclassprotected static boolean existsInheritance(java.lang.String className1, java.lang.String className2)
className1
- fully qualified class name of first classclassName2
- fully qualified class name of second classpublic void abandon()
public ObjectWithRoles getRoot()
public RoleProtocol getRoleOf()
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)
public boolean existsAs(java.lang.String qualifiedRoleTypeName, java.lang.Object qualifyingObj)
qualifiedRoleTypeName
- represent the class name of the qualified 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.qualifyingObj
- represents the qualifier.public boolean isEntityEquivalentWith(RoleProtocol anotherObject)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |