Java Ordered Collections and SortedSet Kansas

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

Mersoft Corporation
913-871-6196
9300 W. 110th Street
Overland Park, KS
Access Group LLC
(316) 264-0270
348 Ida St.
Wichita, KS
Midwest CAM Solutions (GibbsCAM)
877-444-0982
NOW SERVING: KANSAS
Wichita, KS
Professional Software Inc
(316) 269-4264
800 E 1st St Ste 150
Wichita, KS
Allen Gibbs & Houlik L C Agh
(316) 267-7231
301 N Main St Ste 1700 Epic Center
Wichita, KS
Backup Solutions
(316) 944-4448
2707 W Douglas Ave Ste B
Wichita, KS
Brainworks Software
(316) 722-8100
7570 W 21st St N
Wichita, KS
C E M Systems Inc
(316) 264-6116
1609 E 2nd St N
Wichita, KS
Choice Solutions
(316) 293-2900
3020 N Cypress Ste 200
Wichita, KS
Vertical Solutions Inc
(316) 941-9429
2142 W Maple St
Wichita, KS



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

Mersoft Corporation

913-871-6196
9300 W. 110th Street
Overland Park, KS
www.mersoft.com

Related Articles
- Enterprise Java Application Architecture and Design Kansas
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.
- UML for Object-Oriented Design Kansas
- Java Standardization Request 168 Kansas
- Java Hashed Collections Kansas
- GlassFish ESB V2 for SOA Tooling Kansas
Related Articles
- Java Hashed Collections Kansas
The Java collections framework contains classes you use to maintain collections of other objects. These collection classes have different performance and ordering properties. See how the HashMap and HashSet Classes allow objects to be added to a collection, removed from a collection, or found in roughly constant time. Discover how to use these classes and what to do to achieve good performance from them.
- Enterprise Java Application Architecture and Design Kansas
- Java Standardization Request 168 Kansas
- GlassFish ESB V2 for SOA Tooling Kansas
- UML for Object-Oriented Design Kansas
Related Local Events
Influencing without Authority
Dates: 12/3/2009 - 12/3/2009
Location: CMD Training Center WSU campus
Wichita, KS
View Details

Bio Science Committee
Dates: 6/11/2009 - 6/11/2009
Location: KCK Chamber
Kansas City, KS
View Details

Kansas Main Street Directors Quarterly Training
Dates: 5/19/2009 - 5/20/2009
Location: Downtown Vision & Finnup Center
Garden City, KS
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