01: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
02:
03: This file is part of the db4o open source object database.
04:
05: db4o is free software; you can redistribute it and/or modify it under
06: the terms of version 2 of the GNU General Public License as published
07: by the Free Software Foundation and as clarified by db4objects' GPL
08: interpretation policy, available at
09: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11: Suite 350, San Mateo, CA 94403, USA.
12:
13: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14: WARRANTY; without even the implied warranty of MERCHANTABILITY or
15: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16: for more details.
17:
18: You should have received a copy of the GNU General Public License along
19: with this program; if not, write to the Free Software Foundation, Inc.,
20: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21: package com.db4o.internal;
22:
23: import com.db4o.ext.*;
24: import com.db4o.foundation.*;
25: import com.db4o.reflect.*;
26:
27: /**
28: * @exclude
29: */
30: public class StoredFieldImpl implements StoredField {
31:
32: private final Transaction _transaction;
33:
34: private final FieldMetadata _fieldMetadata;
35:
36: public StoredFieldImpl(Transaction transaction,
37: FieldMetadata fieldMetadata) {
38: _transaction = transaction;
39: _fieldMetadata = fieldMetadata;
40: }
41:
42: public void createIndex() {
43: _fieldMetadata.createIndex();
44: }
45:
46: public Object get(Object onObject) {
47: return _fieldMetadata.get(_transaction, onObject);
48: }
49:
50: public String getName() {
51: return _fieldMetadata.getName();
52: }
53:
54: public ReflectClass getStoredType() {
55: return _fieldMetadata.getStoredType();
56: }
57:
58: public boolean hasIndex() {
59: return _fieldMetadata.hasIndex();
60: }
61:
62: public boolean isArray() {
63: return _fieldMetadata.isArray();
64: }
65:
66: public void rename(String name) {
67: _fieldMetadata.rename(name);
68: }
69:
70: public void traverseValues(Visitor4 visitor) {
71: _fieldMetadata.traverseValues(_transaction, visitor);
72: }
73:
74: public int hashCode() {
75: return _fieldMetadata.hashCode();
76: }
77:
78: public boolean equals(Object obj) {
79: if (obj == null) {
80: return false;
81: }
82: if (getClass() != obj.getClass()) {
83: return false;
84: }
85: return _fieldMetadata
86: .equals(((StoredFieldImpl) obj)._fieldMetadata);
87: }
88:
89: }
|