public abstract class Element extends Object implements EPGMElement
| 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 |
Element()
Default constructor.
|
protected |
Element(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 Element()
protected Element(GradoopId id, String label, Properties properties)
id - entity identifierlabel - entity labelproperties - key-value propertiespublic GradoopId getId()
getId in interface EPGMIdentifiablepublic void setId(GradoopId id)
setId in interface EPGMIdentifiableid - identifierpublic String getLabel()
getLabel in interface EPGMLabeledpublic void setLabel(String label)
setLabel in interface EPGMLabeledlabel - label to be set (must not be null or empty)@Nullable public Properties getProperties()
getProperties in interface EPGMAttributedpublic Iterable<String> getPropertyKeys()
null it that entity has
no properties.getPropertyKeys in interface EPGMAttributedpublic PropertyValue getPropertyValue(String key)
null if the key
does not exist.getPropertyValue in interface EPGMAttributedkey - property keynull if key does not existpublic void setProperties(Properties properties)
setProperties in interface EPGMAttributedproperties - new propertiespublic void setProperty(Property property)
setProperty in interface EPGMAttributedproperty - propertypublic void setProperty(String key, Object value)
key does not exist, a new
property will be created. Otherwise, the existing property value will be
overwritten by the given value.setProperty in interface EPGMAttributedkey - property keyvalue - property valuepublic void setProperty(String key, PropertyValue value)
key does not exist, a new
property will be created. Otherwise, the existing property value will be
overwritten by the given value.setProperty in interface EPGMAttributedkey - property keyvalue - property valuepublic PropertyValue removeProperty(String key)
removeProperty in interface EPGMAttributedkey - property keynull if the key was not foundpublic int getPropertyCount()
EPGMAttributedgetPropertyCount in interface EPGMAttributedpublic boolean hasProperty(String key)
hasProperty in interface EPGMAttributedkey - property keyCopyright © 2014 - 2018–2018 University of Leipzig. All rights reserved.