com.hp.hpl.jena.rdf.model
Interface RDFNode

All Superinterfaces:
FrontsNode
All Known Subinterfaces:
AllDifferent, AllValuesFromRestriction, Alt, AnnotationProperty, Bag, BooleanClassDescription, CardinalityQRestriction, CardinalityRestriction, ComplementClass, Container, DAMLClass, DAMLCommon, DAMLDataInstance, DAMLDatatype, DAMLDatatypeProperty, DAMLInstance, DAMLList, DAMLObjectProperty, DAMLOntology, DAMLProperty, DAMLRestriction, DataRange, DatatypeProperty, EnumeratedClass, FunctionalProperty, HasValueRestriction, Individual, IntersectionClass, InverseFunctionalProperty, Literal, MaxCardinalityQRestriction, MaxCardinalityRestriction, MinCardinalityQRestriction, MinCardinalityRestriction, ObjectProperty, OntClass, Ontology, OntProperty, OntResource, Property, QualifiedRestriction, RDFList, ReifiedStatement, Resource, Restriction, Seq, SomeValuesFromRestriction, SymmetricProperty, TransitiveProperty, UnionClass

public interface RDFNode
extends FrontsNode

An RDF Resource or an RDF Literal.

RDFNode represents the methods which RDF Resources and RDF Literals have in common.

Chris added the _as_ method to allow RDFNodes to participate in polymorphic conversions.

Version:
Release='$Name: $' Revision='$Revision: 1.8 $' Date='$Date: 2003/11/30 23:38:34 $'
Author:
bwm

Method Summary
 RDFNode as(Class view)
          RDFNodes can be converted to different implementation types.
 boolean canAs(Class view)
          return true iff this RDFNode can be viewed as a _view_.
 RDFNode inModel(Model m)
          returns a .equals() version of this node, except that its in the model m.
 String toString()
          Return a String representation of the node.
 Object visitWith(RDFVisitor rv)
          Apply the appropriate method of the visitor to this node's content and return the result.
 
Methods inherited from interface com.hp.hpl.jena.graph.FrontsNode
asNode
 

Method Detail

toString

String toString()
Return a String representation of the node. The form of the string depends on the type of the node.

Overrides:
toString in class Object
Returns:
a String representation of this object.

as

RDFNode as(Class view)
RDFNodes can be converted to different implementation types. Convert this RDFNode to a type supporting the viewinterface. The resulting RDFNode should be an instance of view and should have any internal invariants as specified.

If the RDFNode cannot be converted, an exception is thrown.


canAs

boolean canAs(Class view)
return true iff this RDFNode can be viewed as a _view_.


inModel

RDFNode inModel(Model m)
returns a .equals() version of this node, except that its in the model m.

Parameters:
m - a model to move the node to
Returns:
this, if it's already in m (or no model), a copy in m otherwise

visitWith

Object visitWith(RDFVisitor rv)
Apply the appropriate method of the visitor to this node's content and return the result.

Parameters:
rv - an RDFVisitor with a method for URI/blank/literal nodes
Returns:
the result returned by the selected method


Copyright © 2000, 2001, 2002, 2003, 2004 Hewlett-Packard Development Company, LP