public abstract class EPGMElement extends Object implements Element
| Modifier and Type | Field and Description |
|---|---|
protected GradoopId |
id
Entity identifier.
|
protected String |
label
Label of that entity.
|
protected Properties |
properties
Internal property storage
|
| Modifier | Constructor and Description |
|---|---|
protected |
EPGMElement()
Default constructor.
|
protected |
EPGMElement(GradoopId id,
String label,
Properties properties)
Creates an object from the given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
GradoopId |
getId()
Returns the identifier of that entity.
|
String |
getLabel()
Returns the label of that entity.
|
Properties |
getProperties()
Returns all properties of that entity.
|
int |
getPropertyCount()
Returns the number of properties stored at that entity.
|
Iterable<String> |
getPropertyKeys()
Returns all property keys of that entity or
null it that entity has
no properties. |
PropertyValue |
getPropertyValue(String key)
Returns the object referenced by the given key or
null if the key
does not exist. |
int |
hashCode() |
boolean |
hasProperty(String key)
Returns true, if the element has a property with the given property key.
|
PropertyValue |
removeProperty(String key)
Removes the properties associated with the given key.
|
void |
setId(GradoopId id)
Sets the identifier of that entity.
|
void |
setLabel(String label)
Sets the label of that entity.
|
void |
setProperties(Properties properties)
Sets the given properties as new properties.
|
void |
setProperty(Property property)
Adds a given property to that entity.
|
void |
setProperty(String key,
Object value)
Adds a given property to that entity.
|
void |
setProperty(String key,
PropertyValue value)
Adds a given property to that entity.
|
String |
toString() |
protected GradoopId id
protected String label
protected Properties properties
protected EPGMElement()
protected EPGMElement(GradoopId id, String label, Properties properties)
id - entity identifierlabel - entity labelproperties - key-value propertiespublic GradoopId getId()
IdentifiablegetId in interface Identifiablepublic void setId(GradoopId id)
IdentifiablesetId in interface Identifiableid - identifierpublic String getLabel()
Labeledpublic void setLabel(String label)
Labeled@Nullable public Properties getProperties()
AttributedgetProperties in interface Attributedpublic Iterable<String> getPropertyKeys()
Attributednull it that entity has
no properties.getPropertyKeys in interface Attributedpublic PropertyValue getPropertyValue(String key)
Attributednull if the key
does not exist.getPropertyValue in interface Attributedkey - property keynull if key does not existpublic void setProperties(Properties properties)
AttributedsetProperties in interface Attributedproperties - new propertiespublic void setProperty(Property property)
AttributedsetProperty in interface Attributedproperty - propertypublic void setProperty(String key, Object value)
Attributedkey does not exist, a new
property will be created. Otherwise, the existing property value will be
overwritten by the given value.setProperty in interface Attributedkey - property keyvalue - property valuepublic void setProperty(String key, PropertyValue value)
Attributedkey does not exist, a new
property will be created. Otherwise, the existing property value will be
overwritten by the given value.setProperty in interface Attributedkey - property keyvalue - property valuepublic PropertyValue removeProperty(String key)
AttributedremoveProperty in interface Attributedkey - property keynull if the key was not foundpublic int getPropertyCount()
AttributedgetPropertyCount in interface Attributedpublic boolean hasProperty(String key)
AttributedhasProperty in interface Attributedkey - property keyCopyright © 2014 - 2019–2019 University of Leipzig. All rights reserved.