Count (query directive)

From WandoraWiki
(Difference between revisions)
Jump to: navigation, search
(Examples)
 
Line 11: Line 11:
 
Following example counts all instances of the input directive.
 
Following example counts all instances of the input directive.
  
importPackage(org.wandora.query2);
+
importPackage(org.wandora.query2);
new Count(new Instances())
+
new Count(new Instances())
  
 
Following example finds all topics in the topic map that have more than 5 instances.
 
Following example finds all topics in the topic map that have more than 5 instances.

Latest revision as of 13:04, 21 August 2009

[edit] Description

Counts the number of rows returned by the inner directive using same input the Count directive got.

[edit] Constructor

Count(Directive directive)

[edit] Examples

Following example counts all instances of the input directive.

importPackage(org.wandora.query2);
new Count(new Instances())

Following example finds all topics in the topic map that have more than 5 instances.

importPackage(org.wandora.query2);
new Count(new Instances())
.as("#count")
.from(new AllTopics().as("#topic"))
.where("#count",">","\"5\"",true)
Personal tools