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.core.qos.rss;
028:
029: import org.cougaar.core.qos.metrics.Metric;
030: import org.cougaar.qos.qrs.DataValue;
031:
032: /**
033: * This class wraps RSS DataValues in the {@link Metric} API.
034: */
035: public class DataWrapper implements Metric, java.io.Serializable {
036: private final DataValue data;
037:
038: public DataWrapper(DataValue data) {
039: this .data = data;
040: }
041:
042: public String toString() {
043: return data.toString();
044: }
045:
046: public DataValue getDataValue() {
047: return data;
048: }
049:
050: public String stringValue() {
051: return data.getStringValue();
052: }
053:
054: public byte byteValue() {
055: return data.getByteValue();
056: }
057:
058: public short shortValue() {
059: return data.getShortValue();
060: }
061:
062: public int intValue() {
063: return data.getIntValue();
064: }
065:
066: public long longValue() {
067: return data.getLongValue();
068: }
069:
070: public float floatValue() {
071: return data.getFloatValue();
072: }
073:
074: public double doubleValue() {
075: return data.getDoubleValue();
076: }
077:
078: public char charValue() {
079: return data.getCharValue();
080: }
081:
082: public boolean booleanValue() {
083: return data.getBooleanValue();
084: }
085:
086: public Object getRawValue() {
087: return data.getRawValue();
088: }
089:
090: public double getCredibility() {
091: return data.getCredibility();
092: }
093:
094: public String getUnits() {
095: return data.getUnits();
096: }
097:
098: public String getProvenance() {
099: return data.getProvenance();
100: }
101:
102: public long getTimestamp() {
103: return data.getTimestamp();
104: }
105:
106: public long getHalflife() {
107: return data.getHalflife();
108: }
109: }
|