Package java.util

Examples of java.util.AbstractList$ListIteratorImpl


  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

      List<Edge> edgeList = shortestPathAlg.getPath(sourceVertex, targetVertex);

      if (edgeList.size() > 0) {
        List<ServiceReference<AlgorithmFactory>> serviceReferences = Lists.newArrayList();
        for (Edge edge : edgeList) {
          AbstractList converterList =
              (AbstractList) edge.getUserDatum(SERVICE_LIST);
          serviceReferences.add((ServiceReference) converterList.get(0));
        }

        return ConverterImpl.createConverter(bContext, ciContext, serviceReferences);
      }
    }
View Full Code Here

          (String) serviceReference.getProperty(Constants.SERVICE_PID);

      if (sourceVertex != null && targetVertex != null) {
        Edge edge = sourceVertex.findEdge(targetVertex);
        if (edge != null) {
          AbstractList serviceList =
              (AbstractList) edge.getUserDatum(SERVICE_LIST);
          for (Iterator refs = serviceList.iterator(); refs.hasNext();) {
            ServiceReference currentServiceReference =
                (ServiceReference) refs.next();
            String currentPid =
                (String) currentServiceReference
                .getProperty(Constants.SERVICE_PID);

            if (pid.equals(currentPid)) {
              refs.remove();
            }
          }
          if (serviceList.isEmpty()) {
            graph.removeEdge(edge);
          }
        }
      }
    }
View Full Code Here

        directedEdge =
            new DirectedSparseEdge(sourceVertex, targetVertex);
        graph.addEdge(directedEdge);
      }

      AbstractList serviceList =
          (AbstractList) directedEdge.getUserDatum(SERVICE_LIST);
      if (serviceList == null) {
        serviceList = new ArrayList();
        serviceList.add(serviceReference);
      }
      directedEdge.setUserDatum(SERVICE_LIST, serviceList,
          new UserDataContainer.CopyAction.Shared());
    }
  }
View Full Code Here

        return _locale;
    }

    public List getAvailableLanguages()
    {
        return new AbstractList()
        {
            public Object get(int index)
            {
                Locale locale = (Locale)AVAILABLE_LOCALES.get(index);
                String language = locale.getDisplayLanguage(locale);
View Full Code Here

    /**
     * Return all the header lines as a collection
     */
    public List getAllHeaderLines() {
        if(headerValueView==null)
            headerValueView = new AbstractList() {
                public Object get(int index) {
                    return ((hdr)headers.get(index)).line;
                }

                public int size() {
View Full Code Here

  /**
   * @see java.util.Map#values()
   */
  public Collection values()
  {
    return new AbstractList()
    {
      public Object get(final int index)
      {
        if (index > size - 1)
        {
View Full Code Here

        return _locale;
    }

    public List getAvailableLanguages()
    {
        return new AbstractList()
        {
            public Object get(int index)
            {
                Locale locale = (Locale)AVAILABLE_LOCALES.get(index);
                String language = locale.getDisplayLanguage(locale);
View Full Code Here

            throw new UnmarshallException("Could not read javaClass", e);
        }
        if (java_class == null) {
            throw new UnmarshallException("no type hint");
        }
        final AbstractList al = new LinkedList();

        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

TOP

Related Classes of java.util.AbstractList$ListIteratorImpl

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.