Package cruise.umple.compiler
Class AssociationVariable
java.lang.Object
cruise.umple.compiler.UmpleVariable
cruise.umple.compiler.AssociationVariable
public class AssociationVariable extends UmpleVariable
An association variable represents one of the variables used to represent
an association. In a two-directional association (navigable) there would
be one of these in each associated class.
See also AssociationEnd
TODO: Code smell. Should be replaced by the 'otherEnd' of the AssociationEnd
In Umple_Code.ump: Methods for testing various complex properties
-
Constructor Summary
Constructors Constructor Description AssociationVariable(AssociationVariable another)
AssociationVariable(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, Multiplicity aMultiplicity, boolean aIsNavigable)
-
Method Summary
Modifier and Type Method Description boolean
addComment(Comment aComment)
boolean
addCommentAt(Comment aComment, int index)
boolean
addOrMoveCommentAt(Comment aComment, int index)
boolean
addOrMoveRequirementAt(Requirement aRequirement, int index)
boolean
addRequirement(Requirement aRequirement)
boolean
addRequirementAt(Requirement aRequirement, int index)
void
configureRelatedAssociation(AssociationVariable newRelatedAssociation)
void
delete()
Comment
getComment(int index)
java.util.List<Comment>
getComments()
The comments associated with the association (such as the Javadoc above it).java.lang.String
getCommonClassName()
boolean
getIsComposition()
boolean
getIsNavigable()
boolean
getIsSpecialization()
is it a specialization of another?boolean
getIsSpecialized()
code relevant to specialization of associations is it ever specialized?java.util.ArrayList<java.lang.String>
getMethodNames()
boolean
getMulChangedToN()
boolean
getMulChangedToOne()
Multiplicity
getMultiplicity()
boolean
getNeedsCommonCode()
boolean
getNeedsSuperCode()
java.lang.String
getPriority()
AssociationVariable
getRelatedAssociation()
int
getRelevantEnd()
0 to ensure that everything doesn't breakboolean
getReqSetCode()
Requirement
getRequirement(int index)
java.util.List<Requirement>
getRequirements()
java.lang.String
getScName()
AssociationVariable
getSpecializedFromVariable()
specialized from this association variablejava.lang.String
getSuperClassName()
java.util.List<TraceItem>
getTraced(java.lang.String method, UmpleClass uClass)
Retrieve the AttributeTraceItem associated with this UmpleVariableUmpleClass
getUmpleClass()
UmpleTrait
getUmpleTrait()
boolean
hasComments()
boolean
hasRelatedAssociation()
boolean
hasRequirements()
boolean
hasUmpleClass()
boolean
hasUmpleTrait()
int
indexOfComment(Comment aComment)
int
indexOfRequirement(Requirement aRequirement)
boolean
isImmutable()
boolean
isIsComposition()
boolean
isIsNavigable()
boolean
isIsSpecialization()
boolean
isIsSpecialized()
boolean
isMandatory()
boolean
isMandatoryMany()
boolean
isMandatoryOne()
boolean
isMany()
boolean
isMN()
boolean
isMStar()
boolean
isMulChangedToN()
boolean
isMulChangedToOne()
boolean
isN()
boolean
isNeedsCommonCode()
boolean
isNeedsSuperCode()
boolean
isOne()
boolean
isOnlyOne()
boolean
isOptionalMany()
boolean
isOptionalN()
boolean
isOptionalOne()
boolean
isReflexive()
boolean
isReqSetCode()
boolean
isSorted()
boolean
isStar()
boolean
isSymmetricReflexive()
boolean
isTwoDirectionalAssociation(AssociationVariable other)
boolean
isUpperBounded()
static int
max(int first, int second)
static int
min(int first, int second)
static int
minimumNumberOfComments()
static int
minimumNumberOfRequirements()
int
numberOfComments()
int
numberOfRequirements()
boolean
removeComment(Comment aComment)
boolean
removeRequirement(Requirement aRequirement)
boolean
setCommonClassName(java.lang.String aCommonClassName)
boolean
setImmutable()
boolean
setIsComposition(boolean aIsComposition)
boolean
setIsSpecialization(boolean aIsSpecialization)
boolean
setIsSpecialized(boolean aIsSpecialized)
boolean
setMulChangedToN(boolean aMulChangedToN)
boolean
setMulChangedToOne(boolean aMulChangedToOne)
boolean
setMultiplicity(Multiplicity aMultiplicity)
boolean
setNeedsCommonCode(boolean aNeedsCommonCode)
boolean
setNeedsSuperCode(boolean aNeedsSuperCode)
void
setOneDirectionalRelatedAssociation(AssociationVariable other)
boolean
setPriority(java.lang.String aPriority)
boolean
setRelatedAssociation(AssociationVariable aNewRelatedAssociation)
boolean
setRelevantEnd(int aRelevantEnd)
boolean
setReqSetCode(boolean aReqSetCode)
boolean
setScName(java.lang.String aScName)
boolean
setSpecializedFromVariable(AssociationVariable aSpecializedFromVariable)
boolean
setSuperClassName(java.lang.String aSuperClassName)
boolean
setUmpleClass(UmpleClass aUmpleClass)
boolean
setUmpleTrait(UmpleTrait aUmpleTrait)
java.lang.String
toString()
Methods inherited from class cruise.umple.compiler.UmpleVariable
getModifier, getName, getType, getUpperCaseName, getValue, normalizeValue, setModifier, setName, setType, setValue
-
Constructor Details
-
AssociationVariable
public AssociationVariable(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, Multiplicity aMultiplicity, boolean aIsNavigable) -
AssociationVariable
-
-
Method Details
-
setMultiplicity
-
setIsComposition
public boolean setIsComposition(boolean aIsComposition) -
setPriority
public boolean setPriority(java.lang.String aPriority) -
setSpecializedFromVariable
-
setIsSpecialized
public boolean setIsSpecialized(boolean aIsSpecialized) -
setIsSpecialization
public boolean setIsSpecialization(boolean aIsSpecialization) -
setCommonClassName
public boolean setCommonClassName(java.lang.String aCommonClassName) -
setSuperClassName
public boolean setSuperClassName(java.lang.String aSuperClassName) -
setRelevantEnd
public boolean setRelevantEnd(int aRelevantEnd) -
setNeedsSuperCode
public boolean setNeedsSuperCode(boolean aNeedsSuperCode) -
setNeedsCommonCode
public boolean setNeedsCommonCode(boolean aNeedsCommonCode) -
setMulChangedToOne
public boolean setMulChangedToOne(boolean aMulChangedToOne) -
setScName
public boolean setScName(java.lang.String aScName) -
setMulChangedToN
public boolean setMulChangedToN(boolean aMulChangedToN) -
setReqSetCode
public boolean setReqSetCode(boolean aReqSetCode) -
getMultiplicity
-
getIsNavigable
public boolean getIsNavigable() -
getIsComposition
public boolean getIsComposition() -
getPriority
public java.lang.String getPriority() -
getSpecializedFromVariable
specialized from this association variable -
getIsSpecialized
public boolean getIsSpecialized()code relevant to specialization of associations is it ever specialized? -
getIsSpecialization
public boolean getIsSpecialization()is it a specialization of another? -
getCommonClassName
public java.lang.String getCommonClassName() -
getSuperClassName
public java.lang.String getSuperClassName() -
getRelevantEnd
public int getRelevantEnd()0 to ensure that everything doesn't break -
getNeedsSuperCode
public boolean getNeedsSuperCode() -
getNeedsCommonCode
public boolean getNeedsCommonCode() -
getMulChangedToOne
public boolean getMulChangedToOne() -
getScName
public java.lang.String getScName() -
getMulChangedToN
public boolean getMulChangedToN() -
getReqSetCode
public boolean getReqSetCode() -
isIsNavigable
public boolean isIsNavigable() -
isIsComposition
public boolean isIsComposition() -
isIsSpecialized
public boolean isIsSpecialized() -
isIsSpecialization
public boolean isIsSpecialization() -
isNeedsSuperCode
public boolean isNeedsSuperCode() -
isNeedsCommonCode
public boolean isNeedsCommonCode() -
isMulChangedToOne
public boolean isMulChangedToOne() -
isMulChangedToN
public boolean isMulChangedToN() -
isReqSetCode
public boolean isReqSetCode() -
getRelatedAssociation
-
hasRelatedAssociation
public boolean hasRelatedAssociation() -
getComment
-
getComments
The comments associated with the association (such as the Javadoc above it). -
numberOfComments
public int numberOfComments() -
hasComments
public boolean hasComments() -
indexOfComment
-
getRequirement
-
getRequirements
-
numberOfRequirements
public int numberOfRequirements() -
hasRequirements
public boolean hasRequirements() -
indexOfRequirement
-
getUmpleClass
-
hasUmpleClass
public boolean hasUmpleClass() -
getUmpleTrait
-
hasUmpleTrait
public boolean hasUmpleTrait() -
setRelatedAssociation
-
minimumNumberOfComments
public static int minimumNumberOfComments() -
addComment
-
removeComment
-
addCommentAt
-
addOrMoveCommentAt
-
minimumNumberOfRequirements
public static int minimumNumberOfRequirements() -
addRequirement
-
removeRequirement
-
addRequirementAt
-
addOrMoveRequirementAt
-
setUmpleClass
-
setUmpleTrait
-
delete
public void delete()- Overrides:
delete
in classUmpleVariable
-
isReflexive
public boolean isReflexive() -
isSymmetricReflexive
public boolean isSymmetricReflexive() -
configureRelatedAssociation
-
setOneDirectionalRelatedAssociation
-
isTwoDirectionalAssociation
-
min
public static int min(int first, int second) -
max
public static int max(int first, int second) -
isMany
public boolean isMany() -
isOptionalN
public boolean isOptionalN() -
isOne
public boolean isOne() -
isOnlyOne
public boolean isOnlyOne() -
isOptionalOne
public boolean isOptionalOne() -
isOptionalMany
public boolean isOptionalMany() -
isUpperBounded
public boolean isUpperBounded() -
isN
public boolean isN() -
isMN
public boolean isMN() -
isMStar
public boolean isMStar() -
isStar
public boolean isStar() -
isMandatory
public boolean isMandatory() -
isMandatoryOne
public boolean isMandatoryOne() -
isMandatoryMany
public boolean isMandatoryMany() -
isImmutable
public boolean isImmutable()- Overrides:
isImmutable
in classUmpleVariable
-
setImmutable
public boolean setImmutable() -
isSorted
public boolean isSorted() -
getMethodNames
public java.util.ArrayList<java.lang.String> getMethodNames() -
getTraced
Description copied from class:UmpleVariable
Retrieve the AttributeTraceItem associated with this UmpleVariable- Overrides:
getTraced
in classUmpleVariable
- Returns:
- Attribute_Traceitem for this UmpleVariable(either association or attribute);
-
toString
public java.lang.String toString()- Overrides:
toString
in classUmpleVariable
-