Question

le Edit Source Refactor Navigate Search Project Run Window Help 1-import org.apache.commons.collections15.Factory; 3 import j
le Edit Source Refactor Navigate Search Project Run Window Help 32 34 35 36 public boolean equals(object o) t if(o instanceof

hi,
i have to add javadoc to this class and i dont really know how to do it, can someone please help me.
thanks
0 0
Add a comment Improve this question Transcribed image text
Answer #1

package org.students;

import java.awt.Color;

public class ThreeTenNode implements Comparable<ThreeTenNode> {
   /**
   * This nodeCount generates the unique id
   */
   public static int nodeCount = 0;
   /**
   * Declaring instance variable id
   */
   private int id;
   /**
   * Declaring instance variable text
   */
   private String text;
   /**
   * declaring instance variable Color and Assign WHITE as default value
   */
   private Color c = Color.WHITE;

   /**
   * This is a default constructor
   */
   public ThreeTenNode() {
       this.id = nodeCount++;
       this.text = "" + this.id;
   }

   /**
   * This Method will return Color
   * @return Color
   */
   public Color getColor() {
       return c;
   }

   /**
   * This Method will set the Color
   * @param Color
   */
   public void setColor(Color c) {
       this.c = c;
   }

   /**
   * This method will return text
   * @return text of type String
   */
   public String getText() {
       return text;
   }
/**
* This Method will set text
* @param text
*/
   public void setText(String text) {
       this.text = text;
   }

   /**
   * This method will return the Information about the class
   * @return String
   */
   @Override
   public String toString() {
       return text;

   }

   /**
   * This method will return the Id
   * @return id of type integer
   */
   @Override
   public int hashCode() {
       return id;
   }
  
/**
* This method will check two Objects are same or not
* @param Object
* @return boolean
*/
   @Override
   public boolean equals(Object o) {
       if (o instanceof ThreeTenNode) {
           return this.id == ((ThreeTenNode) o).id;
       }
       return false;
   }
  
   /**
   * This method will compare Two ThreeTenNodes
   * @param ThreeTenNode class
   * @return int
   */
   @Override
   public int compareTo(ThreeTenNode n) {

       return this.id - n.id;
   }

   /**
   * This method will return the instance of ThreeTenNode class
   * @return ThreeTenNode
   */
   public static Factory<ThreeTenNode> getFactory() {
       return new Factory<ThreeTenNode>() {
           public ThreeTenNode create() {
               return new ThreeTenNode();
           }
       };
   }

}

_____________________________Thank You

Add a comment
Know the answer?
Add Answer to:
hi, i have to add javadoc to this class and i dont really know how to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Introduction to Java Programming Question: I’m doing a java game which user clicks on two different blocks and see the number and remember their locations and match the same number. I’m basically look...

    Introduction to Java Programming Question: I’m doing a java game which user clicks on two different blocks and see the number and remember their locations and match the same number. I’m basically looking for codes that could make my memory match game more difficult or more interesting.(a timer, difficulty level, color, etc.) GUI must be included in the code. Here is what I got so far: package Card; import javax.swing.JButton; public class Card extends JButton{    private int id;    private boolean...

  • Introduction to Java Programming Question: I’m doing a java game which user clicks on two different...

    Introduction to Java Programming Question: I’m doing a java game which user clicks on two different blocks and see the number and remember their locations and match the same number. I’m basically looking for codes that could make my memory match game more difficult or more interesting.(a timer, difficulty level, color, etc.) GUI must be included in the code. Here is what I got so far: package Card; import javax.swing.JButton; public class Card extends JButton{    private int id;   ...

  • FOR JAVA: Summary: Create a program that adds students to the class list (see below). The...

    FOR JAVA: Summary: Create a program that adds students to the class list (see below). The solution should be named Roster402_v2.java. Allow the user to control the number of students added to the roster. Ask if the user would like to see their new roster to confirm additions. If yes, then display contents of the file, if no, end the program. ------------------------------------------------------------------------------------- List of student names and IDs for class (this will be your separate text file): Jones, Jim,45 Hicks,...

  • I need help converting the following two classes into one sql table package Practice.model; impor...

    I need help converting the following two classes into one sql table package Practice.model; import java.util.ArrayList; import java.util.List; import Practice.model.Comment; public class Students {          private Integer id;    private String name;    private String specialties;    private String presentation;    List<Comment> comment;       public Students() {}       public Students(Integer id,String name, String specialties, String presentation)    {        this.id= id;        this.name = name;        this.specialties = specialties;        this.presentation = presentation;        this.comment = new ArrayList<Commment>();                  }       public Students(Integer id,String name, String specialties, String presentation, List<Comment> comment)    {        this.id= id;        this.name...

  • Simple java GUI language translator. English to Spanish, French, or German import javax.swing.*; import java.awt.*; import...

    Simple java GUI language translator. English to Spanish, French, or German import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class translatorApp extends JFrame implements ActionListener {    public static final int width = 500;    public static final int height = 300;    public static final int no_of_lines = 10;    public static final int chars_per_line = 20;    private JTextArea lan1;    private JTextArea lan2;    public static void main(String[] args){        translatorApp gui = new translatorApp();...

  • Java Do 72a, 72b, 72c, 72d. Code & output required. public class Employee { private int...

    Java Do 72a, 72b, 72c, 72d. Code & output required. public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...

  • Hello! I have a problem in my code please I need help, I don't know How I can wright precondition, so I need help about assertion of pre_condition of peek. Java OOP Task is! Improve the circular a...

    Hello! I have a problem in my code please I need help, I don't know How I can wright precondition, so I need help about assertion of pre_condition of peek. Java OOP Task is! Improve the circular array implementation of the bounded queue by growing the elements array when the queue is full. Add assertions to check all preconditions of the methods of the bounded queue implementation. My code is! public class MessageQueue{ public MessageQueue(int capacity){ elements = new Message[capacity];...

  • Lab Description: Using graphics, polygons, and arrays, draw the tree shown below. You can change the...

    Lab Description: Using graphics, polygons, and arrays, draw the tree shown below. You can change the tree anyway you like to make it your own. Sample Data Sec below Files Needed:: GraphicaRunner.java Tree.java Sample Output: import java.awt.Graphics; import java.awt.color; import java.awt.Polygon; import java.awt.Font; import java.awt.Canvas; public class Tree extends Canvas public Tree() setBackground (Color.WHITE) public void paint ( Graphics window) window. setColor (Color.RED); window.setFont (new Font("TAHOMA" ,Font.BOLD,12) window.drawstring("Lab14h Tree Lab", 50, 50) tree(window); IONaA , Font.BOL.D,12) public void tree(Graphics window)...

  • Java Programming Answer 60a, 60b, 60c, 60d. Show code & output. public class Employee { private...

    Java Programming Answer 60a, 60b, 60c, 60d. Show code & output. public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return...

  • Java Do 68a, 68b, 68c, 68d. Show code & output. public class Employee { private int...

    Java Do 68a, 68b, 68c, 68d. Show code & output. public class Employee { private int id; private String name; private int sal; public Employee(int id, String name, int sal) { super(); this.id = id; this.name = name; this.sal = sal; } public int getid) { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; public void setName(String name) { this.name = name; } public int get Sall) { return sal;...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
Active Questions
ADVERTISEMENT