com.hp.hpl.jena.daml
Interface LiteralAccessor

All Superinterfaces:
PropertyAccessor
All Known Subinterfaces:
IntLiteralAccessor
All Known Implementing Classes:
LiteralAccessorImpl

public interface LiteralAccessor
extends PropertyAccessor

Encapsulates the standard methods of modifying a property on a DAML object, where the value of the property is an RDF literal (as opposed to another DAML value, see PropertyAccessor.

Version:
CVS info: $Id: LiteralAccessor.java,v 1.1 2001/09/24 17:02:40 ijd Exp $
Author:
Ian Dickinson, HP Labs (email)

Method Summary
 void addValue(Literal value)
          Add a value to the encapsulated property.
 void addValue(java.lang.String value)
          Add a value to the encapsulated property.
 Literal getValue()
          Answer the a value of the encapsulated property.
 NodeIterator getValues()
          Answer an iteration over the literal values that this property has in the RDF model.
 boolean hasValue(Literal value)
          Answer true if the encapsulated property has the given value as one of its values.
 boolean hasValue(java.lang.String value)
          Answer true if the encapsulated property has the given value as one of its values.
 void removeValue(Literal value)
          Remove a value from the encapsulated property.
 void removeValue(java.lang.String value)
          Remove a value from the encapsulated property.
 
Methods inherited from interface com.hp.hpl.jena.daml.PropertyAccessor
add, count, get, getAll, getDAMLValue, getProperty, hasValue, remove
 

Method Detail

getValues

public NodeIterator getValues()
Answer an iteration over the literal values that this property has in the RDF model.
Returns:
An iteration over the values of the encapsulated property. Each member of the iteration will be an RDF literal.

getValue

public Literal getValue()
Answer the a value of the encapsulated property. If it has no values, answer null. If it has one value, answer that value. Otherwise, answer an undetermined member of the set of values.
Returns:
A value for the encapsulated property, or null if the property has no value.

addValue

public void addValue(java.lang.String value)
Add a value to the encapsulated property.
Parameters:
value - The value to be added, as a string.

addValue

public void addValue(Literal value)
Add a value to the encapsulated property.
Parameters:
value - The value to be added, as an RDF literal.

removeValue

public void removeValue(java.lang.String value)
Remove a value from the encapsulated property.
Parameters:
value - The value to be removed, as a string.

removeValue

public void removeValue(Literal value)
Remove a value from the encapsulated property.
Parameters:
value - The value to be removed, as a literal.

hasValue

public boolean hasValue(java.lang.String value)
Answer true if the encapsulated property has the given value as one of its values.
Parameters:
value - A DAML value to test for
Returns:
True if the RDF model contains a statement giving a value for the encapsulated property matching the given value.

hasValue

public boolean hasValue(Literal value)
Answer true if the encapsulated property has the given value as one of its values.
Parameters:
value - A DAML value to test for
Returns:
True if the RDF model contains a statement giving a value for the encapsulated property matching the given value.


Copyright 2001 Hewlett-Packard. All Rights Reserved.