Package java.util

Examples of java.util.List.subList()


        }
        final Map tags2 = new HashMap();
        for(final Iterator iter = tags.keySet().iterator();iter.hasNext();) {
            final LispValue tag = (LispValue)iter.next();
            final int index = ((Integer)tags.get(tag)).intValue();
            tags2.put(tag,progns.subList(index,progns.size()));
        }

        compiler.getLegalTags().push(tags.keySet());

        final Map tags3 = new HashMap();
View Full Code Here


    for (int i = 0; i < 10; i++) {
      al.add(new Integer(i));
    }
    assertTrue(
        "Sublist returned should have implemented Random Access interface",
        al.subList(3, 7) instanceof RandomAccess);

    List ll = new LinkedList();
    for (int i = 0; i < 10; i++) {
      ll.add(new Integer(i));
    }
View Full Code Here

    for (int i = 0; i < 10; i++) {
      ll.add(new Integer(i));
    }
    assertTrue(
        "Sublist returned should not have implemented Random Access interface",
        !(ll.subList(3, 7) instanceof RandomAccess));

        }

  /**
     * @tests java.util.AbstractList#subList(int, int)
View Full Code Here

   
            // check if the maximum lookup count is reached
            if (dnsService.getRecordLimit() > 0 && domainList.size() > dnsService.getRecordLimit()) {
                // Truncate the PTR list to getRecordLimit.
                // See #ptr-limit rfc4408 test
                domainList = domainList.subList(0, dnsService.getRecordLimit()-1);
                // throw new PermErrorException("Maximum PTR lookup count reached");
            }
             
            for (int i = 0; i < domainList.size(); i++) {
                List aList = null;
View Full Code Here

            // We start at an offset of 1 because the entire column
            // list is generally implicitly indexed by the fact that
            // it's a primary key.
            for (int i = 1; i < size; i++)
            {
                addIndex(new Index(this, pk.subList(i, size)));
            }
        }
        catch (EngineException e)
        {
            log.error(e, e);
View Full Code Here

    public List read (Kryo kryo, Input input, Class<List> type) {
      List list = (List)kryo.readClassAndObject(input);
      int fromIndex = input.readInt();
      int count = input.readInt();
      return list.subList(fromIndex, fromIndex + count);
    }
  }

  static public class ArraySubListSerializer extends Serializer<List> {
    private Field parentField, offsetField, sizeField;
View Full Code Here

    public List read (Kryo kryo, Input input, Class<List> type) {
      List list = (List)kryo.readClassAndObject(input);
      int offset = input.readInt();
      int size = input.readInt();
      return list.subList(offset, offset + size);
    }
  }
}
View Full Code Here

    public Preference getNode(String path) {
      List components = Arrays.asList((path.split("/")));
      Preference child;
      if (components.isEmpty()) return this;
      if ((child=getAttribute((String)components.get(0)))==null) return null;
      return child.getNode(components.subList(1, components.size()));
    }
   
    /**
     * Gets the Preference (node) at a specified path in the tree
     * @param components A List of Strings, an ordered set of nodes specifying the path
View Full Code Here

       }


       public Object[] getFullElements() {
           List l = Arrays.asList(outer.getFullElements());
           return l.subList(3, l.size() - 3).toArray();
       }


       public Object[] getOtherElements() {
           return outer.getOtherElements();
View Full Code Here

     * @return the sub-list
     * @see java.util.List#subList(int, int)
     */
    public List subList(int fromIndex, int toIndex) {
        List list = (List) m_dependency.getService();
        return list.subList(fromIndex, toIndex);
    }

    /**
     * Iterator on a set of service objects.
     * This iterator iterates on a cached copy of service objects.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.