pricequote.java

来自「java web services how to program」· Java 代码 · 共 67 行

JAVA
67
字号
// PriceQuote.java
// PriceQuote maintains price information for one book store.
package jws1casestudy.pricefinder.common;

public class PriceQuote {
   
   private double price;             // book price
   private String isbn;              // book ISBN
   private int storeID;              // store ID
   private String storeDescription;  // store description

   // public default constructor
   public PriceQuote() {}
   
   // get book price
   public double getPrice() 
   { 
      return price; 
   }

   // get book ISBN
   public String getIsbn() 
   {
      return isbn; 
   }

   // get store ID
   public int getStoreID()
   {
      return storeID;
   }

   // get store description
   public String getStoreDescription() 
   {
      return storeDescription; 
   }

   // set book price
   public void setPrice( double price )
   {
      if ( price >= 0 )
         this.price = price;
      else
         this.price = 0;
   }

   // set book ISBN
   public void setIsbn( String isbn )
   {
      this.isbn = isbn;
   }

   // set book ID
   public void setStoreID( int storeID )
   {
      this.storeID = storeID;
   }

   // set weather description
   public void setStoreDescription( String storeDescription )
   {
      this.storeDescription = storeDescription;
   }

} // end class PriceQuote

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?