dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16812
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6494: Removed unused class.
------------------------------------------------------------
revno: 6494
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-04-06 09:48:17 +0700
message:
Removed unused class.
removed:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewTable.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewTable.java 2012-04-03 08:51:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewTable.java 1970-01-01 00:00:00 +0000
@@ -1,169 +0,0 @@
-package org.hisp.dhis.sqlview;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author Dang Duy Hieu
- */
-public class SqlViewTable
-{
- private List<String> headers = new ArrayList<String>();
-
- private List<List<Object>> records = new ArrayList<List<Object>>();
-
- // -------------------------------------------------------------------------
- // Constructors
- // -------------------------------------------------------------------------
-
- public SqlViewTable()
- {
- }
-
- public SqlViewTable( List<String> headers )
- {
- this.headers = headers;
- }
-
- public SqlViewTable( List<String> headers, List<List<Object>> records )
- {
- this.headers = headers;
- this.records = records;
- }
-
- // -------------------------------------------------------------------------
- // Getters & Setters
- // -------------------------------------------------------------------------
-
- public List<String> getHeaders()
- {
- return headers;
- }
-
- public void setHeaders( List<String> headers )
- {
- this.headers = headers;
- }
-
- public List<List<Object>> getRecords()
- {
- return records;
- }
-
- public void setRecords( List<List<Object>> records )
- {
- this.records = records;
- }
-
- // -------------------------------------------------------------------------
- // Other methods
- // -------------------------------------------------------------------------
-
- public void addRecord( List<Object> record )
- {
- records.add( record );
- }
-
- public void createViewerStructure( ResultSet rs )
- {
- try
- {
- ResultSetMetaData rsmd = rs.getMetaData();
-
- int columnNo = rsmd.getColumnCount();
-
- for ( int i = 1; i <= columnNo; i++ )
- {
- headers.add( rsmd.getColumnLabel( i ) );
- }
- }
- catch ( SQLException ex )
- {
- throw new RuntimeException( ex );
- }
- }
-
- public void addRecord( ResultSet rs )
- {
- try
- {
- int columnNo = rs.getMetaData().getColumnCount();
-
- while ( rs.next() )
- {
- List<Object> rows = new ArrayList<Object>();
-
- for ( int i = 1; i <= columnNo; i++ )
- {
- rows.add( rs.getObject( i ) );
- }
-
- records.add( rows );
- }
- }
- catch ( SQLException ex )
- {
- throw new RuntimeException( ex );
- }
- }
-
- // -------------------------------------------------------------------------
- // hashCode() & equals()
- // -------------------------------------------------------------------------
-
- @Override
- public int hashCode()
- {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((headers == null) ? 0 : headers.hashCode());
- result = prime * result + ((records == null) ? 0 : records.hashCode());
- return result;
- }
-
- @Override
- public boolean equals( Object obj )
- {
- if ( this == obj )
- {
- return true;
- }
- if ( obj == null )
- {
- return false;
- }
- if ( getClass() != obj.getClass() )
- {
- return false;
- }
-
- final SqlViewTable other = (SqlViewTable) obj;
-
- if ( headers == null )
- {
- if ( other.headers != null )
- {
- return false;
- }
- }
- else if ( !headers.equals( other.headers ) )
- {
- return false;
- }
- if ( records == null )
- {
- if ( other.records != null )
- {
- return false;
- }
- }
- else if ( !records.equals( other.records ) )
- {
- return false;
- }
- return true;
- }
-}