Package test

Class Word

java.lang.Object
test.Word

public class Word extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Word(Tile[] tiles, int row, int col, boolean vertical)
    The Word function returns the word that is formed by the tiles in a Word object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    The getCol function returns the column of the current position.
    int
    The getRow function returns the row of the current position.
    The getTiles function returns the tiles array.
    boolean
    The isVertical function returns a boolean value that indicates whether the current instance of the class is vertical or not.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Word

      public Word(Tile[] tiles, int row, int col, boolean vertical)
      The Word function returns the word that is formed by the tiles in a Word object.
      Parameters:
      tiles - Store the tiles that make up this word
      row - Set the row of the word
      col - Set the column of the first tile in a word
      vertical - Determine if the word is vertical or horizontal
  • Method Details

    • getTiles

      public Tile[] getTiles()
      The getTiles function returns the tiles array.
      Returns:
      An array of tiles
    • getRow

      public int getRow()
      The getRow function returns the row of the current position.
      Returns:
      The row number of first letter of word
    • getCol

      public int getCol()
      The getCol function returns the column of the current position.
      Returns:
      The column number of first letter of word
    • isVertical

      public boolean isVertical()
      The isVertical function returns a boolean value that indicates whether the current instance of the class is vertical or not.
      Returns:
      A boolean value of true or false depending on the orientation of the word
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object