[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ozone 0.4-dev4 available
Hi Falko,
I just downloaded and compiled Ozone 0.4.4. I should mention a few
things I normally do to get Ozone to compile. You may or may not want to
wind these into the std release:
I create a src directory and move the org directory into it. This means
that the ozone directory is no longer the source root, but rather the src
directory is.
I create a non-src directory and move some things that don't compile into
there. The current list of things that dont compile is:
- org/ozoneDB/core/classicStore/
- org/ozoneDB/core/monitor/
- org/ozoneDB/DxLib/test/
- org/ozoneDB/DxLib/Test.java
- org/ozoneDB/test/
- org/ozoneDB/xml/
I also patch the odmg stuff to work with the java 1.1 collections. It
would be nice if the only changes were the includes at the top of the
files. I've attached my odmg folder so you can do the diffs if you choose.
One of the files with have a mangled name - just ignore that one, there are
no diffs in it anyway :).
later,
\x/ill :-}
--On Tue, Feb 29, 2000 1:47 PM +0100 Falko Braeutigam
<falko@softwarebuero.de> wrote:
> Folks,
> the 0.4dev4 release is available. The UserManager problems are still
> there. I will have a look at this as soon as possible. Afterwards
>
> The biggest change is that the central object-id table is based on
> DxDiskHashTable again. This allows to handle a virtually unlimited number
> of objects even with low RAM. The drawback is that it slows down object
> access in some cases. In the long run there is no alternative if we want
> to handle millions of DOM nodes in XML documents.
>
> Complete changes list:
>
> Version 0.4-dev4 (Tue Feb 29 10:42:12 2000)
> -------------------------------------------
> - Server: Wills -c and -u options added
>
> - Johanns interim NT build scripts added; ANT based build environment to
> follow
>
> - Transaction/WizardsStore: bug fixed that causes the store to save
> shadows every time a container was created
>
> - Setup: bug fixed that causes ozone to fail running in Taiwan ;)
> instead of getByte() the properties() method copies the bytes out of
> the string itself to avoid char encoding according to the locale
> setting
>
> - Libs: self compiled and much more smaller xerces.jar (version 1.0.0)
>
> - WizardStore: OID table is a DxDiskHashtable again. This allows a server
> to handle virtually any number of objects even with low memory. Besides
> the normal startup time does not depend from the number of objects.
> The backdraw is that loading objects into the cold cache is slower.
>
> - AdminTool: bug fixed that cause the AdminToolTerm to hang after close
> and shutdown
>
>
> BTW: we have tested Objectivity a bit. The test source is in the distro.
> We are of course no experts for this product so maybe we did not optimize
> it to the max. However, we found the performance of ozone and Objy at
> least comparable!!! In fact, ozone runs faster in some test cases.
>
>
> Falko
> --
> ______________________________________________________________________
> Falko Braeutigam mailto:falko@softwarebuero.de
> softwarebuero m&b (SMB) http://www.softwarebuero.de
>
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: ArrayOfObject.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public class ArrayOfObject extends OzoneObject implements DArray {
static final int BLOCK_SIZE = 32;
static final int START_SIZE = 32;
static final int MAX_SIZE = 32;
Object[] data;
int space;
int itemCount;
/** Constructor */
public ArrayOfObject () {
super ();
itemCount = 0;
space = START_SIZE;
data = new Object[space];
}
/** calculates the space for a resize based on the new-space-wish
* @param _wish the new arraycapacity (should be greater then
size()!!!)
* @return the new capacity (may be equal to current capacity)
*/
private int calculateSpace (int _wish) {
int result = space;
// // EXPONENTIAL-Version
// if (_wish < result)
// while ((_wish < result) && (result / 2 > _wish))
// result /= 2;
// else
// while (_wish > result)
// result *= 2;
// or
// THIS-Version
result = _wish + Math.min (_wish, 4096);
return result;
}
// ++++++++ Interface: DCollection
+++++++++++++++++++++++++++++++++++++++++++++++
/**
*/
public int size() {
return itemCount;
}
/**
*/
public boolean isEmpty() {
if (itemCount == 0)
return true;
return false;
}
/**
*/
public boolean contains(Object _obj) {
for (int i = 0; i < itemCount; i++)
if (data[i].equals ( _obj))
return true;
return false;
}
/**
*/
public Iterator iterator() {
return new DArrayIterator ((DArray)this.self ());
}
/** */
public Object[] toArray() {
Object[] result = new Object[itemCount];
System.arraycopy (data, 0, result, 0, itemCount);
return result;
}
/** */
public Object[] toArray(Object _a[]) {
// throw new UnsupportedOperationException ("Impossible via rmi!");
return null;
}
/** Adds _obj to the end of this array. */
public boolean add(Object _obj) {
if (itemCount == space)
resize (space + 1);
data[itemCount] = _obj;
itemCount++;
return true;
}
/** Removes ALL occurences of _obj in this array.
*/
public boolean remove(Object _obj) {
boolean result = false;
int end = 0;
// iterate over my array
for (int i = 0; i < itemCount; i++) {
if (! _obj.equals (data[i])) {
// we will keep it...
data[end] = data[i];
end ++;
}
}
// did we remove something ?
if (itemCount > end) {
// delete all references in the undefined tail of the array
for (int i = end; i < itemCount; i++)
data[i] = null;
itemCount = end;
result = true;
}
return result;
}
/** Returns true if ALL elements of _c are in this array too. */
public boolean containsAll (Collection _c) {
boolean result = true;
Iterator it = _c.iterator ();
// compare it with every element of _c
while (it.hasNext () && result) {
Object obj = it.next ();
result = false;
// iterate over my array
for (int i = 0; i < itemCount; i++) {
if (obj.equals (data[i])) {
// this object is not in my array...
result = true;
break;
}
}
}
return result;
}
/** */
public boolean addAll (Collection _c) {
boolean result = false;
int count = _c.size ();
Iterator it = _c.iterator ();
int neededSpace = itemCount + count;
Object[] newData;
// do we need to increase size
if (neededSpace > space) {
neededSpace = calculateSpace (neededSpace);
newData = new Object[neededSpace];
// copy frontpart of the old array to the new
System.arraycopy (data, 0, newData, 0, itemCount);
data = newData;
}
// insert the collection
// if at this point _c.size() would return other value then count
// -> this operation ends with undefined arraycontent and maybe
IndexOutOfBoundeEx
for (int i = itemCount; it.hasNext (); i++)
data[i] = it.next ();
neededSpace = itemCount + count;
if (itemCount != neededSpace) {
itemCount = neededSpace;
result = true;
}
return result;
}
/** Removes ALL occurences of all in _c available elements in this
array.
* @return returns true, even when nothing has changed!
*/
public boolean removeAll (Collection _c) {
boolean result = false;
Iterator it = _c.iterator ();
// compare it with every element of _c
while (it.hasNext ())
if (remove (it.next ()))
result = true;
return result;
}
/** Removes all elements from this array, which are not elements in _c
too.
* (uses Object.equals () for compare.)
* Any ideas for raising performance?
*/
public boolean retainAll (Collection _c) {
boolean result = false;
int end;
int newItemCount = itemCount;
Iterator it = _c.iterator ();
// compare it with every element of _c
while (it.hasNext ()) {
Object obj = it.next ();
end = 0;
// iterate over my array
for (int i = 0; i < newItemCount; i++) {
if (obj.equals (data[i])) {
// we will keep it...
data[end] = data[i];
end ++;
}
}
newItemCount = end;
}
// did we remove something ?
if (itemCount > newItemCount) {
// delete all references in the undefined tail of the array
for (int i = newItemCount; i < itemCount; i++)
data[i] = null;
itemCount = newItemCount;
result = true;
}
return result;
}
/** */
public void clear() {
// delete all references
for (int i = 0; i < itemCount; i++)
data[i] = null;
itemCount = 0;
}
/** Returns true if _obj is an ArrayOfObject with the same size and the
same
* elements in the same order as this array. */
public boolean equals (Object _obj) {
boolean result = false;
if ((_obj instanceof ArrayOfObject) &&
(((ArrayOfObject)_obj).size () == this.size ())) {
result = true;
// this should keep the order:
Iterator myself = iterator ();
Iterator obj = iterator ();
while (myself.hasNext ())
if (myself.next ().equals (obj.next ())) {
result = false;
break;
}
}
return result;
}
/** */
//int hashCode();
/** */
public Object selectElement (String _predicate) throws
QueryInvalidException {
return null;
}
/** */
public Iterator select (String _predicate) throws QueryInvalidException
{
return null;
}
/** */
public DCollection query (String _predicate) throws
QueryInvalidException {
return null;
}
/** */
public boolean existsElement (String _predicate) throws
QueryInvalidException {
return false;
}
// ++++++++ Interface: java.util.List
++++++++++++++++++++++++++++++++++++++++++++
/** */
public boolean addAll (int _index, Collection _c) {
boolean result = false;
if (_index < 0 || _index > itemCount)
throw new IndexOutOfBoundsException ();
int count = _c.size ();
Iterator it = _c.iterator ();
int neededSpace = itemCount + count;
Object[] newData;
// do we need to increase size
if (neededSpace > space) {
neededSpace = calculateSpace (neededSpace);
newData = new Object[neededSpace];
// copy frontpart of the old array to the new
System.arraycopy (data, 0, newData, 0, _index);
}
else
newData = data;
// shift the backpart of the array
System.arraycopy (data, _index, newData, _index + count, itemCount -
_index);
data = newData;
// insert the collection
// if at this point _c.size() would return other value then count
// -> this operation ends with undefined arraycontent and maybe
IndexOutOfBoundeEx
for (int i = _index; it.hasNext (); i++)
data[i] = it.next ();
neededSpace = itemCount + count;
if (itemCount != neededSpace) {
itemCount = neededSpace;
result = true;
}
return result;
}
/** */
public Object get (int _index) {
return data[_index];
}
/**
* @return the element previously at the specified position. */
public Object set (int _index, Object _obj) {
Object old = data[_index];
data[_index] = _obj;
return old;
}
/** */
public void add (int _index, Object _obj) {
if (_index < 0 || _index > itemCount)
throw new IndexOutOfBoundsException ();
int neededSpace = itemCount + 1;
Object[] newData;
// do we need to increase size
if (neededSpace > space) {
neededSpace = calculateSpace (neededSpace);
newData = new Object[neededSpace];
// copy frontpart of the old array to the new
System.arraycopy (data, 0, newData, 0, _index);
}
else
newData = data;
// shift the backpart of the array
System.arraycopy (data, _index, newData, _index + 1, itemCount -
_index);
data = newData;
// insert the object
data[_index] = _obj;
itemCount++;
}
/** */
public Object remove (int _index) throws IndexOutOfBoundsException {
if (_index < 0 || _index >= itemCount)
throw new IndexOutOfBoundsException ();
Object obj = data[_index];
// just shift a subarray to front
System.arraycopy (data, _index + 1, data, _index, itemCount - _index
- 1);
System.out.println (--itemCount);
data[itemCount] = null;
return obj;
}
/** */
public int indexOf (Object _obj) {
int result = -1;
for (int i = 0; i < itemCount; i++)
if (_obj.equals (data[i])) {
result = i;
break;
}
return result;
}
/** */
public int lastIndexOf (Object _obj) {
int result = -1;
for (int i = itemCount - 1; i >= 0; i--)
if (_obj.equals (data[i])) {
result = i;
break;
}
return result;
}
/** */
public ListIterator listIterator() {
return new DArrayIterator (this);
}
/** */
public ListIterator listIterator(int _index) {
//if (_index < 0 || _index >= itemCount)
// throw new IndexOutOfBoundsException ();
return new DArrayIterator (this, _index);
}
/**
*/
public List subList(int fromIndex, int toIndex) {
// throw new UnsupportedOperationException ();
return null;
}
// ++++++++ Interface: DArray
++++++++++++++++++++++++++++++++++++++++++++++++++++
/** This method (defined by ODMG Spec.2.0) only was implemented for
compatiblity.
* Because the array from userview looks like a list, the resizing
makes no sense
* (DArray.resize (X) -> DArray.size() != X).
* In this implementation resize() is meant as suggestion for the
DArray's capacity.
* @param _newSpace the expected capacity of this DArray
*/
public synchronized void resize (int _newSpace) {
// calculate real newSpace (should always be greater then size()!)
_newSpace = calculateSpace (Math.max (_newSpace, itemCount));
if (_newSpace != space) {
Object[] newData = new Object[_newSpace];
System.arraycopy (data, 0, newData, 0, itemCount);
data = newData;
space = _newSpace;
}
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: BagOfObject.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
/**
*/
public abstract class BagOfObject extends OzoneObject implements DBag {
// // +++++++++ DCollection
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// /**
// * Returns the number of elements in this collection. If this
collection
// * contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
// * <tt>Integer.MAX_VALUE</tt>.
// *
// * @return the number of elements in this collection
// */
// int size();
//
// /**
// * Returns <tt>true</tt> if this collection contains no elements.
// *
// * @returns <tt>true</tt> if this collection contains no elements
// */
// boolean isEmpty();
//
// /**
// * Returns <tt>true</tt> if this collection contains the specified
// * element. More formally, returns <tt>true</tt> if and only if this
// * collection contains at least one element <tt>e</tt> such that
// * <tt>(o==null ? e==null : o.equals(e))</tt>.
// *
// * @param o element whose presence in this collection is to be tested.
// * @return <tt>true</tt> if this collection contains the specified
// * element
// */
// boolean contains(Object o);
//
// /**
// * Returns an iterator over the elements in this collection. There
are no
// * guarantees concerning the order in which the elements are returned
// * (unless this collection is an instance of some class that provides
a
// * guarantee).
// *
// * @returns an <tt>Iterator</tt> over the elements in this collection
// */
// Iterator iterator();
//
// /**
// * Returns an array containing all of the elements in this collection.
If
// * the collection makes any guarantees as to what order its elements
are
// * returned by its iterator, this method must return the elements in
the
// * same order.<p>
// *
// * The returned array will be "safe" in that no references to it are
// * maintained by this collection. (In other words, this method must
// * allocate a new array even if this collection is backed by an
array).
// * The caller is thus free to modify the returned array.<p>
// *
// * This method acts as bridge between array-based and collection-based
// * APIs.
// *
// * @return an array containing all of the elements in this collection
// */
// Object[] toArray();
//
// /**
// * Returns an array containing all of the elements in this collection
// * whose runtime type is that of the specified array. If the
collection
// * fits in the specified array, it is returned therein. Otherwise, a
new
// * array is allocated with the runtime type of the specified array and
the
// * size of this collection.<p>
// *
// * If this collection fits in the specified array with room to spare
// * (i.e., the array has more elements than this collection), the
element
// * in the array immediately following the end of the collection is set
to
// * <tt>null</tt>. This is useful in determining the length of this
// * collection <i>only</i> if the caller knows that this collection
does
// * not contain any <tt>null</tt> elements.)<p>
// *
// * If this collection makes any guarantees as to what order its
elements
// * are returned by its iterator, this method must return the elements
in
// * the same order.<p>
// *
// * Like the <tt>toArray</tt> method, this method acts as bridge
between
// * array-based and collection-based APIs. Further, this method allows
// * precise control over the runtime type of the output array, and may,
// * under certain circumstances, be used to save allocation costs<p>
// *
// * Suppose <tt>l</tt> is a <tt>List</tt> known to contain only
strings.
// * The following code can be used to dump the list into a newly
allocated
// * array of <tt>String</tt>:
// *
// * <pre>
// * String[] x = (String[]) v.toArray(new String[0]);
// * </pre><p>
// *
// * Note that <tt>toArray(new Object[0])</tt> is identical in function
to
// * <tt>toArray()</tt>.
// *
// * @param the array into which the elements of this collection are to
be
// * stored, if it is big enough; otherwise, a new array of the
same
// * runtime type is allocated for this purpose.
// * @return an array containing the elements of this collection
// *
// * @throws ArrayStoreException the runtime type of the specified array
is
// * not a supertype of the runtime type of every element in
this
// * collection.
// */
//
// Object[] toArray(Object a[]);
//
// // Modification Operations
//
// /**
// * Ensures that this collection contains the specified element
(optional
// * operation). Returns <tt>true</tt> if this collection changed as a
// * result of the call. (Returns <tt>false</tt> if this collection
does
// * not permit duplicates and already contains the specified
element.)<p>
// *
// * Collections that support this operation may place limitations on
what
// * elements may be added to this collection. In particular, some
// * collections will refuse to add <tt>null</tt> elements, and others
will
// * impose restrictions on the type of elements that may be added.
// * Collection classes should clearly specify in their documentation
any
// * restrictions on what elements may be added.<p>
// *
// * If a collection refuses to add a particular element for any reason
// * other than that it already contains the element, it <i>must</i>
throw
// * an exception (rather than returning <tt>false</tt>). This
preserves
// * the invariant that a collection always contains the specified
element
// * after this call returns.
// *
// * @param o element whose presence in this collection is to be
ensured.
// * @return <tt>true</tt> if this collection changed as a result of the
// * call
// *
// * @throws UnsupportedOperationException add is not supported by this
// * collection.
// * @throws ClassCastException class of the specified element prevents
it
// * from being added to this collection.
// * @throws IllegalArgumentException some aspect of this element
prevents
// * it from being added to this collection.
// */
// boolean add(Object o);
//
// /**
// * Removes a single instance of the specified element from this
// * collection, if it is present (optional operation). More formally,
// * removes an element <tt>e</tt> such that <tt>(o==null ? e==null :
// * o.equals(e))</tt>, if this collection contains one or more such
// * elements. Returns true if this collection contained the specified
// * element (or equivalently, if this collection changed as a result of
the
// * call).
// *
// * @param o element to be removed from this collection, if present.
// * @return <tt>true</tt> if this collection changed as a result of the
// * call
// *
// * @throws UnsupportedOperationException remove is not supported by
this
// * collection.
// */
// boolean remove(Object o);
//
//
// // Bulk Operations
//
// /**
// * Returns <tt>true</tt> if this collection contains all of the
elements
// * in the specified collection.
// *
// * @param c collection to be checked for containment in this
collection.
// * @return <tt>true</tt> if this collection contains all of the
elements
// * in the specified collection
// * @see #contains(Object)
// */
// boolean containsAll(Collection c);
//
// /**
// * Adds all of the elements in the specified collection to this
collection
// * (optional operation). The behavior of this operation is undefined
if
// * the specified collection is modified while the operation is in
progress.
// * (This implies that the behavior of this call is undefined if the
// * specified collection is this collection, and this collection is
// * nonempty.)
// *
// * @param c elements to be inserted into this collection.
// * @return <tt>true</tt> if this collection changed as a result of the
// * call
// *
// * @throws UnsupportedOperationException if this collection does not
// * support the <tt>addAll</tt> method.
// * @throws ClassCastException if the class of an element of the
specified
// * collection prevents it from being added to this collection.
// * @throws IllegalArgumentException some aspect of an element of the
// * specified collection prevents it from being added to this
// * collection.
// *
// * @see #add(Object)
// */
// boolean addAll(Collection c);
//
// /**
// *
// * Removes all this collection's elements that are also contained in
the
// * specified collection (optional operation). After this call
returns,
// * this collection will contain no elements in common with the
specified
// * collection.
// *
// * @param c elements to be removed from this collection.
// * @return <tt>true</tt> if this collection changed as a result of the
// * call
// *
// * @throws UnsupportedOperationException if the <tt>removeAll</tt>
method
// * is not supported by this collection.
// *
// * @see #remove(Object)
// * @see #contains(Object)
// */
// boolean removeAll(Collection c);
//
// /**
// * Retains only the elements in this collection that are contained in
the
// * specified collection (optional operation). In other words, removes
from
// * this collection all of its elements that are not contained in the
// * specified collection.
// *
// * @param c elements to be retained in this collection.
// * @return <tt>true</tt> if this collection changed as a result of the
// * call
// *
// * @throws UnsupportedOperationException if the <tt>retainAll</tt>
method
// * is not supported by this Collection.
// *
// * @see #remove(Object)
// * @see #contains(Object)
// */
// boolean retainAll(Collection c);
//
// /**
// * Removes all of the elements from this collection (optional
operation).
// * This collection will be empty after this method returns unless it
// * throws an exception.
// *
// * @throws UnsupportedOperationException if the <tt>clear</tt> method
is
// * not supported by this collection.
// */
// void clear();
//
//
// // Comparison and hashing
//
// /**
// * Compares the specified object with this collection for equality.
<p>
// *
// * While the <tt>Collection</tt> interface adds no stipulations to the
// * general contract for the <tt>Object.equals</tt>, programmers who
// * implement the <tt>Collection</tt> interface "directly" (in other
words,
// * create a class that is a <tt>Collection</tt> but is not a
<tt>Set</tt>
// * or a <tt>List</tt>) must exercise care if they choose to override
the
// * <tt>Object.equals</tt>. It is not necessary to do so, and the
simplest
// * course of action is to rely on <tt>Object</tt>'s implementation,
but
// * the implementer may wish to implement a "value comparison" in place
of
// * the default "reference comparison." (The <tt>List</tt> and
// * <tt>Set</tt> interfaces mandate such value comparisons.)<p>
// *
// * The general contract for the <tt>Object.equals</tt> method states
that
// * equals must be symmetric (in other words, <tt>a.equals(b)</tt> if
and
// * only if <tt>b.equals(a)</tt>). The contracts for
<tt>List.equals</tt>
// * and <tt>Set.equals</tt> state that lists are only equal to other
lists,
// * and sets to other sets. Thus, a custom <tt>equals</tt> method for
a
// * collection class that implements neither the <tt>List</tt> nor
// * <tt>Set</tt> interface must return <tt>false</tt> when this
collection
// * is compared to any list or set. (By the same logic, it is not
possible
// * to write a class that correctly implements both the <tt>Set</tt>
and
// * <tt>List</tt> interfaces.)
// *
// * @param o Object to be compared for equality with this collection.
// * @return <tt>true</tt> if the specified object is equal to this
// * collection
// *
// * @see Object#equals(Object)
// * @see Set#equals(Object)
// * @see List#equals(Object)
// */
// boolean equals(Object o);
//
// /**
// *
// * Returns the hash code value for this collection. While the
// * <tt>Collection</tt> interface adds no stipulations to the general
// * contract for the <tt>Object.hashCode</tt> method, programmers
should
// * take note that any class that overrides the <tt>Object.equals</tt>
// * method must also override the <tt>Object.hashCode</tt> method in
order
// * to satisfy the general contract for the
<tt>Object.hashCode</tt>method.
// * In particular, <tt>c1.equals(c2)</tt> implies that
// * <tt>c1.hashCode()==c2.hashCode()</tt>.
// *
// * @return the hash code value for this collection
// *
// * @see Object#hashCode()
// * @see Object#equals(Object)
// */
// int hashCode();
//
//
// // +++++++++ DCollection
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// /** */
// public Object selectElement (String _predicate) throws
QueryInvalidException;
//
// /** */
// public java.util.Iterator select (String _predicate) throws
QueryInvalidException;
//
// /** */
// public DCollection query (String _predicate) throws
QueryInvalidException;
//
// /** */
// public boolean existsElement (String _predicate) throws
QueryInvalidException;
//
//
//
// // +++++++++ DBag
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// /** */
// public DBag union (DBag _dbag);
//
// /** */
// public DBag intersection (DBag _dbag);
//
// /** */
// public DBag difference (DBag _dbag);
//
// /** */
// public int occurrences (Object _obj);
//
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DArray.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public interface DArray extends OzoneRemote, DCollection , List
{
// ++++ Interface Collection
++++++++++++++++++++++++++++++++++++++++++++++++++
public boolean add(Object o);//update
public boolean remove(Object o);//update
public boolean addAll(Collection c);//update
public boolean removeAll(Collection c);//update
public boolean retainAll(Collection c);//update
public void clear();//update
// ++++ Interface List
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
public boolean addAll(int index, Collection c);//update
// public Object get(int index);
public Object set(int index, Object element);//update
public void add(int index, Object element);//update
public Object remove(int index);//update
// public int indexOf(Object o);
// public int lastIndexOf(Object o);
// public ListIterator listIterator();
// public ListIterator listIterator(int index);
// public List subList(int fromIndex, int toIndex);
// ++++ ODMG Specification
+++++++++++++++++++++++++++++++++++++++++++++++++++++
/** */
public void resize (int _newSize);//update
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DArrayIterator.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
import java.io.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public class DArrayIterator implements ListIterator, Serializable {
int position;
int lastPosition;
DArray array;
boolean ChangeAllowed;
/** Constructor */
public DArrayIterator (DArray _arrayOfObject) {
this (_arrayOfObject, 0);
}
/** Constructor */
public DArrayIterator (DArray _arrayOfObject, int _startIndex) {
array = _arrayOfObject;
position = -1 + _startIndex;
lastPosition = -1 + _startIndex;
ChangeAllowed = false;
}
/** */
public boolean hasNext () {
if (position < (array.size () - 1))
return true;
return false;
}
/** */
public boolean hasPrevious () {
if (position >= 0)
return true;
return false;
}
/** */
public Object next () throws NoSuchElementException {
if (position < (array.size () - 1)) {
++position;
lastPosition = position;
ChangeAllowed = true;
return array.get (lastPosition);
}
else
throw new NoSuchElementException ("Iteration has no more
elements.");
}
/** */
public Object previous() throws NoSuchElementException {
if (position >= 0) {
lastPosition = position;
--position;
ChangeAllowed = true;
return array.get (lastPosition);
}
else
throw new NoSuchElementException ("Iteration has no previous
element.");
}
/** */
public void add(Object _obj) {
if (ChangeAllowed) {
array.add (lastPosition, _obj);
ChangeAllowed = false;
}
else
throw new IllegalStateException ("first call next() or
previous()!");
}
/** */
public void remove() throws IllegalStateException {
if (ChangeAllowed) {
array.remove (lastPosition);
ChangeAllowed = false;
}
else
throw new IllegalStateException ("first call next() or
previous()!");
}
/** */
public void set(Object _obj) throws IllegalStateException {
if (ChangeAllowed) {
array.remove (lastPosition);
ChangeAllowed = false;
}
else
throw new IllegalStateException ("first call next() or
previous()!");
}
/** */
public int nextIndex() {
return Math.min ((lastPosition + 1), array.size ());
}
/** */
public int previousIndex() {
return lastPosition;
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: Database.java,v 1.5 1999/11/01 14:14:11 daniela Exp $
package org.ozoneDB.odmg;
//import org.ozoneDB.*;
/**
@author <a href="http://www.softwarebuero.de/">SMB</a>
@version $Revision: 1.5 $Date: 1999/06/08 09:28:36 $
*/
public class Database extends Object {
public static final int notOpen = 0;
public static final int openReadOnly = 1;
public static final int openReadWrite = 2;
public static final int openExclusive = 3;
/** */
public static Database open(String name, int accessMode) throws
ODMGException {
throw new Error ("Method not implemented yet");
}
/** */
public void close() throws ODMGException {
}
/** */
public static Database create(String name, int fileMode) {
throw new Error ("Method not implemented yet");
}
/** */
public void bind(Object object, String name) {
}
/** */
public Object lookup(String name) throws ObjectNameNotFoundException {
throw new Error ("Method not implemented yet");
}
/** */
public void unbind(String name) throws ObjectNameNotFoundException {
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DBag.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
//import org.ozoneDB.*;
/**
*/
public interface DBag extends DCollection
{
/** */
public DBag union (DBag _dbag);
/** */
public DBag intersection (DBag _dbag);
/** */
public DBag difference (DBag _dbag);
/** */
public int occurrences (Object _obj);
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DCollection.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public interface DCollection extends Collection
{
// ++++ Interface Collection
+++++++++++++++++++++++++++++++++++++++++++++++++++
// public int size();
// public boolean isEmpty();
// public boolean contains(Object o);
// public Iterator iterator();
// public Object[] toArray();
// public Object[] toArray(Object a[]);
//
// public boolean add(Object o);//update
// public boolean remove(Object o);//update
//
// public boolean containsAll(Collection c);
//
// public boolean addAll(Collection c);//update
// public boolean removeAll(Collection c);//update
// public boolean retainAll(Collection c);//update
// public void clear();//update
//
// public boolean equals(Object o);
// public int hashCode();
// ++++ ODMG Specification
+++++++++++++++++++++++++++++++++++++++++++++++++++++
/** */
public Object selectElement (String _predicate) throws
QueryInvalidException;
/** */
public Iterator select (String _predicate) throws QueryInvalidException;
/** */
public DCollection query (String _predicate) throws
QueryInvalidException;
/** */
public boolean existsElement (String _predicate) throws
QueryInvalidException;
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DIterator.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public abstract class DIterator implements Iterator {
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DList.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
//import org.ozoneDB.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public interface DList extends List, DCollection
{
/** */
public DList concat (DList _dlist);
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: DSet.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
//import org.ozoneDB.*;
import com.sun.java.util.collections.*; // import java.util.*;
/**
*/
public interface DSet extends DCollection, Set
{
/** */
public DSet union (DSet _dset);
/** */
public DSet intersection (DSet _dset);
/** */
public DSet difference (DSet _dset);
/** (equivalent to containsAll() from java.util.Collection)*/
public boolean subsetOf (DSet _dset);
/** */
public boolean properSubsetOf (DSet _dset);
/** */
public boolean supersetOf (DSet _dset);
/** */
public boolean properSupersetOf (DSet _dset);
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: ObjectNameNotFoundException.java,v 1.3 1999/11/01 14:14:11 daniela
Exp $
package org.ozoneDB.odmg;
//import org.ozoneDB.*;
/**
@author <a href="http://www.softwarebuero.de/">SMB</a>
@version $Revision: 1.3 $Date: 1999/06/08 09:28:36 $
*/
public class ObjectNameNotFoundException extends ODMGException {
/** */
public ObjectNameNotFoundException(String message) {
super(message);
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: ODMGException.java,v 1.4 1999/11/01 14:14:11 daniela Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
/**
@author <a href="http://www.softwarebuero.de/">SMB</a>
@version $Revision: 1.4 $Date: 1999/06/08 09:28:36 $
*/
public class ODMGException extends OzoneRemoteExc {
/** */
public ODMGException (String message) {
super(message);
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: QueryException.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
/**
*/
public class QueryException extends ODMGException {
/** */
public QueryException (String message) {
super(message);
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: QueryInvalidException.java,v 1.2 1999/10/01 14:14:19 lars Exp $
package org.ozoneDB.odmg;
import org.ozoneDB.*;
/**
*/
public class QueryInvalidException extends QueryException {
/** */
public QueryInvalidException (String message) {
super(message);
}
}
// You can redistribute this software and/or modify it under the terms of
// the Ozone Library License version 1 published by softwarebuero m&b (SMB).
//
// The original code and portions created by SMB are
// Copyright (C) 1997-1999 by softwarebuero m&b (SMB). All rights reserved.
//
// $Id: Transaction.java,v 1.5 1999/11/19 16:07:34 daniela Exp $
package org.ozoneDB.odmg;
//import org.ozoneDB.*;
/**
@author <a href="http://www.softwarebuero.de/">SMB</a>
@version $Revision: 1.5 $Date: 1999/06/08 09:28:36 $
*/
public class Transaction {
public static final int READ = 1;
public static final int UPGRADE = 2;
public static final int WRITE = 3;
/** */
public static Transaction current() {
throw new Error ("Method not implemented yet");
}
/** */
public Transaction() {
}
/** */
public void join() {
}
/** */
public void leave() {
}
/** */
public void begin() {
}
/** */
public boolean isOpen() {
throw new Error ("Method not implemented yet");
}
/** */
public void commit() {
}
/** */
public void abort() {
}
/** */
public void checkpoint() {
}
/** */
public void lock (Object obj, int mode) {
}
}