Class StructuredRepresentation
- java.lang.Object
-
- it.unive.lisa.util.representation.StructuredRepresentation
-
- All Implemented Interfaces:
java.lang.Comparable<StructuredRepresentation>
- Direct Known Subclasses:
ListRepresentation
,MapRepresentation
,ObjectRepresentation
,SetRepresentation
,StringRepresentation
public abstract class StructuredRepresentation extends java.lang.Object implements java.lang.Comparable<StructuredRepresentation>
A structured representation of the information present in a single instance of an object. Instances of this class can be used to depict the content of an element in a domain-agnostic way, such as dumping the information to a file.
-
-
Constructor Summary
Constructors Constructor Description StructuredRepresentation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(StructuredRepresentation o)
boolean
equals(java.lang.Object obj)
java.util.SortedMap<java.lang.String,java.lang.String>
getProperties()
Yields the set collection of textual properties defined for this representation.int
hashCode()
void
setProperty(java.lang.String key, java.lang.String value)
Sets a textual property to enrich the information represented by this instance.abstract SerializableValue
toSerializableValue()
Produces a serializable version of this representation.abstract java.lang.String
toString()
-
-
-
Method Detail
-
getProperties
public java.util.SortedMap<java.lang.String,java.lang.String> getProperties()
Yields the set collection of textual properties defined for this representation.- Returns:
- the properties
-
setProperty
public void setProperty(java.lang.String key, java.lang.String value)
Sets a textual property to enrich the information represented by this instance.- Parameters:
key
- the key of the propertyvalue
- the value of the property
-
toSerializableValue
public abstract SerializableValue toSerializableValue()
Produces a serializable version of this representation.- Returns:
- an instance of
SerializableValue
containing representing the same information as this representation
-
compareTo
public final int compareTo(StructuredRepresentation o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<StructuredRepresentation>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public abstract java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-