Package java.util

Examples of java.util.AbstractList$Itr


            throw new UnmarshallException("Could not read javaClass", e);
        }
        if (java_class == null) {
            throw new UnmarshallException("no type hint");
        }
        AbstractList al;
        if (java_class.equals("java.util.List") ||
                java_class.equals("java.util.AbstractList") ||
                java_class.equals("java.util.ArrayList")) {
            al = new ArrayList();
        } else if (java_class.equals("java.util.LinkedList")) {
            al = new LinkedList();
        } else if (java_class.equals("java.util.Vector")) {
            al = new Vector();
        } else {
            throw new UnmarshallException("not a List");
        }

        JSONArray jsonlist;
        try {
            jsonlist = jso.getJSONArray("list");
        } catch (JSONException e) {
            throw new UnmarshallException("Could not read list: " + e.getMessage(), e);
        }
        if (jsonlist == null) {
            throw new UnmarshallException("list missing");
        }
        state.setSerialized(o, al);
        int i = 0;
        try {
            for (; i < jsonlist.length(); i++) {
                al.add(_ser.unmarshall(state, null, jsonlist.get(i)));
            }
        } catch (UnmarshallException e) {
            throw new UnmarshallException("element " + i + " " + e.getMessage(), e);
        } catch (JSONException e) {
            throw new UnmarshallException("element " + i + " " + e.getMessage(), e);
View Full Code Here


         */
        public List getAliases(final boolean ident, final boolean inner) {
            if (_ids == null)
                return Collections.EMPTY_LIST;

            return new AbstractList() {
                public int size() {
                    return (ident && _idents != null) ? _idents.size()
                        : _ids.size();
                }

View Full Code Here

  protected String[] groupNamesToArray(String names) {
    if (names.equals(NOT_IN_ANY_GROUP))
      return new String[] { names };

    AbstractList items = new ArrayList();
    int start = 0;
    int end;

    while (start < names.length() && (names.charAt(start) == ' '))
      start++;

    for (; start < names.length();) {
      end = names.indexOf(' ', start);
      if (end == -1) {
        items.add(names.substring(start));
        break;
      }
      items.add(names.substring(start, end));
      start = end;
      while (start < names.length() && names.charAt(start) == ' ')
        start++;
    }
    return (String[]) items.toArray(stringArray0);
  }
View Full Code Here

      return null;

    if (isNOT_IN_ANY_GROUP(group))
      return new TreeItem[] { settingsTree.getItems()[0] };

    AbstractList results = new ArrayList();

    String[] groupNamesArray = groupNamesToArray(getName(group.getText()));
    TreeItem[] items = settingsTree.getItems();

    if (groupNamesArray.length == 1 && groupNamesArray[0].equals(COMMON_GROUP)) {
      // add parm to all groups except <Not in any group>
      TreeItem[] result = new TreeItem[items.length - 1];
      System.arraycopy(items, 1, result, 0, result.length);
      return result;
    }

    for (int itemIndex = 0; itemIndex < items.length; itemIndex++) {
      String name = getName(items[itemIndex].getText());
      for (int i = 0; i < groupNamesArray.length; i++) {
        if (name.equals(groupNamesArray[i]))
          results.add(items[itemIndex]);
      }
    }
    return (TreeItem[]) results.toArray(treeItemArray0);
  }
View Full Code Here

    this();
    setLabel(label);
    setValue(value);
  }
  private void init() {
    _items =  new AbstractList() {
      public int size() {
        return getItemCount();
      }
      public Iterator iterator() {
        return new IterItems();
View Full Code Here

    setLabel(label);
    setValue(value);
  }

  private void init() {
    _items =  new AbstractList() {
      public int size() {
        return getItemCount();
      }
      public Iterator iterator() {
        return new IterItems();
View Full Code Here

      public Iterator iterator() {
        return new Iter();
      }
    };
    _groupsInfo = new LinkedList();
    _groups = new AbstractList() {
      public int size() {
        return getGroupCount();
      }

      public Iterator iterator() {
View Full Code Here

            System.arraycopy(data, index+1, data, index, numMoved);
        data[--size] = null;
    }

    public List toList () {
        return new AbstractList() {

            public Object get(int index) {
                return FastArray.this.get(index);
            }
View Full Code Here

  public Rows() {
    init();
  }
  private void init () {
    _groupsInfo = new LinkedList();
    _groups = new AbstractList() {
      public int size() {
        return getGroupCount();
      }
      public Iterator iterator() {
        return new IterGroups();
View Full Code Here

  protected String[] groupNamesToArray(String names) {
    if (names.equals(NOT_IN_ANY_GROUP))
      return new String[] { names };

    AbstractList items = new ArrayList();
    int start = 0;
    int end;

    while (start < names.length() && (names.charAt(start) == ' '))
      start++;

    for (; start < names.length();) {
      end = names.indexOf(' ', start);
      if (end == -1) {
        items.add(names.substring(start));
        break;
      }
      items.add(names.substring(start, end));
      start = end;
      while (start < names.length() && names.charAt(start) == ' ')
        start++;
    }
    return (String[]) items.toArray(stringArray0);
  }
View Full Code Here

TOP

Related Classes of java.util.AbstractList$Itr

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.