1 package com.openedit.modules.admin.filemanager; 2 3 import java.text.SimpleDateFormat ; 4 import java.util.Date ; 5 6 import com.openedit.page.Page; 7 import com.openedit.users.User; 8 9 public class TimeCopy implements Comparable 10 { 11 protected Date fieldDate; 12 protected Page fieldTo; 13 protected Page fieldFrom; 14 protected User fieldUser; 15 protected String fieldDescription; 16 protected SimpleDateFormat fieldFormat; 17 18 public Date getDate() 19 { 20 return fieldDate; 21 } 22 public void setDate(Date inDate) 23 { 24 fieldDate = inDate; 25 } 26 public String getDescription() 27 { 28 return fieldDescription; 29 } 30 public void setDescription(String inDescription) 31 { 32 fieldDescription = inDescription; 33 } 34 public Page getFrom() 35 { 36 return fieldFrom; 37 } 38 public void setFrom(Page inFrom) 39 { 40 fieldFrom = inFrom; 41 } 42 public Page getTo() 43 { 44 return fieldTo; 45 } 46 public void setTo(Page inTo) 47 { 48 fieldTo = inTo; 49 } 50 public User getUser() 51 { 52 return fieldUser; 53 } 54 public void setUser(User inUser) 55 { 56 fieldUser = inUser; 57 } 58 public int compareTo(Object inObject) 59 { 60 TimeCopy copy = (TimeCopy) inObject; 61 return copy.getDate().compareTo(getDate()); 62 } 63 public SimpleDateFormat getFormat() 64 { 65 return fieldFormat; 66 } 67 public void setFormat(SimpleDateFormat inFormat) 68 { 69 fieldFormat = inFormat; 70 } 71 72 public String getFormattedDate() 73 { 74 return getFormat().format(getDate()); 75 } 76 } 77 | Popular Tags |