summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-11-16 09:29:20 +0000
committermichelou <michelou@epfl.ch>2005-11-16 09:29:20 +0000
commitda822066486e416035bce96fd6d6669429cd98f9 (patch)
treeb55d1456373d98dcadfa99f8cdc1fd4505e638a2
parenta34d33eecbbc80ef5d93b6a09f9438459533d846 (diff)
downloadscala-da822066486e416035bce96fd6d6669429cd98f9.tar.gz
scala-da822066486e416035bce96fd6d6669429cd98f9.tar.bz2
scala-da822066486e416035bce96fd6d6669429cd98f9.zip
- cleaned up
-rw-r--r--sources/scala/dbc/DataType.scala50
-rw-r--r--sources/scala/dbc/Utilities.scala9
2 files changed, 34 insertions, 25 deletions
diff --git a/sources/scala/dbc/DataType.scala b/sources/scala/dbc/DataType.scala
index b8cdb657a8..b984169350 100644
--- a/sources/scala/dbc/DataType.scala
+++ b/sources/scala/dbc/DataType.scala
@@ -9,30 +9,37 @@
package scala.dbc;
/** An ISO-9075:2003 (SQL) data type. Mappings between SQL types and
- * database specific types should be provided by the database driver. */
+ * database specific types should be provided by the database driver.
+ */
abstract class DataType {
/** Tests whether this datatype is equivalent to another. Usually, two
- * types are defined as equivalent if they are equal. Two types can be
- * equivalent without being equal if values of those types will be encoded
- * in the same native Scala type. */
- def isEquivalent (datatype:DataType): Boolean;
+ * types are defined as equivalent if they are equal. Two types can be
+ * equivalent without being equal if values of those types will be
+ * encoded in the same native Scala type.
+ */
+ def isEquivalent(datatype: DataType): Boolean;
/** Tests whether this datatype is equivalent or a subtype of another
- * datatype. Type A is said to be subtype of type B if any value of type A
- * can be represented as a value of type B. */
- def isSubtypeOf (datatype:DataType): Boolean;
+ * datatype. Type <code>A</code> is said to be subtype of type
+ * <code>B</code> if any value of type <code>A</code> can be
+ * represented as a value of type <code>B</code>.
+ */
+ def isSubtypeOf(datatype: DataType): Boolean;
/** The native Scala type in which values of this SQL type will be
- * encoded. */
+ * encoded.
+ */
type NativeType <: Any;
- /**The native Scala type in which values of this SQL type will be
- * encoded. This must point to the same type as <code>NativeType</code>. */
+ /** The native Scala type in which values of this SQL type will be
+ * encoded. This must point to the same type as <code>NativeType</code>.
+ */
def nativeTypeId: DataType.Id;
/** Whether the value can take the null value, None when this property is
- * unknown. */
+ * unknown.
+ */
def nullable: Option[Boolean] = None;
/** The SQL name of the type */
@@ -43,16 +50,17 @@ abstract class DataType {
object DataType {
type Id = Int;
- val OBJECT: Id = 10;
- val BOOLEAN: Id = 20;
- val BYTE: Id = 30;
- val SHORT: Id = 31;
- val INT: Id = 32;
- val LONG: Id = 33;
+
+ val OBJECT : Id = 10;
+ val BOOLEAN : Id = 20;
+ val BYTE : Id = 30;
+ val SHORT : Id = 31;
+ val INT : Id = 32;
+ val LONG : Id = 33;
val BIG_INTEGER: Id = 34;
val BIG_DECIMAL: Id = 35;
- val FLOAT: Id = 40;
- val DOUBLE: Id = 41;
- val STRING: Id = 50;
+ val FLOAT : Id = 40;
+ val DOUBLE : Id = 41;
+ val STRING : Id = 50;
}
diff --git a/sources/scala/dbc/Utilities.scala b/sources/scala/dbc/Utilities.scala
index b7bc4f1ad0..46ca27a019 100644
--- a/sources/scala/dbc/Utilities.scala
+++ b/sources/scala/dbc/Utilities.scala
@@ -9,14 +9,15 @@
package scala.dbc;
/** An object offering transformation methods (views) on various values.
- * This object's members must be visible in an expression to use value auto-
- * conversion. */
+ * This object's members must be visible in an expression to use value
+ * auto-conversion.
+ */
object Utilities {
- def view (obj:statement.expression.Constant): Value =
+ def view (obj: statement.expression.Constant): Value =
obj.constantValue;
- def view (obj:Value): statement.expression.Constant =
+ def view (obj: Value): statement.expression.Constant =
new statement.expression.Constant {
val constantValue = obj;
}