01: /*
02: * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.ubt.report.data;
06:
07: import java.io.Serializable;
08:
09: /**
10: *
11: */
12: public class Attribute implements Comparable, Serializable {
13: String name;
14: String value;
15:
16: public Attribute(String name, String value) {
17: this .name = name;
18: this .value = value;
19: }
20:
21: public String getValue() {
22: return value;
23: }
24:
25: public String getName() {
26: return name;
27: }
28:
29: public boolean ifThis(String name) {
30: if (this .name.equals(name)) {
31: return true;
32: } else {
33: return false;
34: }
35: }
36:
37: public String toString() {
38: return name + "=" + value;
39: }
40:
41: public int compareTo(Object o) {
42: if (o instanceof Attribute
43: && ((Attribute) o).name.equals(this .name)
44: && ((Attribute) o).value.equals(this .value)) {
45: return 0;
46: }
47: return -1;
48: }
49: }
|