Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class javax.speech.EngineList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--javax.speech.EngineList

public class EngineList
extends Vector
EngineList is a container for a set of EngineModeDesc objects. An EngineList is used in the selection of speech engines in conjuction with the methods of the Central class. It provides convenience methods for the purpose of testing and manipulating the EngineModeDesc objects it contains.

An EngineList object is typically obtained through the availableSynthesizers or availableRecognizers methods of the javax.speech.Central class. The orderByMatch, anyMatch, requireMatch and rejectMatch methods are used to prune the list to find the best match given multiple criteria.

See Also:
EngineModeDesc, Central, availableRecognizers, availableSynthesizers, Serialized Form

Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Method Summary
boolean anyMatch(EngineModeDesc require)
          Return true if one or more EngineModeDesc in the EngineList match the required properties.
void orderByMatch(EngineModeDesc require)
          Order the list so that elements matching the required features are at the head of the list, and others are at the end.
void rejectMatch(EngineModeDesc reject)
          Remove EngineModeDesc entries from the list that do match require.
void requireMatch(EngineModeDesc require)
          Remove EngineModeDesc entries from the list that do not match require.
 
Methods inherited from class java.util.Vector
addAll, addAll, addElement, add, add, capacity, clear, clone, containsAll, contains, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAllElements, removeAll, removeElementAt, removeElement, remove, remove, retainAll, setElementAt, setSize, set, size, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
add, add, addAll, equals, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList
 
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Method Detail

anyMatch

public boolean anyMatch(EngineModeDesc require)
Return true if one or more EngineModeDesc in the EngineList match the required properties. The require object is tested with the match method of each EngineModeDesc in the list. If any match call returns true then this method returns true.

anyMatch is often used to test whether pruning a list (with requireMatch or rejectMatch) would leave the list empty.

See Also:
match

requireMatch

public void requireMatch(EngineModeDesc require)
Remove EngineModeDesc entries from the list that do not match require. The match method for each EngineModeDesc in the list is called: if it returns false it is removed from the list. Example:
   // Remove engine mode descriptors from a list if they
   // don't support US English.
   EngineList list = ....;
   EngineModeDesc desc = new EngineModeDesc(Locale.US);
   list.requireMatch(desc);
 
See Also:
match

rejectMatch

public void rejectMatch(EngineModeDesc reject)
Remove EngineModeDesc entries from the list that do match require. The match method for each EngineModeDesc in the list is called: if it returns true it is removed from the list. Example:
   // Remove engine mode descriptors if they support US English.
   EngineList list = ....;
   EngineModeDesc desc = new EngineModeDesc(Locale.US);
   list.rejectMatch(desc);
 
See Also:
match

orderByMatch

public void orderByMatch(EngineModeDesc require)
Order the list so that elements matching the required features are at the head of the list, and others are at the end. Within categories, the original order of the list is preserved. Example:
   // Put running engines at the head of the list.
   EngineList list = ....;
   EngineModeDesc desc = new EngineModeDesc();
   desc.setRunning(true);
   list.orderByMatch(desc);
 

Overview | Package | Class | Tree | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

JavaTM Speech API
Copyright 1997-1998 Sun Microsystems, Inc. All rights reserved
Send comments to javaspeech-comments@sun.com