Methods Summary |
---|
public void | addOffset(TypedTime offset)Adds an starting time offset.
offsets.addElement(offset);
|
public java.lang.Object | clone()Copies the current instance.
RepeatField retval = new RepeatField();
if (this.repeatInterval != null)
retval.repeatInterval =
(TypedTime) this.repeatInterval.clone();
if (this.activeDuration != null)
retval.activeDuration =
(TypedTime)this.activeDuration.clone();
retval.offsets =
(SDPObjectList) this.offsets.clone();
return retval;
|
public java.lang.String | encode()Gets an encoded string representation of the object.
String retval = REPEAT_FIELD + repeatInterval.encode()
+ Separators.SP +
activeDuration.encode();
for (int i = 0; i < offsets.size(); i++) {
TypedTime off = (TypedTime) offsets.elementAt(i);
retval += Separators.SP + off.encode();
}
retval += Separators.NEWLINE;
return retval;
|
public int | getActiveDuration()Returns the "active duration" in seconds.
if (activeDuration == null)
return -1;
else {
return activeDuration.getTime();
}
|
public int[] | getOffsetArray()Returns the list of offsets. These are relative to the start-time given
in the Time object (t=field) with which this RepeatTime is associated.
int[] result = new int[offsets.size()];
for (int i = 0; i < offsets.size(); i++) {
TypedTime typedTime = (TypedTime)offsets.elementAt(i);
result[i] = typedTime.getTime();
}
return result;
|
public java.util.Vector | getOffsets()Gets a vector of starting time offsets. return offsets;
|
public int | getRepeatInterval()Returns the "repeat interval" in seconds.
if (repeatInterval == null)
return -1;
else {
return repeatInterval.getTime();
}
|
public boolean | getTypedTime()Returns whether the field will be output as a typed time or a
integer value.
Typed time is formatted as an integer followed by a unit
character. The unit indicates an
appropriate multiplier for the integer.
The following unit types are allowed.
d - days (86400 seconds)
h - hours (3600 seconds)
m - minutes (60 seconds)
s - seconds ( 1 seconds)
return true;
|
public void | setActiveDuration(int activeDuration)Sets the "active duration" in seconds.
if (activeDuration < 0)
throw new SdpException("The active Duration is < 0");
else {
if (this.activeDuration == null)
this.activeDuration = new TypedTime();
this.activeDuration.setTime(activeDuration);
}
|
public void | setActiveDuration(TypedTime duration)Sets the duration.
activeDuration = duration;
|
public void | setOffsetArray(int[] offsets)Sets the list of offsets. These are relative to the start-time
given in the Time object (t=field) with which this RepeatTime
is associated.
for (int i = 0; i < offsets.length; i++) {
TypedTime typedTime = new TypedTime();
typedTime.setTime(offsets[i]);
addOffset(typedTime);
}
|
public void | setRepeatInterval(TypedTime interval)Sets the repeat interval.
repeatInterval = interval;
|
public void | setRepeatInterval(int repeatInterval)Sets the repeat interval in seconds.
if (repeatInterval < 0)
throw new SdpException("The repeat interval is < 0");
else {
if (this.repeatInterval == null)
this.repeatInterval = new TypedTime();
this.repeatInterval.setTime(repeatInterval);
}
|
public void | setTypedTime(boolean typedTime)Sets whether the field will be output as a typed time or a integer value.
Typed time is formatted as an integer followed by a unit
character. The unit indicates an
appropriate multiplier for the integer.
The following unit types are allowed.
d - days (86400 seconds)
h - hours (3600 seconds)
m - minutes (60 seconds)
s - seconds ( 1 seconds)
|