001/**
002 * Portions Copyright 2001 Sun Microsystems, Inc.
003 * Portions Copyright 1999-2001 Language Technologies Institute, 
004 * Carnegie Mellon University.
005 * All Rights Reserved.  Use is subject to license terms.
006 * 
007 * See the file "license.terms" for information on usage and
008 * redistribution of this file, and for a DISCLAIMER OF ALL 
009 * WARRANTIES.
010 */
011package com.sun.speech.freetts;
012
013
014import com.sun.speech.freetts.relp.Sample;      
015
016/**
017 * Defines a generic interface to a Unit. 
018 *
019 */
020public interface Unit {
021    
022    /**
023     * Returns the name of this Unit.
024     *
025     * @return the name of this Unit
026     */
027    public String getName();
028
029    /**
030     * Returns the size of this unit.
031     *
032     * @return the size of this unit
033     */
034    public int getSize();
035
036    /**
037     * Retrieves the nearest sample.
038     *
039     * @param index the ideal index
040     *
041     * @return the nearest Sample
042     */
043    public Sample getNearestSample(float index);
044
045
046    /**
047     * Dumps this unit.
048     */
049    public void dump(); 
050}