Java Doc for Node.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » graph » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.graph 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.graph.Node

All known Subclasses:   com.hp.hpl.jena.graph.Node_Concrete,  com.hp.hpl.jena.graph.Node_Fluid,
Node
abstract public class Node (Code)
A Node has five subtypes: Node_Blank, Node_Anon, Node_URI, Node_Variable, and Node_ANY. Nodes are only constructed by the node factory methods, and they will attempt to re-use existing nodes with the same label if they are recent enough.
author:
   Jeremy Carroll and Chris Dollin

Inner Class :public static class NotLiteral extends JenaException
Inner Class :abstract static class NodeMaker

Field Summary
final public static  NodeANY
     The canonical instance of Node_ANY.
final public static  NodeNULL
     The canonical NULL.
final static  StringRDFprefix
    
final static  intTHRESHOLD
    
final protected  Objectlabel
    
final static  NodeMakermakeAnon
    
final static  NodeMakermakeLiteral
    
final static  NodeMakermakeURI
    
final static  NodeMakermakeVariable
    
final static  NodeCachepresent
    

Constructor Summary
 Node(Object label)
     keep the distinguishing label value.

Method Summary
public static  voidcache(boolean wantCache)
     provided only for testing purposes.
public static  Nodecreate(String x)
     Returns a Node described by the string, primarily for testing purposes. The string represents a URI, a numeric literal, a string literal, a bnode label, or a variable.
public static  Nodecreate(PrefixMapping pm, String x)
     As for create(String), but the PrefixMapping used to translate URI strings is an additional argument.
public static synchronized  Nodecreate(NodeMaker maker, Object label)
     We object strongly to null labels: for example, they make .equals flaky.
public static  NodecreateAnon()
    
public static  NodecreateAnon(AnonId id)
    
public static  NodecreateLiteral(LiteralLabel lit)
    
public static  NodecreateLiteral(String value)
    
public static  NodecreateLiteral(String lit, String lang, boolean isXml)
     make a literal with specified language and XMLishness.
public static  NodecreateLiteral(String lex, String lang, RDFDatatype dtype)
     Build a typed literal node from its lexical form.
public static  NodecreateURI(String uri)
    
public static  NodecreateUncachedLiteral(Object value, String lang, RDFDatatype dtype)
    
public static  NodecreateVariable(String name)
    
abstract public  booleanequals(Object o)
     Nodes only equal other Nodes that have equal labels.
public  AnonIdgetBlankNodeId()
    
public  StringgetBlankNodeLabel()
     Answer the label of this blank node or throw an UnsupportedOperationException if it's not blank.
public  ObjectgetIndexingValue()
     Answer the object which is the index value for this Node.
public  LiteralLabelgetLiteral()
    
public  RDFDatatypegetLiteralDatatype()
     Answer the RDF datatype object of this node's literal value, if it is a literal; otherwise die horribly.
public  StringgetLiteralDatatypeURI()
     Answer the data-type URI of this node's literal value, if it is a literal; otherwise die horribly.
public  booleangetLiteralIsXML()
    
public  StringgetLiteralLanguage()
     Answer the language of this node's literal value, if it is a literal; otherwise die horribly.
public  StringgetLiteralLexicalForm()
     Answer the lexical form of this node's literal value, if it is a literal; otherwise die horribly.
public  ObjectgetLiteralValue()
     Answer the value of this node's literal value, if it is a literal; otherwise die horribly.
public  StringgetLocalName()
    
public  StringgetName()
    
public  StringgetNameSpace()
    
public static  RDFDatatypegetType(String s)
    
public  StringgetURI()
    
public  booleanhasURI(String uri)
    
public  inthashCode()
    
public  booleanisBlank()
    
abstract public  booleanisConcrete()
     Answer true iff this node is concrete, ie not variable, ie URI, blank, or literal.
public  booleanisLiteral()
    
public  booleanisURI()
    
public  booleanisVariable()
    
public  booleanmatches(Node other)
     Answer true iff this node accepts the other one as a match.
public  booleansameValueAs(Object o)
     Test that two nodes are semantically equivalent. In some cases this may be the same as equals, in others equals is stricter.
public  StringtoString()
     Answer a human-readable representation of this Node.
public  StringtoString(boolean quoting)
     Answer a human-readable representation of this Node where literals are quoted according to quoting but URIs are not compressed.
public  StringtoString(PrefixMapping pm)
     Answer a human-readable representation of the Node, quoting literals and compressing URIs.
public  StringtoString(PrefixMapping pm, boolean quoting)
     Answer a human readable representation of this Node, quoting literals if specified, and compressing URIs using the prefix mapping supplied.
abstract public  ObjectvisitWith(NodeVisitor v)
     Visit a Node and dispatch on it to the appropriate method from the NodeVisitor v.

Field Detail
ANY
final public static Node ANY(Code)
The canonical instance of Node_ANY. No other instances are required.



NULL
final public static Node NULL(Code)
The canonical NULL. It appears here so that revised definitions [eg as a bnode] that require the cache-and-maker system will work; the NodeMaker constants should be non-null at this point.



RDFprefix
final static String RDFprefix(Code)



THRESHOLD
final static int THRESHOLD(Code)



label
final protected Object label(Code)



makeAnon
final static NodeMaker makeAnon(Code)



makeLiteral
final static NodeMaker makeLiteral(Code)



makeURI
final static NodeMaker makeURI(Code)



makeVariable
final static NodeMaker makeVariable(Code)



present
final static NodeCache present(Code)




Constructor Detail
Node
Node(Object label)(Code)
keep the distinguishing label value.




Method Detail
cache
public static void cache(boolean wantCache)(Code)
provided only for testing purposes. _cache(false)_ switches off caching and clears the cache. _cache(true)_ switches caching [back] on. This allows structural equality to be tested.



create
public static Node create(String x)(Code)
Returns a Node described by the string, primarily for testing purposes. The string represents a URI, a numeric literal, a string literal, a bnode label, or a variable.
  • 'some text' :: a string literal with that text
  • 'some text'someLanguage:: a string literal with that text and language
  • 'some text'someURI:: a typed literal with that text and datatype
  • digits :: a literal [OF WHAT TYPE] with that [numeric] value
  • _XXX :: a bnode with an AnonId built from _XXX
  • ?VVV :: a variable with name VVV
  • &PPP :: to be done
  • name:stuff :: the URI; name may be expanded using the Extended map

Parameters:
  x - the string describing the node a node of the appropriate type with the appropriate labelNodeCreateUtils.create(String)



create
public static Node create(PrefixMapping pm, String x)(Code)
As for create(String), but the PrefixMapping used to translate URI strings is an additional argument.
Parameters:
  pm - the PrefixMapping for translating pre:X strings
Parameters:
  x - the string encoding the node to create a node with the appropriate type and labelNodeCreateUtils.create(PrefixMappingString)



create
public static synchronized Node create(NodeMaker maker, Object label)(Code)
We object strongly to null labels: for example, they make .equals flaky. We reuse nodes from the recent cache if we can. Otherwise, the maker knows how to construct a new node of the correct class, and we add that node to the cache. create is synchronised to avoid threading problems - a separate thread might zap the cache entry that get is currently looking at.



createAnon
public static Node createAnon()(Code)
make a blank node with a fresh anon id



createAnon
public static Node createAnon(AnonId id)(Code)
make a blank node with the specified label



createLiteral
public static Node createLiteral(LiteralLabel lit)(Code)
make a literal node with the specified literal value



createLiteral
public static Node createLiteral(String value)(Code)



createLiteral
public static Node createLiteral(String lit, String lang, boolean isXml)(Code)
make a literal with specified language and XMLishness. _lit_ must *not* be null.
Parameters:
  isXml - If true then lit is exclusive canonical XML of type rdf:XMLLiteral, and no checking will be invoked.



createLiteral
public static Node createLiteral(String lex, String lang, RDFDatatype dtype) throws DatatypeFormatException(Code)
Build a typed literal node from its lexical form. The lexical form will be parsed now and the value stored. If the form is not legal this will throw an exception.
Parameters:
  lex - the lexical form of the literal
Parameters:
  lang - the optional language tag
Parameters:
  dtype - the type of the literal, null for old style "plain" literals
throws:
  DatatypeFormatException - if lex is not a legal form of dtype



createURI
public static Node createURI(String uri)(Code)
make a URI node with the specified URIref string



createUncachedLiteral
public static Node createUncachedLiteral(Object value, String lang, RDFDatatype dtype) throws DatatypeFormatException(Code)



createVariable
public static Node createVariable(String name)(Code)
make a variable node with a given name



equals
abstract public boolean equals(Object o)(Code)
Nodes only equal other Nodes that have equal labels.



getBlankNodeId
public AnonId getBlankNodeId()(Code)
get the blank node id if the node is blank, otherwise die horribly



getBlankNodeLabel
public String getBlankNodeLabel()(Code)
Answer the label of this blank node or throw an UnsupportedOperationException if it's not blank.



getIndexingValue
public Object getIndexingValue()(Code)
Answer the object which is the index value for this Node. The default is this Node itself; overridden in Node_Literal for literal indexing purposes. Only concrete nodes should use this method.



getLiteral
public LiteralLabel getLiteral()(Code)
Answer the literal value of a literal node, or throw an UnsupportedOperationException if it's not a literal node



getLiteralDatatype
public RDFDatatype getLiteralDatatype()(Code)
Answer the RDF datatype object of this node's literal value, if it is a literal; otherwise die horribly.



getLiteralDatatypeURI
public String getLiteralDatatypeURI()(Code)
Answer the data-type URI of this node's literal value, if it is a literal; otherwise die horribly.



getLiteralIsXML
public boolean getLiteralIsXML()(Code)



getLiteralLanguage
public String getLiteralLanguage()(Code)
Answer the language of this node's literal value, if it is a literal; otherwise die horribly.



getLiteralLexicalForm
public String getLiteralLexicalForm()(Code)
Answer the lexical form of this node's literal value, if it is a literal; otherwise die horribly.



getLiteralValue
public Object getLiteralValue()(Code)
Answer the value of this node's literal value, if it is a literal; otherwise die horribly.



getLocalName
public String getLocalName()(Code)
get the localname part of this node if it's a URI node, else die horribly



getName
public String getName()(Code)
get a variable nodes name, otherwise die horribly



getNameSpace
public String getNameSpace()(Code)
get the namespace part of this node if it's a URI node, else die horribly



getType
public static RDFDatatype getType(String s)(Code)



getURI
public String getURI()(Code)
get the URI of this node if it has one, else die horribly



hasURI
public boolean hasURI(String uri)(Code)
answer true iff this node is a URI node with the given URI



hashCode
public int hashCode()(Code)



isBlank
public boolean isBlank()(Code)
Answer true iff this node is a blank node [subclasses override]



isConcrete
abstract public boolean isConcrete()(Code)
Answer true iff this node is concrete, ie not variable, ie URI, blank, or literal.



isLiteral
public boolean isLiteral()(Code)
Answer true iff this node is a literal node [subclasses override]



isURI
public boolean isURI()(Code)
Answer true iff this node is a URI node [subclasses override]



isVariable
public boolean isVariable()(Code)
Answer true iff this node is a variable node - subclasses override



matches
public boolean matches(Node other)(Code)
Answer true iff this node accepts the other one as a match. The default is an equality test; it is over-ridden in subclasses to provide the appropriate semantics for literals, ANY, and variables.
Parameters:
  other - a node to test for matching true iff this node accepts the other as a match



sameValueAs
public boolean sameValueAs(Object o)(Code)
Test that two nodes are semantically equivalent. In some cases this may be the same as equals, in others equals is stricter. For example, two xsd:int literals with the same value but different language tag are semantically equivalent but distinguished by the java equality function in order to support round-tripping.

Default implementation is to use equals, subclasses should override this.




toString
public String toString()(Code)
Answer a human-readable representation of this Node. It will not compress URIs, nor quote literals (because at the moment too many places use toString() for something machine-oriented).



toString
public String toString(boolean quoting)(Code)
Answer a human-readable representation of this Node where literals are quoted according to quoting but URIs are not compressed.



toString
public String toString(PrefixMapping pm)(Code)
Answer a human-readable representation of the Node, quoting literals and compressing URIs.



toString
public String toString(PrefixMapping pm, boolean quoting)(Code)
Answer a human readable representation of this Node, quoting literals if specified, and compressing URIs using the prefix mapping supplied.



visitWith
abstract public Object visitWith(NodeVisitor v)(Code)
Visit a Node and dispatch on it to the appropriate method from the NodeVisitor v.
Parameters:
  v - the visitor to apply to the node the value returned by the applied method



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.