Two List set combination method based on Java platform

A collection and platform technology, applied in the field of Java platform, can solve the problems of index confusion and content duplication, and achieve the effect of solving index confusion

Inactive Publication Date: 2018-06-29
G CLOUD TECH +1
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The technical problem solved by the present invention is to provide a method for merging two List collections based on the Java platform; to solve the problem that the content of a certain attribute is repeated and the index is confused in the merged List collection

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Two List set combination method based on Java platform
  • Two List set combination method based on Java platform
  • Two List set combination method based on Java platform

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0017] Such as figure 1 Shown, the present invention adopts following steps:

[0018] Step 1. Create an entity class Product, which contains name and count attributes and create a tool class ListUtil; for example:

[0019]

[0020] Step 2. Create a large List in the ListUtil tool class bigList collection, small List samllList collection and List nameList collection; such as:

[0021]

[0022] Step 3. In the construction method, initialize the data of the bigList collection and the samllList collection, then loop through the bigList collection, and add the content of the name attribute of all Products to the nameList collection; for example:

[0023]

[0024]

[0025]

[0026] Step 4. Create the getUnionList() method, pass in the above three collections, and loop through the samllList collection; for example:

[0027]

[0028] Step 5. Obtain the index index of the object with the same name in the large collection according t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to the technical field of Java platforms, in particular to a two List set combination method based on a Java platform. The method is characterized in that when two List sets arecombined, the attributes of the repeated content to be removed in the large List set are extracted and sealed as another set, the small List set is traversed to obtain the index of of repeated data, and the repeated data is removed; data is added once again to the index, so that repeated data is removed and the index remains unchanged. By means of the method, the problems of repeated contents of some attributes and disordered index exist in the combined List set are solved.

Description

technical field [0001] The invention relates to the technical field of the Java platform, in particular to a method for merging two List collections based on the Java platform. Background technique [0002] When merging two List (list) collections under the Java platform, it is easy to cause the problem that the content of a certain attribute in the merged List collection is repeated; in order to solve this problem, the merged process statement needs to be filtered and encapsulated. Contents of the invention [0003] The technical problem to be solved by the present invention is to provide a method for merging two List collections based on the Java platform; to solve the problem that the content of a certain attribute is repeated and the index is confused in the merged List collection. [0004] The technical scheme that the present invention solves the problems of the technologies described above is: [0005] When merging two List collections, firstly extract and encapsul...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/30
CPCG06F8/315
Inventor 陈林徐震宇张来卿文新季统凯
Owner G CLOUD TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products