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>
domain
private Set<Deficiency>
idDom
The set of deficiencies mapped identically.private Set<Deficiency>
range
The elements oftarget
for whichgetInverseImage(eu.simuline.relana.model.Deficiency)
yields a non-empty result.private Map<Set<Deficiency>,Deficiency>
setOfNew2old
The set of deficiencies all mapped to the same deficiency.private SClass
source
The source of this map.private SClass
target
The 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) void
checkInvImg01()
DeficiencyMap
compose(DeficiencyMap second)
Returns the composition of this map andsecond
(in this order).Set<Deficiency>
cont(Set<Deficiency> defs)
Returns the inverse image ofdefs
under this map.Set<Deficiency>
cov(Set<Deficiency> defs)
Returns the image ofdefs
under this map.(package private) Set<Deficiency>
getDomain()
Returns the domain of this map.DeficiencyMap
getInverse()
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.SClass
getSource()
Returns the source of this map.static DeficiencyMap
getSubclassMap(Map<Set<Deficiency>,Deficiency> setOfNew2old, SClass source, SClass target)
SClass
getTarget()
Returns the target of this map.static DeficiencyMap
identity(SClass sourceTarget)
Returns the identity map with the given source and target with full domain and range.boolean
isIsotone()
Returns whether this map is isotone.boolean
isTwistIsotone()
Returns whether this map is twist-isotone.Deficiency
map(Deficiency def)
Performs the mapping.String
toString()
-
-
-
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 oftarget
for 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
DeficiencyMap
which 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
DeficiencyMap
andsecond
. - Throws:
IllegalArgumentException
- ifthis.target != second.source
.
-
map
public Deficiency map(Deficiency def)
Performs the mapping.- Parameters:
def
- theDeficiency
to be mapped.- Returns:
- the image of
def
with respect to this map. If and only ifdef
is 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
- theDeficiency
for which the inverse image is to be determined.- Returns:
- the inverse image of
def
with 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 ofdefs
under this map.- Parameters:
defs
- a set ofDeficiency
s to be mapped.- Returns:
- the image of
defs
under this map.
-
cont
public Set<Deficiency> cont(Set<Deficiency> defs)
Returns the inverse image ofdefs
under this map.- Parameters:
defs
- a set ofDeficiency
s to be "reverse mapped'.- Returns:
- the inverse image of
defs
under this map.
-
-