simpledb.remote
Class RemoteMetaDataImpl
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
simpledb.remote.RemoteMetaDataImpl
- All Implemented Interfaces:
- Serializable, Remote, RemoteMetaData
public class RemoteMetaDataImpl
- extends UnicastRemoteObject
- implements RemoteMetaData
The RMI server-side implementation of RemoteMetaData.
- Author:
- Edward Sciore
- See Also:
- Serialized Form
Method Summary |
int |
getColumnCount()
Returns the size of the field list. |
int |
getColumnDisplaySize(int column)
Returns the number of characters required to display the
specified column. |
String |
getColumnName(int column)
Returns the field name for the specified column number. |
int |
getColumnType(int column)
Returns the type of the specified column. |
RemoteMetaDataImpl
public RemoteMetaDataImpl(Schema sch)
throws RemoteException
- Creates a metadata object that wraps the specified schema.
The method also creates a list to hold the schema's
collection of field names,
so that the fields can be accessed by position.
- Parameters:
sch
- the schema
- Throws:
RemoteException
getColumnCount
public int getColumnCount()
throws RemoteException
- Returns the size of the field list.
- Specified by:
getColumnCount
in interface RemoteMetaData
- Throws:
RemoteException
- See Also:
RemoteMetaData.getColumnCount()
getColumnName
public String getColumnName(int column)
throws RemoteException
- Returns the field name for the specified column number.
In JDBC, column numbers start with 1, so the field
is taken from position (column-1) in the list.
- Specified by:
getColumnName
in interface RemoteMetaData
- Throws:
RemoteException
- See Also:
RemoteMetaData.getColumnName(int)
getColumnType
public int getColumnType(int column)
throws RemoteException
- Returns the type of the specified column.
The method first finds the name of the field in that column,
and then looks up its type in the schema.
- Specified by:
getColumnType
in interface RemoteMetaData
- Throws:
RemoteException
- See Also:
RemoteMetaData.getColumnType(int)
getColumnDisplaySize
public int getColumnDisplaySize(int column)
throws RemoteException
- Returns the number of characters required to display the
specified column.
For a string-type field, the method simply looks up the
field's length in the schema and returns that.
For an int-type field, the method needs to decide how
large integers can be.
Here, the method arbitrarily chooses 6 characters,
which means that integers over 999,999 will
probably get displayed improperly.
- Specified by:
getColumnDisplaySize
in interface RemoteMetaData
- Throws:
RemoteException
- See Also:
RemoteMetaData.getColumnDisplaySize(int)
Copyright © 2011. All Rights Reserved.