org.jnario.lib
Class ExampleTable<T extends ExampleTableRow>

java.lang.Object
  extended by org.jnario.lib.ExampleTable<T>
All Implemented Interfaces:
Iterable<T>

public class ExampleTable<T extends ExampleTableRow>
extends Object
implements Iterable<T>

An implementation of a table with rows and columns. It should be used together with Each.forEach(ExampleTable, org.eclipse.xtext.xbase.lib.Procedures.Procedure1).

Author:
Sebastian Benz - Initial contribution and API

Constructor Summary
ExampleTable(String name, List<String> columns, List<T> rows)
           
 
Method Summary
static
<P extends ExampleTableRow>
ExampleTable<P>
create(String name, List<String> columns, P... entries)
           
 T get(int index)
          Returns the table row at the specified index.
 List<String> getColumnNames()
           
 String getName()
           
 List<T> getRows()
           
 Iterator<T> iterator()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExampleTable

public ExampleTable(String name,
                    List<String> columns,
                    List<T> rows)
Method Detail

create

public static <P extends ExampleTableRow> ExampleTable<P> create(String name,
                                                                 List<String> columns,
                                                                 P... entries)

get

public T get(int index)
Returns the table row at the specified index.

Parameters:
index -
Returns:
the table row
Throws:
IndexOutOfBoundsException - if the index is out of range

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T extends ExampleTableRow>

getRows

public List<T> getRows()
Returns:
the list of rows

getColumnNames

public List<String> getColumnNames()
Returns:
the column names

getName

public String getName()
Returns:
the name of this table


Copyright © 2012-2013 BMW Car IT. All Rights Reserved.