home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.3 KB | 51 lines |
- // House.java - Object representing a single house listing
- //
- // Copyright (C) 1996 by Dale Gass
- // Non-exclusive license granted to MKS, Inc.
- //
-
- import java.lang.*;
- import java.util.*;
- import java.awt.*;
- import java.net.*;
- import java.applet.*;
-
- public class House {
- String describe; // Description
- String area; // Location
- int price; // Price
- int beds; // # bedrooms
- boolean view; // Are floor plans and camera views available?
- String code; // Prefix code for associated files
-
- // Constructor
-
- public House(String d, String a, int p, int b, boolean v, String c) {
- describe = d;
- area = a;
- price = p;
- beds = b;
- view = v;
- code = c;
- }
-
- // Retrieve the various components
-
- public String getDesc() { return describe; }
- public boolean hasView() { return view; }
- public int getPrice() { return price; }
- public String getCode() { return code; }
- public String getArea() { return area; }
- public int getBeds() { return beds; }
-
- // Show summary string description of listing
-
- public String toString() {
- String r = "$"+price+" "+area+", "+beds+" bedroom " + describe;
- if (view) {
- r += ", Online Viewing Available";
- }
- return (r);
- }
- }
-