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


java.lang.Object
   com.hp.hpl.jena.reasoner.rulesys.impl.Generator

Generator
public class Generator implements LPAgendaEntry,LPInterpreterContext(Code)
A generator represents a set of memoized results for a single tabled subgoal. The generator may be complete (in which case it just contains the complete cached set of results for a goal), ready (not complete but likely to product more results if called) or blocked (not complete and awaiting results from a dependent generator).

Each generator may have multiple associated consumer choice points representing different choices in satisfying the generator's goal.


author:
   Dave Reynolds
version:
   $Revision: 1.10 $ on $Date: 2008/01/02 12:06:16 $


Field Summary
protected  booleancheckReadyNeeded
    
protected  LFlagcompletionState
    
protected  SetconsumingCPs
    
protected  SetgeneratingCPs
    
protected  TriplePatterngoal
    
protected  LPInterpreterinterpreter
    
protected  booleanisReady
    
protected  booleanisSingleton
    
protected  SetresultSet
    
protected  ArrayListresults
    

Constructor Summary
public  Generator(LPInterpreter interpreter, TriplePattern goal)
     Constructor.

Method Summary
public  voidaddConsumer(ConsumerChoicePointFrame ccp)
     Add a new client choince point to consume results from this generator.
public  voidcheckForCompletions()
     Check for deadlocked states where none of the generators we are (indirectly) dependent on can run.
public static  voidcheckForCompletions(Collection completions)
     Check for deadlocked states across a collection of generators which have been run.
public  GeneratorgetGenerator()
    
public  booleanisComplete()
     Return true if the generator is complete.
public  booleanisReady()
     Return true if the generator is ready to be scheduled (i.e.
public  voidnotifyBlockedOn(ConsumerChoicePointFrame ccp)
     Notify that the interpreter has now blocked on the given choice point.
public  voidnotifyFinished(ConsumerChoicePointFrame ccp)
     Notify this context that the given choice point has terminated and can be remove from the wait list.
public  voidnotifyResults()
     Signal dependents that we have new results.
public  intnumResults()
     Return the number of results available from this context.
protected static  voidpostCompletionCheckScan(Set visited)
     Scan the result of a (set of) completion check(s) to detect which of the unknowns are actually live and set the remaining (deadlocked) states to complete.
protected  voidpropagateLive(Set filter)
     Propagate liveness state forward to consuming generators, but only those within the filter set.
public  voidpump()
     Start this generator running for the first time.
public  voidpump(LPInterpreterState context)
     Start this generator running from the given previous blocked generating choice point.
public  voidremoveConsumer(ConsumerChoicePointFrame ccp)
     Remove a terminated consuming choice point from the state set.
protected  LFlagrunCompletionCheck(Set visited)
     Check whether this generator is live (indirectly dependent on a ready generator), dead (complete) or in a deadlock loop which might or might not be live (unknown).
public  voidsetComplete()
     Signal that this generator is complete, no more results can be created.
public  voidsetReady(ConsumerChoicePointFrame ccp)
     Directly set that this generator is ready (because the generator for one of its generatingCPs has produced new results).

Field Detail
checkReadyNeeded
protected boolean checkReadyNeeded(Code)
set to true if at least one branch has block so an active readiness check is required



completionState
protected LFlag completionState(Code)
Flags whether the generator is live/dead/unknown during completion checking



consumingCPs
protected Set consumingCPs(Code)
The list of active consumer choice points consuming results from this generator



generatingCPs
protected Set generatingCPs(Code)
The set of choice points producing results for us to use



goal
protected TriplePattern goal(Code)
The goal the generator is satisfying - just used in debugging



interpreter
protected LPInterpreter interpreter(Code)
The intepreter instance which generates the results for this goal, null if the generator is complete



isReady
protected boolean isReady(Code)
set to true if the dependent generator has new results ready for us



isSingleton
protected boolean isSingleton(Code)
True if this generator can produce at most one answer



resultSet
protected Set resultSet(Code)
A indexed version of the result set, used while the generator is live to detect duplicate results



results
protected ArrayList results(Code)
The ordered set of results available for the goal




Constructor Detail
Generator
public Generator(LPInterpreter interpreter, TriplePattern goal)(Code)
Constructor.
Parameters:
  interpreter - an initialized interpreter instance that will answer results for this generator.




Method Detail
addConsumer
public void addConsumer(ConsumerChoicePointFrame ccp)(Code)
Add a new client choince point to consume results from this generator.



checkForCompletions
public void checkForCompletions()(Code)
Check for deadlocked states where none of the generators we are (indirectly) dependent on can run.



checkForCompletions
public static void checkForCompletions(Collection completions)(Code)
Check for deadlocked states across a collection of generators which have been run.



getGenerator
public Generator getGenerator()(Code)
Return the generator associated with this entry (might be the entry itself)



isComplete
public boolean isComplete()(Code)
Return true if the generator is complete.



isReady
public boolean isReady()(Code)
Return true if the generator is ready to be scheduled (i.e. it is not known to be complete and not known to be waiting for a dependent generator).



notifyBlockedOn
public void notifyBlockedOn(ConsumerChoicePointFrame ccp)(Code)
Notify that the interpreter has now blocked on the given choice point.



notifyFinished
public void notifyFinished(ConsumerChoicePointFrame ccp)(Code)
Notify this context that the given choice point has terminated and can be remove from the wait list.



notifyResults
public void notifyResults()(Code)
Signal dependents that we have new results.



numResults
public int numResults()(Code)
Return the number of results available from this context.



postCompletionCheckScan
protected static void postCompletionCheckScan(Set visited)(Code)
Scan the result of a (set of) completion check(s) to detect which of the unknowns are actually live and set the remaining (deadlocked) states to complete.



propagateLive
protected void propagateLive(Set filter)(Code)
Propagate liveness state forward to consuming generators, but only those within the filter set.



pump
public void pump()(Code)
Start this generator running for the first time. Should be called from within an appropriately synchronized block.



pump
public void pump(LPInterpreterState context)(Code)
Start this generator running from the given previous blocked generating choice point. Should be called from within an appropriately synchronized block.



removeConsumer
public void removeConsumer(ConsumerChoicePointFrame ccp)(Code)
Remove a terminated consuming choice point from the state set.



runCompletionCheck
protected LFlag runCompletionCheck(Set visited)(Code)
Check whether this generator is live (indirectly dependent on a ready generator), dead (complete) or in a deadlock loop which might or might not be live (unknown).



setComplete
public void setComplete()(Code)
Signal that this generator is complete, no more results can be created.



setReady
public void setReady(ConsumerChoicePointFrame ccp)(Code)
Directly set that this generator is ready (because the generator for one of its generatingCPs has produced new results).



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)

w___ww___._j___av_a_2s_.c_o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.