com.hp.hpl.jena.daml.common
Class IntLiteralAccessorImpl

java.lang.Object
  |
  +--com.hp.hpl.jena.daml.common.PropertyAccessorImpl
        |
        +--com.hp.hpl.jena.daml.common.LiteralAccessorImpl
              |
              +--com.hp.hpl.jena.daml.common.IntLiteralAccessorImpl
All Implemented Interfaces:
IntLiteralAccessor, LiteralAccessor, PropertyAccessor

public class IntLiteralAccessorImpl
extends LiteralAccessorImpl
implements IntLiteralAccessor

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, and the literal is known to encapsulate an integer value.

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

Constructor Summary
IntLiteralAccessorImpl(Property property, DAMLCommon val)
          Construct a new accessor for integer literal values of the given property.
 
Method Summary
 void addInt(int value)
          Add a value to the encapsulated property.
 int getInt()
          Answer the a value of the encapsulated property.
 boolean hasIntValue(int value)
          Answer true if the encapsulated property has the given value as one of its values.
 void removeInt(int value)
          Remove an integer value from the encapsulated property.
 
Methods inherited from class com.hp.hpl.jena.daml.common.LiteralAccessorImpl
addValue, addValue, getValue, getValues, hasValue, hasValue, removeValue, removeValue
 
Methods inherited from class com.hp.hpl.jena.daml.common.PropertyAccessorImpl
add, count, get, getAll, getDAMLValue, getProperty, hasValue, remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.daml.LiteralAccessor
addValue, addValue, getValue, getValues, hasValue, hasValue, removeValue, removeValue
 
Methods inherited from interface com.hp.hpl.jena.daml.PropertyAccessor
add, count, get, getAll, getDAMLValue, getProperty, hasValue, remove
 

Constructor Detail

IntLiteralAccessorImpl

public IntLiteralAccessorImpl(Property property,
                              DAMLCommon val)
Construct a new accessor for integer literal values of the given property.
Parameters:
property - The property that this accessor works on
val - The DAML value that has this property
Method Detail

getInt

public int getInt()
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.
Specified by:
getInt in interface IntLiteralAccessor
Returns:
A value for the encapsulated property in the model, as an integer.
Throws:
{@link - java.lang.RuntimeException} if the property is not defined or cannot be interpreted as an integer.

addInt

public void addInt(int value)
Add a value to the encapsulated property.
Specified by:
addInt in interface IntLiteralAccessor
Parameters:
value - The value to be added, as an int.

removeInt

public void removeInt(int value)
Remove an integer value from the encapsulated property.
Specified by:
removeInt in interface IntLiteralAccessor
Parameters:
value - The value to be removed, as an int.

hasIntValue

public boolean hasIntValue(int value)
Answer true if the encapsulated property has the given value as one of its values.
Specified by:
hasIntValue in interface IntLiteralAccessor
Parameters:
value - An int 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.