Java Doc for ArrayGrid.java in  » Web-Framework » ThinWire » thinwire » util » 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 » Web Framework » ThinWire » thinwire.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   thinwire.util.ArrayGrid

ArrayGrid
public class ArrayGrid implements Grid<R, C>(Code)
ArrayGrid is an implementation of the Grid interface which provides a disconnected dataset.

The samples below populate an ArrayGrid with values from an array and then print out the values in the ArrayGrid.

Notes

  • Don't add the same Column to an ArrayGrid twice. The following code illustrates the error.
     Grid ag = new ArrayGrid();
     Grid.Column col = new ArrayGrid.Column();
     ag.getColumns().add(col);
     ag.getColumns().add(col); //!!! Don't do this.
     
  • Don't add the same Row to an ArrayGrid twice.
     Grid ag = new ArrayGrid();
     Grid.Row row = new ArrayGrid.Row();
     ag.getRows().add(row);
     ag.getRows().add(row); //!!! Don't do this.
     
  • If you replace a Row in an ArrayGrid, be careful with the replaced Row. If after replacing a Row, you retrieve an element from the replaced Row, the element will still be converted according to the ArrayGrid's policy.
     Grid ag = new ArrayGrid();
     Grid.Row row1 = new ArrayGrid.Row();
     ag.getRows().add(row1);
     Grid.Row row2 = new ArrayGrid.Row();
     Grid.row row3 = ag.getRows().set(0, row2);  //Be careful with row3.
     Object rowVal = row3.get(0); //Be careful with rowVal.
     
     In the code above, row1 is replaced in ag with row2, and row3 is identical to
     row1.  Despite its removal from ag, row1 (aka row3) still has ag as a parent.  If you retrieve
     an element from row1 (aka row3), the value you retrieve may not be the exact Object placed in
     row1.  The value you retrieve - e.g. rowVal in the code above - is a value converted from the
     original via ag's policy.
     
Sample Code:
 int[][] values = new int[][]{ { 0, 1, 2, 3, 4 }, { 10, 11, 12, 13, 14 },
 { 20, 21, 22, 23, 24 }, { 30, 31, 32, 33, 34 }, { 40, 41, 42, 43, 44 } };
 ArrayGrid ag = new ArrayGrid();
 for (int i = 0; i < 5; i++) {
 ArrayGrid.Column col = new ArrayGrid.Column();
 ag.getColumns().add(col);
 }
 for (int i = 0; i < 5; i++) {
 ArrayGrid.Row row = new ArrayGrid.Row();
 ag.getRows().add(row);
 for (int j = 0; j < 5; j++) {
 row.set(j, new Integer(values[i][j]));
 }
 }
 System.out.println("\r\n");
 for (int i = 0; i < 5; i++) {
 ArrayGrid.Row row = (ArrayGrid.Row) ag.getRows().get(i);
 String line = "";
 for (int j = 0; j < 5; j++) {
 line += row.get(j) + " ";
 }
 System.out.println(line);
 }
 

author:
   Joshua J. Gertzen

Inner Class :public static class Row extends AbstractList implements Grid.Row
Inner Class :public static class Column extends AbstractList implements Grid.Column


Constructor Summary
public  ArrayGrid()
     Construct an ArrayGrid.
public  ArrayGrid(Grid<R, C> g)
     Constructs an ArrayGrid based on another grid.
protected  ArrayGrid(Grid<R, C> grid, Class<? extends Row> rowType, Class<? extends Column> columnType)
     Construct an ArrayGrid, specifying an optional inner Grid, a Row type, and a Column type.
Parameters:
  grid - the inner Grid to which this ArrayGrid provides access.

Method Summary
protected  voidfireItemChange(Type type, int rowIndex, int columnIndex, Object oldValue, Object newValue)
    
public  List<C>getColumns()
    
public  List<R>getRows()
    


Constructor Detail
ArrayGrid
public ArrayGrid()(Code)
Construct an ArrayGrid.



ArrayGrid
public ArrayGrid(Grid<R, C> g)(Code)
Constructs an ArrayGrid based on another grid.
Parameters:
  g - a grid that should be copied into this grid.



ArrayGrid
protected ArrayGrid(Grid<R, C> grid, Class<? extends Row> rowType, Class<? extends Column> columnType)(Code)
Construct an ArrayGrid, specifying an optional inner Grid, a Row type, and a Column type.
Parameters:
  grid - the inner Grid to which this ArrayGrid provides access. May be null.
Parameters:
  rowType - the class to which this ArrayGrid's Rows belong
Parameters:
  columnType - the class to which this ArrayGrid's Columns belong
throws:
  ClassCastException - if rowType does not extend Grid.Row or columnType doesnot extend Grid.Column.




Method Detail
fireItemChange
protected void fireItemChange(Type type, int rowIndex, int columnIndex, Object oldValue, Object newValue)(Code)



getColumns
public List<C> getColumns()(Code)

See Also:   thinwire.util.Grid.getColumns



getRows
public List<R> getRows()(Code)

See Also:   thinwire.util.Grid.getRows



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.