package com.github.bot.curiosone.core.knowledge;

import com.github.bot.curiosone.core.knowledge.interfaces.Vertex;

/**
 * This class represents a Concept of a Semantic Network.
 * @author Christian Sordi.
 */
public class Concept implements Vertex {
  /**
   * Name of the represented Concept.
   */
  private final String id;

  /**
   * Default class constructor.
   * @param id Concept name.
   */
  public Concept(String id) {
    this.id = id;
  }

  /**
   * Returns Concept name.
   */
  @Override
  public String getId() {
    return id;
  }

  /**
   * Returns Concept String representation.
   */
  public String toString() {
    return getId();
  }

  /**
   * Method to confront the instance with another object.
   * @param o the other Concept to be confronted with.
   * @return true, if the concept are equal, false if not.
   */
  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o == null || o.getClass() != this.getClass()) {
      return false;
    }
    return this.id.equals(((Concept)o).getId());
  }

  /**
   * Returns the HashCode of the Concept name.
   */
  @Override
  public int hashCode() {
    int conta = 0;
    for (int x = 0; x < id.length(); x++) {
      conta += id.charAt(x) * 31;
    }
    return conta;
  }
}

@@ -120,19 +120,8 @@
 *%0A *
- This class
  rep
@@ -137,16 +137,17 @@
  Concept
+s
  of a Se
@@ -152,17 +152,16 @@
 Semantic
- 
 Network.
@@ -165,36 +165,8 @@
 rk.%0A
- * @author Christian Sordi.%0A
  */%0A
@@ -206,16 +206,17 @@
 ertex %7B%0A
+%0A
   /**%0A  
@@ -222,31 +222,32 @@
   * 
-Name of the represented
+Represents the ID of the
  Con
@@ -301,33 +301,49 @@
   * 
-Default class constructor
+Constructs this Concept with the given ID
 .%0A  
@@ -355,28 +355,34 @@
 aram id 
+ID of this 
 Concept
- name
 .%0A   */%0A
@@ -453,28 +453,38 @@
 Returns 
+the ID of this 
 Concept
- name
 .%0A   */%0A
@@ -560,23 +560,17 @@
 Returns 
-Concept
+a
  String 
@@ -583,16 +583,32 @@
 entation
+ of this Concept
 .%0A   */%0A
@@ -676,54 +676,57 @@
   * 
-Method to confront the instance with another o
+Checks whether this Concept equals to the given O
 bjec
@@ -772,21 +772,22 @@
 e co
-nfronted with
+mpared against
 .%0A  
@@ -801,53 +801,102 @@
 urn 
+%7B@code 
 true
-,
+%7D
  if th
-e c
+is C
 oncept 
-are 
 equal
-, false if not.
+s to the other Concept;%0A   *         %7B@code false%7D otherwise
 %0A   
@@ -1165,25 +1165,26 @@
 de of th
-e
+is
  Concept
  name.%0A 
@@ -1179,13 +1179,61 @@
 cept
- name
+.%0A   * The HashCode depends on the ID of this Concept
 .%0A  

improve Concept javadoc