public class CountFunction extends Object implements DatumFunction<Void>
DatumFunction
that counts something, mainly used as a debugging purpose
in Selection.each(DatumFunction)
method.
You may override the #takeIntoAccount(Element, Datum, int)
to change when the count is incremented.
Constructor and Description |
---|
CountFunction() |
public Void apply(com.google.gwt.dom.client.Element context, Value d, int index)
DatumFunction
Element
at the specified index
of the Selection
mapped to the given Datum
.
Note that if no datum is mapped to the element, Datum#isUndefined()
will return true.
apply
in interface DatumFunction<Void>
context
- the current element, may be irrelevant or null in some context.d
- the datumindex
- the index of the element in the selectionpublic int getCount()
public CountFunction reset()
Copyright © 2015 gwt-d3. All rights reserved.