TimeValue implements CellValue { public static TimeValue from(final Object o) throws FastOdsException { if (o instanceof Number) { final Number number = (Number) o; long l = number.longValue(); final boolean neg = l < 0; if (neg) { l = -l; } return new TimeValue(neg, 0, 0, 0, 0, 0, (double) l / 1000); } else if (o instanceof TimeValue) { return (TimeValue) o; } else { throw new FastOdsException("Can't cast " + o + " to Time"); } } TimeValue(final boolean neg, final long years, final long months, final long days,
                     final long hours, final long minutes, final double seconds); static TimeValue from(final Object o); @Override boolean equals(final Object o); @Override final int hashCode(); @Override void setToCell(final TableCell tableCell); @Override String toString();  }
@Test public void testFromTimeValue() throws FastOdsException { final TimeValue tv1 = TimeValue.from(123456L); final TimeValue tv2 = TimeValue.from(tv1); Assert.assertEquals(tv1, tv2); }
@Test(expected = FastOdsException.class) public void testFromString() throws FastOdsException { TimeValue.from(""); }