public class Rack extends LinkedList<Tile> implements Cloneable
Rack
.
Name | Mode | Type | isHidden | isBound | isConstrained |
---|---|---|---|---|---|
empty | R | boolean | false | false | false |
first | R | E | false | false | false |
last | R | E | false | false | false |
modCount
Constructor and Description |
---|
Rack()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Tile tile) |
Rack |
clone() |
Stream<List<Tile>> |
combinations()
Method to get the
Stream of all possible combinations. |
List<Tile> |
draw(Bag bag)
|
boolean |
hasCapacity()
Method to determine if the
Rack has any remaining capacity
(should draw). |
Tile[] |
toArray() |
add, addAll, addAll, addFirst, addLast, clear, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray
iterator
equals, hashCode, listIterator, removeRange, subList
containsAll, isEmpty, removeAll, retainAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
parallelStream, removeIf, stream
public Rack()
public boolean hasCapacity()
Rack
has any remaining capacity
(should draw).true
if the Rack
contains less than its
maximum capacity; false
otherwise.public Stream<List<Tile>> combinations()
Stream
of all possible combinations.Stream
of combinations (each a List
of Tile
s).Combinations
public Tile[] toArray()
toArray
in interface Collection<Tile>
toArray
in interface List<Tile>
toArray
in class LinkedList<Tile>
public Rack clone()
clone
in class LinkedList<Tile>
Copyright © 2015–2020 Allen D. Ball. All rights reserved.