In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "java binary multi-field matching method", the content of the article is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "java binary multi-field matching method" bar!
Package util;/** merges multiple int positive integers into a long type for storage, and calculates whether the two groups of int match by xor operation * the value of MultiEnumVal64 int positive integers must be greater than 0 and 0 for the special calculation of MultiVal64 itself, b as an example * * String sql = ""; * if (mv643.isHasIgnoreVal ()) {* sql = "select * from table where column_name (") * for (int [] pos: mv643.getIgnorePos ()) {* if (pos [0] > 0 | | pos [1] > 0) {* for (int start = pos [1]; start b as an example * * String sql = ""; * if (mv643.isHasIgnoreVal ()) {* sql = "select * from table where (column_name & ~"; * sql + = mv643.getComparVal ()) * sql + = ") ^" + mv643.getLong () + "= 0;"; *} else {* sql = "select * from table where column_name ^" + mv643.getLong () + "= 0;"; *} * * / public class MultiEnumVal64 {/ * binary length container for the maximum value of all attributes * / private int [] config / * ignore locations that do not participate in matching values * / private int [] [] ignorePos; / * binary values * / private long longVal; / * the binary length synthesis of the maximum value of all attributes * / private int length; / * whether there is no participation in the matching identity * / private boolean hasIgnoreVal = false / * * the maximum value of each group of int * * @ param maxValConfig * / public MultiEnumVal64 (int... MaxValConfig) {this.config = new int [maxValConfig.length]; this.ignorePos = new int [maxValConfig.length] [2]; for (int index = 0; index)
< maxValConfig.length; index++) { int maxVal = maxValConfig[index]; if (maxVal < 0) { throw new IllegalArgumentException("value must be greater than 0"); } int tempLength = Integer.toBinaryString(maxVal).length(); this.config[index] = tempLength; length += tempLength; } if (length + 1 >63) {throw new IllegalArgumentException (length + "over the maximum digit 62");}} / * * value 1) {startIndex = 1; values [I] = Integer.parseInt (binary.substring (startIndex, endIndex), 2);} else {values [I] =-1 }} else {values [I] = Integer.parseInt (binary.substring (startIndex, endIndex), 2);} if (values [I] = = 0) {values [I] =-1;} endIndex = startIndex;} return values } public int [] [] getIgnorePos () {return ignorePos;} public int getLength () {return length;} public long getComparVal () {long M1 = 0L If (hasIgnoreVal) {for (int [] pos: ignorePos) {if (pos [0] > 0 | | pos [1] > 0) {for (int start = pos [1]; start)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.