public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
@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); }
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(); }
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)); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
public static Tuple createTuple(Object[] array) { return new Tuple(array); }
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); } }
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); } }
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); } }
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); } }
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(); }
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(); } }
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>();