Package eu.simuline.relana.expressions
Class Type
- java.lang.Object
-
- eu.simuline.relana.expressions.Type
-
public final class Type extends Object
A type maps declaredDeficiencys to their nodes and defines minimum and maximumDeficiencys. Created: Fri Apr 29 11:18:57 2005- Version:
- 1.0
- Author:
- Ernst Reissner
-
-
Field Summary
Fields Modifier and Type Field Description static TypeBOOLEANprivate Map<Deficiency,DeficiencyNode>deficiency2orderingMaps declaredDeficiencys ********** (seeSClass.getDeclaredDeficiency2ordering()) to their nodes which determine their predecessors and their successors.static TypeEMPTYprivate Set<Deficiency>maxDefsprivate Set<Deficiency>minDefs
-
Constructor Summary
Constructors Constructor Description Type()Type(Type other)Type(Map<Deficiency,DeficiencyNode> deficiency2ordering)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAll(Map<Deficiency,DeficiencyNode> deficiency2ordering)Set<Deficiency>asSet()Returns a copy to be modified without affecting the original of the maximal set of deficiencies of this type.private booleanconsistency()Returns wheter the successors or the predecessors of an value ofdeficiency2orderingare all in the value set ofdeficiency2ordering.protected Map<Deficiency,DeficiencyNode>copy()booleanequals(Object obj)Set<Deficiency>getCone(Deficiency def)Map<Deficiency,DeficiencyNode>getDeficiency2ordering()static TypegetEmpty()TypegetInverse()Set<Deficiency>getMax()Set<Deficiency>getMin()inthashCode()booleanimplies(Deficiency def1, Deficiency def2)protected voidinitMMDefics()booleanisValid(Set<Deficiency> set)Returns whether the given set of deficiencies is allowed by this type.Typeremove(Deficiency def)protected DeficiencyNoderemove(Map<Deficiency,DeficiencyNode> def2ord, Deficiency def)TyperemoveAndAbove(Deficiency def)Returns a copy of this type where the given Deficiency, and all Deficiencies above it are removed.voidreplace(Deficiency oldDef, Deficiency newDefMin, Deficiency newDefMax, Type type)StringtoString()
-
-
-
Field Detail
-
EMPTY
public static final Type EMPTY
-
BOOLEAN
public static final Type BOOLEAN
-
deficiency2ordering
private Map<Deficiency,DeficiencyNode> deficiency2ordering
Maps declaredDeficiencys ********** (seeSClass.getDeclaredDeficiency2ordering()) to their nodes which determine their predecessors and their successors. It is required that this relation extends that given bySClass.superClass.
-
minDefs
private Set<Deficiency> minDefs
-
maxDefs
private Set<Deficiency> maxDefs
-
-
Constructor Detail
-
Type
public Type(Map<Deficiency,DeficiencyNode> deficiency2ordering)
-
Type
public Type(Type other)
-
Type
public Type()
-
-
Method Detail
-
consistency
private boolean consistency()
Returns wheter the successors or the predecessors of an value ofdeficiency2orderingare all in the value set ofdeficiency2ordering.
-
getDeficiency2ordering
public Map<Deficiency,DeficiencyNode> getDeficiency2ordering()
-
initMMDefics
protected void initMMDefics()
-
getEmpty
public static Type getEmpty()
-
copy
protected Map<Deficiency,DeficiencyNode> copy()
-
remove
protected DeficiencyNode remove(Map<Deficiency,DeficiencyNode> def2ord, Deficiency def)
-
isValid
public boolean isValid(Set<Deficiency> set)
Returns whether the given set of deficiencies is allowed by this type.- Parameters:
set- a set of deficiencies for which to decide whether this type allows that set.- Returns:
- a
booleanvalue describing whether the given set of deficiencies is allowed by this type. This includesasSet().containsAll(set).
-
asSet
public Set<Deficiency> asSet()
Returns a copy to be modified without affecting the original of the maximal set of deficiencies of this type.- Returns:
- a copy to be modified without affecting the original of the maximal set of deficiencies of this type.
-
getInverse
public Type getInverse()
-
getMin
public Set<Deficiency> getMin()
-
getMax
public Set<Deficiency> getMax()
-
addAll
public void addAll(Map<Deficiency,DeficiencyNode> deficiency2ordering)
-
replace
public void replace(Deficiency oldDef, Deficiency newDefMin, Deficiency newDefMax, Type type)
-
remove
public Type remove(Deficiency def)
-
removeAndAbove
public Type removeAndAbove(Deficiency def)
Returns a copy of this type where the given Deficiency, and all Deficiencies above it are removed.- Parameters:
def- aDeficiencywhich is assumed to be minimal within this type.- Returns:
- a
Typevalue
-
implies
public boolean implies(Deficiency def1, Deficiency def2)
-
getCone
public Set<Deficiency> getCone(Deficiency def)
-
-