Top Description Fields Constructors Methods
de.undercouch.citeproc.csl.internal

public Class CountingVariableListener

extends Object
implements VariableListener
Class Inheritance
All Implemented Interfaces
de.undercouch.citeproc.csl.internal.VariableListener
Imports
de.undercouch.citeproc.csl.CSLDate, .CSLName

A variable listener that counts the number of variables fetched from the RenderContext.
Author
Michel Kraemer

Field Summary

Modifier and TypeField and Description
private int
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the number of fetched variables
getCalled
()

Get the number of times a variable was fetched from the context

public int

Returns:

the number of empty variables fetched from the context
getEmpty
()

Get the number of times an empty variable was fetched from the context.

public void
onFetchDateVariable(String name, CSLDate value)

Implements de.undercouch.citeproc.csl.internal.VariableListener.onFetchDateVariable.

Will be called when a date variable is fetched from the context

public void
onFetchNameVariable(String name, CSLName[] value)

Implements de.undercouch.citeproc.csl.internal.VariableListener.onFetchNameVariable.

Will be called when a name variable is fetched from the context

public void
onFetchStringVariable(String name, String value)

Implements de.undercouch.citeproc.csl.internal.VariableListener.onFetchStringVariable.

Will be called when a string variable is fetched from the context

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

calledback to summary
private int called
emptyback to summary
private int empty

Constructor Detail

CountingVariableListenerback to summary
public CountingVariableListener()

Method Detail

getCalledback to summary
public int getCalled()

Get the number of times a variable was fetched from the context

Returns:int

the number of fetched variables

getEmptyback to summary
public int getEmpty()

Get the number of times an empty variable was fetched from the context. This value is always lower than or equal to the one returned by getCalled().

Returns:int

the number of empty variables fetched from the context

onFetchDateVariableback to summary
public void onFetchDateVariable(String name, CSLDate value)

Implements de.undercouch.citeproc.csl.internal.VariableListener.onFetchDateVariable.

Doc from de.undercouch.citeproc.csl.internal.VariableListener.onFetchDateVariable.

Will be called when a date variable is fetched from the context

Annotations
@Override
onFetchNameVariableback to summary
public void onFetchNameVariable(String name, CSLName[] value)

Implements de.undercouch.citeproc.csl.internal.VariableListener.onFetchNameVariable.

Doc from de.undercouch.citeproc.csl.internal.VariableListener.onFetchNameVariable.

Will be called when a name variable is fetched from the context

Annotations
@Override
onFetchStringVariableback to summary
public void onFetchStringVariable(String name, String value)

Implements de.undercouch.citeproc.csl.internal.VariableListener.onFetchStringVariable.

Doc from de.undercouch.citeproc.csl.internal.VariableListener.onFetchStringVariable.

Will be called when a string variable is fetched from the context

Annotations
@Override