All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class scrobble.Word

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

public class Word
extends Object
implements Serializable
Word.java is a Vector of Letter or SquarePositioner. There are indeed two kinds of letters : letters of player, or letters of the Board. The letters of the Board can be get with SquarePositioner.


Variable Index

 o scoring
Scoring of the Word
 o vectorWord
List containing the ordered letters of the word or SquarePositioner.
 o wordPanel
The panel which represents the Word.

Constructor Index

 o Word()
Creates a new Word
 o Word(Vector)
Creates a new Word with the given vectorWord
 o Word(Vector, int)
Creates a new Word with the given vectorWord and the given scoring

Method Index

 o addLetter(Letter)
Adds a letter to the word at the final position
 o addSquarePositioner(SquarePositioner)
Adds a squarepositioner to the word at the final position
 o getComponent()
Returns a Panel containing the letters or squarepositioner of the word .
 o getNbLetters()
Returns the number of letters (or squarepositioners) vectorWord.
 o getScoring()
Returns the scoring of the Word
 o getVectorWord()
Returns the vectorWord of the Word
 o insertLetterAtFirstPosition(Letter)
Insert a letter at the beginning of the word
 o removeElement(Object)
Remove a specified letter or a squarepositionner of the word.
 o removeElementAt(int)
Remove a letter or a squarepositionner at the position index.
 o setScoring(int)
Modifies the scoring of the Word
 o setVectorWord(Vector)
Modifies the vectorWord of the Word, that is : modifies the letters or the SquarePositioner of the Word
 o updateWordPanel()
[DESCRIBE ME]
 o wordToString()
Converts a given Word into a String.

Variables

 o vectorWord
 Vector vectorWord
List containing the ordered letters of the word or SquarePositioner. There are indeed two kinds of letters : letters of player, or letters of the Board. The letters of the Board can be get with SquarePositioner.

 o wordPanel
 transient JPanel wordPanel
The panel which represents the Word.

 o scoring
 int scoring
Scoring of the Word

Constructors

 o Word
 public Word()
Creates a new Word

 o Word
 public Word(Vector vectorWord)
Creates a new Word with the given vectorWord

Parameters:
vectorWord - the vectorWord of the new Word being created
 o Word
 public Word(Vector vectorWord,
             int scoring)
Creates a new Word with the given vectorWord and the given scoring

Parameters:
vectorWord - the vectorWord of the new Word being created
scoring - the scoring of the new Word being created

Methods

 o setVectorWord
 public void setVectorWord(Vector newVectorWord)
Modifies the vectorWord of the Word, that is : modifies the letters or the SquarePositioner of the Word

Parameters:
newVectorWord - the new vectorWord of the Word
 o getVectorWord
 public Vector getVectorWord()
Returns the vectorWord of the Word

Returns:
the vectorWord
 o setScoring
 public void setScoring(int newScoring)
Modifies the scoring of the Word

Parameters:
newScoring - the new scoring of the Word
 o getScoring
 public int getScoring()
Returns the scoring of the Word

Returns:
the scoring
 o wordToString
 public String wordToString()
Converts a given Word into a String. This method is used by the method isWord in the class Dico.

Returns:
the string.
 o addLetter
 public void addLetter(Letter letter)
Adds a letter to the word at the final position

Parameters:
letter - the letter to be added
 o addSquarePositioner
 public void addSquarePositioner(SquarePositioner square)
Adds a squarepositioner to the word at the final position

Parameters:
square - the squarepositioner to be added
 o removeElementAt
 public void removeElementAt(int index)
Remove a letter or a squarepositionner at the position index.

Parameters:
index - the index of the letter or the squarepositionner to be removed.
 o removeElement
 public void removeElement(Object object)
Remove a specified letter or a squarepositionner of the word.

Parameters:
object - the object of the letter or the squarepositionner to be removed.
 o insertLetterAtFirstPosition
 public void insertLetterAtFirstPosition(Letter letter)
Insert a letter at the beginning of the word

Parameters:
letter - the letter to be inserted
 o getNbLetters
 public int getNbLetters()
Returns the number of letters (or squarepositioners) vectorWord.

 o getComponent
 public Component getComponent()
Returns a Panel containing the letters or squarepositioner of the word .

 o updateWordPanel
 public void updateWordPanel()
[DESCRIBE ME]


All Packages  Class Hierarchy  This Package  Previous  Next  Index