public final class FileTime extends Object implements Comparable<FileTime>
Instances of this class are immutable.
|Modifier and Type||Method and Description|
Compares the value of two
Computes a hash code for this file time.
Returns the value in milliseconds.
Returns the string representation of this
public int compareTo(FileTime other)
FileTimeobjects for order.
other- the other
FileTimeto be compared
FileTimeis equal to
other, a value less than 0 if this
FileTimerepresents a time that is before
other, and a value greater than 0 if this
FileTimerepresents a time that is after
public boolean equals(Object obj)
FileTimefor equality with the given object.
The result is
true if and only if the argument is not
null and is a
FileTime that represents the same time. This
method satisfies the general contract of the
public static FileTime fromMillis(long value)
FileTimerepresenting the given value in milliseconds.
value- the value, in milliseconds, since the epoch (1970-01-01T00:00:00Z); can be negative
FileTimerepresenting the given value
public int hashCode()
The hash code is based upon the value represented, and satisfies the
general contract of the
public long toMillis()
Conversion from a coarser granularity that would numerically overflow
Long.MIN_VALUE if negative or
public String toString()
FileTime. The string is returned in the ISO 8601 format:
[.s+]" represents a dot followed by one of more digits for the decimal fraction of a second. It is only present when the decimal fraction of a second is not zero. For example,
FileTime is primarily intended to represent the value of a
file's time stamp. Where used to represent extreme values, where
the year is less than "
0001" or greater than "
this method deviates from ISO 8601 in the same manner as the
language. That is, the year may be expanded to more than four digits
and may be negative-signed. If more than four digits then leading zeros
are not present. The year before "
0001" is "
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.