FileDocCategorySizeDatePackage
RepeatCondition.javaAPI DocphoneME MR2 API (J2ME)3665Wed May 02 18:00:34 BST 2007com.sun.perseus.model

RepeatCondition

public final class RepeatCondition extends EventBaseCondition
A RepeatCondition generates a TimeInstance everytime the associated repeat event occurs with the expected repeatCount value.
version
$Id: RepeatCondition.java,v 1.3 2006/06/29 10:47:34 ln156897 Exp $

Fields Summary
int
repeatCount
The repeatCount which triggers the condition.
Constructors Summary
public RepeatCondition(TimedElementSupport timedElement, boolean isBegin, String eventBaseId, long offset, int repeatCount)

param
timedElement the associated TimedElementSupport. Should not be null.
param
isBegin defines whether this condition is for a begin list.
param
eventBaseId the id of the element which generates events this listener listens to. should not be null.
param
offset offset from the sync base. This means that time instances synchronized on the syncBase begin or end time are offset by this amount.
param
repeatCount only when the eventBase generates a repeat event with this repeatCount will a TimeInstance be generated.

        super(timedElement, 
              isBegin, 
              eventBaseId,
              TimedElementSupport.REPEAT_EVENT_TYPE, 
              offset);

        this.repeatCount = repeatCount;
    
Methods Summary
public voidhandleEvent(org.w3c.dom.events.Event evt)
Implementation of the EventListener interface. This is a simple filtered version of the handleEvent implementation in EventBaseCondition.

param
evt the event that occured

        if (((ModelEvent) evt).repeatCount == repeatCount) {
            super.handleEvent(evt);
        }
    
protected java.lang.StringtoStringTrait()
Converts this RepeatCondition to a String trait.

return
a string describing this TimeCondition

        StringBuffer sb = new StringBuffer();

        sb.append(eventBaseId);
        sb.append(".repeat(");
        sb.append(repeatCount);
        sb.append(')");

        if (offset != 0) {
            if (offset > 0) {
                sb.append('+");
            } 
            sb.append(offset / 1000f);
            sb.append('s");
        }

        return sb.toString();