Package ball.game.scrabble
Class Bag
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList<Tile>
-
- ball.game.scrabble.Bag
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<Tile>,Collection<Tile>,Deque<Tile>,List<Tile>,Queue<Tile>
public class Bag extends LinkedList<Tile> implements Cloneable
ScrabbleBag.- Author:
- Allen D. Ball
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bagclone()Tiledraw()Tiledraw(char letter)SortedMap<Character,Integer>frequencies()LocalegetLocale()SortedMap<Character,Integer>points()Tile[]toArray()-
Methods inherited from class java.util.LinkedList
add, 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
-
-
-
-
Method Detail
-
frequencies
public SortedMap<Character,Integer> frequencies()
-
draw
public Tile draw()
- Returns:
- The next
Tile. - See Also:
LinkedList.pollFirst()
-
draw
public Tile draw(char letter)
- Parameters:
letter- The name of the requestedTile.- Returns:
- The requested
Tile;nullif no matchingTileis available. - See Also:
LinkedList.remove(int)
-
toArray
public Tile[] toArray()
- Specified by:
toArrayin interfaceCollection<Tile>- Specified by:
toArrayin interfaceList<Tile>- Overrides:
toArrayin classLinkedList<Tile>
-
clone
public Bag clone()
- Overrides:
clonein classLinkedList<Tile>
-
-