Labels extends AlignmentData { public int getLabelIndexAtTime(double time) { if (items == null) { return -1; } for (int i = 0; i < items.length; i++) { if (items[i].time >= time) { return i; } } return -1; } Labels(Label[] items);  Labels(String[] lines);  Labels(String[] lines, int minItemsPerLine);  Labels(Labels e);  Labels(InputStream in);  Labels(String labelFile);  Labels(Document acoustparams); String[] getLabelSymbols(); void print(); @Override String toString(); int getLabelIndexAtTime(double time); @Override boolean equals(Object other); @Override int hashCode(); public Label[] items; }
@Test public void indexFromTime() { Labels l = new Labels(createTestLabels()); assertEquals(2, l.getLabelIndexAtTime(0.019)); }