T
- the data type this Matrix is to keep track ofpublic class Matrix<T>
extends java.lang.Object
Constructor | Description |
---|---|
Matrix() |
Creates a new
Matrix ready to be loaded with word pairs. |
Matrix(Matrix<T> other) |
Creates a copy of the specified
Matrix . |
Modifier and Type | Method | Description |
---|---|---|
void |
addPair(T first,
T second) |
Loads the specified element pair
|
T |
getNextWord(T word) |
|
T |
getRandomElement() |
|
T |
getRandomPair() |
|
boolean |
isEmpty() |
|
void |
updateProbabilities() |
public Matrix()
Matrix
ready to be loaded with word pairs.public boolean isEmpty()
public void addPair(T first, T second)
first
- first element of the pairsecond
- second element of the pairpublic void updateProbabilities()
public T getRandomElement()
public T getRandomPair()