This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is use of Backed Collection in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What is use of Backed Collection in java" Watch "What is use of Backed Collection in java" New topic
Author

What is use of Backed Collection in java

Prateek Kumar Singh
Greenhorn

Joined: Jan 21, 2011
Posts: 29

Hi
can any body elaborate that what is use of Backed Collection in java.

Prateek Singh
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1666
    
    7

Backed collections, like the ones you get from SortedSet's headSet(), subSet() and tailSet() methods, or SortedMap's headMap(), subMap(), and tailMap()'s methods, are intented as views of a particular section of the larger collection - according to their API documentation. These view collections are conceptually similar to updatable database views, and offer some of the same advantages. Their memory footprint is small, because no data is actually duplicated, as all references point to the same objects, and they can logically partition a large collection making it easier to work with relevant data. A "write-through" view isn't always what you want, though, so it's very important to be aware of that behavior. Some times you actually need a defensive copy of a collection, and directly exposing the results of the methods mentioned earlier would of course violate that. Another kind of backing is what you get when using Arrays.asList() where the returned List is backed by an array.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is use of Backed Collection in java
 
Similar Threads
HELP needed in backed collections and priority queues!
Backed collection
need help in understanding backed collections and pollFirstXXX() methods?
K&B-6-pg-591 - Backed Collections - exam watch
File backed collection