01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.perseus.model;
28:
29: /**
30: * @version $Id: RefValues.java,v 1.2 2006/04/21 06:38:26 st125089 Exp $
31: */
32: public interface RefValues {
33: /**
34: * @param i requested segment index.
35: * @return Segment at index i
36: */
37: Segment getSegment(int i);
38:
39: /**
40: * @return the number of segments in refValues
41: */
42: int getSegments();
43:
44: /**
45: * @return the number of components in the refValues
46: */
47: int getComponents();
48:
49: /**
50: * Computes the value for the input interpolated values.
51: * There should be as many entries in the return array as there
52: * are components in the RefValues.
53: *
54: * @param si the current segment index
55: * @param p the current penetration
56: */
57: Object[] compute(int si, float p);
58:
59: /**
60: * Adds a new time segment so accomodate for discreet behavior.
61: * If there is only one segment for discreet animations, the
62: * last value is never shown. To accomodate for that, this
63: * method should add a segment to the RefValues so that the
64: * last animation value is shown during the last value interval
65: * of a discreet animation.
66: */
67: void makeDiscrete();
68:
69: /**
70: * Computes the length of the RefValues. This is meant for paced timing
71: * computation.
72: *
73: * @return the total length of refValues.
74: */
75: float getLength();
76:
77: /**
78: * Computes the length of segment at index si.
79: *
80: * @param si the segment index.
81: * @param ci the component index.
82: */
83: float getLength(final int si);
84:
85: /**
86: * Should be called after the RefValue's configuration is complete
87: * to give the implementation a chance to initialize
88: * internal data and cache values.
89: */
90: void initialize();
91:
92: }
|