As a note to self, I just used this code to delete rows from a JavaFX
TableView in a Scala application:
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is one of the shortest recipes, Recipe 11.19, “How to Get the Keys or Values from a Scala Map”
You want to get all of the keys or values from a Scala
To get the keys, use
keySet to get the keys as a
Set, keys to get an
keysIterator to get the keys as an iterator:
This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 10.12, “Using Iterators with Scala Collection Classes”
You want (or need) to work with an iterator in a Scala application.
Scala FAQ: Can you share some examples of using tuples in Scala?
A Scala tuple is a class that can contain a miscellaneous collection of elements. I like to think of them as a little bag or container you can use to hold things and pass them around.
You create a tuple with the following syntax, enclosing its elements in parentheses. Here's a tuple that contains an
Int and a
I've recently started writing a series of articles on Design Patterns in Java, i.e., Design Patterns explained using Java source code examples. Although it will take me a little while to create each design pattern example, this page will eventually contain links to all of those examples.
If you're not familiar with software design patterns, they're described on Wikipedia like this:
Summary: The Iterator Pattern is demonstrated using Java source code examples.
The Iterator Design Pattern is one of the most simple and frequently used design patterns. The Iterator Pattern lets you sequentially move through a collection of objects using a standard interface, and without having to know the internal representation of that collection.