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: /** AlertParameter Implementation
029: *
030: **/
031:
032: public class AlertParameterImpl implements AlertParameter,
033: NewAlertParameter {
034:
035: // Description of the parameter
036: protected String myDescription;
037: // Actual parameter
038: protected Object myParameter;
039: // Operator response
040: protected Object myResponse;
041: // Editable
042: protected boolean editable = true;
043: // Visible
044: protected boolean visible = true;
045:
046: /**
047: * Constructor - takes no arguments
048: */
049: public AlertParameterImpl() {
050: myDescription = null;
051: myParameter = null;
052: myResponse = null;
053: }
054:
055: /**
056: * Constructor
057: *
058: * @param description String description for the parameter
059: * @param parameter Object actual object associated with the parameter
060: */
061: public AlertParameterImpl(String description, Object parameter) {
062: myDescription = description;
063: myParameter = parameter;
064: }
065:
066: /**
067: * getParameter - return Object whose contents would be meaningful to a UI user
068: * who must respond to the Alert associated with this AlertParameter
069: *
070: * @return Object
071: */
072: public Object getParameter() {
073: return myParameter;
074: }
075:
076: /**
077: * setParameter - set object whose contents would be meaningful to a UI user
078: * who must respond to the Alert associated with this AlertParameter.
079: *
080: * @param param Object
081: */
082: public void setParameter(Object param) {
083: myParameter = param;
084: }
085:
086: /**
087: * getDescription - returns a description of the AlertParameter for display in
088: * the UI to tell a user what and why he is seeing it.
089: *
090: * @return String
091: */
092: public String getDescription() {
093: return myDescription;
094: }
095:
096: /**
097: * setDescription - sets a description of the AlertParameter for display in the
098: * UI to tell a user what and why he is seeing it.
099: *
100: * @param paramDescription String
101: */
102: public void setDescription(String paramDescription) {
103: myDescription = paramDescription;
104: }
105:
106: /**
107: * setResponse - saves the answer to the question posed by this AlertParameter.
108: * This method would be used by the UI to fill in the user's response, if any.
109: **/
110: public void setResponse(Object response) {
111: myResponse = response;
112: }
113:
114: /**
115: * getRespose - The answer to the question posed by this AlertParameter. This method
116: * would be used by the UI to fill in the user's response, if any.
117: **/
118: public Object getResponse() {
119: return myResponse;
120: }
121:
122: public boolean isEditable() {
123: return editable;
124: }
125:
126: public void setEditable(boolean newEditable) {
127: editable = newEditable;
128: }
129:
130: public boolean isVisible() {
131: return visible;
132: }
133:
134: public void setVisible(boolean newVisible) {
135: visible = newVisible;
136: }
137: }
|