groovy.lang.Tuple.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(108)

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

Tuple.<init>介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.codehaus.groovy/groovy

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.codehaus.groovy/groovy

@SuppressWarnings("unchecked")
@Override
public List<E> subList(int fromIndex, int toIndex) {
  int size = toIndex - fromIndex;
  E[] newContent = (E[]) new Object[size];
  System.arraycopy(contents, fromIndex, newContent, 0, size);
  return new Tuple<>(newContent);
}

代码示例来源:origin: apache/groovy

private static String adaptForNamedParams(String sql, List<Tuple> indexPropList) {
  StringBuilder newSql = new StringBuilder();
  int txtIndex = 0;
  Matcher matcher = NAMED_QUERY_PATTERN.matcher(sql);
  while (matcher.find()) {
    newSql.append(sql, txtIndex, matcher.start()).append('?');
    String indexStr = matcher.group(1);
    if (indexStr == null) indexStr = matcher.group(3);
    int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : Integer.parseInt(indexStr) - 1;
    String prop = matcher.group(2);
    if (prop == null) prop = matcher.group(4);
    indexPropList.add(new Tuple(index, prop == null || prop.length() == 0 ? "<this>" : prop));
    txtIndex = matcher.end();
  }
  newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
  return newSql.toString();
}

代码示例来源:origin: groovy/groovy-core

public void testHashCodeAndEquals() {
  Tuple a = new Tuple(new Object[]{"a", "b", "c"});
  Tuple b = new Tuple(new Object[]{"a", "b", "c"});
  Tuple c = new Tuple(new Object[]{"d", "b", "c"});
  Tuple d = new Tuple(new Object[]{"a", "b"});
  Tuple2<String, String> e = new Tuple2<String, String>("a", "b");
  Tuple2<String, String> f = new Tuple2<String, String>("a", "c");
  assertEquals("hashcode", a.hashCode(), b.hashCode());
  assertTrue("hashcode", a.hashCode() != c.hashCode());
  assertEquals("a and b", a, b);
  assertFalse("a != c", a.equals(c));
  assertFalse("!a.equals(null)", a.equals(null));
  assertTrue("d.equals(e)", d.equals(e));
  assertTrue("e.equals(d)", e.equals(d));
  assertFalse("!e.equals(f)", e.equals(f));
  assertFalse("!f.equals(e)", f.equals(e));
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.kohsuke.droovy/groovy

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.kohsuke.droovy/groovy

public static Tuple createTuple(Object[] array) {
  return new Tuple(array);
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

public List subList(int fromIndex, int toIndex) {
    int size = toIndex - fromIndex;
    Object[] newContent = new Object[size];
    System.arraycopy(contents, fromIndex, newContent, 0, size);
    return new Tuple(newContent);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

public List subList(int fromIndex, int toIndex) {
    int size = toIndex - fromIndex;
    Object[] newContent = new Object[size];
    System.arraycopy(contents, fromIndex, newContent, 0, size);
    return new Tuple(newContent);
  }
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

public List subList(int fromIndex, int toIndex) {
    int size = toIndex - fromIndex;
    Object[] newContent = new Object[size];
    System.arraycopy(contents, fromIndex, newContent, 0, size);
    return new Tuple(newContent);
  }
}

代码示例来源:origin: org.kohsuke.droovy/groovy

public List subList(int fromIndex, int toIndex) {
    int size = toIndex - fromIndex;
    Object[] newContent = new Object[size];
    System.arraycopy(contents, fromIndex, newContent, 0, size);
    return new Tuple(newContent);
  }
}

代码示例来源:origin: org.codehaus.groovy/groovy-sql

private static String adaptForNamedParams(String sql, List<Tuple> indexPropList) {
  StringBuilder newSql = new StringBuilder();
  int txtIndex = 0;
  Matcher matcher = NAMED_QUERY_PATTERN.matcher(sql);
  while (matcher.find()) {
    newSql.append(sql, txtIndex, matcher.start()).append('?');
    String indexStr = matcher.group(1);
    if (indexStr == null) indexStr = matcher.group(3);
    int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : Integer.parseInt(indexStr) - 1;
    String prop = matcher.group(2);
    if (prop == null) prop = matcher.group(4);
    indexPropList.add(new Tuple(index, prop == null || prop.length() == 0 ? "<this>" : prop));
    txtIndex = matcher.end();
  }
  newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
  return newSql.toString();
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

private String adaptForNamedParams(String sql, List<Tuple> indexPropList) {
    StringBuilder newSql = new StringBuilder();
    int txtIndex = 0;
    Matcher matcher = NAMED_QUERY_PATTERN.matcher(sql);
    while (matcher.find()) {
      newSql.append(sql.substring(txtIndex, matcher.start())).append('?');
      String indexStr = matcher.group(1);
      if (indexStr == null) indexStr = matcher.group(3);
      int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : new Integer(indexStr) - 1;
      String prop = matcher.group(2);
      if (prop == null) prop = matcher.group(4);
      indexPropList.add(new Tuple(new Object[]{index, prop == null || prop.length() == 0 ? "<this>" : prop}));
      txtIndex = matcher.end();
    }
    newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
    return newSql.toString();
  }
}

代码示例来源:origin: org.apache.pig/pig

groovyObject = new groovy.lang.Tuple(a);
} else if (pigObject instanceof DataBag) {
 size_iterator[0] = ((DataBag) pigObject).size();
 size_iterator[1] = new DataBagGroovyIterator(((DataBag) pigObject).iterator());
 groovyObject = new groovy.lang.Tuple(size_iterator);
} else if (pigObject instanceof Map) {
 Map<String, Object> m = new HashMap<String, Object>();

相关文章

微信公众号

最新文章

更多