Java Ordered Collections and SortedSet Virginia

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

IBM Corp
(757) 446-6200
999 Waterside DR
Norfolk, VA
Digital Image Technology Corp
(757) 623-3709
500 E Plume St
Norfolk, VA
Electronics Boutique
757-465-5977
4200 Portsmouth Blvd
Chesapeake, VA
Paramount Technology Group Inc
757-405-0110
3909 Colony Pointe DR
Chesapeake, VA
Active Computer & Electronics
757-558-8878
2981 S Military Hwy
Chesapeake, VA
Software Development & Services Corporation
703-359-1380
2200 Wilson Blvd
Arlington, VA
Geeks On Call America
(757) 722-3200
814 Kempsville Rd
Norfolk, VA
Patriot Computers
(757) 587-6400
7862 Tidewater Dr
Norfolk, VA
Direct2U Computer Repair
757-803-8126
4213 Schooner Trail
Chesapeake, VA
Torrential Data Solutions Inc
757-222-2000
5604 Virginia Beach Blvd
Virginia Beach, VA



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

IBM Corp

(757) 446-6200
999 Waterside DR
Norfolk, VA

Related Articles
- UML for Object-Oriented Design Virginia
The Unified Modeling Language (UML) is a notation you can use for object-oriented design. This article contains a brief overview of UML to introduce you to the subset of UML that you can use to describe classes, interfaces, objectsand the relationships among them.
- Enterprise Java Application Architecture and Design Virginia
- Java Standardization Request 168 Virginia
- GlassFish ESB V2 for SOA Tooling Virginia
- Java Hashed Collections Virginia
Regional Articles
- Java Ordered Collections and SortedSet Alexandria VA
- Java Ordered Collections and SortedSet Annandale VA
- Java Ordered Collections and SortedSet Arlington VA
- Java Ordered Collections and SortedSet Ashburn VA
- Java Ordered Collections and SortedSet Bassett VA
- Java Ordered Collections and SortedSet Blacksburg VA
- Java Ordered Collections and SortedSet Bristol VA
- Java Ordered Collections and SortedSet Burke VA
- Java Ordered Collections and SortedSet Centreville VA
- Java Ordered Collections and SortedSet Chantilly VA
- Java Ordered Collections and SortedSet Charlottesville VA
- Java Ordered Collections and SortedSet Chesapeake VA
- Java Ordered Collections and SortedSet Chester VA
- Java Ordered Collections and SortedSet Chesterfield VA
- Java Ordered Collections and SortedSet Christiansburg VA
- Java Ordered Collections and SortedSet Colonial Heights VA
- Java Ordered Collections and SortedSet Culpeper VA
- Java Ordered Collections and SortedSet Danville VA
- Java Ordered Collections and SortedSet Dumfries VA
- Java Ordered Collections and SortedSet Fairfax Station VA
- Java Ordered Collections and SortedSet Fairfax VA
- Java Ordered Collections and SortedSet Falls Church VA
- Java Ordered Collections and SortedSet Farmville VA
- Java Ordered Collections and SortedSet Fredericksburg VA
- Java Ordered Collections and SortedSet Front Royal VA
- Java Ordered Collections and SortedSet Galax VA
- Java Ordered Collections and SortedSet Glen Allen VA
- Java Ordered Collections and SortedSet Hampton VA
- Java Ordered Collections and SortedSet Harrisonburg VA
- Java Ordered Collections and SortedSet Herndon VA
- Java Ordered Collections and SortedSet Hopewell VA
- Java Ordered Collections and SortedSet King George VA
- Java Ordered Collections and SortedSet Leesburg VA
- Java Ordered Collections and SortedSet Lorton VA
- Java Ordered Collections and SortedSet Lynchburg VA
- Java Ordered Collections and SortedSet Manassas VA
- Java Ordered Collections and SortedSet Martinsville VA
- Java Ordered Collections and SortedSet Mc Lean VA
- Java Ordered Collections and SortedSet Mechanicsville VA
- Java Ordered Collections and SortedSet Midlothian VA
- Java Ordered Collections and SortedSet Newport News VA
- Java Ordered Collections and SortedSet Norfolk VA
- Java Ordered Collections and SortedSet Petersburg VA
- Java Ordered Collections and SortedSet Portsmouth VA
- Java Ordered Collections and SortedSet Powhatan VA
- Java Ordered Collections and SortedSet Radford VA
- Java Ordered Collections and SortedSet Reston VA
- Java Ordered Collections and SortedSet Richmond VA
- Java Ordered Collections and SortedSet Roanoke VA
- Java Ordered Collections and SortedSet Salem VA
- Java Ordered Collections and SortedSet Spotsylvania VA
- Java Ordered Collections and SortedSet Springfield VA
- Java Ordered Collections and SortedSet Stafford VA
- Java Ordered Collections and SortedSet Staunton VA
- Java Ordered Collections and SortedSet Sterling VA
- Java Ordered Collections and SortedSet Suffolk VA
- Java Ordered Collections and SortedSet Vienna VA
- Java Ordered Collections and SortedSet Vinton VA
- Java Ordered Collections and SortedSet Virginia Beach VA
- Java Ordered Collections and SortedSet Warrenton VA
- Java Ordered Collections and SortedSet Waynesboro VA
- Java Ordered Collections and SortedSet Williamsburg VA
- Java Ordered Collections and SortedSet Winchester VA
- Java Ordered Collections and SortedSet Woodbridge VA
- Java Ordered Collections and SortedSet Yorktown VA
Related Articles
- Enterprise Java Application Architecture and Design Virginia
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 Virginia
- GlassFish ESB V2 for SOA Tooling Virginia
- Java Hashed Collections Virginia
- Java Standardization Request 168 Virginia
Related Local Events
SANS Virginia Beach 2009
Dates: 8/28/2009 - 9/4/2009
Location: Sheraton Oceanfront Virginia Beach
Virginia Beach, VA
View Details

The 2009 Federal Technology Policy Forum
Dates: 7/15/2009 - 7/17/2009
Location: The Performance Institute
Arlington, VA
View Details

4th Annual Military Armor Protection
Dates: 6/23/2009 - 6/26/2009
Location: Hilton McLean
Tysons Corner, VA
View Details

Coalition Warfighter Interoperability Demonstration
Dates: 6/15/2009 - 6/26/2009
Location: Joint Systems Integration Center
Suffolk, VA
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