net.ontopia.topicmaps.core
Interface OccurrenceIF

All Superinterfaces:
ReifiableIF, ScopedIF, TMObjectIF, TypedIF
All Known Implementing Classes:
Occurrence, Occurrence, ReadOnlyOccurrence, SnapshotOccurrence

public interface OccurrenceIF
extends ScopedIF, TypedIF, ReifiableIF

PUBLIC: Implemented by objects representing occurrences in the topic map model. An occurrence is a relationship between a topic, and an information resource which is relevant to that topic.

NOTE Comments partly revised only.


Method Summary
 LocatorIF getDataType()
          PUBLIC: Gets the data type of this occurrence.
 long getLength()
          PUBLIC: Returns the length of the occurrence value.
 LocatorIF getLocator()
          PUBLIC: Returns a LocatorIF representation of the occurrence value.
 java.io.Reader getReader()
          PUBLIC: Returns a Reader that allows you to stream the string representation of this occurrence.
 TopicIF getTopic()
          PUBLIC: Gets the topic for this occurrence.
 java.lang.String getValue()
          PUBLIC: Gets the string representation of this occurrence.
 void setLocator(LocatorIF locator)
          PUBLIC: Same as setValue(locator.getAddress(), DataTypes.TYPE_URI).
 void setReader(java.io.Reader value, long length, LocatorIF datatype)
          PUBLIC: Sets the value and the data type of this occurrence using a reader.
 void setValue(java.lang.String value)
          PUBLIC: Same as setValue(value, DataTypes.TYPE_STRING).
 void setValue(java.lang.String value, LocatorIF datatype)
          PUBLIC: Sets the value and the data type of this occurrence using a string.
 
Methods inherited from interface net.ontopia.topicmaps.core.ScopedIF
addTheme, getScope, removeTheme
 
Methods inherited from interface net.ontopia.topicmaps.core.TypedIF
getType, setType
 
Methods inherited from interface net.ontopia.topicmaps.core.ReifiableIF
getReifier, setReifier
 
Methods inherited from interface net.ontopia.topicmaps.core.TMObjectIF
addItemIdentifier, getItemIdentifiers, getObjectId, getTopicMap, isReadOnly, remove, removeItemIdentifier
 

Method Detail

getTopic

TopicIF getTopic()
PUBLIC: Gets the topic for this occurrence.

Returns:
The topic to which this occurrence belongs; an object implementing TopicIF.

getDataType

LocatorIF getDataType()
PUBLIC: Gets the data type of this occurrence.

Since:
4.0

getValue

java.lang.String getValue()
PUBLIC: Gets the string representation of this occurrence. This method will return null if the length of the value exceeds the supported maximum size.


getReader

java.io.Reader getReader()
PUBLIC: Returns a Reader that allows you to stream the string representation of this occurrence. Values of all sizes are supported by this method.

Since:
4.0

setValue

void setValue(java.lang.String value)
PUBLIC: Same as setValue(value, DataTypes.TYPE_STRING). This method is here primarily for backwards compatibility.


getLocator

LocatorIF getLocator()
PUBLIC: Returns a LocatorIF representation of the occurrence value. This method will return null if the value is not of type xsd:anyURI (same as DataType.TYPE_URI). This method is here primarily for backwards compatibility.


setLocator

void setLocator(LocatorIF locator)
PUBLIC: Same as setValue(locator.getAddress(), DataTypes.TYPE_URI). This method is here primarily for backwards compatibility.


setValue

void setValue(java.lang.String value,
              LocatorIF datatype)
PUBLIC: Sets the value and the data type of this occurrence using a string. The value must conform to the correct string representation according to the datatype.

Since:
4.0

setReader

void setReader(java.io.Reader value,
               long length,
               LocatorIF datatype)
PUBLIC: Sets the value and the data type of this occurrence using a reader. The reader value must conform to the correct string representation according to the datatype.

Since:
4.0

getLength

long getLength()
PUBLIC: Returns the length of the occurrence value. The number of characters in the string representation is returned.

Since:
4.0


Copyright © 2000-2012 Ontopia.