[go: up one dir, main page]

CN113434125A - Method and system for interconversion between sets based on java language - Google Patents

Method and system for interconversion between sets based on java language Download PDF

Info

Publication number
CN113434125A
CN113434125A CN202110703479.5A CN202110703479A CN113434125A CN 113434125 A CN113434125 A CN 113434125A CN 202110703479 A CN202110703479 A CN 202110703479A CN 113434125 A CN113434125 A CN 113434125A
Authority
CN
China
Prior art keywords
conversion
collection
converted
java language
sets
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110703479.5A
Other languages
Chinese (zh)
Inventor
张康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Huanwang Technology Co Ltd
Original Assignee
Guangdong Huanwang Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Huanwang Technology Co Ltd filed Critical Guangdong Huanwang Technology Co Ltd
Priority to CN202110703479.5A priority Critical patent/CN113434125A/en
Publication of CN113434125A publication Critical patent/CN113434125A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

本发明涉及一种基于java语言进行集合间互相转换的方法及系统,方法包括:获取集合转换指令,集合转换指令包括待转换集合和目标集合;通过Collection.concert调用集合转换指令对应的集合转换方法;利用集合转换方法将待转换集合转换为目标集合,通过将所有的转换方法提前封装于Collection.concert中,使得在进行集合间的互相转换时,仅需要在对应的类中进行调用即可,然后便可以快速的完成集合的互相之间的转换,有效地提高了集合之间的转换效率。

Figure 202110703479

The invention relates to a method and system for mutual conversion between sets based on java language. The method includes: acquiring a set conversion instruction, where the set conversion instruction includes a set to be converted and a target set; and calling a set conversion method corresponding to the set conversion instruction through Collection.concert ;Using the collection conversion method to convert the collection to be converted into the target collection, by encapsulating all conversion methods in Collection.concert in advance, so that when performing mutual conversion between collections, only need to be called in the corresponding class, Then, the conversion between sets can be quickly completed, which effectively improves the conversion efficiency between sets.

Figure 202110703479

Description

Method and system for interconversion between sets based on java language
Technical Field
The invention belongs to the technical field of set conversion, and particularly relates to a method and a system for performing inter-set conversion based on java language.
Background
The use of sets is very common in the process of developing projects, such as Map, List, Set, ArrayList, TreeMap, and the like, and sometimes, the currently used List Set needs to be converted into Map or into Set and other sets. When the collection classes are converted into each other, if the collection is not clearly understood, some column problems are caused, so that the code quality is low, and the project progress is influenced.
Therefore, how to improve the conversion efficiency between sets becomes a technical problem that those skilled in the art need to conclude urgently.
Disclosure of Invention
In order to at least solve the above problems in the prior art, the present invention provides a method and a system for performing inter-set conversion based on java language, so as to improve the conversion efficiency between sets.
The technical scheme provided by the invention is as follows:
in one aspect, a method for inter-set conversion based on java language includes:
acquiring a set conversion instruction, wherein the set conversion instruction comprises a set to be converted and a target set;
calling a set conversion method corresponding to the set conversion instruction through Collection.Concert;
and converting the set to be converted into the target set by using the set conversion method.
Optionally, before the obtaining the set conversion instruction, the method further includes:
acquiring a basic class set;
establishing a conversion method between the basic class sets;
and encapsulating the mutual conversion method of the basic class sets in Collection.
Optionally, the basic class set includes: map, List, and Set.
Optionally, after the set to be converted is converted into the target set by using the set conversion method, the method further includes:
and returning the target set to a user operation interface.
In another aspect, a system for inter-set conversion based on java language includes:
the system comprises an acquisition module, a conversion module and a conversion module, wherein the acquisition module is used for acquiring a set conversion instruction, and the set conversion instruction comprises a set to be converted and a target set;
a calling module, configured to call, through collection.concert, a collection conversion method corresponding to the collection conversion instruction;
and the conversion module is used for converting the set to be converted into the target set by using the set conversion method.
Optionally, the system for performing inter-set interconversion based on java language further includes an encapsulation module, which is specifically configured to:
acquiring a basic class set;
establishing a conversion method between the basic class sets;
and encapsulating the mutual conversion method of the basic class sets in Collection.
Optionally, the basic class set includes: map, List, and Set.
Optionally, the system for performing inter-set interconversion based on java language further includes a return module, which is specifically configured to:
and returning the target set to a user operation interface.
The invention has the beneficial effects that:
the invention provides a method and a system for mutual conversion among sets based on java language, wherein the method comprises the following steps: acquiring a set conversion instruction, wherein the set conversion instruction comprises a set to be converted and a target set; calling a set conversion method corresponding to the set conversion instruction through Collection.concert; the set to be converted is converted into the target set by using the set conversion method, and all conversion methods are packaged in the collection.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart of a method for inter-set conversion based on java language according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a system for inter-set conversion based on java language according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the examples given herein without any inventive step, are within the scope of the present invention.
Fig. 1 is a flowchart of a method for inter-set conversion based on java language according to an embodiment of the present invention.
As shown in fig. 1, the method for performing inter-set conversion based on java language provided in this embodiment includes the following steps:
s11, acquiring a set conversion instruction, wherein the set conversion instruction comprises a set to be converted and a target set.
The set conversion instruction is that a user comprises a set to be converted and a target set, wherein the set to be converted is combined, namely, a set required to be converted, the target set refers to a required set type, and the set to be converted is required to be converted into the target set.
And S12, calling a set conversion method corresponding to the set conversion instruction through Collection.
Specifically, before the combination conversion is performed, a basic class set is obtained; then, a method for converting the basic class sets is established, that is, the mutual conversion among all the sets is established, and finally, the method for converting the basic class sets is encapsulated in collection. Then, after the set conversion instruction is acquired, a set conversion method corresponding to the set conversion instruction is directly searched in collection. Wherein, the basic class set generally comprises: map, List, and Set.
And S13, converting the set to be converted into a target set by using a set conversion method.
After the corresponding set conversion method is obtained, the set to be converted can be directly converted into the target set by using the set conversion method. Therefore, the mutual conversion among the sets can be rapidly carried out, the data in the sets are directly transferred to the other set through a calling method, and the mutual conversion among the sets can be rapidly completed without rewriting codes.
The method and system for performing inter-set interconversion based on java language provided by the embodiment comprises the following steps: acquiring a set conversion instruction, wherein the set conversion instruction comprises a set to be converted and a target set; calling a set conversion method corresponding to the set conversion instruction through Collection.concert; the set to be converted is converted into the target set by using the set conversion method, and all conversion methods are packaged in the collection.
Further, in this embodiment, after the set to be converted is converted into the target set by using the set conversion method, the method further includes: and returning the target set to the user operation interface, so that the obtained final conversion result can be directly returned to the operation interface, and the method is more intuitive and efficient.
Based on the same general inventive concept, the application also protects a system for mutual conversion between sets based on java language.
Fig. 2 is a schematic structural diagram of a system for inter-set conversion based on java language according to an embodiment of the present invention.
As shown in fig. 2, the system for performing inter-set conversion based on java language provided in this embodiment includes:
an obtaining module 10, configured to obtain a set conversion instruction, where the set conversion instruction includes a set to be converted and a target set;
a calling module 20, configured to call, through collection.concert, a collection conversion method corresponding to the collection conversion instruction;
and the conversion module 30 is configured to convert the set to be converted into the target set by using a set conversion method.
The system for performing inter-set conversion based on java language provided by this embodiment includes: acquiring a set conversion instruction, wherein the set conversion instruction comprises a set to be converted and a target set; calling a set conversion method corresponding to the set conversion instruction through Collection.concert; the set to be converted is converted into the target set by using the set conversion method, and all conversion methods are packaged in the collection.
Further, the system for performing inter-set conversion based on java language in this embodiment further includes an encapsulation module, which is specifically configured to:
acquiring a basic class set;
establishing a mutual conversion method of the basic class sets;
and encapsulating the conversion method of the basic class sets among each other in Collection.
Further, the basic class set in this embodiment includes: map, List, and Set.
Further, the system for performing inter-set conversion based on java language in this embodiment further includes a return module, which is specifically configured to return the target set to the user operation interface.
Embodiments of the apparatus parts have been described in detail in relation to corresponding method embodiments, and therefore will not be described in detail in relation to corresponding apparatus parts, which may be understood by reference to each other.
Embodiments of the present application provide a storage medium, where a computer program is stored, and when the computer program is executed by a processor, the method for controlling a novel multifunctional express cabinet according to any of the above embodiments is implemented.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that the terms "first," "second," and the like in the description of the present invention are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present invention, the meaning of "a plurality" means at least two unless otherwise specified.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (8)

1. A method for mutual conversion between sets based on java language is characterized by comprising the following steps:
acquiring a set conversion instruction, wherein the set conversion instruction comprises a set to be converted and a target set;
calling a set conversion method corresponding to the set conversion instruction through Collection.Concert;
and converting the set to be converted into the target set by using the set conversion method.
2. The method for set-to-set conversion based on java language as claimed in claim 1, wherein before the obtaining the set conversion instruction, further comprising:
acquiring a basic class set;
establishing a conversion method between the basic class sets;
and encapsulating the mutual conversion method of the basic class sets in Collection.
3. The method for set-to-set interconversion based on java language as claimed in claim 2, wherein said base class set comprises: map, List, and Set.
4. The method for set-to-set mutual conversion based on java language as claimed in claim 1, wherein after said set conversion method is used to convert said set to be converted into said target set, further comprising:
and returning the target set to a user operation interface.
5. A system for interconversion between sets based on java language, comprising:
the system comprises an acquisition module, a conversion module and a conversion module, wherein the acquisition module is used for acquiring a set conversion instruction, and the set conversion instruction comprises a set to be converted and a target set;
a calling module, configured to call, through collection.concert, a collection conversion method corresponding to the collection conversion instruction;
and the conversion module is used for converting the set to be converted into the target set by using the set conversion method.
6. The system for set-to-set interconversion based on java language as claimed in claim 1, further comprising an encapsulation module, specifically configured to:
acquiring a basic class set;
establishing a conversion method between the basic class sets;
and encapsulating the mutual conversion method of the basic class sets in Collection.
7. The system for set-to-set interconversion based on java language as claimed in claim 6, wherein said base class set comprises: map, List, and Set.
8. The system for set-to-set interconversion based on java language as claimed in claim 5, further comprising a return module, specifically configured to:
and returning the target set to a user operation interface.
CN202110703479.5A 2021-06-24 2021-06-24 Method and system for interconversion between sets based on java language Pending CN113434125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110703479.5A CN113434125A (en) 2021-06-24 2021-06-24 Method and system for interconversion between sets based on java language

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110703479.5A CN113434125A (en) 2021-06-24 2021-06-24 Method and system for interconversion between sets based on java language

Publications (1)

Publication Number Publication Date
CN113434125A true CN113434125A (en) 2021-09-24

Family

ID=77753865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110703479.5A Pending CN113434125A (en) 2021-06-24 2021-06-24 Method and system for interconversion between sets based on java language

Country Status (1)

Country Link
CN (1) CN113434125A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080120595A1 (en) * 2006-11-17 2008-05-22 O'farrell Bill System and method for hot code replace
CN106919434A (en) * 2017-03-22 2017-07-04 恒生电子股份有限公司 A kind of code generating method and device
CN108664546A (en) * 2018-03-26 2018-10-16 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Xml data structure conversion method and device
CN111143446A (en) * 2019-11-26 2020-05-12 贝壳技术有限公司 Data structure conversion processing method and device of data object and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080120595A1 (en) * 2006-11-17 2008-05-22 O'farrell Bill System and method for hot code replace
CN106919434A (en) * 2017-03-22 2017-07-04 恒生电子股份有限公司 A kind of code generating method and device
CN108664546A (en) * 2018-03-26 2018-10-16 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Xml data structure conversion method and device
CN111143446A (en) * 2019-11-26 2020-05-12 贝壳技术有限公司 Data structure conversion processing method and device of data object and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PETER_QYQ: "Java集合转换(数组、List、Set、Map相互转换)", pages 2 - 3, Retrieved from the Internet <URL:https://blog.csdn.net/peter_qyq/article/details/75045573> *
孟祥飞: "《Java程序设计》", 31 January 2019, 北京:北京理工大学出版社, pages: 65 *

Similar Documents

Publication Publication Date Title
US9817857B2 (en) Deep cloning of objects using binary format
WO2019095968A1 (en) Dynamic loading method, and target file producing method and apparatus
CN112633077B (en) Face detection method, system, storage medium and terminal based on in-layer multi-scale feature enhancement
CN107526806A (en) The conversion method and device of data
CN108021357B (en) Optimization method and device for program call
CN117573359B (en) Heterogeneous cluster-based computing framework management system and method
CN111767056A (en) A source code compilation method, an executable file running method, and a terminal device
CN111569431A (en) Game engine resource processing method, electronic device and computer readable storage medium
WO2022228500A1 (en) Data storage method and apparatus for bios, device and storage medium
CN111124382A (en) Attribute assignment method and device in Java and server
CN112631649B (en) Smart contract management method, device, terminal equipment and medium
CN114816413A (en) Method, device, equipment and storage medium for generating component dependency relationship
CN106341469B (en) Loading method and device of tree node data
EP3779697A1 (en) Data processing method, device and apparatus
EP3396536A1 (en) Application program running method and apparatus
CN111414206A (en) A method and device for starting parallel loading of metadata based on HDFS
CN113434125A (en) Method and system for interconversion between sets based on java language
WO2011008196A1 (en) Modifying a video resolution of video data in a pre-operating system environment
CN114564175A (en) Software development method, intelligent terminal and storage medium
CN114647548A (en) A log generation method and device
CN116483481A (en) Firmware library calling method, device, equipment and storage medium
CN116225463A (en) A front-end project construction packaging method, system, device and storage medium
CN106886448A (en) A kind of introduction method and device of OVA files
CN111124386B (en) Animation event processing method, device, equipment and storage medium based on Unity
CN112667948A (en) Data communication method and system based on Fetch

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210924