Kasper Sørensen created METAMODEL-145:
-----------------------------------------

             Summary: A Column subinterface with type arguments
                 Key: METAMODEL-145
                 URL: https://issues.apache.org/jira/browse/METAMODEL-145
             Project: Apache MetaModel
          Issue Type: New Feature
            Reporter: Kasper Sørensen


I propose to introduce a new interface to extend the Column interface. This 
interface should have a type parameter, representing the value type of the 
column. My suggested name would be TypedColumn<E>.

To take advantage of this type information I propose a few changes:

DataSet: Add a getValue(TypedColumn) method. When you have a typed column you 
can then get values from DataSets that do not need casting:

{code}
TypedColumn<Boolean> c1 = ...
TypedColumn<String> c2 = ...
DataSet ds = ...

Boolean value1 = ds.getValue(c1);
Boolean value2 = ds.getValue(c2);
{code}

Table: Change the return type of getNumberColumns() to return TypedColumn<? 
extends Number>[] instead of just Column[]. Apply same principle to other such 
methods (getBooleanColumns, getLiteralColumns etc.).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to