se.kmr.scam.editor.util
Class PredicateValueObject

java.lang.Object
  extended byse.kmr.scam.editor.util.PredicateValueObject
All Implemented Interfaces:
ValueObject

public class PredicateValueObject
extends Object
implements ValueObject

Should be renamed to Value. Wrapper for a fact in a value model.

Version:
$Revision: 1.11 $
Author:
Matthias
Created:
den 29 november 2002

Constructor Summary
PredicateValueObject(ValueObject vO, Resource variable)
           
 
Method Summary
 ValueObject duplicate()
          If predicate is set to something this copies the binding tree.
 String getLanguage()
          Gets the literalLanguage attribute of the ValueObject object
 RDFNode getNode()
          Gets the node attribute of the ValueObject object
 Property getPredicate()
           
 Resource getResource()
          Gets the resource attribute of the ValueObject object
 Resource getSubject()
          Gets the subject attribute of the ValueObject object
 String getValue()
          Gets the language attribute of the value, if such exists.
 boolean isDummy()
          Tells wether a valueobject is empty, i.e. set to a dummy value.
 boolean isEdited()
           
 int isOk()
          OBS OBS OBS, THIS FUNCTION IS UNUSED AND I CAN'T FIGURE IT'S FUNCTION.
 boolean isValid()
           
 void remove()
          Removes the fact from the RDF-model
 void removeValueAndPossibleConstraints()
          Observe that this function removes the statement as well ass all properties around the predicate since it is bound to the current variable, i.e.
 void setEdited(boolean edited)
           
 void setPredicate(Property newPredicate)
           
 void setValid(boolean valid)
          Used for validation of values in forms.
 void setValue(String value)
          Sets the literal value of the fact.
 void setValue(String value, String language)
          Sets the value of the fact.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredicateValueObject

public PredicateValueObject(ValueObject vO,
                            Resource variable)
Method Detail

getNode

public RDFNode getNode()
Description copied from interface: ValueObject
Gets the node attribute of the ValueObject object

Specified by:
getNode in interface ValueObject
Returns:
The node value

getSubject

public Resource getSubject()
Description copied from interface: ValueObject
Gets the subject attribute of the ValueObject object

Specified by:
getSubject in interface ValueObject
Returns:
The subject value

getResource

public Resource getResource()
Description copied from interface: ValueObject
Gets the resource attribute of the ValueObject object

Specified by:
getResource in interface ValueObject
Returns:
The node value, as a resource.

getValue

public String getValue()
Description copied from interface: ValueObject
Gets the language attribute of the value, if such exists.

Specified by:
getValue in interface ValueObject
Returns:
The string value of the language. The string is empty if no language exists.

getLanguage

public String getLanguage()
Description copied from interface: ValueObject
Gets the literalLanguage attribute of the ValueObject object

Specified by:
getLanguage in interface ValueObject
Returns:
The literalLanguage value

setValue

public void setValue(String value)
              throws RDFException
Description copied from interface: ValueObject
Sets the literal value of the fact.

Specified by:
setValue in interface ValueObject
Parameters:
value - The new value
Throws:
RDFException - thrown in case of exception while updating the object.

setValue

public void setValue(String value,
                     String language)
              throws RDFException
Description copied from interface: ValueObject
Sets the value of the fact. If the fact is represented by a Literal the value will be set with a language attribute. (The language attribute will only set if the language argument is non-null)
For facts that is represented by Resource will the language argument have no effect.

Specified by:
setValue in interface ValueObject
Parameters:
value - The new value
language - The new language value
Throws:
RDFException - thrown if the value is null, the object represents a root node or in case of exception while updating the data model.

setPredicate

public void setPredicate(Property newPredicate)
                  throws RDFException
Specified by:
setPredicate in interface ValueObject
Throws:
RDFException

getPredicate

public Property getPredicate()
                      throws RDFException
Specified by:
getPredicate in interface ValueObject
Throws:
RDFException

isDummy

public boolean isDummy()
Description copied from interface: ValueObject
Tells wether a valueobject is empty, i.e. set to a dummy value.

Specified by:
isDummy in interface ValueObject
Returns:
boolean

duplicate

public ValueObject duplicate()
                      throws RDFException
If predicate is set to something this copies the binding tree.

Specified by:
duplicate in interface ValueObject
Returns:
If this object represents a Statement a (structural)duplicate of this object, otherwise null.
Throws:
RDFException - thrown in case of exception while duplicating the Statement
See Also:
ValueObject.duplicate()

remove

public void remove()
            throws RDFException
Description copied from interface: ValueObject
Removes the fact from the RDF-model

Specified by:
remove in interface ValueObject
Throws:
RDFException - thrown in case of exception while removing fact from the RDF-model.

removeValueAndPossibleConstraints

public void removeValueAndPossibleConstraints()
                                       throws RDFException
Observe that this function removes the statement as well ass all properties around the predicate since it is bound to the current variable, i.e. constraints created in the binding process around the predicate is removed. Hence, if (sic!) subpropertyof information is contained in the valuemodel it is removed as well. In all relevant situations this does not happend since such information resides in the extramodel not in the current valuemodel. The take home message of this is that in current implementation it's not possible to have ontological information in the current valuemodel if it is requested as a constraint on a predicate variable since removal of a specific statement may destroy that ontological infomration. If this behaviour is pathological comment out the marked code in this function. Observe that this is not true when it comes to ValueObjects with non predicate variables, i.e. the case in all #ValueObjectimpl.

Specified by:
removeValueAndPossibleConstraints in interface ValueObject
Throws:
RDFException - thrown in case of exception while removing fact from the RDF-model.
See Also:
ValueObject.removeValueAndPossibleConstraints()

setEdited

public void setEdited(boolean edited)
Specified by:
setEdited in interface ValueObject

setValid

public void setValid(boolean valid)
Description copied from interface: ValueObject
Used for validation of values in forms.

Specified by:
setValid in interface ValueObject

isEdited

public boolean isEdited()
Specified by:
isEdited in interface ValueObject
Returns:

isValid

public boolean isValid()
Specified by:
isValid in interface ValueObject
Returns:

isOk

public int isOk()
Description copied from interface: ValueObject
OBS OBS OBS, THIS FUNCTION IS UNUSED AND I CAN'T FIGURE IT'S FUNCTION. Enlighten me by explaining it here.... Otherwise I will remove it. /Matthias

Specified by:
isOk in interface ValueObject
Returns:


Copyright © 2003 SCAM. All Rights Reserved.