uk.ac.manchester.cs.owl.owlapi
Class OWLStringLiteralImpl

java.lang.Object
  extended by uk.ac.manchester.cs.owl.owlapi.OWLObjectImpl
      extended by uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl
          extended by uk.ac.manchester.cs.owl.owlapi.OWLStringLiteralImpl
All Implemented Interfaces:
java.lang.Comparable<OWLObject>, OWLAnnotationObject, OWLAnnotationValue, OWLLiteral, OWLObject, OWLPropertyAssertionObject, OWLStringLiteral

public class OWLStringLiteralImpl
extends OWLLiteralImpl
implements OWLStringLiteral

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 26-Oct-2006


Constructor Summary
OWLStringLiteralImpl(OWLDataFactory dataFactory, java.lang.String literal, java.lang.String lang)
           
 
Method Summary
 void accept(OWLAnnotationValueVisitor visitor)
           
<O> O
accept(OWLAnnotationValueVisitorEx<O> visitor)
           
 void accept(OWLDataVisitor visitor)
           
<O> O
accept(OWLDataVisitorEx<O> visitor)
           
 void accept(OWLObjectVisitor visitor)
           
<O> O
accept(OWLObjectVisitorEx<O> visitor)
           
 OWLTypedLiteral asOWLStringLiteral()
          If this literal is a typed (i.e.
 OWLStringLiteral asRDFTextLiteral()
          If this literal is an RDFTextLiteral (i.e.
protected  int compareObjectOfSameType(OWLObject object)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getLang()
          Gets the language tag (if present)
 boolean hasLang()
           
 boolean hasLang(java.lang.String lang)
          Determines if this constant has a specific language tag.
 boolean isTyped()
          Determines if this literal is typed (i.e.
 
Methods inherited from class uk.ac.manchester.cs.owl.owlapi.OWLLiteralImpl
getLiteral, hashCode
 
Methods inherited from class uk.ac.manchester.cs.owl.owlapi.OWLObjectImpl
compareSets, compareTo, getClassesInSignature, getDataPropertiesInSignature, getDatatypesInSignature, getIndividualsInSignature, getObjectPropertiesInSignature, getOWLDataFactory, getSignature, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.semanticweb.owlapi.model.OWLLiteral
getLiteral
 

Constructor Detail

OWLStringLiteralImpl

public OWLStringLiteralImpl(OWLDataFactory dataFactory,
                            java.lang.String literal,
                            java.lang.String lang)
Method Detail

getLang

public java.lang.String getLang()
Description copied from interface: OWLStringLiteral
Gets the language tag (if present)

Specified by:
getLang in interface OWLStringLiteral
Returns:
A String which represents the langauge tag, or null if there is no language tag

hasLang

public boolean hasLang()

hasLang

public boolean hasLang(java.lang.String lang)
Description copied from interface: OWLStringLiteral
Determines if this constant has a specific language tag.

Specified by:
hasLang in interface OWLStringLiteral
Parameters:
lang - The specific lang to test for.
Returns:
true if this constant has the specified langauge tag, or false if this constant does not have a language tag or if this constant has a language tag that is not equal to the specified language tag.

isTyped

public boolean isTyped()
Description copied from interface: OWLLiteral
Determines if this literal is typed (i.e. an instance of OWLTypedLiteral)

Specified by:
isTyped in interface OWLLiteral
Returns:
true if the literal is typed, otherwise false false

asOWLStringLiteral

public OWLTypedLiteral asOWLStringLiteral()
Description copied from interface: OWLLiteral
If this literal is a typed (i.e. if the isTyped method returns true then this method obtains this literal as a typed literal. If isTyped returns false then calling this method will cause an OWLRuntimeException to be thrown.

Specified by:
asOWLStringLiteral in interface OWLLiteral
Returns:
This literal as a typed literal

asRDFTextLiteral

public OWLStringLiteral asRDFTextLiteral()
Description copied from interface: OWLLiteral
If this literal is an RDFTextLiteral (i.e. if the isTyped method returns false then this method obtains this literal as an RDFTextLiteral. If the isTyped method returns true because this method is a typed literal, then calling this method will cause an OWLRuntimeException to be thrown.

Specified by:
asRDFTextLiteral in interface OWLLiteral
Returns:
This literal as a more specific RDF Text Literal

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class OWLLiteralImpl

accept

public void accept(OWLAnnotationValueVisitor visitor)
Specified by:
accept in interface OWLAnnotationValue

accept

public <O> O accept(OWLAnnotationValueVisitorEx<O> visitor)
Specified by:
accept in interface OWLAnnotationValue

accept

public void accept(OWLDataVisitor visitor)
Specified by:
accept in interface OWLLiteral

accept

public void accept(OWLObjectVisitor visitor)
Specified by:
accept in interface OWLObject

accept

public <O> O accept(OWLDataVisitorEx<O> visitor)
Specified by:
accept in interface OWLLiteral

accept

public <O> O accept(OWLObjectVisitorEx<O> visitor)
Specified by:
accept in interface OWLObject

compareObjectOfSameType

protected int compareObjectOfSameType(OWLObject object)
Specified by:
compareObjectOfSameType in class OWLObjectImpl