Mercurial > projects > dwt-samples
diff jface/Librarian.d @ 143:42c3056512ba
redirect the jface examples to the new collection wrappers
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 07 Aug 2008 22:21:50 +0200 |
parents | 9ff9b8f7284b |
children |
line wrap: on
line diff
--- a/jface/Librarian.d Thu Aug 07 17:23:25 2008 +0200 +++ b/jface/Librarian.d Thu Aug 07 22:21:50 2008 +0200 @@ -46,7 +46,6 @@ import dwt.dwthelper.ByteArrayInputStream; import tango.text.convert.Format; -import tango.util.collection.LinkSeq; import tango.io.FilePath; import tango.io.File; import tango.io.Print; @@ -54,6 +53,7 @@ import tango.text.Util; import tango.text.stream.LineIterator; import tango.util.log.Trace; +import dwtx.dwtxhelper.Collection; version(JIVE) import jive.stacktrace; @@ -954,7 +954,7 @@ private String filename; // The books - private LinkSeq!(Book) books; + private LinkedList books; // The dirty flag private bool dirty; @@ -963,7 +963,7 @@ * Library constructor Note the signature :-) */ public this() { - books = new LinkSeq!(Book); + books = new LinkedList(); } /** @@ -997,7 +997,8 @@ public void save(String filename) { scope ostr = (new FileOutput(filename)).output; scope printer = new Print!(char)( Format, ostr ); - foreach ( book; books ) { + foreach ( o; books ) { + Book book = cast(Book)o; printer.formatln( "{}|{}",book.getTitle(), (book.getCheckedOutTo() is null ? "" : book.getCheckedOutTo())); } ostr.close(); @@ -1012,7 +1013,7 @@ * @return bool */ public bool add(Book book) { - books.append(book); + books.add(book); setDirty(); return true; } @@ -1032,7 +1033,7 @@ * * @return Collection */ - public LinkSeq!(Book) getBooks() { + public LinkedList getBooks() { return books; }