Java Doc for GraphBase.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » graph » impl » 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.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.graph.impl.GraphBase

All known Subclasses:   com.hp.hpl.jena.graph.compose.CompositionBase,  com.hp.hpl.jena.mem.GraphMemBase,  com.hp.hpl.jena.db.GraphRDB,  com.hp.hpl.jena.reasoner.BaseInfGraph,
GraphBase
abstract public class GraphBase implements GraphWithPerform(Code)
GraphBase is an implementation of Graph that provides some convenient base functionality for Graph implementations.

Subtypes of GraphBase must provide performAdd(Triple), performDelete(Triple), graphBaseFind(TripleMatch,TripleAction), and graphBaseSize(). GraphBase provides default implementations of the other methods, including the other finds (on top of that one), a simple-minded prepare, and contains. GraphBase also handles the event-listening and registration interfaces.

When a GraphBase is closed, future operations on it may throw an exception.
author:
   kers



Field Summary
protected  BulkUpdateHandlerbulkHandler
     The allocated BulkUpdateHandler, or null if no handler has been allocated yet.
protected  Capabilitiescapabilities
     The allocated Capabilities object, or null if unallocated.
protected  booleanclosed
     Whether or not this graph has been closed - used to report ClosedExceptions when an operation is attempted on a closed graph.
protected  GraphEventManagergem
     The event manager that this Graph uses to, well, manage events; allocated on demand.
protected  PrefixMappingpm
    
protected  QueryHandlerqueryHandler
     The query handler for this graph, or null if queryHandler() has not been called yet.
protected  Reifierreifier
     The cache variable for the allocated Reifier.
protected  GraphStatisticsHandlerstatisticsHandler
    
final protected  ReificationStylestyle
     The reification style of this graph, used when the reifier is created (and nowhere else, as it happens, which is good).

Constructor Summary
public  GraphBase()
     Initialise this graph as one with reification style Minimal.
public  GraphBase(ReificationStyle style)
     Initialise this graph with the given reification style (which will be supplied to the reifier when it is created).

Method Summary
public  voidadd(Triple t)
     Add a triple, and notify the event manager.
protected  voidcheckOpen()
     Utility method: throw a ClosedException if this graph has been closed.
public  voidclose()
     Close this graph.
protected  ReifierconstructReifier()
     Answer a reifier appropriate to this graph.
final public  booleancontains(Triple t)
     Answer true iff t is in the graph as revealed by find(t) being non-empty.
final public  booleancontains(Node s, Node p, Node o)
     Answer true if this graph contains (s, p, o); this canonical implementation cannot be over-ridden.
final protected  booleancontainsByFind(Triple t)
     Utility method: answer true iff we can find at least one instantiation of the triple in this graph using find(TripleMatch).
protected  GraphStatisticsHandlercreateStatisticsHandler()
    
final public  voiddelete(Triple t)
     Delete a triple, and notify the event manager.
public  booleandependsOn(Graph other)
     Default implementation answers true iff this graph is the same graph as the argument graph.
final public  ExtendedIteratorfind(TripleMatch m)
     Answer an (extended) iterator over all the triples in this Graph matching m.
final public  ExtendedIteratorfind(Node s, Node p, Node o)
    
public  ExtendedIteratorforTestingOnly_graphBaseFind(TripleMatch tm)
    
public  BulkUpdateHandlergetBulkUpdateHandler()
     Answer a BulkUpdateHandler bound to this graph.
public  CapabilitiesgetCapabilities()
     Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable).
public  GraphEventManagergetEventManager()
     Answer the event manager for this graph; allocate a new one if required.
public  PrefixMappinggetPrefixMapping()
     Answer the PrefixMapping object for this graph, the same one each time.
public  ReifiergetReifier()
     Answer this graph's reifier.
public  GraphStatisticsHandlergetStatisticsHandler()
    
public  TransactionHandlergetTransactionHandler()
     Answer a transaction handler bound to this graph.
protected  booleangraphBaseContains(Triple t)
     Answer true if the graph contains any triple matching t.
abstract protected  ExtendedIteratorgraphBaseFind(TripleMatch m)
     Answer an iterator over all the triples held in this graph's non-reified triple store that match m.
protected  ExtendedIteratorgraphBaseFind(Node s, Node p, Node o)
    
protected  intgraphBaseSize()
     Answer the number of triples in this graph.
public  booleanisClosed()
    
public  booleanisEmpty()
     Answer true iff this graph contains no triples (hidden reification quads do not count).
public  booleanisIsomorphicWith(Graph g)
     Answer true iff this graph is isomorphic to g according to the algorithm (indeed, method) in GraphMatcher.
public  voidnotifyAdd(Triple t)
     Tell the event manager that the triple t has been added to the graph.
public  voidnotifyDelete(Triple t)
     Tell the event manager that the triple t has been deleted from the graph.
public  voidperformAdd(Triple t)
     Add a triple to the triple store.
public  voidperformDelete(Triple t)
     Remove a triple from the triple store.
public  QueryHandlerqueryHandler()
     Answer a QueryHandler bound to this graph.
protected  booleanreifierContains(Triple t)
     Answer true if the reifier contains a quad matching t.
protected  intreifierSize()
     Answer the number of visible reification quads.
protected  ExtendedIteratorreifierTriples(TripleMatch m)
     Answer an iterator over all the triples exposed in this graph's reifier that match m.
final public  intsize()
     Answer the size of this graph (ie the number of exposed triples).
public  StringtoString()
     Answer a human-consumable representation of this graph.
public static  StringtoString(String prefix, Graph that)
     Answer a human-consumable representation of that.

Field Detail
bulkHandler
protected BulkUpdateHandler bulkHandler(Code)
The allocated BulkUpdateHandler, or null if no handler has been allocated yet.



capabilities
protected Capabilities capabilities(Code)
The allocated Capabilities object, or null if unallocated.



closed
protected boolean closed(Code)
Whether or not this graph has been closed - used to report ClosedExceptions when an operation is attempted on a closed graph.



gem
protected GraphEventManager gem(Code)
The event manager that this Graph uses to, well, manage events; allocated on demand.



pm
protected PrefixMapping pm(Code)



queryHandler
protected QueryHandler queryHandler(Code)
The query handler for this graph, or null if queryHandler() has not been called yet.



reifier
protected Reifier reifier(Code)
The cache variable for the allocated Reifier.



statisticsHandler
protected GraphStatisticsHandler statisticsHandler(Code)



style
final protected ReificationStyle style(Code)
The reification style of this graph, used when the reifier is created (and nowhere else, as it happens, which is good).




Constructor Detail
GraphBase
public GraphBase()(Code)
Initialise this graph as one with reification style Minimal.



GraphBase
public GraphBase(ReificationStyle style)(Code)
Initialise this graph with the given reification style (which will be supplied to the reifier when it is created).




Method Detail
add
public void add(Triple t)(Code)
Add a triple, and notify the event manager. Subclasses should not need to override this - we might make it final. The triple is added using performAdd, and notification done by notifyAdd.



checkOpen
protected void checkOpen()(Code)
Utility method: throw a ClosedException if this graph has been closed.



close
public void close()(Code)
Close this graph. Subgraphs may extend to discard resources.



constructReifier
protected Reifier constructReifier()(Code)
Answer a reifier appropriate to this graph. Subclasses override if they need non-SimpleReifiers.



contains
final public boolean contains(Triple t)(Code)
Answer true iff t is in the graph as revealed by find(t) being non-empty. t may contain ANY wildcards. Sub-classes may over-ride reifierContains and graphBaseContains for efficiency.



contains
final public boolean contains(Node s, Node p, Node o)(Code)
Answer true if this graph contains (s, p, o); this canonical implementation cannot be over-ridden.



containsByFind
final protected boolean containsByFind(Triple t)(Code)
Utility method: answer true iff we can find at least one instantiation of the triple in this graph using find(TripleMatch).
Parameters:
  t - Triple that is the pattern to match true iff find(t) returns at least one result



createStatisticsHandler
protected GraphStatisticsHandler createStatisticsHandler()(Code)



delete
final public void delete(Triple t)(Code)
Delete a triple, and notify the event manager. Subclasses should not need to override this - we might make it final. The triple is added using performDelete, and notification done by notifyDelete.



dependsOn
public boolean dependsOn(Graph other)(Code)
Default implementation answers true iff this graph is the same graph as the argument graph.



find
final public ExtendedIterator find(TripleMatch m)(Code)
Answer an (extended) iterator over all the triples in this Graph matching m. Subclasses cannot over-ride this, because it implements the appending of reification quadlets; instead they must implement graphBaseFind(TripleMatch).



find
final public ExtendedIterator find(Node s, Node p, Node o)(Code)



forTestingOnly_graphBaseFind
public ExtendedIterator forTestingOnly_graphBaseFind(TripleMatch tm)(Code)



getBulkUpdateHandler
public BulkUpdateHandler getBulkUpdateHandler()(Code)
Answer a BulkUpdateHandler bound to this graph. The default is a SimpleBulkUpdateHandler, which does bulk update by repeated simple (add/delete) updates; the same handler is returned on each call. Subclasses may override if they have specialised implementations.



getCapabilities
public Capabilities getCapabilities()(Code)
Answer the capabilities of this graph; the default is an AllCapabilities object (the same one each time, not that it matters - Capabilities should be immutable).



getEventManager
public GraphEventManager getEventManager()(Code)
Answer the event manager for this graph; allocate a new one if required. Subclasses may override if they have a more specialised event handler. The default is a SimpleEventManager.



getPrefixMapping
public PrefixMapping getPrefixMapping()(Code)
Answer the PrefixMapping object for this graph, the same one each time. Subclasses are unlikely to want to modify this.



getReifier
public Reifier getReifier()(Code)
Answer this graph's reifier. The reifier may be lazily constructed, and it must be the same reifier on each call. The default implementation is a SimpleReifier. Generally DO NOT override this method: override constructReifier instead.



getStatisticsHandler
public GraphStatisticsHandler getStatisticsHandler()(Code)



getTransactionHandler
public TransactionHandler getTransactionHandler()(Code)
Answer a transaction handler bound to this graph. The default is SimpleTransactionHandler, which handles no transactions.



graphBaseContains
protected boolean graphBaseContains(Triple t)(Code)
Answer true if the graph contains any triple matching t. The default implementation uses find and checks to see if the iterator is non-empty.



graphBaseFind
abstract protected ExtendedIterator graphBaseFind(TripleMatch m)(Code)
Answer an iterator over all the triples held in this graph's non-reified triple store that match m. Subclasses must override; it is the core implementation for find(TripleMatch).



graphBaseFind
protected ExtendedIterator graphBaseFind(Node s, Node p, Node o)(Code)



graphBaseSize
protected int graphBaseSize()(Code)
Answer the number of triples in this graph. Default implementation counts its way through the results of a findAll. Subclasses must override if they want size() to be efficient.



isClosed
public boolean isClosed()(Code)



isEmpty
public boolean isEmpty()(Code)
Answer true iff this graph contains no triples (hidden reification quads do not count). The default implementation is size() == 0, which is fine if size is reasonable efficient. Subclasses may override if necessary. This method may become final and defined in terms of other methods.



isIsomorphicWith
public boolean isIsomorphicWith(Graph g)(Code)
Answer true iff this graph is isomorphic to g according to the algorithm (indeed, method) in GraphMatcher.



notifyAdd
public void notifyAdd(Triple t)(Code)
Tell the event manager that the triple t has been added to the graph.



notifyDelete
public void notifyDelete(Triple t)(Code)
Tell the event manager that the triple t has been deleted from the graph.



performAdd
public void performAdd(Triple t)(Code)
Add a triple to the triple store. The default implementation throws an AddDeniedException; subclasses must override if they want to be able to add triples.



performDelete
public void performDelete(Triple t)(Code)
Remove a triple from the triple store. The default implementation throws a DeleteDeniedException; subclasses must override if they want to be able to remove triples.



queryHandler
public QueryHandler queryHandler()(Code)
Answer a QueryHandler bound to this graph. The default implementation returns the same SimpleQueryHandler each time it is called; sub-classes may override if they need specialised query handlers.



reifierContains
protected boolean reifierContains(Triple t)(Code)
Answer true if the reifier contains a quad matching t. The default implementation uses the reifier's findExposed method. Subclasses probably don't need to override (if they're interested, they probably have specialised reifiers).



reifierSize
protected int reifierSize()(Code)
Answer the number of visible reification quads. Subclasses will not normally need to override this, since it just invokes the reifier's size() method, and they can implement their own reifier.



reifierTriples
protected ExtendedIterator reifierTriples(TripleMatch m)(Code)
Answer an iterator over all the triples exposed in this graph's reifier that match m. The default implementation delegates this to the reifier; subclasses probably don't need to override this.



size
final public int size()(Code)
Answer the size of this graph (ie the number of exposed triples). Defined as the size of the triple store plus the size of the reification store. Subclasses must override graphBaseSize() to reimplement (and reifierSize if they have some special reason for redefined that).



toString
public String toString()(Code)
Answer a human-consumable representation of this graph. Not advised for big graphs, as it generates a big string: intended for debugging purposes.



toString
public static String toString(String prefix, Graph that)(Code)
Answer a human-consumable representation of that. The string prefix will appear near the beginning of the string. Nodes may be prefix-compressed using that's prefix-mapping. This default implementation will display all the triples exposed by the graph (ie including reification triples if it is Standard).



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.