Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: University project - Library Program.

  1. #1
    Junior Member adrian.tudor's Avatar
    Join Date
    Dec 2012
    Location
    Bucharest, Romania
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default University project - Library Program.

    Hello everyone.
    I am kinda a beginner, been java programming for 3-4 months, but i learn fast.
    I have a java programming project, a gui library system, something complex.
    User has to create library, then add books, delete books, add chapters in book, remove chapter.

    First i have to do 6 classes( architecture, they name it):
    - class Library: contains objects of type Book and implements ILibrary
    - class Book: contains objects of type Chapter and book name and implements IBook
    - class Chapter: contains objects of type Paragraph and chapter name si and implements IChapter
    - class Sentence: extends ArrayList<String> and retain one sentence
    - class Paragraph: extends Body<Sentence> and retain one or more sentences, so a paragraph
    - class Body: implements Collection and can retain only objects of the same type in a ArrayList

    I did 3 classes for this 6. But i stuck at class Body, i did not learn about parameterized class, so i don't know how to declare it. Can someone help me with Body class and Paragraph class?

    Especially i stuck at build constructors. I don't know what to do with the <E> from Body

    package element;
     
    import java.util.ArrayList;
    import java.util.Collection;
    import java.util.Iterator;
     
    public class Body<E> implements Collection {
     
        private E item;
        private ArrayList<E> items = new ArrayList<E>();
     
        @Override
        public int size() {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean isEmpty() {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean contains(Object o) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public Iterator iterator() {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public Object[] toArray() {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public Object[] toArray(Object[] a) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean add(Object e) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean remove(Object o) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean containsAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean addAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean removeAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public boolean retainAll(Collection c) {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
        @Override
        public void clear() {
            throw new UnsupportedOperationException("Not supported yet.");
        }
     
    }

    I'm a still a student and a beginner in java, so please bear with me.

    Ignore javadoc becouse is in romanian(my language
    Attached Files Attached Files


  2. #2
    Junior Member adrian.tudor's Avatar
    Join Date
    Dec 2012
    Location
    Bucharest, Romania
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: University project - Library Program.

    Nobody can help me with this class? I can't find a convincing example with parameterized class.
    VISTA = Virus Inside Switch to Apple
    UNIX - Where there is a shell, there's a way.

Similar Threads

  1. Hi guys..I need some tips in creating a library programme for my Uni project
    By clarky2006 in forum What's Wrong With My Code?
    Replies: 13
    Last Post: November 21st, 2012, 02:42 PM
  2. Program goes into infinite compilation. University project - Library Program.
    By clarky2006 in forum What's Wrong With My Code?
    Replies: 35
    Last Post: November 10th, 2012, 03:56 PM
  3. Help With My Library Program please.
    By jaydac12 in forum What's Wrong With My Code?
    Replies: 26
    Last Post: September 29th, 2012, 09:31 AM
  4. Having Trouble Using a Project as a Library
    By snowguy13 in forum Java IDEs
    Replies: 0
    Last Post: July 5th, 2012, 08:11 PM
  5. Java Project / Library to evaluate poker hands
    By Farmer in forum Java IDEs
    Replies: 1
    Last Post: February 14th, 2012, 10:25 AM