Package org.nutz.lang.util

Examples of org.nutz.lang.util.LinkedIntArray


class WorkingStack {

  WorkingStack() {
    sb = new StringBuilder();
    chain = new ArrayList<String>();
    indexes = new LinkedIntArray(20);
  }
View Full Code Here


    names = new HashMap<Integer, String>();
    orders = new ArrayList<String>();
  }

  void add(String name, int index) {
    LinkedIntArray lia = indexes.get(name);
    if (null == lia) {
      lia = new LinkedIntArray();
      indexes.put(name, lia);
    }
    lia.push(index);
    names.put(index, name);
    orders.add(name);
  }
View Full Code Here

  Collection<LinkedIntArray> values() {
    return indexes.values();
  }

  public int[] getOrderIndex(String name) {
    LinkedIntArray re = new LinkedIntArray(orders.size());
    int i = 0;
    for (String od : orders) {
      if (od.equals(name))
        re.push(i);
      i++;
    }
    return re.toArray();
  }
View Full Code Here

  public String nameOf(int i) {
    return names.get(i);
  }

  public int[] indexesOf(String name) {
    LinkedIntArray lia = indexes.get(name);
    if (null == lia)
      return null;
    return lia.toArray();
  }
View Full Code Here

* @author zozoh(zozohtnt@gmail.com)
*/
public class QueryIntCallback implements SqlCallback {

  public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
    LinkedIntArray ary = new LinkedIntArray(20);
    while (rs.next())
      ary.push(rs.getInt(1));
    return ary.toArray();
  }
View Full Code Here

* @author zozoh(zozohtnt@gmail.com)
*/
public class QueryIntCallback implements SqlCallback {

    public Object invoke(Connection conn, ResultSet rs, Sql sql) throws SQLException {
        LinkedIntArray ary = new LinkedIntArray(20);
        while (rs.next())
            ary.push(rs.getInt(1));
        return ary.toArray();
    }
View Full Code Here

class WorkingStack {

    WorkingStack() {
        sb = new StringBuilder();
        chain = new ArrayList<String>();
        indexes = new LinkedIntArray(20);
    }
View Full Code Here

        names = new HashMap<Integer, String>();
        orders = new ArrayList<String>();
    }

    void add(String name, int index) {
        LinkedIntArray lia = indexes.get(name);
        if (null == lia) {
            lia = new LinkedIntArray();
            indexes.put(name, lia);
        }
        lia.push(index);
        names.put(index, name);
        orders.add(name);
    }
View Full Code Here

    Collection<LinkedIntArray> values() {
        return indexes.values();
    }

    public int[] getOrderIndex(String name) {
        LinkedIntArray re = new LinkedIntArray(orders.size());
        int i = 0;
        for (String od : orders) {
            if (od.equals(name))
                re.push(i);
            i++;
        }
        return re.toArray();
    }
View Full Code Here

    public String nameOf(int i) {
        return names.get(i);
    }

    public int[] indexesOf(String name) {
        LinkedIntArray lia = indexes.get(name);
        if (null == lia)
            return null;
        return lia.toArray();
    }
View Full Code Here

TOP

Related Classes of org.nutz.lang.util.LinkedIntArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.