1 21 package com.db4o; 22 23 24 27 public final class YapConst 28 { 29 static final Object initMe = init(); 30 31 public static final byte YAPFILEVERSION = 4; 32 33 public static final byte YAPBEGIN = (byte)'{'; 34 public static final byte YAPFILE = (byte)'Y'; 35 static final byte YAPID = (byte)'#'; 36 static final byte YAPPOINTER = (byte)'>'; 37 public static final byte YAPCLASSCOLLECTION = (byte)'A'; 38 public static final byte YAPCLASS = (byte)'C'; 39 static final byte YAPFIELD = (byte)'F'; 40 public static final byte YAPOBJECT = (byte)'O'; 41 static final byte YAPARRAY = (byte)'N'; 42 static final byte YAPARRAYN = (byte)'Z'; 43 public static final byte YAPINDEX = (byte)'X'; 44 public static final byte YAPSTRING = (byte)'S'; 45 static final byte YAPLONG = (byte)'l'; 46 static final byte YAPINTEGER = (byte)'i'; 47 static final byte YAPBOOLEAN = (byte)'='; 48 static final byte YAPDOUBLE = (byte)'d'; 49 static final byte YAPBYTE = (byte)'b'; 50 static final byte YAPSHORT = (byte)'s'; 51 static final byte YAPCHAR = (byte)'c'; 52 static final byte YAPFLOAT = (byte)'f'; 53 static final byte YAPEND = (byte)'}'; 54 static final byte YAPNULL = (byte)'0'; 55 public static final byte BTREE = (byte)'T'; 56 public static final byte BTREE_NODE = (byte)'B'; 57 public static final byte HEADER = (byte)'H'; 58 59 static final int IDENTIFIER_LENGTH = (Deploy.debug && Deploy.identifiers)?1:0; 60 public static final int BRACKETS_BYTES = (Deploy.debug && Deploy.brackets)?1:0; 61 static final int BRACKETS_LENGTH = BRACKETS_BYTES * 2; 62 63 public static final int LEADING_LENGTH = IDENTIFIER_LENGTH + BRACKETS_BYTES; 64 public static final int ADDED_LENGTH = IDENTIFIER_LENGTH + BRACKETS_LENGTH; 65 66 static final int SHORT_BYTES = 2; 67 static final int INTEGER_BYTES = (Deploy.debug && Deploy.debugLong)?11:4; 68 static final int LONG_BYTES = (Deploy.debug && Deploy.debugLong)?20:8; 69 static final int CHAR_BYTES = 2; 70 71 static final int UNSPECIFIED = Integer.MIN_VALUE + 100; 73 public static final int INT_LENGTH = INTEGER_BYTES + ADDED_LENGTH; 74 public static final int ID_LENGTH = INT_LENGTH; 75 public static final int LONG_LENGTH = LONG_BYTES + ADDED_LENGTH; 76 77 static final int WRITE_LOOP = (INTEGER_BYTES - 1) * 8; 78 79 public static final int OBJECT_LENGTH = ADDED_LENGTH; 80 81 public static final int POINTER_LENGTH = (INT_LENGTH * 2) + ADDED_LENGTH; 82 83 public static final int MESSAGE_LENGTH = INT_LENGTH * 2 + 1; 84 85 public static final byte SYSTEM_TRANS = (byte)'s'; 86 public static final byte USER_TRANS = (byte)'u'; 87 88 static final byte XBYTE = (byte)'X'; 90 91 public static final int IGNORE_ID = -99999; 95 96 static final int PRIMITIVE = -2000000000; 99 100 static final int TYPE_SIMPLE = 1; 102 static final int TYPE_CLASS = 2; 103 static final int TYPE_ARRAY = 3; 104 static final int TYPE_NARRAY = 4; 105 106 static final int NONE = 0; static final int STATE = 1; static final int ACTIVATION = 2; 111 static final int TRANSIENT = -1; 112 static final int ADD_MEMBERS_TO_ID_TREE_ONLY = 0; 113 static final int ADD_TO_ID_TREE = 1; 114 115 static final byte ISO8859 = (byte)1; 117 static final byte UNICODE = (byte)2; 118 119 public static final int LOCK_TIME_INTERVAL = 1000; 121 static final int SERVER_SOCKET_TIMEOUT = Debug.longTimeOuts ? 1000000: 5000; static final int CLIENT_SOCKET_TIMEOUT = 300000; static final int CONNECTION_TIMEOUT = Debug.longTimeOuts ? 1000000: 180000; 125 public static final int MAXIMUM_BLOCK_SIZE = 70000000; static final int MAXIMUM_ARRAY_ENTRIES = 7000000; static final int MAXIMUM_ARRAY_ENTRIES_PRIMITIVE = MAXIMUM_ARRAY_ENTRIES * 100; 130 static Class CLASS_COMPARE; 131 static Class CLASS_DB4OTYPE; 132 static Class CLASS_DB4OTYPEIMPL; 133 static Class CLASS_INTERNAL; 134 static Class CLASS_UNVERSIONED; 135 public static Class CLASS_OBJECT; 136 static Class CLASS_OBJECTCONTAINER; 137 static Class CLASS_REPLICATIONRECORD; 138 static Class CLASS_STATICFIELD; 139 static Class CLASS_STATICCLASS; 140 static Class CLASS_TRANSIENTCLASS; 141 142 public static final String EMBEDDED_CLIENT_USER = "embedded client"; 143 144 static final int CLEAN = 0; 147 static final int ACTIVE = 1; 148 static final int PROCESSING = 2; 149 static final int CACHED_DIRTY = 3; 150 static final int CONTINUE = 4; 151 static final int STATIC_FIELDS_STORED = 5; 152 static final int CHECKED_CHANGES = 6; 153 static final int DEAD = 7; 154 static final int READING = 8; 155 156 static final int UNCHECKED = 0; 157 158 public static final int NO = -1; 160 public static final int YES = 1; 161 public static final int DEFAULT = 0; 162 public static final int UNKNOWN = 0; 163 164 public static final int OLD = -1; 165 public static final int NEW = 1; 166 167 168 public static final YapStringIOUnicode stringIO = new YapStringIOUnicode(); 169 170 private static final Object init(){ 171 CLASS_OBJECT = new Object ().getClass(); 172 CLASS_COMPARE = com.db4o.config.Compare.class; 173 CLASS_DB4OTYPE = com.db4o.types.Db4oType.class; 174 CLASS_DB4OTYPEIMPL = Db4oTypeImpl.class; 175 CLASS_INTERNAL = Internal4.class; 176 CLASS_UNVERSIONED = com.db4o.types.Unversioned.class; 177 CLASS_OBJECTCONTAINER = ObjectContainer.class; 178 CLASS_REPLICATIONRECORD = new ReplicationRecord().getClass(); 179 CLASS_STATICFIELD = new StaticField().getClass(); 180 CLASS_STATICCLASS = new StaticClass().getClass(); 181 CLASS_TRANSIENTCLASS = com.db4o.types.TransientClass.class; 182 183 return null; 184 } 185 186 static final Class [] ESSENTIAL_CLASSES = { 188 190 192 CLASS_STATICFIELD, 193 CLASS_STATICCLASS 194 }; 195 196 public static final String VIRTUAL_FIELD_PREFIX = "v4o"; 197 198 public static final int MAX_STACK_DEPTH = 20; 199 200 201 } 202 | Popular Tags |