Java Ordered Collections and SortedSet Indiana

This article explores Java collections framework classes that implement the SortedSet interface and how they keep a set of objects in a guaranteed order, independent of the order that they are added to the collection.

Local Companies

Bell Industries Technology Solutions Group
317-704-6000
8888 Keystone Xing
Indianapolis, IN
GT Solutions
317-844-3510
250 E 96th St
Indianapolis, IN
Peartree Software Consulting
317-257-2486
600 Holliday Ln
Indianapolis, IN
Professional Solutions
317-255-1944
2040 E 54th St
Indianapolis, IN
Sanyog Computer Solutions
317-579-0746
8650 Malaga DR
Indianapolis, IN
Seven Opals Software LLC
317-569-1810
1537 Sierra Spgs
Indianapolis, IN
Sterling Creek Software
317-567-5060
5881 E 82nd St
Indianapolis, IN
Advanced Solutions Inc
260-432-9695
7030 Pointe Inverness Way
Fort Wayne, IN
Britannia Inc
260-482-6321
1616 Directors Row
Fort Wayne, IN
CBS Computer Repair
260-441-9000
2727 Stardale Dr
Fort Wayne, IN



The Java collections framework includes classes you use to maintain collections of other objects. These collection classes implement interfaces that support different organizations of the objects they contain. For example, classes that implement the List interface keep objects in the order that they are added to the collection and can take a long time to search (proportionate to the number of objects in the collection). Classes that implement the Map interface keep objects in no particular order but are very fast to search (search time is independent of the number of objects in the collection). Classes that implement the SortedSet interface keep a set of objects in a guaranteed order, independent of the order they are added to the collection; this makes them fast to search.

SortedSet



Collection classes that implement the SortedSet interface impose a total ordering on the objects that they contain. There are two kinds of orderings that can be used with a SortedSet.

Instances of SortedSet classes can use the natural ordering of objects in the collection if the objects in the collection implement the Comparable interface. This means that the order of the objects is determined by the objects themselves.


  • A SortedSet collection imposes a natural ordering on the objects it contains by calling the compareTo method that is part of the SortedSet interface. An object's compareTo method takes one argument that is the other object it compares the object to. The compareTo method returns a positive integer, 0, or a negative integer depending on whether the object is greater than, equal to, or less than the other object.
  • ...

    Read the Rest of this Article at Developer.com

Featured Local Company

Bell Industries Technology Solutions Group

317-704-6000
8888 Keystone Xing
Indianapolis, IN

Related Articles
- Enterprise Java Application Architecture and Design Indiana
Discover how to combine the Model-View-Controller (MVC) architectural principles with the Java EE platform to derive multitier Java EE application architecture. You will also see how the Java EE design patterns catalog provides guidance and how you can document this architecture using UML notations.
- GlassFish ESB V2 for SOA Tooling Indiana
- UML for Object-Oriented Design Indiana
- Java Hashed Collections Indiana
- Java Standardization Request 168 Indiana
Regional Articles
- Java Ordered Collections and SortedSet Anderson IN
- Java Ordered Collections and SortedSet Angola IN
- Java Ordered Collections and SortedSet Bedford IN
- Java Ordered Collections and SortedSet Bloomington IN
- Java Ordered Collections and SortedSet Brazil IN
- Java Ordered Collections and SortedSet Brownsburg IN
- Java Ordered Collections and SortedSet Carmel IN
- Java Ordered Collections and SortedSet Chesterton IN
- Java Ordered Collections and SortedSet Columbia City IN
- Java Ordered Collections and SortedSet Columbus IN
- Java Ordered Collections and SortedSet Connersville IN
- Java Ordered Collections and SortedSet Crawfordsville IN
- Java Ordered Collections and SortedSet Crown Point IN
- Java Ordered Collections and SortedSet Dyer IN
- Java Ordered Collections and SortedSet East Chicago IN
- Java Ordered Collections and SortedSet Elkhart IN
- Java Ordered Collections and SortedSet Evansville IN
- Java Ordered Collections and SortedSet Fishers IN
- Java Ordered Collections and SortedSet Fort Wayne IN
- Java Ordered Collections and SortedSet Franklin IN
- Java Ordered Collections and SortedSet Gary IN
- Java Ordered Collections and SortedSet Goshen IN
- Java Ordered Collections and SortedSet Granger IN
- Java Ordered Collections and SortedSet Greenfield IN
- Java Ordered Collections and SortedSet Greenwood IN
- Java Ordered Collections and SortedSet Hammond IN
- Java Ordered Collections and SortedSet Hobart IN
- Java Ordered Collections and SortedSet Huntington IN
- Java Ordered Collections and SortedSet Indianapolis IN
- Java Ordered Collections and SortedSet Jeffersonville IN
- Java Ordered Collections and SortedSet Kendallville IN
- Java Ordered Collections and SortedSet Kokomo IN
- Java Ordered Collections and SortedSet Lafayette IN
- Java Ordered Collections and SortedSet Laporte IN
- Java Ordered Collections and SortedSet Logansport IN
- Java Ordered Collections and SortedSet Marion IN
- Java Ordered Collections and SortedSet Martinsville IN
- Java Ordered Collections and SortedSet Merrillville IN
- Java Ordered Collections and SortedSet Michigan City IN
- Java Ordered Collections and SortedSet Mishawaka IN
- Java Ordered Collections and SortedSet Muncie IN
- Java Ordered Collections and SortedSet Munster IN
- Java Ordered Collections and SortedSet New Albany IN
- Java Ordered Collections and SortedSet New Castle IN
- Java Ordered Collections and SortedSet Newburgh IN
- Java Ordered Collections and SortedSet Noblesville IN
- Java Ordered Collections and SortedSet North Vernon IN
- Java Ordered Collections and SortedSet Peru IN
- Java Ordered Collections and SortedSet Portage IN
- Java Ordered Collections and SortedSet Richmond IN
- Java Ordered Collections and SortedSet Schererville IN
- Java Ordered Collections and SortedSet Seymour IN
- Java Ordered Collections and SortedSet Shelbyville IN
- Java Ordered Collections and SortedSet South Bend IN
- Java Ordered Collections and SortedSet Terre Haute IN
- Java Ordered Collections and SortedSet Valparaiso IN
- Java Ordered Collections and SortedSet Vincennes IN
- Java Ordered Collections and SortedSet Wabash IN
- Java Ordered Collections and SortedSet Warsaw IN
- Java Ordered Collections and SortedSet West Lafayette IN
- Java Ordered Collections and SortedSet Zionsville IN
Related Articles
- Enterprise Java Application Architecture and Design Indiana
Discover how to combine the Model-View-Controller (MVC) architectural principles with the Java EE platform to derive multitier Java EE application architecture. You will also see how the Java EE design patterns catalog provides guidance and how you can document this architecture using UML notations.
- GlassFish ESB V2 for SOA Tooling Indiana
- UML for Object-Oriented Design Indiana
- Java Hashed Collections Indiana
- Java Standardization Request 168 Indiana
Related Local Event
Live, Learn, & Intern - XBOX Tournament @ Aptera
Dates: 7/30/2009 - 7/30/2009
Location: Aptera Software, Inc.
Fort Wayne, IN
View Details

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML