Package com.sun.speech.freetts

# Class PathExtractorImpl

java.lang.Object
com.sun.speech.freetts.PathExtractorImpl

All Implemented Interfaces:
  `PathExtractor`

public class PathExtractorImpl extends Object implements PathExtractor
Interface that Manages a feature or item path. Allows navigation to the corresponding feature or item. This class in controlled by the following system properties:

       com.sun.speech.freetts.interpretCartPaths - default false
       com.sun.speech.freetts.lazyCartCompile - default true

com.sun.speech.freetts.interpretCartPaths Instances of this class will optionally pre-compile the paths. Pre-compiling paths reduces the processing time and objects needed to extract a feature or an item based upon a path.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`INTERPRET_PATHS_PROPERTY`
If this system property is set to true, paths will not be compiled.
`static final String`
`LAZY_COMPILE_PROPERTY`
If this system property is set to true, CART feature/item paths will only be compiled as needed.

## Constructor Summary

Constructors
Constructor
Description
`PathExtractorImpl(String pathAndFeature, boolean wantFeature)`
Creates a path for the given feature.

## Method Summary

Modifier and Type
Method
Description
`Object`
`findFeature(Item item)`
Finds the feature associated with this Path.
`Item`
`findItem(Item item)`
Finds the item associated with this Path.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### INTERPRET_PATHS_PROPERTY

public static final String INTERPRET_PATHS_PROPERTY
If this system property is set to true, paths will not be compiled.

See Also:
  - Constant Field Values

### LAZY_COMPILE_PROPERTY

public static final String LAZY_COMPILE_PROPERTY
If this system property is set to true, CART feature/item paths will only be compiled as needed.

See Also:
  - Constant Field Values

## Constructor Details

### PathExtractorImpl

public PathExtractorImpl(String pathAndFeature, boolean wantFeature)
Creates a path for the given feature.

## Method Details

### findItem

public Item findItem(Item item)
Finds the item associated with this Path.

Specified by:
  `findItem` in interface `PathExtractor`
Parameters:
  `item` - the item to start at
Returns:
  the item associated with the path or null

### findFeature

public Object findFeature(Item item)
Finds the feature associated with this Path.

Specified by:
  `findFeature` in interface `PathExtractor`
Parameters:
  `item` - the item to start at
Returns:
  the feature associated or "0" if the feature was not found.

### toString

public String toString()

Overrides:
  `toString` in class `Object`