Java Ordered Collections and SortedSet South Milwaukee WI

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

Acra International
414-672-0000
3742 W Lakefield DR
Milwaukee, WI
PKWARE, Inc.
414-289-9788 ext 117
648 N Plankinton Ave
Milwaukee, AK
Thin Air Software
414-732-2400
10437 W Innovation Dr
Milwaukee, WI
Zeon Solutions
414-475-6472
10437 W Innovation Dr
Milwaukee, WI
HarrisData
800-225-0585
13555 Bishops Court
Brookfield, WI
G4 Enterprise Solutions
414-389-1234
3031 W Lincoln Ave
Milwaukee, WI
Access Technologies International
414-289-3121
840 N Old World 3rd St
Milwaukee, WI
Guild Software Inc
414-259-0959
10437 W Innovation DR
Milwaukee, WI
Weyer Software Services
414-302-0321
2239 N 114th St
Milwaukee, WI
Practice Management Solutions Inc
414-352-8160
7571 N Teutonia Ave
Milwaukee, WI



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

G4 Enterprise Solutions

414-389-1234
3031 W Lincoln Ave
Milwaukee, WI

Related Articles
- UML for Object-Oriented Design South Milwaukee WI
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 South Milwaukee WI
- Java Hashed Collections South Milwaukee WI
- GlassFish ESB V2 for SOA Tooling South Milwaukee WI
- Java Standardization Request 168 South Milwaukee WI
Related Articles
- UML for Object-Oriented Design South Milwaukee WI
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 South Milwaukee WI
- Java Hashed Collections South Milwaukee WI
- GlassFish ESB V2 for SOA Tooling South Milwaukee WI
- Java Standardization Request 168 South Milwaukee WI

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