info.sswap.impl.empire.model
Class PropertyImpl

java.lang.Object
  extended by info.sswap.impl.empire.model.ModelImpl
      extended by info.sswap.impl.empire.model.ElementImpl
          extended by info.sswap.impl.empire.model.PropertyImpl
All Implemented Interfaces:
com.clarkparsia.empire.SupportsRdfId, SSWAPElement, SSWAPModel, SSWAPProperty

public class PropertyImpl
extends ElementImpl
implements SSWAPProperty

Implementation of SSWAPProperty

Author:
Blazej Bulka

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.clarkparsia.empire.SupportsRdfId
com.clarkparsia.empire.SupportsRdfId.BNodeKey, com.clarkparsia.empire.SupportsRdfId.RdfKey<T>, com.clarkparsia.empire.SupportsRdfId.URIKey
 
Field Summary
private  SSWAPIndividual individual
           
private static int ODD_PRIME
          An arbitrary odd prime used in the hash function.
private  java.net.URI uri
           
private  SSWAPElement value
          The value of the property.
 
Constructor Summary
PropertyImpl(SSWAPIndividual individual, com.hp.hpl.jena.rdf.model.Property property)
          Initializes the SSWAPProperty based on the information from a Jena Property (the predicate between SSWAPIndividual and the value).
 
Method Summary
 boolean equals(java.lang.Object o)
           
 SSWAPIndividual getIndividual()
          Gets the individual for which this property is assigned.
 SSWAPPredicate getPredicate()
          Gets the SSWAPPredicate for this property.
 com.clarkparsia.empire.SupportsRdfId.RdfKey getRdfId()
           
 java.net.URI getURI()
          Get the URI.
 SSWAPElement getValue()
          Gets the value of the property.
 int hashCode()
          Overridden hash code method to make sure that the generated hashcodes are consistent with the overriden equals() method.
 void removeProperty()
          Removes the property from the individual.
(package private)  void setIndividual(SSWAPIndividual individual)
           
 void setRdfId(com.clarkparsia.empire.SupportsRdfId.RdfKey rdfIdentifier)
           
 void setURI(java.net.URI uri)
          Sets the URI of this object.
(package private)  void setValue(SSWAPElement value)
           
 
Methods inherited from class info.sswap.impl.empire.model.ElementImpl
addComment, addLabel, asBoolean, asDouble, asIndividual, asInteger, asList, asLiteral, asString, getComment, getJenaResource, getLabel, isAnonymous, isIndividual, isList, isLiteral
 
Methods inherited from class info.sswap.impl.empire.model.ModelImpl
addImport, assertModel, assertSourceModel, checkProfile, dereference, dereference, doClosure, getAllDependentObjects, getDependentObject, getDocument, getExpressivity, getImports, getInputStream, getNsPrefixMap, getReasoningService, getSourceModel, getTypeSignature, hasSourceModel, hasSourceModelWithEntityManager, isDereferenced, persist, rdfIdEquals, rdfIdHashCode, refresh, refreshSiblings, removeImport, removeNsPrefix, serialize, serialize, setDereferenced, setNsPrefix, setSourceModel, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.sswap.api.model.SSWAPElement
addComment, addLabel, asBoolean, asDouble, asIndividual, asInteger, asList, asLiteral, asString, getComment, getLabel, isIndividual, isList, isLiteral
 
Methods inherited from interface info.sswap.api.model.SSWAPModel
addImport, checkProfile, dereference, dereference, doClosure, getDocument, getImports, getInputStream, getNsPrefixMap, getReasoningService, getTypeSignature, isDereferenced, removeImport, removeNsPrefix, serialize, serialize, setNsPrefix, validate
 

Field Detail

uri

private java.net.URI uri

individual

private SSWAPIndividual individual

value

private SSWAPElement value
The value of the property.


ODD_PRIME

private static final int ODD_PRIME
An arbitrary odd prime used in the hash function.

See Also:
Constant Field Values
Constructor Detail

PropertyImpl

PropertyImpl(SSWAPIndividual individual,
             com.hp.hpl.jena.rdf.model.Property property)
Initializes the SSWAPProperty based on the information from a Jena Property (the predicate between SSWAPIndividual and the value).

Parameters:
property - the Jena Property
Method Detail

getRdfId

public com.clarkparsia.empire.SupportsRdfId.RdfKey getRdfId()
Specified by:
getRdfId in interface com.clarkparsia.empire.SupportsRdfId

setRdfId

public void setRdfId(com.clarkparsia.empire.SupportsRdfId.RdfKey rdfIdentifier)
Specified by:
setRdfId in interface com.clarkparsia.empire.SupportsRdfId

setURI

public void setURI(java.net.URI uri)
Description copied from class: ModelImpl
Sets the URI of this object. This method should be called only once in the lifetime of the object.

Overrides:
setURI in class ModelImpl
Parameters:
uri - the new uri of the object

getURI

public java.net.URI getURI()
Description copied from interface: SSWAPModel
Get the URI. For RDGs, RIGs, and RRGs, return the URI of the sswapResource (for RQGs, leave undefined for now). For PDGs return the URI of the sswapProvider. Return null on failure.

Specified by:
getURI in interface SSWAPModel
Overrides:
getURI in class ModelImpl
Returns:
the URI, such that if the model is serialized and hosted on the web, when dereferenced retrieves the model

getValue

public SSWAPElement getValue()
Description copied from interface: SSWAPProperty
Gets the value of the property.

Specified by:
getValue in interface SSWAPProperty
Returns:
the SSWAPElement (dereferenced) containing the value.

setValue

void setValue(SSWAPElement value)

getPredicate

public SSWAPPredicate getPredicate()
Description copied from interface: SSWAPProperty
Gets the SSWAPPredicate for this property.

Specified by:
getPredicate in interface SSWAPProperty
Returns:
SSWAPPredicate for this property

getIndividual

public SSWAPIndividual getIndividual()
Description copied from interface: SSWAPProperty
Gets the individual for which this property is assigned. If the property is no longer is associated with an individual (e.g., it was removed), this method returns null.

Specified by:
getIndividual in interface SSWAPProperty
Returns:
the individual or null (if the property is no longer associated with an individual)

setIndividual

void setIndividual(SSWAPIndividual individual)

removeProperty

public void removeProperty()
Description copied from interface: SSWAPProperty
Removes the property from the individual.

Specified by:
removeProperty in interface SSWAPProperty

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overridden hash code method to make sure that the generated hashcodes are consistent with the overriden equals() method.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode.


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.