Mercurial > dive4elements > gnv-client
diff geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java @ 884:12f88239fb33
Updated Javadocs to the Listed Classes.
Also done some Codecleanup and removed unused Methods from the Code.
geo-backend/trunk@842 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Fri, 26 Mar 2010 15:23:03 +0000 |
parents | 203f95af5b2c |
children | 8b442223741c |
line wrap: on
line diff
--- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java Fri Mar 26 11:07:01 2010 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java Fri Mar 26 15:23:03 2010 +0000 @@ -1,17 +1,5 @@ /** - * Title: Row, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/datasources/Row.java,v 1.4 2008/01/30 12:38:34 blume Exp $ - * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/datasources/Row.java,v $ - * created by: Stefan Blume (blume) - * erstellt am: 21.11.2007 - * Copyright: con terra GmbH, 2005 * - * modified by: $Author: blume $ - * modified on: $Date: 2008/01/30 12:38:34 $ - * Version: $Revision: 1.4 $ - * TAG: $Name: $ - * locked from: $Locker: $ - * CVS State: $State: Exp $ - * Project: $ProjectName$ */ package de.intevation.gnv.geobackend.sde.datasources; @@ -33,10 +21,7 @@ * In a technical manner (e.g. database manner) a row contains all attributes of a single "hit". * * @author blume - * @version 1.0 - * @serial 1.0 - * @see - * @since 21.11.2007 11:00:54 + * @author Tim Englich <tim.englich@intevation.de> */ public class Row { /** @@ -51,29 +36,26 @@ /** * Constructor. - * * @param pRowSize the number of attributes contained by this row. */ public Row(int pRowSize) { mObjects = new Object[pRowSize]; } - + /** * Constructor. - * * @param ArrayStr a line from CSV-File. */ public Row (String[] ArrayStr){ - this (ArrayStr.length); - int nLength = ArrayStr.length; - for (int i=0; i < nLength; i++){ - addObject(ArrayStr[i], i); - - } - + this (ArrayStr.length); + int nLength = ArrayStr.length; + for (int i=0; i < nLength; i++){ + addObject(ArrayStr[i], i); + + } + } - - + /** * Adds an attribute value to a specific position of this row. * @@ -105,7 +87,6 @@ } } - /** * This is a covenient method for getting strongly typed objects out of the row. * It has to be ensured, that the type of the requested row position has been resolved out of the ColumnDefinition ({@link ResultSet#getColumnDefinitions()}). @@ -117,23 +98,23 @@ * @see #getValue(int) */ public Date getDateValue(int pPos) throws TechnicalException { - Date date = null; + Date date = null; try { Calendar lCalendar = (Calendar) getValue(pPos); date = lCalendar.getTime(); } catch (ClassCastException e) { - try{ - //SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); - date = DateUtils.getDateFromString ((String)getValue(pPos)); //(Date)formatter.parse((String)getValue(pPos)); - - - } - catch (Exception ex){ - sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); - throw new TechnicalException("Could not cast this value to the Date Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } - } + try{ + //SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss"); + date = DateUtils.getDateFromString ((String)getValue(pPos)); //(Date)formatter.parse((String)getValue(pPos)); + + + } + catch (Exception ex){ + sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); + throw new TechnicalException("Could not cast this value to the Date Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } + } return date; } @@ -195,13 +176,13 @@ try { return (Double) getValue(pPos); } catch (ClassCastException e) { - try{ - return new Double ((String)getValue(pPos)); - } - catch(Exception ex){ - sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); - throw new TechnicalException("Could not cast this value to the Double Type. Object is of value type: " + getValue(pPos).getClass().getName()); - } + try{ + return new Double ((String)getValue(pPos)); + } + catch(Exception ex){ + sLogger.error(getValue(pPos) + " " + ex.getMessage(), ex); + throw new TechnicalException("Could not cast this value to the Double Type. Object is of value type: " + getValue(pPos).getClass().getName()); + } } } @@ -267,8 +248,6 @@ }else{ returnValue.append("LINESTRING("); } - - for (int i = 0; i< length;i++){ @@ -287,7 +266,7 @@ returnValue.append(" , "); } } - + if(isMultiLineString){ returnValue.append("))"); }else{