提交 dc4f999e authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting, javadocs

上级 0dae0b0b
...@@ -56,7 +56,7 @@ import org.h2.value.ValueUuid; ...@@ -56,7 +56,7 @@ import org.h2.value.ValueUuid;
/** /**
* This class represents a byte buffer that contains persistent data of a page. * This class represents a byte buffer that contains persistent data of a page.
* *
* @author Thomas Mueller * @author Thomas Mueller
* @author Noel Grandin * @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888 * @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......
...@@ -19,7 +19,7 @@ import java.util.Properties; ...@@ -19,7 +19,7 @@ import java.util.Properties;
* is unloaded when stopping the bundle. * is unloaded when stopping the bundle.
*/ */
public class DbDriverActivator implements BundleActivator { public class DbDriverActivator implements BundleActivator {
private OSGIClassFactory osgiClassFactory; private OSGIClassFactory osgiClassFactory;
private OSGIServiceClassFactory osgiServiceClassFactory; private OSGIServiceClassFactory osgiServiceClassFactory;
...@@ -47,7 +47,7 @@ public class DbDriverActivator implements BundleActivator { ...@@ -47,7 +47,7 @@ public class DbDriverActivator implements BundleActivator {
* Stop the bundle. This will unload the database driver. The * Stop the bundle. This will unload the database driver. The
* DataSourceFactory service is implicitly un-registered by the OSGi * DataSourceFactory service is implicitly un-registered by the OSGi
* framework. * framework.
* *
* @param bundleContext the bundle context * @param bundleContext the bundle context
*/ */
@Override @Override
...@@ -65,7 +65,7 @@ public class DbDriverActivator implements BundleActivator { ...@@ -65,7 +65,7 @@ public class DbDriverActivator implements BundleActivator {
* BundleSymbolicName:BundleVersion:BinaryClassName * BundleSymbolicName:BundleVersion:BinaryClassName
*/ */
private static class OSGIClassFactory implements Utils.ClassFactory { private static class OSGIClassFactory implements Utils.ClassFactory {
/** /**
* Separator character to merge bundle name,version and class binary * Separator character to merge bundle name,version and class binary
* name * name
...@@ -78,7 +78,7 @@ public class DbDriverActivator implements BundleActivator { ...@@ -78,7 +78,7 @@ public class DbDriverActivator implements BundleActivator {
/** /**
* Constructor * Constructor
* *
* @param bundleContext Valid bundleContext instance * @param bundleContext Valid bundleContext instance
*/ */
OSGIClassFactory(BundleContext bundleContext) { OSGIClassFactory(BundleContext bundleContext) {
...@@ -114,21 +114,23 @@ public class DbDriverActivator implements BundleActivator { ...@@ -114,21 +114,23 @@ public class DbDriverActivator implements BundleActivator {
+ parts[BUNDLE_VERSION_INDEX]); + parts[BUNDLE_VERSION_INDEX]);
} }
} }
/** /**
* Extend the H2 class loading in order to find class defined in other bundles. * Extend the H2 class loading in order to find class defined in other
* bundles.
* *
* The Class must be registered as a service. * The class must be registered as a service.
* *
* The main difference with {@link OSGIClassFactory} is that it does not rely to a specific bundle. * The main difference with {@link OSGIClassFactory} is that it does not
* OSGIServiceClassFactory is the preferred way to register function used in table constraints, * rely to a specific bundle. OSGIServiceClassFactory is the preferred way
* theses functions should not be removed of the DataBase. * to register function used in table constraints, these functions should
* not be removed from the database.
* *
* The class format for bundle service class is the following : * The class format for bundle service class is the following:
* OSGI:BinaryClassNameService * OSGI:BinaryClassNameService
*/ */
private static class OSGIServiceClassFactory implements Utils.ClassFactory { private static class OSGIServiceClassFactory implements Utils.ClassFactory {
/** /**
* Separator character to merge bundle name, version and class binary * Separator character to merge bundle name, version and class binary
* name * name
...@@ -136,7 +138,7 @@ public class DbDriverActivator implements BundleActivator { ...@@ -136,7 +138,7 @@ public class DbDriverActivator implements BundleActivator {
public static final String SEPARATOR = "="; public static final String SEPARATOR = "=";
private static final int BINARY_CLASS_NAME_INDEX = 1; private static final int BINARY_CLASS_NAME_INDEX = 1;
private BundleContext bundleContext; private BundleContext bundleContext;
/** /**
...@@ -168,5 +170,5 @@ public class DbDriverActivator implements BundleActivator { ...@@ -168,5 +170,5 @@ public class DbDriverActivator implements BundleActivator {
throw new ClassNotFoundException("OSGi Service not found "+parts[BINARY_CLASS_NAME_INDEX]); throw new ClassNotFoundException("OSGi Service not found "+parts[BINARY_CLASS_NAME_INDEX]);
} }
} }
} }
...@@ -62,12 +62,12 @@ public class Utils { ...@@ -62,12 +62,12 @@ public class Utils {
private static boolean allowAllClasses; private static boolean allowAllClasses;
private static HashSet<String> allowedClassNames; private static HashSet<String> allowedClassNames;
/** /**
* In order to manage more than one class loader * In order to manage more than one class loader
*/ */
private static ArrayList<ClassFactory> userClassFactories = new ArrayList<ClassFactory>(); private static ArrayList<ClassFactory> userClassFactories = new ArrayList<ClassFactory>();
private static String[] allowedClassNamePrefixes; private static String[] allowedClassNamePrefixes;
static { static {
...@@ -80,14 +80,14 @@ public class Utils { ...@@ -80,14 +80,14 @@ public class Utils {
} }
} }
} }
private Utils() { private Utils() {
// utility class // utility class
} }
/** /**
* Add a class factory in order to manage more than one class loader. * Add a class factory in order to manage more than one class loader.
* *
* @param classFactory An object that implements ClassFactory * @param classFactory An object that implements ClassFactory
*/ */
public static void addClassFactory(ClassFactory classFactory) { public static void addClassFactory(ClassFactory classFactory) {
...@@ -96,13 +96,13 @@ public class Utils { ...@@ -96,13 +96,13 @@ public class Utils {
/** /**
* Remove a class factory * Remove a class factory
* *
* @param classFactory Already inserted class factory instance * @param classFactory Already inserted class factory instance
*/ */
public static void removeClassFactory(ClassFactory classFactory) { public static void removeClassFactory(ClassFactory classFactory) {
getUserClassFactories().remove(classFactory); getUserClassFactories().remove(classFactory);
} }
private static ArrayList<ClassFactory> getUserClassFactories() { private static ArrayList<ClassFactory> getUserClassFactories() {
if (userClassFactories == null) { if (userClassFactories == null) {
// initially, it is empty // initially, it is empty
...@@ -111,7 +111,7 @@ public class Utils { ...@@ -111,7 +111,7 @@ public class Utils {
} }
return userClassFactories; return userClassFactories;
} }
private static int readInt(byte[] buff, int pos) { private static int readInt(byte[] buff, int pos) {
return (buff[pos++] << 24) + ((buff[pos++] & 0xff) << 16) + ((buff[pos++] & 0xff) << 8) + (buff[pos] & 0xff); return (buff[pos++] << 24) + ((buff[pos++] & 0xff) << 16) + ((buff[pos++] & 0xff) << 8) + (buff[pos] & 0xff);
} }
...@@ -920,19 +920,19 @@ public class Utils { ...@@ -920,19 +920,19 @@ public class Utils {
* in order to provide a class from another bundle ClassLoader. * in order to provide a class from another bundle ClassLoader.
*/ */
public interface ClassFactory { public interface ClassFactory {
/** /**
* Check whether the factory can return the named class. * Check whether the factory can return the named class.
* *
* @param name the binary name of the class * @param name the binary name of the class
* @return true if this factory can return a valid class for the * @return true if this factory can return a valid class for the
* provided class name * provided class name
*/ */
boolean match(String name); boolean match(String name);
/** /**
* Load the class. * Load the class.
* *
* @param name the binary name of the class * @param name the binary name of the class
* @return the class object * @return the class object
* @throws ClassNotFoundException If the class is not handle by this * @throws ClassNotFoundException If the class is not handle by this
......
...@@ -963,7 +963,7 @@ public class DataType { ...@@ -963,7 +963,7 @@ public class DataType {
/** /**
* Check whether a given object is a Geometry object. * Check whether a given object is a Geometry object.
* *
* @param x the the object * @param x the the object
* @return true if it is a Geometry object * @return true if it is a Geometry object
*/ */
......
...@@ -34,7 +34,7 @@ import org.h2.util.Utils; ...@@ -34,7 +34,7 @@ import org.h2.util.Utils;
/** /**
* This is the base class for all value classes. * This is the base class for all value classes.
* It provides conversion and comparison methods. * It provides conversion and comparison methods.
* *
* @author Thomas Mueller * @author Thomas Mueller
* @author Noel Grandin * @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888 * @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
......
...@@ -22,7 +22,7 @@ import com.vividsolutions.jts.io.WKTWriter; ...@@ -22,7 +22,7 @@ import com.vividsolutions.jts.io.WKTWriter;
/** /**
* Implementation of the GEOMETRY data type. * Implementation of the GEOMETRY data type.
* *
* @author Thomas Mueller * @author Thomas Mueller
* @author Noel Grandin * @author Noel Grandin
* @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888 * @author Nicolas Fortin, Atelier SIG, IRSTV FR CNRS 24888
...@@ -79,18 +79,18 @@ public class ValueGeometry extends Value { ...@@ -79,18 +79,18 @@ public class ValueGeometry extends Value {
/** /**
* Test if this geometry envelope intersects with the other geometry * Test if this geometry envelope intersects with the other geometry
* envelope. * envelope.
* *
* @param r the other geometry * @param r the other geometry
* @return true if the two envelopes overlaps * @return true if the two overlap
*/ */
public boolean intersectsBoundingBox(ValueGeometry r) { public boolean intersectsBoundingBox(ValueGeometry r) {
// it is useless to cache the envelope as the Geometry object do this already // the Geometry object caches the envelope
return geometry.getEnvelopeInternal().intersects(r.getGeometry().getEnvelopeInternal()); return geometry.getEnvelopeInternal().intersects(r.getGeometry().getEnvelopeInternal());
} }
/** /**
* Get the union. * Get the union.
* *
* @param r the other geometry * @param r the other geometry
* @return the union of this geometry envelope and another geometry envelope * @return the union of this geometry envelope and another geometry envelope
*/ */
...@@ -99,13 +99,13 @@ public class ValueGeometry extends Value { ...@@ -99,13 +99,13 @@ public class ValueGeometry extends Value {
Envelope mergedEnvelope = new Envelope(geometry.getEnvelopeInternal()); Envelope mergedEnvelope = new Envelope(geometry.getEnvelopeInternal());
mergedEnvelope.expandToInclude(r.getGeometry().getEnvelopeInternal()); mergedEnvelope.expandToInclude(r.getGeometry().getEnvelopeInternal());
return get(gf.toGeometry(mergedEnvelope)); return get(gf.toGeometry(mergedEnvelope));
} }
/** /**
* Get the intersection. * Get the intersection.
* *
* @param r the other geometry * @param r the other geometry
* @return the intersection of this geometry envelope and another geometry envelope * @return the intersection of this geometry envelope and another
*/ */
public ValueGeometry getEnvelopeIntersection(ValueGeometry r) { public ValueGeometry getEnvelopeIntersection(ValueGeometry r) {
Envelope e1 = geometry.getEnvelopeInternal(); Envelope e1 = geometry.getEnvelopeInternal();
...@@ -120,7 +120,7 @@ public class ValueGeometry extends Value { ...@@ -120,7 +120,7 @@ public class ValueGeometry extends Value {
GeometryFactory gf = new GeometryFactory(); GeometryFactory gf = new GeometryFactory();
return get(gf.toGeometry(e3)); return get(gf.toGeometry(e3));
} }
@Override @Override
public int getType() { public int getType() {
return Value.GEOMETRY; return Value.GEOMETRY;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论