com.ashridgetech.jamda.uml
Class Association.End

java.lang.Object
  |
  +--com.ashridgetech.jamda.uml.ModelElement
        |
        +--com.ashridgetech.jamda.uml.Association.End
All Implemented Interfaces:
PropertyElement
Enclosing class:
Association

public static class Association.End
extends ModelElement
implements PropertyElement

Represents a UML AssociationEnd. Holds details of one end of an association. Note that the aggregation value which is taken from the Association End at the other end of the Association, as that is usually more relevant - see getAggregation().


Nested Class Summary
protected  class Association.End.PropertyImpl
          Inner class implementation of the Property interface for Association.End.
 
Nested classes inherited from class com.ashridgetech.jamda.uml.ModelElement
ModelElement.DuplicateElementException, ModelElement.ElementListStore, ModelElement.ElementNameListStore, ModelElement.ElementNameStore, ModelElement.ElementStore, ModelElement.TaggedValue, ModelElement.UnknownElementException
 
Field Summary
 
Fields inherited from class com.ashridgetech.jamda.uml.ModelElement
DUMMY_STORE
 
Constructor Summary
protected Association.End(ru.novosoft.uml.foundation.core.MAssociationEnd mae, Association assoc)
          Creates new AssociationEnd from a NSUML MAssociationEnd object.
 
Method Summary
 StructuredType.Aggregation getAggregation()
          Get the StructuredType.Aggregation instance relevant to this End.
 Association getAssociation()
          Get the Association to which this End belongs.
 ClassType getClassType()
          Get the type of this End as a ClassType.
 java.lang.String getDescription()
          Get a description of this element for logging.
 java.lang.String getElementType()
          Get the name of the type of element.
 int getLowerMultiplicity()
          Get the lower bound of the multiplicity range.
 java.lang.String getMultName()
          Get the name of this Property , converted to plural using Util.pluralize(java.lang.String) if isMultiple() returns true.
 java.lang.String getName()
          Get the best name for this End.
 Association.End getOtherEnd()
          Get the other End which belongs to this Association.
 Property getProperty()
          Get the representation of this Attribute as a Property.
 java.util.Set getReaders()
          Get Actors who can read this Property
 Type getType()
          Get the type of this End, to implement TypedItem.
 int getUpperMultiplicity()
          Get the upper bound of the multiplicity range.
 StructuredType.Visibility getVisibility()
           
 java.util.Set getWriters()
          Get Actors who can write this Property
 boolean isChangeable()
          Show whether this End is changeable.
 boolean isMultiple()
          Show whether this End can have multiple instances, according to the rules in NSUtil.isMultiple(ru.novosoft.uml.foundation.data_types.MMultiplicity).
 boolean isNavigable()
          Show whether this End is navigable.
 boolean isOid()
           
 boolean isReadable()
           
 boolean isReadableBy(Actor actor)
          Indicate whether the value(s) of this property can be read by a given Actor.
 boolean isWritable()
           
 boolean isWritableBy(Actor actor)
          Indicate whether the value(s) of this property can be updated by a given Actor.
 java.lang.String toString()
          Safe override for ModelElement.toString() which only uses the name if the Model is initialised, and gives the id otherwise.
 
Methods inherited from class com.ashridgetech.jamda.uml.ModelElement
add, addStereotype, addTaggedValue, addTaggedValue, addTaggedValues, addTaggedValuesInternal, checkInitialised, checkState, checkValid, findTaggedValueCollection, getBooleanTaggedValue, getChildElements, getComment, getDirectSource, getElement, getFullName, getId, getModel, getNsElement, getOriginalSource, getParentElement, getProperties, getStereotypes, getStringTaggedValue, getSubElementStore, getTaggedValue, getTaggedValues, getXpathContext, hasStereotype, hasTaggedValue, init, initLoad, isInitialised, load, load, load, loadElement, logChange, logger, logger, logLoad, logLoadWarning, logNew, logWarning, removeTaggedValue, select, setComment, setDirectSource, setTaggedValue, setTaggedValue, setTaggedValue, setTaggedValues, stereotype, tag, tagError, type, type, type, xpath, xpathList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Association.End

protected Association.End(ru.novosoft.uml.foundation.core.MAssociationEnd mae,
                          Association assoc)
Creates new AssociationEnd from a NSUML MAssociationEnd object.

Method Detail

getName

public java.lang.String getName()
Get the best name for this End. If this association end has a name specified in the UML model, that is used, otherwise the type name is used, uncapitalized.

NOTE: this method may not be called before the Model to which this object belongs is fully loaded, as the Type to which this object refers may not have been loaded.

Overrides:
getName in class ModelElement
Returns:
the name

getAssociation

public Association getAssociation()
Get the Association to which this End belongs.

Returns:
the association

getOtherEnd

public Association.End getOtherEnd()
Get the other End which belongs to this Association.

Returns:
the end

getType

public Type getType()
Get the type of this End, to implement TypedItem.

Returns:
the type

getClassType

public ClassType getClassType()
Get the type of this End as a ClassType.

Returns:
the type

getAggregation

public StructuredType.Aggregation getAggregation()
Get the StructuredType.Aggregation instance relevant to this End. NOTE: this is actually the aggregation value at the OTHER end of the association in the UML model

Returns:
the aggregation

isChangeable

public boolean isChangeable()
Show whether this End is changeable.

Returns:
true if this is changeable

isNavigable

public boolean isNavigable()
Show whether this End is navigable.

Returns:
true if this is navigable

getLowerMultiplicity

public int getLowerMultiplicity()
Get the lower bound of the multiplicity range.

Returns:
the lowest number of instances, or StructuredType.UNBOUNDED.

getUpperMultiplicity

public int getUpperMultiplicity()
Get the upper bound of the multiplicity range.

Returns:
the greatest number of instances, or StructuredType.UNBOUNDED if there is no upper limit.

isMultiple

public boolean isMultiple()
Show whether this End can have multiple instances, according to the rules in NSUtil.isMultiple(ru.novosoft.uml.foundation.data_types.MMultiplicity).

Returns:
true if multiple instances are allowed.

getMultName

public java.lang.String getMultName()
Get the name of this Property , converted to plural using Util.pluralize(java.lang.String) if isMultiple() returns true.

Returns:
the singular or plural name as appropriate

isReadable

public boolean isReadable()

isReadableBy

public boolean isReadableBy(Actor actor)
Indicate whether the value(s) of this property can be read by a given Actor.

Returns:
true if the values can be read

isWritable

public boolean isWritable()

isWritableBy

public boolean isWritableBy(Actor actor)
Indicate whether the value(s) of this property can be updated by a given Actor.

Returns:
true if the values can be updated

getReaders

public java.util.Set getReaders()
Get Actors who can read this Property

Returns:
the set of Actors. May be null to indicate that ALL Actors can read this Property, or an empty Set to indicate that NO Actors can read this Property

getWriters

public java.util.Set getWriters()
Get Actors who can write this Property

Returns:
the set of Actors. May be null to indicate that ALL Actors can write this Property, or an empty Set to indicate that NO Actors can write this Property

isOid

public boolean isOid()

getVisibility

public StructuredType.Visibility getVisibility()

getElementType

public java.lang.String getElementType()
Get the name of the type of element.

Overrides:
getElementType in class ModelElement
Returns:
this implementation returns a fixed name of "Association.End".

getDescription

public java.lang.String getDescription()
Get a description of this element for logging. This implementation ensures that getName() is not called until the Model is initialised.

Overrides:
getDescription in class ModelElement

toString

public java.lang.String toString()
Safe override for ModelElement.toString() which only uses the name if the Model is initialised, and gives the id otherwise. The name is not available until the Model is intialised, as it is formed from the name of the type of this AssociationEnd if it does not have one, and the type cannot be looked up before the Model is initialised. This only gives a problem when toString() is called by Model.store(com.ashridgetech.jamda.uml.ModelElement).

Overrides:
toString in class ModelElement

getProperty

public Property getProperty()
Get the representation of this Attribute as a Property.

Specified by:
getProperty in interface PropertyElement
Returns:
the Property for this Attribute - always the same instance


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.