Protégé-OWL 3.4.1

edu.stanford.smi.protegex.owl.model.impl
Class DefaultRDFSLiteral

java.lang.Object
  extended by edu.stanford.smi.protegex.owl.model.impl.DefaultRDFSLiteral
All Implemented Interfaces:
RDFObject, RDFSLiteral, Visitable, Comparable

public class DefaultRDFSLiteral
extends Object
implements RDFSLiteral

Author:
Holger Knublauch

Field Summary
static String DATATYPE_PREFIX
           
static String LANGUAGE_PREFIX
           
static char SEPARATOR
           
 
Constructor Summary
DefaultRDFSLiteral(OWLModel owlModel, String rawValue)
           
 
Method Summary
 void accept(OWLModelVisitor visitor)
          This method is provided to be used with the OWLModelVisitor, which is part of the visitor design pattern.
 int compareTo(Object o)
           
static RDFSLiteral create(OWLModel owlModel, Object value)
           
static RDFSLiteral create(OWLModel owlModel, String lexicalValue, RDFSDatatype datatype)
           
static RDFSLiteral create(OWLModel owlModel, String text, String language)
           
 boolean equals(Object obj)
           
 boolean equalsStructurally(RDFObject object)
          Determines whether or not the specified class is structurally equal to this class.
 boolean getBoolean()
          Gets the value as a boolean.
 String getBrowserText()
           
 byte[] getBytes()
          Gets the appropriate byte array if the value has datatype xsd:base64Binary
 RDFSDatatype getDatatype()
          Gets the RDFSDatatype of this value.
 double getDouble()
           
 float getFloat()
           
 int getInt()
          Gets the value as an int.
 String getLanguage()
          Gets the language if it has been defined for this.
protected  String getLanguageFromRawValue()
           
 long getLong()
           
 Object getPlainValue()
          If the datatype of this is one of the default datatypes, which can be optimized by Protege, then this returns an optimized value.
static Object getPlainValueIfPossible(Object value)
           
 String getRawValue()
           
static String getRawValue(String lexicalValue, RDFSDatatype datatype)
           
static String getRawValue(String text, String lang)
           
 short getShort()
           
 String getString()
           
 int hashCode()
           
static boolean isRawValue(String value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DATATYPE_PREFIX

public static final String DATATYPE_PREFIX
See Also:
Constant Field Values

LANGUAGE_PREFIX

public static final String LANGUAGE_PREFIX
See Also:
Constant Field Values

SEPARATOR

public static final char SEPARATOR
See Also:
Constant Field Values
Constructor Detail

DefaultRDFSLiteral

public DefaultRDFSLiteral(OWLModel owlModel,
                          String rawValue)
Method Detail

accept

public void accept(OWLModelVisitor visitor)
Description copied from interface: Visitable
This method is provided to be used with the OWLModelVisitor, which is part of the visitor design pattern. By implementing this method, instances of the implementing class are stating that they can accept an OWLModelVisitor

Specified by:
accept in interface Visitable
Parameters:
visitor - The visitor that will operate on this object.

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

create

public static RDFSLiteral create(OWLModel owlModel,
                                 Object value)

create

public static RDFSLiteral create(OWLModel owlModel,
                                 String lexicalValue,
                                 RDFSDatatype datatype)

create

public static RDFSLiteral create(OWLModel owlModel,
                                 String text,
                                 String language)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equalsStructurally

public boolean equalsStructurally(RDFObject object)
Description copied from interface: RDFObject
Determines whether or not the specified class is structurally equal to this class. Note that this does not test for structural equivalence using structural subsumption tests.

Specified by:
equalsStructurally in interface RDFObject
Parameters:
object - The class to test against.
Returns:
true if the class is structurally equal to this, false if the class is not structurally equal to this.

getBoolean

public boolean getBoolean()
Description copied from interface: RDFSLiteral
Gets the value as a boolean.

Specified by:
getBoolean in interface RDFSLiteral
Returns:
the boolean value

getBrowserText

public String getBrowserText()
Specified by:
getBrowserText in interface RDFObject

getBytes

public byte[] getBytes()
Description copied from interface: RDFSLiteral
Gets the appropriate byte array if the value has datatype xsd:base64Binary

Specified by:
getBytes in interface RDFSLiteral
Returns:
the byte array, I guess

getDatatype

public RDFSDatatype getDatatype()
Description copied from interface: RDFSLiteral
Gets the RDFSDatatype of this value.

Specified by:
getDatatype in interface RDFSLiteral
Returns:
the RDFSDatatype

getDouble

public double getDouble()
Specified by:
getDouble in interface RDFSLiteral

getFloat

public float getFloat()
Specified by:
getFloat in interface RDFSLiteral

getInt

public int getInt()
Description copied from interface: RDFSLiteral
Gets the value as an int.

Specified by:
getInt in interface RDFSLiteral
Returns:
the int value

getLanguage

public String getLanguage()
Description copied from interface: RDFSLiteral
Gets the language if it has been defined for this.

Specified by:
getLanguage in interface RDFSLiteral
Returns:
a language or null

getLanguageFromRawValue

protected String getLanguageFromRawValue()

getLong

public long getLong()
Specified by:
getLong in interface RDFSLiteral

getShort

public short getShort()
Specified by:
getShort in interface RDFSLiteral

getPlainValue

public Object getPlainValue()
Description copied from interface: RDFSLiteral
If the datatype of this is one of the default datatypes, which can be optimized by Protege, then this returns an optimized value.

Specified by:
getPlainValue in interface RDFSLiteral
Returns:
null or a Boolean, Integer, Float, or String

getPlainValueIfPossible

public static Object getPlainValueIfPossible(Object value)

getRawValue

public String getRawValue()

getString

public String getString()
Specified by:
getString in interface RDFSLiteral

getRawValue

public static final String getRawValue(String lexicalValue,
                                       RDFSDatatype datatype)

getRawValue

public static final String getRawValue(String text,
                                       String lang)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

isRawValue

public static final boolean isRawValue(String value)

toString

public String toString()
Overrides:
toString in class Object

Protégé-OWL 3.4.1

Submit a bug report or feature request
Copyright (c) 1998-2009 Stanford University.