001 /*
002 * The contents of this file are subject to the Mozilla Public License
003 * Version 1.1 (the "License"); you may not use this file except in
004 * compliance with the License. You may obtain a copy of the License at
005 * http://www.mozilla.org/MPL/
006 *
007 * Software distributed under the License is distributed on an "AS IS" basis,
008 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009 * the specific language governing rights and limitations under the License.
010 *
011 * The Original Code is Protege-2000.
012 *
013 * The Initial Developer of the Original Code is Stanford University. Portions
014 * created by Stanford University are Copyright (C) 2007. All Rights Reserved.
015 *
016 * Protege was developed by Stanford Medical Informatics
017 * (http://www.smi.stanford.edu) at the Stanford University School of Medicine
018 * with support from the National Library of Medicine, the National Science
019 * Foundation, and the Defense Advanced Research Projects Agency. Current
020 * information about Protege can be obtained at http://protege.stanford.edu.
021 *
022 */
023
024 package edu.stanford.smi.protegex.owl.model;
025
026 import edu.stanford.smi.protegex.owl.model.visitor.Visitable;
027
028 /**
029 * An interface to represent an RDF/XML Schema literal.
030 * This encapsulates the value, the datatype and the language tag.
031 *
032 * @author Holger Knublauch <holger@knublauch.com>
033 */
034 public interface RDFSLiteral extends Comparable, RDFObject, Visitable {
035
036
037 /**
038 * Gets the value as a boolean.
039 *
040 * @return the boolean value
041 */
042 boolean getBoolean();
043
044
045 /**
046 * Gets the appropriate byte array if the value has datatype xsd:base64Binary
047 *
048 * @return the byte array, I guess
049 */
050 byte[] getBytes();
051
052
053 /**
054 * Gets the RDFSDatatype of this value.
055 *
056 * @return the RDFSDatatype
057 */
058 RDFSDatatype getDatatype();
059
060 double getDouble();
061
062 float getFloat();
063
064 short getShort();
065
066
067 /**
068 * Gets the value as an int.
069 *
070 * @return the int value
071 */
072 int getInt();
073
074
075 /**
076 * Gets the language if it has been defined for this.
077 *
078 * @return a language or null
079 */
080 String getLanguage();
081
082
083 long getLong();
084
085
086 /**
087 * If the datatype of this is one of the default datatypes, which can be
088 * optimized by Protege, then this returns an optimized value.
089 *
090 * @return null or a Boolean, Integer, Float, or String
091 */
092 Object getPlainValue();
093
094
095 String getString();
096
097 }
098