01: /*
02: * $Id: IndexedObjectImpl.java,v 1.3 2004/07/08 08:01:45 yuvalo Exp $
03: *
04: * (C) Copyright 2002-2004 by Yuval Oren. All rights reserved.
05: *
06: * Licensed under the Apache License, Version 2.0 (the "License");
07: * you may not use this file except in compliance with the License.
08: * You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing, software
13: * distributed under the License is distributed on an "AS IS" BASIS,
14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: * See the License for the specific language governing permissions and
16: * limitations under the License.
17: */
18:
19: package com.bluecast.util;
20:
21: final public class IndexedObjectImpl implements IndexedObject {
22: private int index;
23: private Object object;
24:
25: public IndexedObjectImpl(int index, Object object) {
26: this .index = index;
27: this .object = object;
28: }
29:
30: final public int getIndex() {
31: return index;
32: }
33:
34: final public void setIndex(int index) {
35: this .index = index;
36: }
37:
38: final public Object getObject() {
39: return object;
40: }
41:
42: final public void setObject(Object object) {
43: this .object = object;
44: }
45:
46: final public Object clone() {
47: return new IndexedObjectImpl(index, object);
48: }
49:
50: final public boolean equals(Object o) {
51: if (o instanceof IndexedObject) {
52: IndexedObject i = (IndexedObject) o;
53: return (index == i.getIndex() && object.equals(i
54: .getObject()));
55: } else {
56: return false;
57: }
58: }
59: }
|