Java Collection Data Structure: Difference between revisions

From GM-RKB
Jump to navigation Jump to search
m (Text replace - "* <B>See:</B>" to "* <B><U>See:</U></B>")
 
m (Text replacement - ".<P>" to ". <P>")
 
(31 intermediate revisions by the same user not shown)
Line 1: Line 1:
A [[Java Collection Data Structure]] is a [[collection data structure]] in the [[Java programming language]].
A [[Java Collection Data Structure]] is a [[collection data structure]] in the [[Java programming language]].
* <B><U>Context:</U></B>
* <B>Context:</U></B>
** It can be in a [[superclass relation]] with other [[Data Structure]]s (http://upload.wikimedia.org/wikipedia/commons/4/41/Collection_Classes.jpg)
** It can be in a [[superclass relation]] with other [[Data Structure]]s (http://upload.wikimedia.org/wikipedia/commons/4/41/Collection_Classes.jpg)
** It can range from being a [[Java Set Collection]] to being a [[Java List Collection]] to being a [[Java Queue Collection]].
** It can range from being a [[Java Set Collection]] to being a [[Java List Collection]] to being a [[Java Queue Collection]].
** It can be accessed by a [[Java Iterator]].
** It can be accessed by a [[Java Iterator]].
** It can be accessed by a [[Java for-each Operator]].
** It can be accessed by a [[Java for-each Operator]].
* <B><U>Example(s):</U></B>
* <B>Example(s):</B>
** a [[Java Array]].
** a [[Java Associative Array]].
** a [[Java-based Stack]].
** <code>List<String> list = new ArrayList<String>(c);</code>
** <code>List<String> list = new ArrayList<String>(c);</code>
** <code>List<BigDecimal> vals = new ArrayList<BigDecimal>();</code>
** <code>List<BigDecimal> vals = new ArrayList<BigDecimal>();</code>
* <B><U>See:</U></B> [[Java Collection Iterator]].
* <B>Counter-Example(s):</B>
** [[Python Collection DS]].
** [[Perl Collection DS]].
** [[Scala Collection DS]].
* <B>See:</B> [[Java Collection Iterator]].
 
----
----
----
----
==References==


===2011===
== References ==
 
=== 2011 ===
* http://en.wikipedia.org/wiki/Java_collections_framework
* http://en.wikipedia.org/wiki/Java_collections_framework
** <B>QUOTE:</B> The <B>[[Java programming language|Java]] collections framework</B> (JCF) is a set of [[class (computer science)|classes]] and [[interface (java)|interfaces]] that implement commonly reusable collection [[data structure]]s. Although it is a [[Software framework|framework]], it works in a manner of a '''library'''. The JCF provides both interfaces that define various collections and classes that implement them.
** QUOTE:The <B>[[Java programming language|Java]] collections framework</B> (JCF) is a set of [[class (computer science)|classes]] and [[interface (java)|interface]]s that implement commonly reusable collection [[data structure]]s. Although it is a [[Software framework|framework]], it works in a manner of a '''library</B>. The JCF provides both interfaces that define various collections and classes that implement them.


===2010===
=== 2010 ===
* http://download.oracle.com/javase/tutorial/collections/intro/index.html
* http://download.oracle.com/javase/tutorial/collections/intro/index.html
** <B>QUOTE:</B> A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers). <P> If you've used the Java programming language — or just about any other programming language — you're already familiar with collections. Collection implementations in earlier (pre-1.2) versions of the Java platform included Vector, Hashtable, and array. However, those earlier versions did not contain a collections framework.
** QUOTE:A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers).       <P>         If you've used the Java programming language — or just about any other programming language — you're already familiar with collections. Collection implementations in earlier (pre-1.2) versions of the Java platform included Vector, Hashtable, and array. However, those earlier versions did not contain a collections framework.
<BR>
<BR>
* http://docs.oracle.com/javase/tutorial/collections/interfaces/collection.html
* http://docs.oracle.com/javase/tutorial/collections/interfaces/collection.html
** <B>QUOTE:</B> A [[Java Collection Data Structure|Collection]] represents a group of objects known as its elements. The Collection interface is used to pass around collections of objects where maximum generality is desired. For example, by convention all general-purpose collection implementations have a constructor that takes a Collection argument. This constructor, known as a conversion constructor, initializes the new collection to contain all of the elements in the specified collection, whatever the given collection's subinterface or implementation type. In other words, it allows you to convert the collection's type. <P> Suppose, for example, that you have a Collection<String> c, which may be a List, a Set, or another kind of Collection. This idiom creates a new ArrayList (an implementation of the List interface), initially containing all the elements in c.<P> <code>List<String> list = new ArrayList<String>(c);</code>
** QUOTE:A [[Java Collection Data Structure|Collection]] represents a group of objects known as its elements. The Collection interface is used to pass around collections of objects where maximum generality is desired. For example, by convention all general-purpose collection implementations have a constructor that takes a Collection argument. This constructor, known as a conversion constructor, initializes the new collection to contain all of the elements in the specified collection, whatever the given collection's subinterface or implementation type. In other words, it allows you to convert the collection's type.       <P>         Suppose, for example, that you have a Collection<String> c, which may be a List, a Set, or another kind of Collection. This idiom creates a new ArrayList (an implementation of the List interface), initially containing all the elements in c.         <P>       <code>List<String> list = new ArrayList<String>(c);</code>


----
----
__NOTOC__
__NOTOC__
[[Category:Concept]]
[[Category:Concept]]

Latest revision as of 16:53, 6 April 2023

A Java Collection Data Structure is a collection data structure in the Java programming language.



References

2011

2010

  • http://download.oracle.com/javase/tutorial/collections/intro/index.html
    • QUOTE:A collection — sometimes called a container — is simply an object that groups multiple elements into a single unit. Collections are used to store, retrieve, manipulate, and communicate aggregate data. Typically, they represent data items that form a natural group, such as a poker hand (a collection of cards), a mail folder (a collection of letters), or a telephone directory (a mapping of names to phone numbers).

      If you've used the Java programming language — or just about any other programming language — you're already familiar with collections. Collection implementations in earlier (pre-1.2) versions of the Java platform included Vector, Hashtable, and array. However, those earlier versions did not contain a collections framework.


  • http://docs.oracle.com/javase/tutorial/collections/interfaces/collection.html
    • QUOTE:A Collection represents a group of objects known as its elements. The Collection interface is used to pass around collections of objects where maximum generality is desired. For example, by convention all general-purpose collection implementations have a constructor that takes a Collection argument. This constructor, known as a conversion constructor, initializes the new collection to contain all of the elements in the specified collection, whatever the given collection's subinterface or implementation type. In other words, it allows you to convert the collection's type.

      Suppose, for example, that you have a Collection<String> c, which may be a List, a Set, or another kind of Collection. This idiom creates a new ArrayList (an implementation of the List interface), initially containing all the elements in c.

      List<String> list = new ArrayList<String>(c);