Methods Summary |
---|
public void | addToEnd(java.lang.Object[] by)Adds the input value to this Segment's end value.
throw new IllegalArgumentException();
|
public void | collapse(Segment seg, Animation anim)Collapses this segment with the one passed as a parameter.
Note that if the input segment is not of the same class
as this one, an IllegalArgumentException is thrown. The
method also throws an exception if the input segment's
end does not have the same number of components as this
segment's end.
After this method is called, this segment's end value
is the one of the input seg parameter.
StringSegment mseg = (StringSegment) seg;
if (mseg.end.length != end.length) {
throw new IllegalArgumentException();
}
end = mseg.end;
|
public java.lang.String[] | compute(float p)Computes an interpolated value for the given penetration in the
segment.
if (p == 1) {
return end;
} else {
return start;
}
|
public java.lang.Object[] | getEnd()
return end;
|
public final float | getLength()Computes this segment's length. This is always the value
'1' for a string segment.
return 1;
|
public java.lang.Object[] | getStart()
return start;
|
public final void | initialize()Should be called after the segment's configuration is complete
to give the segment's implementation a chance to initialize
internal data and cache values.
|
public boolean | isAdditive()
return false;
|
public void | setStart(java.lang.Object[] newStart)Sets the start value.
start = (String[]) newStart;
|
public void | setZeroStart()Sets the start value to its notion of 'zero'.
For a StringSegment, a 'zero' start means empty strings
on all components.
for (int i = 0; i < start.length; i++) {
start[i] = "";
}
|
public java.lang.String | toString()Debug helper.
StringBuffer sb = new StringBuffer();
sb.append("StringSegment[");
if (start == null) {
sb.append("null");
} else {
sb.append("start[" + start.length + "] : {");
for (int ci = 0; ci < start.length; ci++) {
sb.append("\"" + start[ci] + "\"");
if (ci < start.length - 1) {
sb.append(",");
}
}
sb.append("}");
}
if (end == null) {
sb.append(" null");
} else {
sb.append(" end[" + end.length + "] : {");
for (int ci = 0; ci < end.length; ci++) {
sb.append("\"" + end[ci] + "\"");
if (ci < end.length - 1) {
sb.append(",");
}
}
sb.append("}");
}
return sb.toString();
|