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:
027: package org.cougaar.mlm.ui.data;
028:
029: import java.io.Serializable;
030: import java.util.Date;
031: import java.util.Vector;
032:
033: public class UISimpleInventory implements Serializable {
034: String assetName;
035: String scheduleType;
036: String unitType;
037: Vector schedules = new Vector();
038: boolean provider;
039: long baseCDayTime;
040: long alpNowTime;
041:
042: public void setAssetName(String assetName) {
043: this .assetName = assetName;
044: }
045:
046: public String getAssetName() {
047: return assetName;
048: }
049:
050: public void setScheduleType(String scheduleType) {
051: this .scheduleType = scheduleType;
052: }
053:
054: public String getScheduleType() {
055: return scheduleType;
056: }
057:
058: public void setUnitType(String unitType) {
059: this .unitType = unitType;
060: }
061:
062: public String getUnitType() {
063: return unitType;
064: }
065:
066: public void addNamedSchedule(String name, Vector schedule) {
067: if (schedule != null) {
068: //System.out.println("Schedule " + name + " has " + schedule.size() + " elements");
069: schedules.addElement(new UISimpleNamedSchedule(name,
070: schedule));
071: } else {
072: System.out.println("Schedule " + name + " is null");
073: }
074: }
075:
076: public UISimpleNamedSchedule getNamedSchedule(String name) {
077: for (int i = 0; i < schedules.size(); i++) {
078: UISimpleNamedSchedule s = (UISimpleNamedSchedule) schedules
079: .elementAt(i);
080: if (s.getName().equals(name))
081: return s;
082: }
083: return null;
084: }
085:
086: public Vector getSchedules() {
087: return schedules;
088: }
089:
090: public void setProvider(boolean provider) {
091: this .provider = provider;
092: }
093:
094: public boolean isProvider() {
095: return provider;
096: }
097:
098: public void setBaseCDay(long theBaseCDayTime) {
099: baseCDayTime = theBaseCDayTime;
100: }
101:
102: public void setBaseCDay(Date baseCDay) {
103: baseCDayTime = baseCDay.getTime();
104: }
105:
106: public long getBaseCDayTime() {
107: return baseCDayTime;
108: }
109:
110: public void setAlpNow(long theAlpNowTime) {
111: alpNowTime = theAlpNowTime;
112: }
113:
114: public void setAlpNow(Date AlpNow) {
115: setAlpNow(AlpNow.getTime());
116: }
117:
118: public long getAlpNowTime() {
119: return alpNowTime;
120: }
121:
122: public String toString() {
123: return "UISimpleInventory {" + "\n assetName: " + assetName
124: + "\n scheduleType: " + scheduleType
125: + "\n unitType: " + unitType + "\n schedules: "
126: + schedules + "\n provider: " + provider
127: + "\n baseCDayTime: " + baseCDayTime + "\n}";
128: }
129: }
|