001: /*
002: * Copyright 2004-2006 the original author or authors.
003: *
004: * Licensed under the Apache License, Version 2.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.compass.gps.device.jdo;
018:
019: /**
020: * Definition of a Product Represents a product, and contains the key aspects of
021: * the item.
022: *
023: */
024: public class Product {
025:
026: private Integer id;
027:
028: /**
029: * Name of the Product.
030: */
031: protected String name = null;
032:
033: /**
034: * Description of the Product.
035: */
036: protected String description = null;
037:
038: /**
039: * Value of the Product.
040: */
041: protected double price = 0.0;
042:
043: /**
044: * Default constructor.
045: */
046: protected Product() {
047: }
048:
049: /**
050: * Constructor.
051: *
052: * @param name
053: * name of product
054: * @param description
055: * description of product
056: * @param price
057: * Price
058: */
059: public Product(String name, String description, double price) {
060: this .name = name;
061: this .description = description;
062: this .price = price;
063: }
064:
065: // ------------------------------- Accessors -------------------------------
066: /**
067: * Accessor for the name of the product.
068: *
069: * @return Name of the product.
070: */
071: public String getName() {
072: return name;
073: }
074:
075: /**
076: * Accessor for the description of the product.
077: *
078: * @return Description of the product.
079: */
080: public String getDescription() {
081: return description;
082: }
083:
084: /**
085: * Accessor for the price of the product.
086: *
087: * @return Price of the product.
088: */
089: public double getPrice() {
090: return price;
091: }
092:
093: // ------------------------------- Mutators --------------------------------
094: /**
095: * Mutator for the name of the product.
096: *
097: * @param name
098: * Name of the product.
099: */
100: public void setName(String name) {
101: this .name = name;
102: }
103:
104: /**
105: * Mutator for the description of the product.
106: *
107: * @param description
108: * Description of the product.
109: */
110: public void setDescription(String description) {
111: this .description = description;
112: }
113:
114: /**
115: * Mutator for the price of the product.
116: *
117: * @param price
118: * price of the product.
119: */
120: public void setPrice(double price) {
121: this .price = price;
122: }
123:
124: public Integer getId() {
125: return id;
126: }
127:
128: public void setId(Integer id) {
129: this.id = id;
130: }
131: }
|