org.postgresql.pljava.internal
Class Oid

java.lang.Object
  extended by java.lang.Number
      extended by org.postgresql.pljava.internal.Oid
All Implemented Interfaces:
java.io.Serializable

public class Oid
extends java.lang.Number

The Oid correspons to the internal PostgreSQL Oid. Should the size of that change from 32 bit, this class must change too. In Java, the InvalidOid is represented as null.

See Also:
Serialized Form

Constructor Summary
Oid(int value)
           
 
Method Summary
 double doubleValue()
           
 boolean equals(java.lang.Object o)
          Checks to see if the other object is an Oid, and if so, if the native value of that Oid equals the native value of this Oid.
 float floatValue()
           
static Oid forJavaClass(java.lang.Class clazz)
          Finds the PostgreSQL well known Oid for the given class.
static Oid forSqlType(int sqlType)
          Finds the PostgreSQL well known Oid for the XOPEN Sql type.
static Oid forTypeName(java.lang.String typeString)
          Finds the PostgreSQL well known Oid for a type name.
 java.lang.Class getJavaClass()
           
static Oid getTypeId()
          Returns the PostgreSQL type id for the Oid type.
 int hashCode()
          The native value is used as the hash code.
 int intValue()
           
 long longValue()
           
static void registerType(java.lang.Class clazz, Oid typeId)
          A Type well known to PostgreSQL but not known as a standard XOPEN SQL type can be registered here.
 java.lang.String toString()
          Returns a string representation of this OID.
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Oid

public Oid(int value)
Method Detail

forJavaClass

public static Oid forJavaClass(java.lang.Class clazz)
Finds the PostgreSQL well known Oid for the given class.

Parameters:
clazz - The class.
Returns:
The well known Oid or null if no such Oid could be found.

forTypeName

public static Oid forTypeName(java.lang.String typeString)
Finds the PostgreSQL well known Oid for a type name.

Parameters:
typeString - The name of the type, optionally qualified with a namespace.
Returns:
The well known Oid.
Throws:
java.sql.SQLException - if the type could not be found

forSqlType

public static Oid forSqlType(int sqlType)
Finds the PostgreSQL well known Oid for the XOPEN Sql type.

Parameters:
sqlType - The XOPEN type code.
Throws:
java.sql.SQLException - if the type could not be found

getTypeId

public static Oid getTypeId()
Returns the PostgreSQL type id for the Oid type.


registerType

public static void registerType(java.lang.Class clazz,
                                Oid typeId)
A Type well known to PostgreSQL but not known as a standard XOPEN SQL type can be registered here. This includes types like the Oid itself and all the geometry related types.

Parameters:
clazz - The Java class that corresponds to the type id.
typeId - The well known type id.

doubleValue

public double doubleValue()
Specified by:
doubleValue in class java.lang.Number

equals

public boolean equals(java.lang.Object o)
Checks to see if the other object is an Oid, and if so, if the native value of that Oid equals the native value of this Oid.

Overrides:
equals in class java.lang.Object
Returns:
true if the objects are equal.

floatValue

public float floatValue()
Specified by:
floatValue in class java.lang.Number

getJavaClass

public java.lang.Class getJavaClass()
                             throws java.sql.SQLException
Throws:
java.sql.SQLException

hashCode

public int hashCode()
The native value is used as the hash code.

Overrides:
hashCode in class java.lang.Object
Returns:
The hashCode for this Oid.

intValue

public int intValue()
Specified by:
intValue in class java.lang.Number

longValue

public long longValue()
Specified by:
longValue in class java.lang.Number

toString

public java.lang.String toString()
Returns a string representation of this OID.

Overrides:
toString in class java.lang.Object


Copyright (c) 2003, 2004, 2005 TADA AB - Taby Sweden. Distributed under the terms shown in COPYRIGHT