The application is suitable for the field of
computer programming and provides a
Java language LINQ expression implementation method based on chain calling, which comprises the following steps: providing a LinqQuery interface, the LinqQuery interface defines a chain operator where operator and select, and
type safety is provided through a generic T; a user generates an operator tree through calling the chain operator of the LinqQuery interface, the operator tree is used for recording query logic; the operator tree is parsed, query is executed in
layers, and a
result set is returned; the application has the beneficial effects that compared with traditional loop and
conditional branch implementation, the number of code lines is reduced by about 40%, the
readability is significantly improved, through an open
operator interface, a developer can easily extend query functions, through generic constraints,
type checking of query logic is completed at the compilation stage, runtime errors are reduced, and unified query of various scenes such as memory collection,
database query and file reading is supported.