/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package real.estate.dao;

/**
 *
 * @author Chathu
 */
public abstract class List {

    /**
     * List to store Listable items
     */
    public Listable[] list;         

    /**
     * Number of items in list
     */
    public int numberOfItems;              
    public int position;     
    

    
    public List(int maxItems) {
        numberOfItems = 0;
        list = new Listable[maxItems];
    }

    public boolean isFull() 
    {
        return (list.length == numberOfItems);
    }

    public int lengthIs() 
    {
        return numberOfItems;
    }
    
    public abstract boolean isThere(Listable item);

   // Returns a copy of the list element with the same key as item
    public abstract Listable retrieve(Listable item);

    // Adds a copy of item to this list 
    public abstract void insert(Listable item);

   
    public abstract void delete(Listable item);

    
    public void reset() 
    {
        position = 0;
    }
    
    
    public Listable getNextItem() 
    {
        Listable next = list[position];
        if (position == numberOfItems - 1) {
            position = 0;
        } else {
            position++;
        }
        return next.copy();
    }

}

@@ -342,25 +342,16 @@
 %5B%5D list;
-         
 %0A%0A    /*
@@ -424,22 +424,49 @@
 ems;
+%0A%0A
     
+/**%0A
      
- 
+* Position of list%0A
     
+ */
 %0A   
@@ -490,24 +490,126 @@
 ion;
-     %0A    %0A
+%0A%0A    /**%0A     * Construct a List instance with a listable array size of maxItem%0A     *%0A     * @param maxItems
 %0A    
+ */
 %0A   
@@ -702,32 +702,110 @@
 xItems%5D;%0A    %7D%0A%0A
+    /**%0A     * Return whether this list is full%0A     *%0A     * @return%0A     */%0A
     public boole
@@ -816,21 +816,16 @@
 sFull() 
-%0A    
 %7B%0A      
@@ -868,24 +868,113 @@
 ms);%0A    %7D%0A%0A
+    /**%0A     * Return the number of elements on this list.%0A     *%0A     * @return%0A     */%0A
     public i
@@ -987,21 +987,16 @@
 gthIs() 
-%0A    
 %7B%0A      
@@ -1021,28 +1021,129 @@
 tems;%0A    %7D%0A
+%0A
     
+/**%0A     * Returns true if the item is on this list%0A     *%0A     * @param item%0A     * @return%0A     */
 %0A    public 
@@ -1259,206 +1259,591 @@
     
-public abstract Listable retrieve(Listable item);%0A%0A    // Adds a copy of item to this list %0A    public abstract void insert(Listable item);%0A%0A   %0A    public abstract void delete(Listable item);%0A%0A    
+/**%0A     * Returns a copy of the list element with the same key as item%0A     *%0A     * @param item%0A     * @return%0A     */%0A    public abstract Listable retrieve(Listable item);%0A%0A    // Adds a copy of item to this list%0A    /**%0A     * Adds the inserted value to this list%0A     * @param item%0A     */%0A    public abstract void insert(Listable item);%0A%0A    /**%0A     * Deletes the element with the same key as item from this list %0A     * @param item%0A     */%0A    public abstract void delete(Listable item);%0A%0A    /**%0A     * Initializes current position for an iteration through this list%0A     */
 %0A   
@@ -1863,21 +1863,16 @@
 reset() 
-%0A    
 %7B%0A      
@@ -1893,25 +1893,100 @@
 ;%0A    %7D%0A
+%0A
     
+/**
 %0A    
+ * Returns copy of the next element on this list%0A     * @return%0A     */
 %0A    pub
@@ -2012,21 +2012,16 @@
 tItem() 
-%0A    
 %7B%0A      

Create the javadoc for list Class