Unlock instant, AI-driven research and patent intelligence for your innovation.

JAVA container synchronization method and system

A synchronization and container technology, applied in the field of JAVA, which can solve the problems of disordered order of iterative objects and inability to know whether the position has been traversed.

Active Publication Date: 2016-06-01
GOERTEK INC
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] 1. When the iterator adds an iterative object, the JAVA container of the ordered sequence will add the iterative object at the position corresponding to the iterator, and the JAVA container of the unordered sequence will add the iterative object at a random position. No matter which sequence, it cannot Know whether this location has been traversed
[0004] 2. When the iterator deletes the current iterable object, the JAVA container of the ordered sequence will advance the iterative object of the subsequent order by one position, while the JAVA container of the unordered sequence deletes the iterative object, and the order of the iterative object of the subsequent order is May be disrupted, no matter what sequence, it will cause the subsequent iteration objects to be reordered

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
  • JAVA container synchronization method and system
  • JAVA container synchronization method and system
  • JAVA container synchronization method and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0020] In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of one or more embodiments. It may be evident, however, that these embodiments may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to facilitate describing one or more embodiments.

[0021] Glossary

[0022] Collection: A collection of multiple iteration objects, each iteration object becomes an element.

[0023] JAVA container: used to store stacked collections.

[0024] Iterator: It is an object that can be used to traverse some or all elements in the JAVA container, and each iterator object represents a certain address in the JAVA container.

[0025] Synchronization: refers to the method of thread synchronization, that is, when a function call is issued, the call will not return until the result is obtained, and other threads cannot...

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 present invention provides a JAVA container synchronization method and system. The method comprises: checking the type of a JAVA container; when the JAVA container is a Collection type, performing thread encapsulation on the JAVA container of the Collection type, so as to transform a set in the JAVA container of the Collection type into a synchronization set; and when the JAVA container is a non-Collection type, iterating the set in the JAVA container of the non-collection type into the JAVA container of the Collection type that is subjected to thread encapsulation. According to the method provided by the present invention, when an iterator adds a to-be-iterated object, the newly-added to-be-iterated object can be added at a tail end of the JAVA container, so as to ensure the newly-added to-be-iterated object will be iterated, and when the iterator deletes the to-be-iterated object, a position o a current to-be-iterated object is not released, so as to ensure each of subsequent to-be-iterated objects will not be resorted due to the position, which otherwise causes an iteration failure.

Description

technical field [0001] The present invention relates to the technical field of JAVA, and more specifically, to a method and system for synchronizing JAVA containers. Background technique [0002] The traditional JAVA iterator (hereinafter referred to as the iterator) is a fast-fail iterator, and its iterative behavior is not thread-safe. Therefore, during the iterator iteration process, when iterative objects are dynamically added or deleted due to business needs, The behavior of the iterator itself will become uncontrollable. Which direction the iteration behavior develops depends on the specific algorithm of the JAVA container implementation class, so there are the following problems: [0003] 1. When the iterator adds an iterative object, the JAVA container of the ordered sequence will add the iterative object at the position corresponding to the iterator, and the JAVA container of the unordered sequence will add the iterative object at a random position. No matter what k...

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
IPC IPC(8): G06F9/52
CPCG06F9/52
Inventor 李栋
Owner GOERTEK INC