Acquisition
Class StandardFileDate

java.lang.Object
  extended by Acquisition.StandardFileDate
All Implemented Interfaces:
FileDate

public class StandardFileDate
extends java.lang.Object
implements FileDate

Implementation of FileDate to read the standard file date format that I use in Logger. I'd have thought that others would be keen to add alternatives, but no one has !

Author:
Doug Gillespie

Constructor Summary
StandardFileDate()
           
 
Method Summary
 boolean doSettings()
           
 java.lang.String getDescription()
           
 java.lang.String getName()
           
 long getTimeFromFile(java.io.File file)
          Get a time in milliseconds from a file date.
 boolean hasSettings()
           
private  java.util.Date tryParseDate(java.lang.String numstr)
          For each digit substring in the file name (i.e., substring starting with a digit that does not have a digit preceding), try a bunch of format strings and see if any of them match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardFileDate

public StandardFileDate()
Method Detail

doSettings

public boolean doSettings()
Specified by:
doSettings in interface FileDate

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface FileDate

getName

public java.lang.String getName()
Specified by:
getName in interface FileDate

getTimeFromFile

public long getTimeFromFile(java.io.File file)
Description copied from interface: FileDate
Get a time in milliseconds from a file date.

Specified by:
getTimeFromFile in interface FileDate
Parameters:
file - file
Returns:
time in milliseconds or 0 if can't work it out.

tryParseDate

private java.util.Date tryParseDate(java.lang.String numstr)
For each digit substring in the file name (i.e., substring starting with a digit that does not have a digit preceding), try a bunch of format strings and see if any of them match. If there is a match, return the corresponding Date, else return null.


hasSettings

public boolean hasSettings()
Specified by:
hasSettings in interface FileDate