Count
See javadoc - uk.gov.gchq.gaffer.operation.impl.Count
Available since Gaffer version 1.0.0
Counts the number of items in an iterable
Required fields
No required fields
Examples
Count all elements
Using this directed graph:
--> 4 <--
/ ^ \
/ | \
1 --> 2 --> 3
\
--> 5
Java
JSON
Full JSON
Python
OperationChain<Long> countAllElements = new OperationChain.Builder()
.first(new GetAllElements())
.then(new Count<>())
.build();
{
"class" : "OperationChain",
"operations" : [ {
"class" : "GetAllElements"
}, {
"class" : "Count"
} ]
}
{
"class" : "uk.gov.gchq.gaffer.operation.OperationChain",
"operations" : [ {
"class" : "uk.gov.gchq.gaffer.operation.impl.get.GetAllElements"
}, {
"class" : "uk.gov.gchq.gaffer.operation.impl.Count"
} ]
}
g.OperationChain(
operations=[
g.GetAllElements(),
g.Count()
]
)
Result:
Java
JSON
11
11