public class BinaryOWLMetadata extends Object
A structure for holding key value pairs that can be serialized in a binary format. The values may take the form of primitive types: string, int, long, boolean, double, byte array, or may also be instances of .
| Constructor and Description |
|---|
BinaryOWLMetadata() |
BinaryOWLMetadata(BinaryOWLInputStream inputStream) |
| Modifier and Type | Method and Description |
|---|---|
BinaryOWLMetadata |
createCopy()
Creates a copy of this metadata object.
|
static BinaryOWLMetadata |
emptyMetadata() |
Boolean |
getBooleanAttribute(String name,
Boolean defaultValue)
Gets the boolean value of an attribute.
|
byte[] |
getByteArrayAttribute(String name,
byte[] defaultValue)
Gets the byte [] value of an attribute.
|
Double |
getDoubleAttribute(String name,
Double defaultValue)
Gets the double value of an attribute.
|
Integer |
getIntAttribute(String name,
Integer defaultValue)
Gets the int value of an attribute.
|
Long |
getLongAttribute(String name,
Long defaultValue)
Gets the long value of an attribute.
|
List<org.semanticweb.owlapi.model.OWLObject> |
getOWLObjectListAttribute(String name,
List<org.semanticweb.owlapi.model.OWLObject> defaultValue)
Gets the
OWLObject list value of an attribute. |
String |
getStringAttribute(String name,
String defaultValue)
Gets the string value of an attribute.
|
boolean |
isEmpty() |
void |
removeAll()
Removes all attributes in this metadata object.
|
void |
removeAttribute(String name)
Removes all types (int, string, long etc.) of attributes with the specified name.
|
void |
removeBooleanAttribute(String name)
Removes a boolean attribute with the specified name.
|
void |
removeByteArrayAttribute(String name)
Removes a byte [] attribute with the specified name.
|
void |
removeDoubleAttribute(String name)
Removes a double attribute with the specified name.
|
void |
removeIntAttribute(String name)
Removes an int attribute with the specified name.
|
void |
removeLongAttribute(String name)
Removes a long attribute with the specified name.
|
void |
removeOWLObjectListAttribute(String name)
Removes an
OWLObject list attribute with the specified name. |
void |
removeStringAttribute(String name)
Removes a string attribute with the specified name.
|
void |
setBooleanAttribute(String name,
boolean value)
Sets the boolean value for the specified attribute name.
|
void |
setByteArrayAttribute(String name,
byte[] value)
Sets the byte [] value for the specified attribute name.
|
void |
setDoubleAttribute(String name,
double value)
Sets the double value for the specified attribute name.
|
void |
setIntAttribute(String name,
int value)
Sets the integer value for the specified attribute name.
|
void |
setLongAttribute(String name,
long value)
Sets the long value for the specified attribute name.
|
void |
setOWLObjectListAttribute(String name,
List<org.semanticweb.owlapi.model.OWLObject> value)
Sets the
OWLObject list values for an attribute. |
void |
setStringAttribute(String name,
String value)
Sets the string value of an attribute.
|
String |
toString() |
void |
write(BinaryOWLOutputStream outputStream) |
public BinaryOWLMetadata()
public BinaryOWLMetadata(BinaryOWLInputStream inputStream) throws IOException, BinaryOWLParseException
IOExceptionBinaryOWLParseExceptionpublic boolean isEmpty()
public BinaryOWLMetadata createCopy()
public void removeAll()
public void removeAttribute(String name)
name - The name.public String getStringAttribute(String name, String defaultValue)
name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain a string value for the specified attribute name.NullPointerException - if name is null.public void setStringAttribute(String name, String value)
name - The name of the attribute. Not null.value - The value of the attribute. Not null.NullPointerException - if the name parameter, or the value parameter is null.public void removeStringAttribute(String name)
name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public void setIntAttribute(String name, int value)
name - The name of the attribute. Not null.value - The value of the attribute to set.NullPointerException - if the name parameter is null.public Integer getIntAttribute(String name, Integer defaultValue)
name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain an int value for the specified attribute name.NullPointerException - if name is null.public void removeIntAttribute(String name)
name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public void setLongAttribute(String name, long value)
name - The name of the attribute. Not null.value - The value of the attribute to set.NullPointerException - if the name parameter is null.public Long getLongAttribute(String name, Long defaultValue)
name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain a long value for the specified attribute name.NullPointerException - if name is null.public void removeLongAttribute(String name)
name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public void setBooleanAttribute(String name, boolean value)
name - The name of the attribute. Not null.value - The value of the attribute to set.NullPointerException - if the name parameter is null.public Boolean getBooleanAttribute(String name, Boolean defaultValue)
name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain a boolean value for the specified attribute name.NullPointerException - if name is null.public void removeBooleanAttribute(String name)
name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public void setDoubleAttribute(String name, double value)
name - The name of the attribute. Not null.value - The value of the attribute to set.NullPointerException - if the name parameter is null.public Double getDoubleAttribute(String name, Double defaultValue)
name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain a double value for the specified attribute name.NullPointerException - if name is null.public void removeDoubleAttribute(String name)
name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public void setByteArrayAttribute(String name, byte[] value)
name - The name of the attribute. Not null.value - The value of the attribute to set.NullPointerException - if the name parameter is null or if the value parameter is null.public byte[] getByteArrayAttribute(String name, byte[] defaultValue)
name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain a byte [] value for the specified attribute name.NullPointerException - if name is null.public void removeByteArrayAttribute(String name)
name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public List<org.semanticweb.owlapi.model.OWLObject> getOWLObjectListAttribute(String name, List<org.semanticweb.owlapi.model.OWLObject> defaultValue)
OWLObject list value of an attribute.name - The name of the attribute. Not null.defaultValue - The default value for the attribute. May be null. This value will be returned if this
metadata object does not contain an OWLObject list value for the specified attribute name.OWLObject list value of the attribute with the specified name, or the value specified by the defaultValue
object if this metadata object does not contain an OWLObject list value for the specified attribute name.NullPointerException - if name is null.public void setOWLObjectListAttribute(String name, List<org.semanticweb.owlapi.model.OWLObject> value)
OWLObject list values for an attribute.name - The name of the attribute. Not null.value - The value of the attribute. Not null.NullPointerException - if name is null or value is null.public void removeOWLObjectListAttribute(String name)
OWLObject list attribute with the specified name.name - The name of the attribute. Not null.NullPointerException - if the name parameter is null.public void write(BinaryOWLOutputStream outputStream) throws IOException
IOExceptionpublic static BinaryOWLMetadata emptyMetadata()
Copyright © 2015. All Rights Reserved.