|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jmlspecs.models.JMLEqualsToObjectRelation
org.jmlspecs.models.JMLEqualsToObjectMap
Maps (i.e., binary relations that are functional) from non-null
elements of Object to non-null elements of Object. The first type, Object, is called
the domain type of the map; the second type,
Object, is called the range type of the map. A
map can be seen as a set of pairs, of form (dv, rv),
consisting of an element of the domain type, dv, and an
element of the range type, rv. Alternatively, it can be
seen as a function that maps each element of the domain to some of
elements of the range type.
This type is a subtype of JMLEqualsToObjectRelation, and as such as can be treated as a
binary relation or a set valued function also. See the
documentation for JMLEqualsToObjectRelation and for the
methods inherited from this supertype for more information.
This type considers elements val and dv
of the domain type, to be distinct just when
_val_not_equal_to_dv_. It considers elements of
r and rv of the range type to be distinct
just when _r_not_equal_to_rv_. Cloning takes place for
the domain or range elements if the corresponding domain or range
type is JMLType.
JMLCollection,
JMLType,
JMLEqualsToObjectRelation,
JMLEqualsToObjectRelationEnumerator,
JMLEqualsToObjectRelationImageEnumerator,
JMLValueSet,
JMLObjectSet,
JMLObjectToObjectMap,
JMLValueToObjectMap,
JMLObjectToValueMap,
JMLValueToValueMap,
JMLEqualsToObjectRelation.toFunction()| Field Summary | |
static JMLEqualsToObjectMap |
EMPTY
The empty JMLEqualsToObjectMap. |
| Fields inherited from class org.jmlspecs.models.JMLEqualsToObjectRelation |
domain_, imagePairSet_, size_, TOO_BIG_TO_UNION |
| Constructor Summary | |
|
JMLEqualsToObjectMap()
Initialize this map to be the empty mapping. |
|
JMLEqualsToObjectMap(Object dv,
Object rv)
Initialize this map to be a mapping that maps the given domain element to the given range element. |
|
JMLEqualsToObjectMap(JMLEqualsObjectPair pair)
Initialize this map to be a mapping that maps the key in the given pair to the value in that pair. |
protected |
JMLEqualsToObjectMap(JMLValueSet ipset,
JMLEqualsSet dom,
int sz)
Initialize this map based on the representation values given. |
| Method Summary | |
Object |
apply(Object dv)
Return the range element corresponding to dv, if there is one. |
JMLEqualsToObjectMap |
clashReplaceUnion(JMLEqualsToObjectMap othMap,
Object errval)
Return a new map that is like the union of the given map and this map, except that if both define a mapping for a given domain element, then each of these clashes is replaced by a mapping from the domain element in question to the given range element. |
Object |
clone()
Return a clone of this object. |
JMLObjectToObjectMap |
compose(JMLObjectToEqualsMap othMap)
Return a new map that is the composition of this and the given map. |
JMLValueToObjectMap |
compose(JMLValueToEqualsMap othMap)
Return a new map that is the composition of this and the given map. |
JMLEqualsToObjectMap |
disjointUnion(JMLEqualsToObjectMap othMap)
Return a map that is the disjoint union of this and othMap. |
JMLEqualsToObjectMap |
extend(Object dv,
Object rv)
Return a new map that is like this but maps the given domain element to the given range element. |
JMLEqualsToObjectMap |
extendUnion(JMLEqualsToObjectMap othMap)
Return a new map that is like the union of the given map and this map, except that if both define a mapping for a given domain element, then only the mapping in the given map is retained. |
boolean |
isaFunction()
Tells whether this relation is a function. |
JMLEqualsToObjectMap |
rangeRestrictedTo(JMLObjectSet rng)
Return a new map that is like this map but only contains associations that map to range elements in the given set. |
JMLEqualsToObjectMap |
removeDomainElement(Object dv)
Return a new map that is like this but has no association for the given domain element. |
JMLEqualsToObjectMap |
restrictedTo(JMLEqualsSet dom)
Return a new map that only maps elements in the given domain to the corresponding range elements in this map. |
static JMLEqualsToObjectMap |
singletonMap(Object dv,
Object rv)
Return the singleton map containing the given association. |
static JMLEqualsToObjectMap |
singletonMap(JMLEqualsObjectPair pair)
Return the singleton map containing the association described by the given pair. |
| Methods inherited from class org.jmlspecs.models.JMLEqualsToObjectRelation |
add, associations, compose, compose, difference, domain, domainElements, elementImage, elements, equals, has, has, has, hashCode, image, imagePairs, imagePairSet, insert, int_size, intersection, inverse, inverseElementImage, inverseImage, isDefinedAt, isEmpty, iterator, range, rangeElements, remove, remove, removeFromDomain, restrictDomainTo, restrictRangeTo, singleton, singleton, toBag, toFunction, toSequence, toSet, toString, union |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final JMLEqualsToObjectMap EMPTY
JMLEqualsToObjectMap()| Constructor Detail |
public JMLEqualsToObjectMap()
EMPTY
public JMLEqualsToObjectMap(Object dv,
Object rv)
singletonMap(Object, Object),
JMLEqualsToObjectMap(JMLEqualsObjectPair)public JMLEqualsToObjectMap(JMLEqualsObjectPair pair)
singletonMap(JMLEqualsObjectPair),
JMLEqualsToObjectMap(Object, Object)
protected JMLEqualsToObjectMap(JMLValueSet ipset,
JMLEqualsSet dom,
int sz)
| Method Detail |
public static JMLEqualsToObjectMap singletonMap(Object dv,
Object rv)
JMLEqualsToObjectMap(Object, Object),
singletonMap(JMLEqualsObjectPair)public static JMLEqualsToObjectMap singletonMap(JMLEqualsObjectPair pair)
JMLEqualsToObjectMap(JMLEqualsObjectPair),
singletonMap(Object, Object)public boolean isaFunction()
isaFunction in class JMLEqualsToObjectRelation
public Object apply(Object dv)
throws JMLNoSuchElementException
dv - the domain element for which an association is
sought (the key to the table).
JMLNoSuchElementException - when dv is not associated
to any range element by this.JMLEqualsToObjectRelation.isDefinedAt(java.lang.Object),
JMLEqualsToObjectRelation.elementImage(java.lang.Object),
JMLEqualsToObjectRelation.image(org.jmlspecs.models.JMLEqualsSet)public Object clone()
JMLEqualsToObjectRelation
clone in interface JMLTypeclone in class JMLEqualsToObjectRelation
public JMLEqualsToObjectMap extend(Object dv,
Object rv)
JMLEqualsToObjectRelation#insert(Object, Object)public JMLEqualsToObjectMap removeDomainElement(Object dv)
JMLEqualsToObjectRelation.removeFromDomain(java.lang.Object)public JMLValueToObjectMap compose(JMLValueToEqualsMap othMap)
compose(JMLObjectToEqualsMap)public JMLObjectToObjectMap compose(JMLObjectToEqualsMap othMap)
compose(JMLValueToEqualsMap)public JMLEqualsToObjectMap restrictedTo(JMLEqualsSet dom)
rangeRestrictedTo(org.jmlspecs.models.JMLObjectSet),
JMLEqualsToObjectRelation.restrictDomainTo(org.jmlspecs.models.JMLEqualsSet)public JMLEqualsToObjectMap rangeRestrictedTo(JMLObjectSet rng)
restrictedTo(org.jmlspecs.models.JMLEqualsSet),
JMLEqualsToObjectRelation.restrictRangeTo(org.jmlspecs.models.JMLObjectSet)
public JMLEqualsToObjectMap extendUnion(JMLEqualsToObjectMap othMap)
throws IllegalStateException
IllegalStateExceptionclashReplaceUnion(org.jmlspecs.models.JMLEqualsToObjectMap, java.lang.Object),
disjointUnion(org.jmlspecs.models.JMLEqualsToObjectMap),
JMLEqualsToObjectRelation.union(org.jmlspecs.models.JMLEqualsToObjectRelation)
public JMLEqualsToObjectMap clashReplaceUnion(JMLEqualsToObjectMap othMap,
Object errval)
throws IllegalStateException
othMap - the other map.errval - the range element to use when clashes occur.
IllegalStateExceptionextendUnion(org.jmlspecs.models.JMLEqualsToObjectMap),
disjointUnion(org.jmlspecs.models.JMLEqualsToObjectMap),
JMLEqualsToObjectRelation.union(org.jmlspecs.models.JMLEqualsToObjectRelation)
public JMLEqualsToObjectMap disjointUnion(JMLEqualsToObjectMap othMap)
throws JMLMapException,
IllegalStateException
othMap - the other mapping
JMLMapException - the ranges of this and othMap have elements
in common (i.e., when they interesect).
IllegalStateExceptionextendUnion(org.jmlspecs.models.JMLEqualsToObjectMap),
clashReplaceUnion(org.jmlspecs.models.JMLEqualsToObjectMap, java.lang.Object),
JMLEqualsToObjectRelation.union(org.jmlspecs.models.JMLEqualsToObjectRelation)
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||