/*
 * 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 User
 */
public class ListHouse implements Listable {

    public int no_of_item;
    public int[] list;
    private static final int max_list = 5;
    public int size;
    public int position;

    private String lastName;
    private String firstName;
    private int lotNumber;
    private int price;
    private int squareFeet;
    private int bedRooms;

//    public ListHouse(int max_list) {
//        no_of_item = 1;
//        list = new int[max_list];
//    }
    public ListHouse(String lastName, String firstName, int lotNumber,
            int price, int squareFeet, int bedRooms) {
        this.lastName = lastName;
        this.firstName = firstName;
        this.lotNumber = lotNumber;
        this.price = price;
        this.squareFeet = squareFeet;
        this.bedRooms = bedRooms;
    }

    public int getNo_of_item() {
        return no_of_item;
    }

    public void setNo_of_item(int no_of_item) {
        this.no_of_item = no_of_item;
    }

    public int[] getList() {
        return list;
    }

    public void setList(int[] list) {
        this.list = list;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    public int length() {
        return no_of_item;
    }

    public int generateList(int max_list) {

        for (int i = 1; i <= max_list; i++) {

        }

        return no_of_item;

    }

    public void insert(int item) {
        if (max_list < 30) {
            list[no_of_item] = item;
        }
        no_of_item++;
        position++;

    }

    public void delete(int index) {
        if (index <= position) {
            for (int i = 0; i <= max_list; i++) {
                list[i] = list[i + 1];

            }
        }
        no_of_item--;
        position--;

    }

    public boolean isEmpty() {
        if (no_of_item == 5) {
            return true;
        } else {
            return false;
        }
    }

    public int find(int item) {
        boolean valueInList = true;
        for (int i = 0; i < no_of_item; i++) {

            if (list[i] == item) {

                System.out.print(i + " ");

            }
            if (valueInList != true) {
                System.out.println("The value not in the list");
            }

        }

        System.out.println();

        return position;
    }

    public void printList() {
        for (int i = 1; i <= max_list; i++) {
            System.out.println(list[i]);

        }

    }

    public Listable copy() {
        ListHouse list1 = new ListHouse(lastName, firstName, lotNumber, price, squareFeet, bedRooms);
        return list1;
    }

//     public Listable getNextItem() 
//    {
//       
//        if (position == no_of_item - 1) {
//            position = 0;
//        } else {
//            position++;
//        }
//        return copy();
//    }
//    public static void main(String[] args) {
//
//        ListHouse li = new ListHouse();
//        li.generateList(max_list);
//        li.insert(10);
//        li.insert(20);
//        li.insert(30);
//        li.insert(40);
//        li.insert(50);
//        li.printList();
//        System.out.println("----------");
//        li.delete(40);
//        li.printList();
//        System.out.println("----------");
//        li.find(10);
//    }
    @Override
    public int compareTo(Listable other) {
      ListHouse other1 = (ListHouse)other;
       return (this.lotNumber-other1.lotNumber); 
    }
    public String firstName(){
        return firstName;
    }
    public String lastName(){
        return lastName;
    }
    public int lotNumber(){
        return lotNumber;
    }
    public int price(){
        return price;
    }
    public int squareFeet(){
        return squareFeet;
    }
    public int bedRooms(){
        return bedRooms;
    }

  
}

@@ -585,117 +585,9 @@
 s;%0A%0A
-//    public ListHouse(int max_list) %7B%0A//        no_of_item = 1;%0A//        list = new int%5Bmax_list%5D;%0A//    %7D
 %0A
+
     
@@ -1488,63 +1488,8 @@
 %0A   
- public int length() %7B%0A        return no_of_item;%0A    %7D
 %0A%0A  
@@ -2575,139 +2575,8 @@
 %0A   
- public void printList() %7B%0A        for (int i = 1; i %3C= max_list; i++) %7B%0A            System.out.println(list%5Bi%5D);%0A%0A        %7D%0A%0A    %7D
 %0A%0A  
@@ -2737,675 +2737,8 @@
  %7D%0A%0A
-//     public Listable getNextItem() %0A//    %7B%0A//       %0A//        if (position == no_of_item - 1) %7B%0A//            position = 0;%0A//        %7D else %7B%0A//            position++;%0A//        %7D%0A//        return copy();%0A//    %7D%0A//    public static void main(String%5B%5D args) %7B%0A//%0A//        ListHouse li = new ListHouse();%0A//        li.generateList(max_list);%0A//        li.insert(10);%0A//        li.insert(20);%0A//        li.insert(30);%0A//        li.insert(40);%0A//        li.insert(50);%0A//        li.printList();%0A//        System.out.println(%22----------%22);%0A//        li.delete(40);%0A//        li.printList();%0A//        System.out.println(%22----------%22);%0A//        li.find(10);%0A//    %7D
 %0A   

Modify ListHouse class