KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > inside > marshall > RawFieldSpec


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 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.inside.marshall;
22
23 import com.db4o.*;
24
25 public class RawFieldSpec {
26     private final String JavaDoc _name;
27     private final int _handlerID;
28     private final boolean _isPrimitive;
29     private final boolean _isArray;
30     private final boolean _isNArray;
31     private final boolean _isVirtual;
32     private int _indexID;
33
34     public RawFieldSpec(final String JavaDoc name, final int handlerID, final byte attribs) {
35         _name = name;
36         _handlerID = handlerID;
37         YapBit yb = new YapBit(attribs);
38         _isPrimitive = yb.get();
39         _isArray = yb.get();
40         _isNArray = yb.get();
41         _isVirtual=false;
42         _indexID=0;
43     }
44
45     public RawFieldSpec(final String JavaDoc name) {
46         _name = name;
47         _handlerID = 0;
48         _isPrimitive = false;
49         _isArray = false;
50         _isNArray = false;
51         _isVirtual=true;
52         _indexID=0;
53     }
54
55     public String JavaDoc name() {
56         return _name;
57     }
58     
59     public int handlerID() {
60         return _handlerID;
61     }
62     
63     public boolean isPrimitive() {
64         return _isPrimitive;
65     }
66
67     public boolean isArray() {
68         return _isArray;
69     }
70
71     public boolean isNArray() {
72         return _isNArray;
73     }
74     
75     public boolean isVirtual() {
76         return _isVirtual;
77     }
78     
79     public int indexID() {
80         return _indexID;
81     }
82     
83     void indexID(int indexID) {
84         _indexID=indexID;
85     }
86 }
87
Popular Tags