org.jgroups.util.Util.parseCommaDelimitedLongs()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(216)

本文整理了Java中org.jgroups.util.Util.parseCommaDelimitedLongs()方法的一些代码示例,展示了Util.parseCommaDelimitedLongs()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.parseCommaDelimitedLongs()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:parseCommaDelimitedLongs

Util.parseCommaDelimitedLongs介绍

[英]Parses comma-delimited longs; e.g., 2000,4000,8000. Returns array of long, or null.
[中]解析逗号分隔的长字符;e、 g.,200040008000。返回long或null的数组。

代码示例

代码示例来源:origin: wildfly/wildfly

  1. public Object convert(Object obj, Class<?> propertyFieldType, String propertyName, String propertyValue, boolean check_scope) throws Exception {
  2. long tmp [] = Util.parseCommaDelimitedLongs(propertyValue);
  3. if(tmp != null && tmp.length > 0){
  4. return tmp;
  5. }else{
  6. // throw new Exception ("Invalid long array specified in " + propertyValue);
  7. return null;
  8. }
  9. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. public Object convert(Object obj, Class<?> propertyFieldType, String propertyName, String propertyValue, boolean check_scope) throws Exception {
  2. long tmp [] = Util.parseCommaDelimitedLongs(propertyValue);
  3. if(tmp != null && tmp.length > 0){
  4. return tmp;
  5. }else{
  6. // throw new Exception ("Invalid long array specified in " + propertyValue);
  7. return null;
  8. }
  9. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. public boolean setProperties(Properties props) {
  2. String str;
  3. long[] tmp;
  4. super.setProperties(props);
  5. str=props.getProperty("print_local_addr");
  6. if(str != null) {
  7. print_local_addr=Boolean.valueOf(str).booleanValue();
  8. props.remove("print_local_addr");
  9. }
  10. str=props.getProperty("timeout");
  11. if(str != null) {
  12. tmp=Util.parseCommaDelimitedLongs(str);
  13. props.remove("timeout");
  14. if(tmp != null && tmp.length > 0)
  15. timeout=tmp;
  16. }
  17. str=props.getProperty("max_xmits");
  18. if(str != null) {
  19. max_xmits=Integer.parseInt(str);
  20. props.remove("max_xmits");
  21. }
  22. if(!props.isEmpty()) {
  23. log.error("SMACK.setProperties(): the following properties are not recognized: " + props);
  24. return false;
  25. }
  26. return true;
  27. }

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. str=props.getProperty("timeout");
  2. if(str != null) {
  3. tmp=Util.parseCommaDelimitedLongs(str);
  4. if(tmp != null && tmp.length > 0)
  5. timeout=tmp;

代码示例来源:origin: org.jgroups/com.springsource.org.jgroups

  1. str=props.getProperty("retransmit_timeout");
  2. if(str != null) {
  3. tmp=Util.parseCommaDelimitedLongs(str);
  4. props.remove("retransmit_timeout");
  5. if(tmp != null && tmp.length > 0) {

相关文章

Util类方法