TimeRangeCollection實用程式類抽象了有序集合TimeRange規範的概念,並提供了將自身轉換為元資料實例的服務。
public final class TimeRangeCollection {
// default constructor method
public TimeRangeCollection(Type type) {...}
// the list of timerange specifications provided at construction time
public TimeRangeCollection(Type type, List<TimeRange> timeRanges) {...}
// timerange specs can also be added later
public void addTimeRange(TimeRange timeRange) {...}
// translate the set of timerange specs into a Metadata instance
public Metadata toMetadata(Metadata options) {...}
}
type
參數是建構函式方法簽名中的第一個位置參數,是TimeRangeCollection#Type
列舉的例項。 這是TimeRangeCollection
類的一部分。 此枚舉當前定義的值為MARK_RANGES
、 DELETE_RANGES
和REPLACE_RANGES
。 您可以使用這三種類型建立TimeRangeCollection
對象。