Package eu.simuline.relana.expressions
Class Type
- java.lang.Object
-
- eu.simuline.relana.expressions.Type
-
public final class Type extends Object
A type maps declaredDeficiency
s to their nodes and defines minimum and maximumDeficiency
s. Created: Fri Apr 29 11:18:57 2005- Version:
- 1.0
- Author:
- Ernst Reissner
-
-
Field Summary
Fields Modifier and Type Field Description static Type
BOOLEAN
private Map<Deficiency,DeficiencyNode>
deficiency2ordering
Maps declaredDeficiency
s ********** (seeSClass.getDeclaredDeficiency2ordering()
) to their nodes which determine their predecessors and their successors.static Type
EMPTY
private Set<Deficiency>
maxDefs
private 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 void
addAll(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 boolean
consistency()
Returns wheter the successors or the predecessors of an value ofdeficiency2ordering
are all in the value set ofdeficiency2ordering
.protected Map<Deficiency,DeficiencyNode>
copy()
boolean
equals(Object obj)
Set<Deficiency>
getCone(Deficiency def)
Map<Deficiency,DeficiencyNode>
getDeficiency2ordering()
static Type
getEmpty()
Type
getInverse()
Set<Deficiency>
getMax()
Set<Deficiency>
getMin()
int
hashCode()
boolean
implies(Deficiency def1, Deficiency def2)
protected void
initMMDefics()
boolean
isValid(Set<Deficiency> set)
Returns whether the given set of deficiencies is allowed by this type.Type
remove(Deficiency def)
protected DeficiencyNode
remove(Map<Deficiency,DeficiencyNode> def2ord, Deficiency def)
Type
removeAndAbove(Deficiency def)
Returns a copy of this type where the given Deficiency, and all Deficiencies above it are removed.void
replace(Deficiency oldDef, Deficiency newDefMin, Deficiency newDefMax, Type type)
String
toString()
-
-
-
Field Detail
-
EMPTY
public static final Type EMPTY
-
BOOLEAN
public static final Type BOOLEAN
-
deficiency2ordering
private Map<Deficiency,DeficiencyNode> deficiency2ordering
Maps declaredDeficiency
s ********** (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 ofdeficiency2ordering
are 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
boolean
value 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
- aDeficiency
which is assumed to be minimal within this type.- Returns:
- a
Type
value
-
implies
public boolean implies(Deficiency def1, Deficiency def2)
-
getCone
public Set<Deficiency> getCone(Deficiency def)
-
-