|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<Tuple,java.lang.Double>
org.infai.emo.matcher.util.Matching
public class Matching
Class saves a matching between two models by extending the Hashtable class.
the keys of that hash are tuples and the values for that keys are the matching-values between the elements of the tuples saved as double values in the range from 0 to 1.0.
Tuple,
Serialized Form| Field Summary | |
|---|---|
private Comparator |
comparator
The comparator that was used to build up the actual matching. |
private Mapping |
map
The mapping between both models. |
| Constructor Summary | |
|---|---|
Matching()
Constructor for an empty matching without a mapping or comparator. |
|
Matching(Mapping map,
ElementComparator comparator)
Creates a new Matching with the specified mapping. |
|
Matching(StructureComparator comparator)
New Matching with the specified comparator of type StructureComparator. |
|
| Method Summary | |
|---|---|
Matching |
addValues(Matching m)
Add all the matching-values of m to the matching on which this method was called. |
Matching |
copy()
Creates a copy of the on which the method was called. |
Matching |
divValues(double factor)
Divides all the matching-values by the given factor. |
Comparator |
getComparator()
|
Matching |
getInvertedMacthing()
Inverts the matching by inverting all the tuples of the underlying mapping of both models. |
Mapping |
getMap()
|
Matching |
getMatchingByFirstElement(java.lang.Object o)
Get a new matching that only contains entries theirs first elements (of the tuples) equal o. |
Matching |
getMatchingBySecondElement(java.lang.Object o)
Get a new matching that only contains entries theirs second elements (of the tuples) equal o. |
double |
getValue(Tuple tuple)
This method returns the matching value for a tuple. |
boolean |
hasMultipleMaximumValues()
Checks whether this matching has more than one tuples that are matched with the maximum matching entry. |
java.util.Map.Entry<Tuple,java.lang.Double> |
maximumMatchingEntry()
Searches for the matching entry with the maximum matching value. |
java.util.Vector<java.util.Map.Entry<Tuple,java.lang.Double>> |
maximumMatchingEntryList()
Searches for the matching entries with the maximum matching value. |
Matching |
multValues(double factor)
Multiplies all the matching-values with the given factor. |
Matching |
normalize(double referenceValue)
Normalize the matching values to the reference-value. |
private void |
setMap(Mapping map)
Set a new mapping to this matching. |
java.lang.String |
toString()
|
| Methods inherited from class java.util.Hashtable |
|---|
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Comparator comparator
Comparatorprivate Mapping map
Mapping,
Tuple| Constructor Detail |
|---|
public Matching()
public Matching(Mapping map,
ElementComparator comparator)
map - the mapping for the matching which includes the tuples to compare.comparator - the comparator of type ElementComparator for comparing elements of the models.map,
comparatorpublic Matching(StructureComparator comparator)
StructureComparator.
comparator - the comparator of that matching.Comparator| Method Detail |
|---|
public Matching copy()
public double getValue(Tuple tuple)
tuple - the tuple that describes the key of the HashTable in which the matching is saved.
public Matching addValues(Matching m)
m to the matching on which this method was called.
m - the matching of which the values shall be added to the actual one.
public Matching multValues(double factor)
factor - the factor to multiply with.
public Matching divValues(double factor)
factor - the factor to divide with.public Matching normalize(double referenceValue)
reference-value.reference-value = 3.0 then the maximum entry maxvalue will become the reference-value and all the other matching-entries will be updated to (value * 3.0)/maxvalue.
reference-value.public java.util.Map.Entry<Tuple,java.lang.Double> maximumMatchingEntry()
Map.Entrypublic java.util.Vector<java.util.Map.Entry<Tuple,java.lang.Double>> maximumMatchingEntryList()
Vector,
Map.Entrypublic boolean hasMultipleMaximumValues()
public Matching getMatchingByFirstElement(java.lang.Object o)
o.
o - the element that shall be the first element of the matching entries.
public Matching getMatchingBySecondElement(java.lang.Object o)
o.
o - the element that shall be the second element of the matching entries.
public Matching getInvertedMacthing()
public java.lang.String toString()
toString in class java.util.Hashtable<Tuple,java.lang.Double>public Comparator getComparator()
comparatorpublic Mapping getMap()
mapprivate void setMap(Mapping map)
map - the new map.map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||