Java Doc for Data.java in  » Testing » jakarta-jmeter » org » apache » jorphan » collections » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jorphan.collections 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.jorphan.collections.Data

Data
public class Data implements Serializable(Code)
Use this class to store database-like data. This class uses rows and columns to organize its data. It has some convenience methods that allow fast loading and retrieval of the data into and out of string arrays. It is also handy for reading CSV files.
author:
   Michael Stover (mstover1 at apache.org)
version:
   $Revision: 582659 $


Field Summary
 intcurrentPossize
    
 Mapdata
    
 ArrayListheader
    

Constructor Summary
public  Data()
     Constructor - takes no arguments.

Method Summary
public  voidaddColumnValue(String column, Object value)
     Adds a value into the Data set at the current row, using a column name to find the column in which to insert the new value.
public  voidaddHeader(String s)
     Adds a header name to the Data object.
public  voidaddRow()
    
public  voidappend(Data d)
     Adds the rows of the given Data object to this Data object.
public  intfindValue(String column, Object value)
     Returns the row number where a certain value is.
Parameters:
  column - column to be searched for value.
Parameters:
  value - object in Search of.
public  String[]getColumn(String columnName)
     This method will retrieve every entry in a certain column.
public  ListgetColumnAsObjectArray(String columnName)
     This method will retrieve every entry in a certain column.
public  ObjectgetColumnValue(String column)
     Gets the value in the current row of the given column.
Parameters:
  column - name of the column.
public  ObjectgetColumnValue(int column)
     Gets the value in the current row of the given column.
Parameters:
  column - index of the column (starts at 0).
public  ObjectgetColumnValue(int column, int row)
    
public  intgetCurrentPos()
     Get the number of the current row.
public  String[]getDataAsText()
     Returns all the data in the Data set as an array of strings.
public static  DatagetDataFromResultSet(ResultSet rs)
     Gets a Data object from a ResultSet.
public  intgetHeaderCount()
    
public  String[]getHeaders()
     Returns a String array of the column headers.
public  booleanhasHeader(String column)
     Checks to see if a column exists in the Data object.
Parameters:
  column - Name of column header to check for.
public  booleannext()
     Sets the current position of the Data set to the next row. True if there is another row.
public  booleanprevious()
     Sets the current position of the Data set to the previous row. True if there is another row.
public  voidremoveColumn(int col)
    
public  voidremoveRow()
     Removes the current row.
public  voidremoveRow(int index)
    
public  voidreplaceHeader(String oldHeader, String newHeader)
     Replaces the given header name with a new header name.
public  voidreset()
     Resets the current position of the data set to just before the first element.
public  voidsetColumnData(String colName, Object value)
     Sets the data for every row in the column.
public  voidsetColumnData(int col, List data)
    
public  voidsetColumnValue(String column, Object value)
     Sets the value in the Data set at the current row, using a column name to find the column in which to insert the new value.
public  voidsetCurrentPos(int r)
     Sets the current pos.
public  voidsetData(String[] contents, String delimiter)
     Use this method to set the entire data set.
public  voidsetHeaders(String[] h)
     Sets the headers for the data set.
public  voidsetLine(String[] line)
     Sets a row of data using an array of strings as input.
public  voidsetLine(String[] line, String deflt)
     Sets a row of data using an array of strings as input.
public  intsize()
     Gets the number of rows in the Data object.
public  voidsort(String column, boolean asc)
     Sorts the data using a given row as the sorting criteria.
public  StringtoString()
    

Field Detail
currentPossize
int currentPossize(Code)



data
Map data(Code)



header
ArrayList header(Code)




Constructor Detail
Data
public Data()(Code)
Constructor - takes no arguments.




Method Detail
addColumnValue
public void addColumnValue(String column, Object value)(Code)
Adds a value into the Data set at the current row, using a column name to find the column in which to insert the new value.
Parameters:
  column - the name of the column to set.
Parameters:
  value - value to set into column.



addHeader
public void addHeader(String s)(Code)
Adds a header name to the Data object.
Parameters:
  s - name of header.



addRow
public void addRow()(Code)



append
public void append(Data d)(Code)
Adds the rows of the given Data object to this Data object.
Parameters:
  d - data object to be appended to this one



findValue
public int findValue(String column, Object value)(Code)
Returns the row number where a certain value is.
Parameters:
  column - column to be searched for value.
Parameters:
  value - object in Search of. row # where value exists.



getColumn
public String[] getColumn(String columnName)(Code)
This method will retrieve every entry in a certain column. It returns an array of strings from the column. Even if the data are not strings, they will be returned as strings in this method.
Parameters:
  columnName - name of the column. array of Strings representing the data.



getColumnAsObjectArray
public List getColumnAsObjectArray(String columnName)(Code)
This method will retrieve every entry in a certain column. It returns an array of Objects from the column.
Parameters:
  columnName - name of the column. array of Objects representing the data.



getColumnValue
public Object getColumnValue(String column)(Code)
Gets the value in the current row of the given column.
Parameters:
  column - name of the column. an Object which holds the value of the column.



getColumnValue
public Object getColumnValue(int column)(Code)
Gets the value in the current row of the given column.
Parameters:
  column - index of the column (starts at 0). an Object which holds the value of the column.



getColumnValue
public Object getColumnValue(int column, int row)(Code)



getCurrentPos
public int getCurrentPos()(Code)
Get the number of the current row. integer representing the current row



getDataAsText
public String[] getDataAsText()(Code)
Returns all the data in the Data set as an array of strings. Each array gives a row of data, each column separated by tabs. array of strings.



getDataFromResultSet
public static Data getDataFromResultSet(ResultSet rs) throws SQLException(Code)
Gets a Data object from a ResultSet.
Parameters:
  rs - ResultSet passed in from a database query a Data object
throws:
  java.sql.SQLException -



getHeaderCount
public int getHeaderCount()(Code)



getHeaders
public String[] getHeaders()(Code)
Returns a String array of the column headers. array of strings of the column headers.



hasHeader
public boolean hasHeader(String column)(Code)
Checks to see if a column exists in the Data object.
Parameters:
  column - Name of column header to check for. True or False depending on whether the column exists.



next
public boolean next()(Code)
Sets the current position of the Data set to the next row. True if there is another row. False if there are no more rows.



previous
public boolean previous()(Code)
Sets the current position of the Data set to the previous row. True if there is another row. False if there are no more rows.



removeColumn
public void removeColumn(int col)(Code)



removeRow
public void removeRow()(Code)
Removes the current row.



removeRow
public void removeRow(int index)(Code)



replaceHeader
public void replaceHeader(String oldHeader, String newHeader)(Code)
Replaces the given header name with a new header name.
Parameters:
  oldHeader - Old header name.
Parameters:
  newHeader - New header name.



reset
public void reset()(Code)
Resets the current position of the data set to just before the first element.



setColumnData
public void setColumnData(String colName, Object value)(Code)
Sets the data for every row in the column.



setColumnData
public void setColumnData(int col, List data)(Code)



setColumnValue
public void setColumnValue(String column, Object value)(Code)
Sets the value in the Data set at the current row, using a column name to find the column in which to insert the new value.
Parameters:
  column - the name of the column to set.
Parameters:
  value - value to set into column.



setCurrentPos
public void setCurrentPos(int r)(Code)
Sets the current pos. If value sent to method is not a valid number, the current position is set to one higher than the maximum.
Parameters:
  r - position to set to.



setData
public void setData(String[] contents, String delimiter)(Code)
Use this method to set the entire data set. It takes an array of strings. It uses the first row as the headers, and the next rows as the data elements. Delimiter represents the delimiting character(s) that separate each item in a data row.
Parameters:
  contents - array of strings, the first element is a list of the columnheaders, the next elements each represent a single row ofdata.
Parameters:
  delimiter - the delimiter character that separates columns within thestring array.



setHeaders
public void setHeaders(String[] h)(Code)
Sets the headers for the data set. Each header represents a column of data. Each row's data can be gotten with the column header name, which will always be a string.
Parameters:
  h - array of strings representing the column headers.



setLine
public void setLine(String[] line)(Code)
Sets a row of data using an array of strings as input. Each value in the array represents a column's value in that row. Assumes the order will be the same order in which the headers were added to the data set.
Parameters:
  line - array of strings representing column values.



setLine
public void setLine(String[] line, String deflt)(Code)
Sets a row of data using an array of strings as input. Each value in the array represents a column's value in that row. Assumes the order will be the same order in which the headers were added to the data set.
Parameters:
  line - array of strings representing column values.
Parameters:
  deflt - default value to be placed in data if line is not as long asheaders.



size
public int size()(Code)
Gets the number of rows in the Data object. number of rows in Data object.



sort
public void sort(String column, boolean asc)(Code)
Sorts the data using a given row as the sorting criteria. A boolean value indicates whether to sort ascending or descending.
Parameters:
  column - name of column to use as sorting criteria.
Parameters:
  asc - boolean value indicating whether to sort ascending ordescending. True for asc, false for desc. Currently thisfeature is not enabled and all sorts are asc.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.