|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.Pair<T,T> de.hpi.fgis.dude.util.OrderedPair<DuDeObject> de.hpi.fgis.dude.util.data.DuDeObjectPair
public class DuDeObjectPair
DuDeObjectPair
is an extension of the OrderedPair
class,
that encapsulates pairs of DuDeObject
s.
DuDeObject
Nested Class Summary | |
---|---|
static class |
DuDeObjectPair.DuplicateType
DuDeObjectPair.DuplicateType declares all possible values
for the is-duplicate property. |
static class |
DuDeObjectPair.GeneratedBy
DuDeObjectPair.GeneratedBy declares the possible values for
the lineage property. |
Field Summary | |
---|---|
protected static String |
DUPLICATE_PROPERTY
The name of the property that indicates, if the current pair is a duplicate. |
static String |
FIRST_ELEMENT_ATTRIBUTE_NAME
The first element's Json attribute name. |
protected static String |
LINEAGE_PROPERTY
The name of the lineage property. |
static double |
NO_SIMILARITY_SET_VALUE
This value will be returned, if no similarity was set. |
static String |
SECOND_ELEMENT_ATTRIBUTE_NAME
The second element's Json attribute name. |
protected static String |
SIMILARITY_PROPERTY
The name of the similarity property. |
Constructor Summary | |
---|---|
DuDeObjectPair(DuDeObject first,
DuDeObject second)
Initializes a pair of DuDeObject s. |
|
DuDeObjectPair(String sourceId1,
JsonArray objectId1,
String sourceId2,
JsonArray objectId2)
Initializes a DuDeObjectPair that contains no real data. |
|
DuDeObjectPair(String sourceId1,
String objectId1,
String sourceId2,
String objectId2)
Initializes a DuDeObjectPair that contains no real data and
where the object id is given as a single String value. |
Method Summary | |
---|---|
void |
clearDuplicateInfo()
Clears the is-duplicate property. |
void |
clearLineage()
Clears the lineage property. |
void |
clearSimilarity()
Clears the similarity of this pair. |
boolean |
equals(Object obj)
|
void |
fromJson(DuDeJsonParser<?> jsonParser)
Initializes the current instance using the passed DuDeJsonParser . |
DuDeObjectPair.DuplicateType |
getDuplicateInfo()
Checks whether the current pair represents a duplicate. |
JsonRecord |
getFirstElementObjectData()
Returns the data of the first DuDeObject . |
DuDeObjectPair.GeneratedBy |
getLineage()
Returns the lineage value of the current pair. |
DuDeObjectPair |
getReference()
Returns a DuDeObjectPair that refers to the current pair. |
JsonRecord |
getSecondElementObjectData()
Returns the data of the second DuDeObject . |
double |
getSimilarity()
Returns the similarity of the DuDeObjectPair or
NO_SIMILARITY_SET_VALUE , if the similarity wasn't set. |
boolean |
hasDuplicateInfo()
Checks whether the is-duplicate property is set. |
int |
hashCode()
|
boolean |
hasLineage()
Checks whether a lineage is specified. |
boolean |
hasSimilarity()
Checks whether the similarity is set. |
boolean |
isDuplicate()
Checks whether the current pair represents a duplicate. |
void |
setDuplicateInfo(DuDeObjectPair.DuplicateType isDuplicate)
Sets the is-duplicate property. |
void |
setLineage(DuDeObjectPair.GeneratedBy generatorType)
Sets the lineage property. |
void |
setSimilarity(double val)
Sets the similarity of this DuDeObjectPair . |
void |
toJson(DuDeJsonGenerator jsonGenerator)
Generates the Json code using the passed DuDeJsonGenerator . |
String |
toString()
|
Methods inherited from class de.hpi.fgis.dude.util.OrderedPair |
---|
copyPropertiesFrom, getProperty, hasProperty, setElements, setFirstElement, setProperty, setSecondElement |
Methods inherited from class de.hpi.fgis.dude.util.Pair |
---|
getFirstElement, getSecondElement, isReflexive, isSymmetricTo |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double NO_SIMILARITY_SET_VALUE
public static final String FIRST_ELEMENT_ATTRIBUTE_NAME
public static final String SECOND_ELEMENT_ATTRIBUTE_NAME
protected static final String SIMILARITY_PROPERTY
protected static final String LINEAGE_PROPERTY
protected static final String DUPLICATE_PROPERTY
Constructor Detail |
---|
public DuDeObjectPair(DuDeObject first, DuDeObject second)
DuDeObject
s.
first
- The first DuDeObject
.second
- The second DuDeObject
.public DuDeObjectPair(String sourceId1, JsonArray objectId1, String sourceId2, JsonArray objectId2)
DuDeObjectPair
that contains no real data.
This constructor can be used for referring to actual
DuDeObjectPairs
.
sourceId1
- The source id of the first object.objectId1
- The object id of the first object.sourceId2
- The source id of the second object.objectId2
- The object id of the second object.public DuDeObjectPair(String sourceId1, String objectId1, String sourceId2, String objectId2)
DuDeObjectPair
that contains no real data and
where the object id is given as a single String
value. This
constructor can be used for referring to actual
DuDeObjectPairs
.
sourceId1
- The source id of the first object.objectId1
- The object id of the first object as a single
String
value.sourceId2
- The source id of the second object.objectId2
- The object id of the second object as a single
String
value.Method Detail |
---|
public JsonRecord getFirstElementObjectData()
DuDeObject
.
JsonRecord
that stores all the data that describes the
real-world object which is represented by the first element.public JsonRecord getSecondElementObjectData()
DuDeObject
.
JsonRecord
that stores all the data that describes the
real-world object which is represented by the second element.public DuDeObjectPair getReference()
DuDeObjectPair
that refers to the current pair.
DuDeObjectPair
.public String toString()
toString
in class Pair<DuDeObject,DuDeObject>
public boolean equals(Object obj)
equals
in class Pair<DuDeObject,DuDeObject>
Object.equals(Object)
public boolean hasSimilarity()
true
, if the similarity was set; otherwise
false
.public void clearSimilarity()
public void setSimilarity(double val)
DuDeObjectPair
. The passed value
needs to be within the range [0;1]. Larger values will lead to a
similarity of 1.0
. Smaller values will lead to a similarity
of 0.0
.
val
- The value which shall be set as a similarity.public double getSimilarity()
DuDeObjectPair
or
NO_SIMILARITY_SET_VALUE
, if the similarity wasn't set.
NO_SIMILARITY_SET_VALUE
, if it was not set.public boolean hasLineage()
true
, if the property is set and unequal to
DuDeObjectPair.GeneratedBy.NotDefined
; otherwise false
.public void clearLineage()
public void setLineage(DuDeObjectPair.GeneratedBy generatorType)
generatorType
- The type of lineage that shall be set.public DuDeObjectPair.GeneratedBy getLineage()
public boolean hasDuplicateInfo()
is-duplicate
property is set.
true
, if this property is set; otherwise
false
.public void clearDuplicateInfo()
is-duplicate
property.
public void setDuplicateInfo(DuDeObjectPair.DuplicateType isDuplicate)
is-duplicate
property. null
unsets
this property.
isDuplicate
- The new value of the is-duplicate
property.public DuDeObjectPair.DuplicateType getDuplicateInfo()
is-duplicate
property.public boolean isDuplicate()
false
, if the pair does not represent a duplicate or
was not defined as a duplicate, yet; otherwise false
.public int hashCode()
hashCode
in class Pair<DuDeObject,DuDeObject>
public void toJson(DuDeJsonGenerator jsonGenerator) throws org.codehaus.jackson.JsonGenerationException, IOException
Jsonable
DuDeJsonGenerator
.
toJson
in interface Jsonable
jsonGenerator
- The DuDeJsonGenerator
that is used internally.
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while writing to the output.public void fromJson(DuDeJsonParser<?> jsonParser) throws org.codehaus.jackson.JsonParseException, IOException
Jsonable
DuDeJsonParser
.
fromJson
in interface Jsonable
jsonParser
- The parser that is used for extracting the data out of the Json.
org.codehaus.jackson.JsonParseException
- If an error occurs while parsing the Json.
IOException
- If an error occurs while reading from the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |