} else { beginPointTime = ((PointInTime) keyframes.get(0)); endPointTime = ((PointInTime) keyframes.get(0));
    private void setBeginAndEnd() {        float minTime = getMinTime();        float maxTime = getMaxTime();                if(getSpeed() > 0){            if(curTime >= maxTime){                if(getRepeatType() == RT_WRAP){                    int[] is = findIndicesBeforeAfter(minTime);                    int beginIndex = is[0];                    int endIndex = is[1];                    beginPointTime = ((PointInTime) keyframes.get(beginIndex));                    endPointTime = ((PointInTime) keyframes.get(endIndex));                    float overshoot = curTime - maxTime;                    curTime = minTime + overshoot;                } else if (getRepeatType() == RT_CLAMP){                    int[] is = findIndicesBeforeAfter(maxTime);                    int beginIndex = is[1];                    beginPointTime = ((PointInTime) keyframes.get(beginIndex));                    endPointTime = beginPointTime;                    curTime = maxTime;                } else if(getRepeatType() == RT_CYCLE){                    int[] is = findIndicesBeforeAfter(maxTime);                    int beginIndex = is[0];                    int endIndex = is[1];                    beginPointTime = ((PointInTime) keyframes.get(beginIndex));                    endPointTime = ((PointInTime) keyframes.get(endIndex));                    float overshoot = curTime - maxTime;                    curTime = maxTime - overshoot;                    setSpeed(- getSpeed());                }            } else if(curTime <= minTime){                int[] is = findIndicesBeforeAfter(minTime);                int beginIndex = is[0];                int endIndex = is[1];                beginPointTime = ((PointInTime) keyframes.get(beginIndex));                endPointTime = ((PointInTime) keyframes.get(endIndex));                curTime = minTime;            } else{//curTime is inside minTime and maxTime                int[] is = findIndicesBeforeAfter(curTime);                int beginIndex = is[0];                int endIndex = is[1];                beginPointTime = ((PointInTime) keyframes.get(beginIndex));                endPointTime = ((PointInTime) keyframes.get(endIndex));            }        } else if(getSpeed() < 0){            if(curTime <= minTime){                if(getRepeatType() == RT_WRAP){                    int[] is = findIndicesBeforeAfter(maxTime);                    int beginIndex = is[1];                    int endIndex = is[0];                    beginPointTime = ((PointInTime) keyframes.get(beginIndex));                    endPointTime = ((PointInTime) keyframes.get(endIndex));                    float overshoot = minTime - curTime;                    curTime = maxTime - overshoot;                } else if (getRepeatType() == RT_CLAMP){                    int[] is = findIndicesBeforeAfter(minTime);                    int beginIndex = is[1];                    beginPointTime = ((PointInTime) keyframes.get(beginIndex));                    endPointTime = beginPointTime;                    curTime = minTime;                } else if(getRepeatType() == RT_CYCLE){                    int[] is = findIndicesBeforeAfter(minTime);                    int beginIndex = is[1];                    int endIndex = is[0];                    beginPointTime = ((PointInTime) keyframes.get(beginIndex));                    endPointTime = ((PointInTime) keyframes.get(endIndex));                    float overshoot = minTime - curTime;                    curTime = minTime + overshoot;                    setSpeed(- getSpeed());                }            } else if(curTime >= maxTime){                int[] is = findIndicesBeforeAfter(maxTime);                int beginIndex = is[1];                int endIndex = is[0];                beginPointTime = ((PointInTime) keyframes.get(beginIndex));                endPointTime = ((PointInTime) keyframes.get(endIndex));                curTime = maxTime;            } else{//curTime is inside minTime and maxTime                int[] is = findIndicesBeforeAfter(curTime);                int beginIndex = is[1];                int endIndex = is[0];                beginPointTime = ((PointInTime) keyframes.get(beginIndex));                endPointTime = ((PointInTime) keyframes.get(endIndex));            }        }    }