FileDocCategorySizeDatePackage
TimeInstance.javaAPI DocphoneME MR2 API (J2ME)3534Wed May 02 18:00:36 BST 2007com.sun.perseus.model

TimeInstance

public class TimeInstance extends Object
Base class for representing time instances in a TimedElementSupport's begin and end instance times lists.
version
$Id: TimeInstance.java,v 1.2 2006/04/21 06:39:25 st125089 Exp $

Fields Summary
TimedElementSupport
timedElement
The associated TimeElement
boolean
clearOnReset
If true, this TimeInstance should be cleared from the TimedElementSupport intance list on reset.
Time
time
This instance's time.
boolean
isBegin
True if this instance is in the begin instance list. Fals if it is part of an end instance list.
Constructors Summary
public TimeInstance(TimedElementSupport timedElement, Time time, boolean clearOnReset, boolean isBegin)
Builds an instance time for the input TimedElementSupport and time. The constructor will insert the Instance automatically into the TimedElementSupport corresponding instance list.

param
timedElement the associated TimedElementSupport
param
time the instance time value.
param
clearOnReset defines whether or not this instance should be cleared from instance times lists on reset.
param
isBegin true if this object is part of the timedElement's begin instance list.
throws
NullPointerException if time or timedElement is null

        if (timedElement == null || time == null) {
            throw new NullPointerException();
        }
        
        this.timedElement = timedElement;
        this.time = time;
        this.clearOnReset = clearOnReset;
        this.isBegin = isBegin;

        timedElement.addTimeInstance(this);
    
Methods Summary
voidsetTime(Time newTime)
Updates this instance time. This notifies the associated TimedElementSupport through its instanceUpdate method.

param
newTime the new instance time. Should not be null.
throws
NullPointerException if newTime is null.

        if (newTime == null) {
            throw new NullPointerException();
        }

        time = newTime;
        timedElement.onTimeInstanceUpdate(this);