All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class scrobble.Letter

java.lang.Object
   |
   +----scrobble.Letter

public class Letter
extends Object
implements Serializable
Letter is able to give its name and its value.


Variable Index

 o letterPanel
The panel which represents the letter;
 o name
Name of Letter
 o nameLabel
The label which contains the name of the letter;
 o value
Value of Letter
 o valueLabel
The label which contains the value of the letter;

Constructor Index

 o Letter()
Creates a new Letter without any parameter
 o Letter(char)
Creates a new Letter with the given name and the value 1 if nothing is given.
 o Letter(char, int)
Creates a new Letter with the given name and the given value.

Method Index

 o equals(Letter)
Tests if Letter has the same name and the same value that the Letter in parameter has.
 o getComponent()
Returns a label containing the letter (his name and his value).
 o getName()
Returns the name of the Letter
 o getValue()
Returns the value of the Letter
 o setName(char)
Changes the name of the Letter
 o setValue(int)
Changes the value of the Letter
 o toString()
Returns a string representation of the object.

Variables

 o name
 char name
Name of Letter

 o value
 int value
Value of Letter

 o nameLabel
 protected JLabel nameLabel
The label which contains the name of the letter;

 o valueLabel
 protected JLabel valueLabel
The label which contains the value of the letter;

 o letterPanel
 protected JPanel letterPanel
The panel which represents the letter;

Constructors

 o Letter
 public Letter(char name)
Creates a new Letter with the given name and the value 1 if nothing is given.

Parameters:
name - the name of the new Letter being created
 o Letter
 public Letter(char name,
               int value)
Creates a new Letter with the given name and the given value.

Parameters:
name - the name of the new Letter being created
value - the value of the new letter being created
 o Letter
 public Letter()
Creates a new Letter without any parameter

Methods

 o setName
 public void setName(char newname)
Changes the name of the Letter

Parameters:
newname - the new name of the Letter
 o getName
 public char getName()
Returns the name of the Letter

Returns:
the name
 o setValue
 public void setValue(int newvalue)
Changes the value of the Letter

Parameters:
newvalue - the new value of the Letter
 o getValue
 public int getValue()
Returns the value of the Letter

Returns:
the value
 o equals
 public boolean equals(Letter letter)
Tests if Letter has the same name and the same value that the Letter in parameter has.

Parameters:
letter - the other letter.
Returns:
true or false
 o toString
 public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
 o getComponent
 public Component getComponent()
Returns a label containing the letter (his name and his value).


All Packages  Class Hierarchy  This Package  Previous  Next  Index