Was habt ihr als letztes kopiert?

02/21/2012 23:02 Stuffel#10516
[Only registered and activated users can see links. Click Here To Register...]
02/21/2012 23:04 Shishihara#10517
02/21/2012 23:38 Yunchen#10518
02/22/2012 01:11 TANZVERBOT#10519
Sido feat Mario Barth - Ick Liebe Dir.
02/22/2012 08:01 Shishihara#10520
02/22/2012 09:12 SeyeZoN#10521
02/22/2012 10:41 RevoGTS#10522
02/22/2012 10:47 Ravenstorm#10523
Code:
int rating = 0;

    Map<IBook, Integer> books = new HashMap<IBook, Integer>();

    /**
     * Add a rated book to the shelf.
     * 
     * @param book
     *            the book to add
     * @param rating
     *            how much did you like this book?
     * @throws NullPointerException
     *             if book is null
     */

    @Override
    public void addBook(IBook book, int rating) {

        if (book.getYear() < 1900) {

            throw new IllegalArgumentException("release date < 1900");

        }

        if (book.getTitle().isEmpty()) {

            throw new IllegalArgumentException("kein Buchtitel gebeben");

        }

        if (book.getAuthors() == null || book.getAuthors().isEmpty()) {

            throw new IllegalArgumentException("keine Authoren vorhanden");

        }

        if (books.containsKey(book)) {

            throw new IllegalArgumentException(
                    "Das selbe Buch ist schon Vorhanden");

        }

        for (Map.Entry<IBook, Integer> e : books.entrySet()) {

            if (book.getAuthors().equals(e.getKey().getAuthors())
                    && book.getTitle().equals(e.getKey().getTitle())
                    && book.getYear() == e.getKey().getYear()) {

                throw new IllegalArgumentException();

            }

        }
02/22/2012 11:24 RevoGTS#10524
[Only registered and activated users can see links. Click Here To Register...]
02/22/2012 11:58 rouvn#10525
[Only registered and activated users can see links. Click Here To Register...]
02/22/2012 11:59 Varus™#10526
02/22/2012 11:59 Ravenstorm#10527
Code:
    /**
     * Add a rated book to the shelf.
     * 
     * @param book
     *            the book to add
     * @param rating
     *            how much did you like this book?
     * @throws NullPointerException
     *             if book is null
     */
02/22/2012 12:02 RevoGTS#10528
[11:36:25] Emir / iGotTnT: Immernoch bei 303 !
02/22/2012 12:18 Yunchen#10529
02/22/2012 12:25 rouvn#10530
[Only registered and activated users can see links. Click Here To Register...]