Package ball.game.scrabble
Class Rack
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<Tile>
-
- ball.game.scrabble.Rack
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Tile>,Collection<Tile>,Deque<Tile>,List<Tile>,Queue<Tile>
public class Rack extends LinkedList<Tile> implements Cloneable
ScrabbleRack.Bean Property Summary
Name Mode Type isHidden isBound isConstrained empty R booleanfalse false false first R Efalse false false last R Efalse false false - Author:
- Allen D. Ball
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description Rack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Tile tile)Rackclone()Stream<List<Tile>>combinations()Method to get theStreamof all possible combinations.List<Tile>draw(Bag bag)booleanhasCapacity()Method to determine if theRackhas any remaining capacity (should draw).Tile[]toArray()-
Methods inherited from class java.util.LinkedList
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
-
Methods inherited from class java.util.AbstractSequentialList
iterator
-
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
-
-
-
Constructor Detail
-
Rack
public Rack()
-
-
Method Detail
-
hasCapacity
public boolean hasCapacity()
Method to determine if theRackhas any remaining capacity (should draw).- Returns:
trueif theRackcontains less than its maximum capacity;falseotherwise.
-
combinations
public Stream<List<Tile>> combinations()
Method to get theStreamof all possible combinations.- Returns:
- The
Streamof combinations (each aListofTiles). - See Also:
Combinations
-
toArray
public Tile[] toArray()
- Specified by:
toArrayin interfaceCollection<Tile>- Specified by:
toArrayin interfaceList<Tile>- Overrides:
toArrayin classLinkedList<Tile>
-
clone
public Rack clone()
- Overrides:
clonein classLinkedList<Tile>
-
-