001: /*
002: * <copyright>
003: *
004: * Copyright 1997-2004 BBNT Solutions, LLC
005: * under sponsorship of the Defense Advanced Research Projects
006: * Agency (DARPA).
007: *
008: * You can redistribute this software and/or modify it under the
009: * terms of the Cougaar Open Source License as published on the
010: * Cougaar Open Source Website (www.cougaar.org).
011: *
012: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013: * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014: * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015: * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016: * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023: *
024: * </copyright>
025: */
026: package org.cougaar.planning.ldm.plan;
027:
028: import java.io.Serializable;
029: import java.util.Date;
030:
031: import org.cougaar.core.util.UID;
032:
033: /** Report Implementation
034: *
035: *
036: * Informational report contains a text and an associated date.
037: **/
038:
039: public class ReportImpl implements Report, NewReport, Serializable {
040:
041: protected String myText; // answers the question "Right, what's all this, then?"
042: protected Date myDate; // Date associated with message. (When created?)
043: private UID myUID;
044:
045: /**
046: * Constructor - takes no args
047: */
048: public ReportImpl() {
049: myText = null;
050: myDate = null;
051: myUID = null;
052: }
053:
054: /**
055: * Constructor - takes text, date, and UID args
056: *
057: * @param text String with text of report
058: * @param date Date associated with report (probably creation date)
059: * @param uid UID for report
060: */
061: public ReportImpl(String text, Date date, UID uid) {
062: myText = text;
063: myDate = date;
064: myUID = uid;
065: }
066:
067: /**
068: * setText - set text for message
069: *
070: * @param reportText String with new text
071: */
072: public void setText(String reportText) {
073: myText = reportText;
074: }
075:
076: /**
077: * getText - return text of message
078: *
079: * @return String with text of the report
080: */
081: public String getText() {
082: return myText;
083: }
084:
085: /**
086: * setDate - set date associated with the report
087: *
088: * @param date Date to be associated with the report
089: */
090: public void setDate(Date date) {
091: myDate = date;
092: }
093:
094: /**
095: * getDate - return date associated with the report
096: *
097: * @return Date associated with the report
098: */
099: public Date getDate() {
100: return myDate;
101: }
102:
103: /**
104: * setUID - set uid for the object
105: * Why is this public? Does it make sense to allow random changes to
106: * UID?
107: *
108: * @param uid UID assigned to object
109: */
110: public void setUID(UID uid) {
111: myUID = uid;
112: }
113:
114: /**
115: * getUID - get uid for the object
116: *
117: * @return UID assigned to object
118: */
119: public UID getUID() {
120: return myUID;
121: }
122: }
|