Package eu.simuline.relana.model
Class DeficiencyMap
- java.lang.Object
-
- eu.simuline.relana.model.DeficiencyMap
-
public final class DeficiencyMap extends Object
Describes a map betweenDeficiency's of one type to another one. Created: Thu Apr 21 14:47:33 2005- Version:
- 1.0
- Author:
- Ernst Reissner
-
-
Field Summary
Fields Modifier and Type Field Description private Set<Deficiency>domainprivate Set<Deficiency>idDomThe set of deficiencies mapped identically.private Set<Deficiency>rangeThe elements oftargetfor whichgetInverseImage(eu.simuline.relana.model.Deficiency)yields a non-empty result.private Map<Set<Deficiency>,Deficiency>setOfNew2oldThe set of deficiencies all mapped to the same deficiency.private SClasssourceThe source of this map.private SClasstargetThe target of this map.
-
Constructor Summary
Constructors Constructor Description DeficiencyMap(Map<Set<Deficiency>,Deficiency> setOfNew2old, SClass source, SClass target, Set<Deficiency> idDom)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckInvImg01()DeficiencyMapcompose(DeficiencyMap second)Returns the composition of this map andsecond(in this order).Set<Deficiency>cont(Set<Deficiency> defs)Returns the inverse image ofdefsunder this map.Set<Deficiency>cov(Set<Deficiency> defs)Returns the image ofdefsunder this map.(package private) Set<Deficiency>getDomain()Returns the domain of this map.DeficiencyMapgetInverse()Returns the inverse of this map provided it exists.(package private) Set<Deficiency>getInverseImage(Deficiency def)Returns the inverse image of the given deficiency with respect to this map.(package private) Set<Deficiency>getRange()Returns the range of this map.SClassgetSource()Returns the source of this map.static DeficiencyMapgetSubclassMap(Map<Set<Deficiency>,Deficiency> setOfNew2old, SClass source, SClass target)SClassgetTarget()Returns the target of this map.static DeficiencyMapidentity(SClass sourceTarget)Returns the identity map with the given source and target with full domain and range.booleanisIsotone()Returns whether this map is isotone.booleanisTwistIsotone()Returns whether this map is twist-isotone.Deficiencymap(Deficiency def)Performs the mapping.StringtoString()
-
-
-
Field Detail
-
setOfNew2old
private final Map<Set<Deficiency>,Deficiency> setOfNew2old
-
domain
private final Set<Deficiency> domain
- See Also:
source
-
range
private final Set<Deficiency> range
The elements oftargetfor whichgetInverseImage(eu.simuline.relana.model.Deficiency)yields a non-empty result.- See Also:
target
-
idDom
private Set<Deficiency> idDom
-
-
Constructor Detail
-
DeficiencyMap
public DeficiencyMap(Map<Set<Deficiency>,Deficiency> setOfNew2old, SClass source, SClass target, Set<Deficiency> idDom)
-
-
Method Detail
-
getSubclassMap
public static DeficiencyMap getSubclassMap(Map<Set<Deficiency>,Deficiency> setOfNew2old, SClass source, SClass target)
-
checkInvImg01
void checkInvImg01()
-
identity
public static DeficiencyMap identity(SClass sourceTarget)
Returns the identity map with the given source and target with full domain and range.
-
getInverse
public DeficiencyMap getInverse()
Returns the inverse of this map provided it exists.- Returns:
- a
DeficiencyMapwhich is the inverse of this one. - Throws:
UnsupportedOperationException- if this map is not invertible.
-
compose
public DeficiencyMap compose(DeficiencyMap second)
Returns the composition of this map andsecond(in this order).- Parameters:
second- anotherDeficiencyMap.- Returns:
- the composition of this
DeficiencyMapandsecond. - Throws:
IllegalArgumentException- ifthis.target != second.source.
-
map
public Deficiency map(Deficiency def)
Performs the mapping.- Parameters:
def- theDeficiencyto be mapped.- Returns:
- the image of
defwith respect to this map. If and only ifdefis outside the domain, returnsnull.
-
getInverseImage
Set<Deficiency> getInverseImage(Deficiency def)
Returns the inverse image of the given deficiency with respect to this map.- Parameters:
def- theDeficiencyfor which the inverse image is to be determined.- Returns:
- the inverse image of
defwith respect to this map. This may well be an empty set.
-
getDomain
Set<Deficiency> getDomain()
Returns the domain of this map.- Returns:
- the domain of this map.
-
getRange
Set<Deficiency> getRange()
Returns the range of this map.- Returns:
- the range of this map.
-
isIsotone
public boolean isIsotone()
Returns whether this map is isotone.- Returns:
- whether this map is isotone.
-
isTwistIsotone
public boolean isTwistIsotone()
Returns whether this map is twist-isotone.- Returns:
- whether this map is twist-isotone.
-
cov
public Set<Deficiency> cov(Set<Deficiency> defs)
Returns the image ofdefsunder this map.- Parameters:
defs- a set ofDeficiencys to be mapped.- Returns:
- the image of
defsunder this map.
-
cont
public Set<Deficiency> cont(Set<Deficiency> defs)
Returns the inverse image ofdefsunder this map.- Parameters:
defs- a set ofDeficiencys to be "reverse mapped'.- Returns:
- the inverse image of
defsunder this map.
-
-