计算checbox选中值
来源:互联网 发布:word朗读软件 编辑:程序博客网 时间:2024/06/04 01:27
这个简直是天才型的人物写出来的东西
public static String toStrFlag(Long v) {
String result = "";if (v == null) {
return result;
}
if (v > 0x7FFF) {
throw new IllegalArgumentException("flag值错误,flag必须(0 <= flag <= 0x7FFF)");
}
List<String> list = new ArrayList<String>();
for (int i = 0; i < 15; i++) {
long f = 1;
f = f << i;
f = f & v.longValue();
if (f > 0) {
list.add(String.valueOf(i + 1));
}
}
return Joiner.on(",").join(list);
}
public static long toLongFlag(String flag) {
long result = 0L;
if (StringUtils.isBlank(flag)) {
return result;
}
String[] flags = flag.split("\\,");
for (String e : flags) {
if (StringUtils.isNotBlank(e)) {
e = e.trim();
int item = Integer.parseInt(e);
if (item < 1 || item > 15) {
throw new IllegalArgumentException("flag元素错误,flag元素必须位于1-15之间(flag=" + flag + ")");
}
int n = 1;
n = n << (item - 1);
result = result | n;
}
}
return result;
}
0 0
- 计算checbox选中值
- jq 分页展示数据,选中checbox将选中的id保存起来传给后台
- WPF-19:分享一个样式(左右滑动选中的checbox)
- ChecBox全选
- jquery计算checkbox选中个数
- Checbox在GridView中的应用
- jsp,html点滴;checbox勾选
- vue 更改计算属性后select选中值不更改的解决方法
- VBA之计算选中多边形的面积
- 一句话计算复选框选中个数
- checbox选择判断当前点击项数据
- DataGridView实现某列可编辑和ChecBox全选
- Android在Gridview中使用Checbox
- GridView中根据CheckBox选中的行取出某列的值及计算数据列的总数
- Jquery实现第一列选中项的计算
- 购物车中计算checkBox选中总价功能的实现
- ArcGis、高德计算选中地块的面积
- 动态计算选中路径,画虚线框
- 180 windows下批量删除bat脚本
- 利用iframe 异步文件上传
- Cocos Creator 控制面板
- Arrays.asList
- MYSQL C API 入门教程
- 计算checbox选中值
- 为什么选择$.getScript()?
- 文章标题
- java中compareTo和compare方法之比较
- window.opener方法的使用 刷新父页面
- unsolved probrms:排列组合
- 响应式网页设计
- Web API 强势入门指南
- 文件过滤器 FilenameFilter