Learn Java for Android Development by Peter Späth & Jeff Friesen
Author:Peter Späth & Jeff Friesen
Language: eng
Format: epub
ISBN: 9781484259436
Publisher: Apress
You need to be careful when designing classes that work with sorted sets. For example, the class must implement Comparable when you plan to store the class’s instances in a sorted set where these elements are sorted according to their natural ordering.
Exploring Navigable Sets
TreeSet is an example of a navigable set, which is a sorted set that can be iterated over in descending order as well as ascending order and which can report closest matches for given search targets. Navigable sets are described by the NavigableSet interface, whose generic type is NavigableSet<E>, which extends SortedSet. Have a look at the API documentation to learn about its methods.
Listing 9-5 demonstrates a navigable set based on a tree set.import java.util.Iterator;
import java.util.NavigableSet;
import java.util.TreeSet;
import java.util.Arrays;
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6251)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(5957)
Kotlin in Action by Dmitry Jemerov(4638)
React Native - Building Mobile Apps with JavaScript by Novick Vladimir(2340)
Learning Angular - Second Edition by Christoffer Noring(2168)
Pride and Prejudice by Jane Austen(2097)
Mobile Forensics Cookbook by Igor Mikhaylov(1814)
Computers For Seniors For Dummies by Nancy C. Muir(1770)
Bulletproof Android: Practical Advice for Building Secure Apps (Developer's Library) by Godfrey Nolan(1671)
Building Android UIs with Custom Views by Raimon Ràfols Montané(1622)
Android Development with Kotlin by Marcin Moskala & Igor Wojda(1616)
Building Progressive Web Apps: Bringing the Power of Native to the Browser by Ater Tal(1534)
1936941139 (N) by Bob Rosenthal(1503)
Android App Development by Franceschi Hervé J.;(1498)
Ember.js in Action by Joachim Haagen Skeie(1469)
Hands-On Internet of Things with MQTT by Tim Pulver(1417)
Hands-On Design Patterns with React Native by Mateusz Grzesiukiewicz(1407)
Practical Industrial Internet of Things Security by Sravani Bhattacharjee(1317)
Voice User Interface Projects by Henry Lee(1270)