|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ejen.ext.Counter
Counter utility (instanciable).
Usage (XSL stylesheet) |
---|
<?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ... xmlns:cnt="org.ejen.ext.Counter" extension-element-prefixes="cnt ..." exclude-result-prefixes="cnt ..." version="1.0"> <xsl:output method="xml" encoding="iso-8859-1"/> <xsl:template match="ejen"> <xsl:variable name="cnt1" select="cnt: |
Constructor Summary | |
Counter()
Constructs a new Counter object with initial value set to 1. |
|
Counter(Counter cnt)
Constructs a new Counter object whose initial value is the current value of the cnt parameter. |
|
Counter(int value)
Constructs a new Counter object whose initial value is the value parameter. |
Method Summary | |
void |
incr(XSLProcessorContext context,
ElemExtensionCall elem)
Increments the value of this Counter by 'step'. |
int |
incrAndRead(ExpressionContext context)
Increments the value of this Counter by 1, then returns it. |
int |
incrAndRead(ExpressionContext context,
int step)
Increments the value of this Counter by 'step', then returns it. |
int |
incrAndRead(XSLProcessorContext context,
ElemExtensionCall elem)
Increments the value of this Counter, then returns it. |
int |
read(ExpressionContext context)
Returns the current value of this Counter. |
int |
read(XSLProcessorContext context,
ElemExtensionCall elem)
Returns the current value of this Counter. |
int |
readAndIncr(ExpressionContext context)
Returns the value of this Counter, then increments it by 1. |
int |
readAndIncr(ExpressionContext context,
int step)
Returns the value of this Counter, then increments it by 'step'. |
int |
readAndIncr(XSLProcessorContext context,
ElemExtensionCall elem)
Returns the value of this Counter, then increments it. |
void |
reset(XSLProcessorContext context,
ElemExtensionCall elem)
Resets the Counter value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Counter()
<xsl:variable name="cnt1" select="cnt:new()"/> |
public Counter(int value)
<xsl:variable name="cnt2" select="cnt:new(0)"/> |
value
- initial value of this Counter.public Counter(Counter cnt)
<xsl:variable name="cnt3" select="cnt:new($cnt1)"/> |
cnt
- a Counter object.Method Detail |
public void reset(XSLProcessorContext context, ElemExtensionCall elem)
<cnt:reset [value="0"] [instance="$cnt2"]/> |
DEFAULT_INITIAL_VALUE
).
context
- automatically passed by the xalan extension mechanism.elem
- automatically passed by the xalan extension mechanism.
WrappedRuntimeException
- with a XSL Exception
or a java.lang.NumberFormatException.public void incr(XSLProcessorContext context, ElemExtensionCall elem)
<cnt:incr [step="-2"] [instance="$cnt2"]/> |
context
- automatically passed by the xalan extension mechanism.elem
- automatically passed by the xalan extension mechanism.
WrappedRuntimeException
- with a XSL Exception
or a java.lang.NumberFormatException.public int read(XSLProcessorContext context, ElemExtensionCall elem)
<cnt:read [instance="$cnt2"]/> |
context
- automatically passed by the xalan extension mechanism.elem
- automatically passed by the xalan extension mechanism.
public int read(ExpressionContext context)
<xsl:param name="i" select="cnt:read([$cnt2])"/> |
context
- automatically passed by the xalan extension mechanism.
public int incrAndRead(XSLProcessorContext context, ElemExtensionCall elem)
<cnt:incrAndRead [step="-2"] [instance="$cnt2"]/> |
context
- automatically passed by the xalan extension mechanism.elem
- automatically passed by the xalan extension mechanism.
WrappedRuntimeException
- with a XSL Exception
or a java.lang.NumberFormatException.public int incrAndRead(ExpressionContext context)
<xsl:param name="i" select="cnt:incrAndRead([$cnt2])"/> |
context
- automatically passed by the xalan extension mechanism.
public int incrAndRead(ExpressionContext context, int step)
<xsl:param name="i" select="cnt:incrAndRead([$cnt2,] -2)"/> |
context
- automatically passed by the xalan extension mechanism.step
- incrementation step.
public int readAndIncr(XSLProcessorContext context, ElemExtensionCall elem)
<cnt:readAndIncr [step="-2"] [instance="$cnt2"]/> |
context
- automatically passed by the xalan extension mechanism.elem
- automatically passed by the xalan extension mechanism.
WrappedRuntimeException
- with a XSL Exception
or a java.lang.NumberFormatException.public int readAndIncr(ExpressionContext context)
<xsl:param name="i" select="cnt:readAndIncr([$cnt2])"/> |
context
- automatically passed by the xalan extension mechanism.
public int readAndIncr(ExpressionContext context, int step)
<xsl:param name="i" select="cnt:readAndIncr([$cnt2,] -2)"/> |
context
- automatically passed by the xalan extension mechanism.step
- incrementation step.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |