3 Replies - 176 Views - Last Post: 17 May 2014 - 03:46 PM Rate Topic: -----

#1 alfonsP  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 05-May 14

I need assistance with javadoc

Posted 17 May 2014 - 02:00 PM

I am trying out Javadoc, but the description for my class aren't working. It is blank when I am trying to enter the description. I would like someone to help me. Here is my code.

import java.text.NumberFormat;

/**
 * @author Alfons Jose Pineda-Knauseder
 * @version 1.0.0
 * 
 *This class can be used to represent any products and their information.
 */ 
public class Product
{
    private String code;
    private String description;
    private double price;
    
    public Product()
    {
        this("", "", 0);
    }
/**
 * @param code The code for your product should be entered here as a <code>String</code>.
 * @param description This should be a <code>String</code> that describes your product.
 * @param price  This should be the price of your product as a <code>double</code> value.
 */
    public Product(String code, String description, double price)
    {
        this.code = code;
        this.description = description;
        this.price = price;
    }

    public void setCode(String code)
    {
        this.code = code;
    }
/**
 * 
 * @return <code>String</code>
 */
    public String getCode(){
        return code;
    }

    public void setDescription(String description)
    {
        this.description = description;
    }

    public String getDescription()
    {
        return description;
    }

    public void setPrice(double price)
    {
        this.price = price;
    }

    public double getPrice()
    {
        return price;
    }

    public String getFormattedPrice()
    {
        NumberFormat currency = NumberFormat.getCurrencyInstance();
        return currency.format(price);
    }

    public boolean equals(Object object)
    {
        if (object instanceof Product)
        {
            Product product2 = (Product) object;
            if
            (
                code.equals(product2.getCode()) &&
                description.equals(product2.getDescription()) &&
                price == product2.getPrice()
            )
                return true;
        }
        return false;
    }

    public String toString()
    {
        return "Code:        " + code + "\n" +
               "Description: " + description + "\n" +
               "Price:       " + this.getFormattedPrice() + "\n";
    }
}


Is This A Good Question/Topic? 0
  • +

Replies To: I need assistance with javadoc

#2 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2694
  • View blog
  • Posts: 11,363
  • Joined: 20-September 08

Re: I need assistance with javadoc

Posted 17 May 2014 - 02:22 PM

Most of your code is undocumented
Was This Post Helpful? 0
  • +
  • -

#3 alfonsP  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 05-May 14

Re: I need assistance with javadoc

Posted 17 May 2014 - 02:42 PM

View Postg00se, on 17 May 2014 - 02:22 PM, said:

Most of your code is undocumented

/**
04
 * @author Alfons Jose Pineda-Knauseder
05
 * @version 1.0.0
06
 *
07
 *This class can be used to represent any products and their information.
08
 */
09
public class Product
10
{
11
    private String code;
12
    private String description;
13
    private double price;
14
     
15
    public Product()
16
    {
17
        this("", "", 0);
18
    }


I specifically want the description for this class. It is not working. I want also like to point out that my <code></code> tags are not working for some reason as well.
Was This Post Helpful? 0
  • +
  • -

#4 alfonsP  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 05-May 14

Re: I need assistance with javadoc

Posted 17 May 2014 - 03:46 PM

Alright everybody, I figured out the solution by myself. For future reference, any documentation you put after the @version or @author dags will be part of that tag even if it is on a different line. I just had to put my description above those.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1