Package com.sun.speech.freetts.util

# Class SegmentRelationUtils

java.lang.Object
com.sun.speech.freetts.util.SegmentRelationUtils

public class SegmentRelationUtils extends Object
Provides a set of utilities for the SegmentRelation. A SegmentRelation is a Relation, but has features specific to Segments.

## Constructor Summary

Constructors
Constructor
Description
`SegmentRelationUtils()`

## Method Summary

Modifier and Type
Method
Description
`static Item`
`findFromEnd(Relation segmentRelation, float time)`
Starting from the end of the given Segment Relation, go backwards to find the Item that corresponds to the given time.
`static Item`
`findFromFront(Relation segmentRelation, float time)`
Starting from the front of the given Segment Relation, finds the Item that corresponds to the given time.
`static Item`
`getItem(Relation segmentRelation, float time)`
Returns the Item in the Segment Relation that corresponds to the given time.
`static float`
`getSegmentEnd(Item segment)`
Returns the value of the feature `end` of the given Segment Item.

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

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

## Constructor Details

### SegmentRelationUtils

public SegmentRelationUtils()

## Method Details

### getItem

public static Item getItem(Relation segmentRelation, float time)
Returns the Item in the Segment Relation that corresponds to the given time.

Parameters:
  `segmentRelation` - the segmentRelation of interest
  `time` - the time

### getSegmentEnd

public static float getSegmentEnd(Item segment)
Returns the value of the feature `end` of the given Segment Item.

Parameters:
  `segment` - the Segment Item
Returns:
  the `end` feature of the Segment

### findFromFront

public static Item findFromFront(Relation segmentRelation, float time)
Starting from the front of the given Segment Relation, finds the Item that corresponds to the given time.

Parameters:
  `segmentRelation` - the Segment Relation to search
  `time` - the time of the Segment Item
Returns:
  the Segment Item

### findFromEnd

public static Item findFromEnd(Relation segmentRelation, float time)
Starting from the end of the given Segment Relation, go backwards to find the Item that corresponds to the given time.

Parameters:
  `segmentRelation` - the Segment Relation to search
  `time` - the time of the Segment Item
Returns:
  the Segment Item