1 package org.apache.velocity.demo.om; 2 3 18 19 import java.util.*; 21 22 29 public class Message 30 { 31 private Integer id; 32 private String subject; 33 private String name; 34 private String email; 35 private String contents; 36 private Date submitted; 37 private Vector replies = null; 38 39 44 public Message() 45 { 46 submitted = new Date(); 47 replies = new Vector(); 48 } 49 50 53 public void setId( Integer index ) 54 { 55 this.id=index; 56 } 57 58 62 public String getId() 63 { 64 return id.toString(); 65 } 66 67 72 public Vector getReplies() 73 { 74 return replies; 75 } 76 77 81 public void addReply( Message m ) 82 { 83 replies.addElement( m ); 84 } 85 86 89 public int numberOfReplies() 90 { 91 return replies.size(); 92 } 93 94 98 public String getSubmitted() 99 { 100 return submitted.toString(); 101 } 102 103 107 public void setSubmitted(Date v) {this.submitted = v;} 108 109 113 public String getContents() {return contents;} 114 115 119 public void setContents(String v) {this.contents = v;} 120 121 125 public String getEmail() {return email;} 126 127 131 public void setEmail(String v) {this.email = v;} 132 133 137 public String getName() {return name;} 138 139 143 public void setName(String v) {this.name = v;} 144 145 149 public String getSubject() {return subject;} 150 151 155 public void setSubject(String v) {this.subject = v;} 156 } 157 158 | Popular Tags |