File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Matrix structure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Matrix structure" Watch "Matrix structure" New topic
Author

Matrix structure

selvas kumars
Ranch Hand

Joined: Jan 06, 2001
Posts: 115
Hi folks,
Is there any data structure(any class) in java to hold matrix data(ie in table form)??
Thanks,
Regards,
silva.
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
hi,
what do you mean by matrix data ?
would just an n-dimensional array do the job ?
pascal
selvas kumars
Ranch Hand

Joined: Jan 06, 2001
Posts: 115
Hi pascal,
you are right .i want to store n dimension structure..specify me which class i can use for this.
Regards,
silva.
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
hi,
this is what you could do to store any kind of objects. you can adapt it to your needs.
Object[][] matrix = new Object[3][4];
this creates an two dimensional array:
[0/0][0/1][0/2][0/3]
[1/0][1/1][1/2][1/3]
[2/0][2/1][2/2][2/3]
iterate through the array:
for (int x = 0; x < matrix.length; x++) {
for (int y = 0; y < matrix[x].length; y++) {
// do something.....maybe print it to system out ??
System.out.println(""+matrix[x][y]);
}
}

hope this helps,
pascal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Matrix structure