Package java.util

Examples of java.util.AbstractList$Itr


      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


         */
        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

    private Object readResolve() {
        treeMapConverter = new TreeMapConverter(mapper()) {

            protected void populateMap(HierarchicalStreamReader reader,
                UnmarshallingContext context, Map map, final Map target) {
                populateCollection(reader, context, new AbstractList() {
                    public boolean add(Object object) {
                        return target.put(object, object) != null;
                    }

                    public Object get(int location) {
View Full Code Here

    public Object unmarshall(SerializerState state, Class clazz, Object o)
  throws UnmarshallException
    {
  JSONObject jso = (JSONObject)o;
  String java_class = getJavaClass(jso);
  AbstractList al = null;
  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 = getList(jso);
  int i = 0;
  try {
      for(; i < jsonlist.length(); i++)
    al.add(ser.unmarshall(state, null, jsonlist.get(i)));
  } catch (JSONException e) {
      throw new UnmarshallException
    ("element " + i + " " + e.getMessage());
  } catch (UnmarshallException e) {
      throw new UnmarshallException
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

         */
        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

  /*
   * Test method for 'java.util.AbstractList.subList(int, int)'
   */
  public void testGet() {
    AbstractList al = new ArrayList();
    Double one = new Double(1.0);
    Double two = new Double(2.0);
    Double three = new Double(3.0);
    Double four = new Double(4.0);
    al.add(one);
    al.add(two);
    al.add(three);
    al.add(four);
    List sub = al.subList(1, 3);
    assertEquals(2, sub.size());
    // the sub.get(1) is 3.0
    assertTrue(((Double) sub.get(1)).doubleValue() <= 3.0);
    assertTrue(((Double) sub.get(1)).doubleValue() > 2.0);

    al.remove(1); // remove the 2.0

    try {
      // illegal call the subList's method get(int).
      sub.get(1);
      fail("It should throws ConcurrentModificationException.");
View Full Code Here

  /*
   * Test method for 'java.util.AbstractList.subList(int, int)'
   */
  public void testSet() {
    AbstractList al = new ArrayList();
    Double one = new Double(1.0);
    Double two = new Double(2.0);
    Double three = new Double(3.0);
    Double four = new Double(4.0);
    al.add(one);
    al.add(two);
    al.add(three);
    al.add(four);
    List sub = al.subList(1, 3);
    assertEquals(2, sub.size());
    // the sub.get(1) is 3.0
    assertTrue(((Double) sub.get(1)).doubleValue() <= 3.0);
    assertTrue(((Double) sub.get(1)).doubleValue() > 2.0);

    al.remove(1); // remove the 2.0

    try {
      // illegal call the subList's method set(int,Object).
      sub.set(1, two);
      fail("It should throws ConcurrentModificationException.");
View Full Code Here

  /*
   * Test method for 'java.util.AbstractList.subList(int, int)'
   */
  public void testAdd() {
    AbstractList al = new ArrayList();
    Double one = new Double(1.0);
    Double two = new Double(2.0);
    Double three = new Double(3.0);
    Double four = new Double(4.0);
    al.add(one);
    al.add(two);
    al.add(three);
    al.add(four);
    List sub = al.subList(1, 3);
    assertEquals(2, sub.size());
    // the sub.get(1) is 3.0
    assertTrue(((Double) sub.get(1)).doubleValue() <= 3.0);
    assertTrue(((Double) sub.get(1)).doubleValue() > 2.0);

    al.remove(1); // remove the 2.0

    try {
      // illegal call the subList's method Add(int,Object).
      sub.add(1, two);
      fail("It should throws ConcurrentModificationException.");
View Full Code Here

  /*
   * Test method for 'java.util.AbstractList.subList(int, int)'
   */
  public void testRemove() {
    AbstractList al = new ArrayList();
    Double one = new Double(1.0);
    Double two = new Double(2.0);
    Double three = new Double(3.0);
    Double four = new Double(4.0);
    al.add(one);
    al.add(two);
    al.add(three);
    al.add(four);
    List sub = al.subList(1, 3);
    assertEquals(2, sub.size());
    // the sub.get(1) is 3.0
    assertTrue(((Double) sub.get(1)).doubleValue() <= 3.0);
    assertTrue(((Double) sub.get(1)).doubleValue() > 2.0);

    al.remove(1); // remove the 2.0

    try {
      // illegal call the subList's method remove(int).
      sub.remove(1);
      fail("It should throws ConcurrentModificationException.");
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.