Collections

You can also create a ListMatrix instead of an ArrayList. A ListMatrix behaves like a java.List but is a Matrix at the same time:

ListMatrix S = new DefaultListMatrix();
// List methods:
S.add(0.5);
S.clear();
// Matrix methods:
S.exportToFile(someFile);
S.showGUI();
Matrix P = S.plus(5).times(2);
// but: P is not a ListMatrix anymore

The same works also for maps:


MapMatrix map = new DefaultMapMatrix();
map.put(key,o);

  • del.icio.us
  • Google Bookmarks
  • MisterWong
  • Facebook
  • Digg
  • DZone
  • Slashdot
  • StumbleUpon
  • Technorati
  • Yahoo! Buzz
  • email
  • Print

Leave a Reply

You must be logged in to post a comment.