01: /**********************************************************************
02: Copyright (c) 2003 Erik Bengtson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15:
16: Contributors:
17: 2003 Andy Jefferson - coding standards
18: ...
19: **********************************************************************/package org.jpox.store.poid;
20:
21: /**
22: * Generator interface for POIDs.
23: * Uses the same methods as in the javax.jdo.datastore.Sequence interface
24: *
25: * @version $Revision: 1.4 $
26: */
27: public interface PoidGenerator {
28: /**
29: * Returns the fully qualified name of the <code>Sequence</code>.
30: * @return the name of the sequence
31: */
32: String getName();
33:
34: /**
35: * Returns the next sequence value as an Object. If the next
36: * sequence value is not available, throw JPOXDataStoreException.
37: * @return the next value
38: */
39: Object next();
40:
41: /**
42: * Provides a hint to the implementation that the application
43: * will need <code>additional</code> sequence value objects in
44: * short order. There is no externally visible behavior of this
45: * method. It is used to potentially improve the efficiency of
46: * the algorithm of obtaining additional sequence value objects.
47: * @param additional the number of additional values to allocate
48: */
49: void allocate(int additional);
50:
51: /**
52: * Returns the current sequence value object if it is available.
53: * It is intended to return a sequence value object previously used.
54: * If the current sequence value is not available, throw JPOXDataStoreException.
55: * @return the current value
56: */
57: Object current();
58:
59: /**
60: * Returns the next sequence value as a long.
61: * If the next sequence value is not available or is not numeric, throw JPOXDataStoreException.
62: * @return the next value
63: */
64: long nextValue();
65:
66: /**
67: * Returns the current sequence value as a long.
68: * If the current sequence value is not available or is not numeric, throw JPOXDataStoreException.
69: * @return the current value
70: */
71: long currentValue();
72: }
|