001 package log; 002 003 import java.io.Serializable; 004 import java.util.Date; 005 006 /** 007 * An entry in the log file. 008 * 009 * <p>A LogEntry does as a minimum always indicate the log time and log date.</p> 010 * 011 * <p>LogEnry is <i>abstract</i> to indicate it does not yet do anything sensible.</p> 012 * 013 * @see Loggable 014 * @see Log 015 * 016 * @author Steffen Zschaler 017 * @version 1.0 018 * @since v1.0 019 */ 020 public abstract class LogEntry extends Object implements Serializable { 021 022 /** 023 * Date and time of logging. 024 * 025 * @serial 026 */ 027 private Date m_dtLogDate = null; 028 { 029 m_dtLogDate = new Date(); 030 } 031 032 /** 033 * Return a String describing the object. 034 * 035 * @return a String describing the object. 036 * 037 * @override Always This is the method used by the {@link log.swing.DefaultLogEntryTED} to render the log 038 * entry's contents. 039 */ 040 public String toString() { 041 return "Object logged: " + getLogDate(); 042 } 043 044 /** 045 * Returns the date this entry was logged. 046 * 047 * @return The logging date and time. 048 * 049 * @override Never 050 */ 051 public Date getLogDate() { 052 return m_dtLogDate; 053 } 054 }