Package java.util

Examples of java.util.AbstractList$SubAbstractList$SubAbstractListIterator


  /*
   * Test method for 'java.util.AbstractList.subList(int, int)'
   */
  public void testAddAll() {
    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 addAll(int,Collection).
      Collection c = new Vector();
      Double five = new Double(5.0);
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

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

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

    public Object unmarshall(SerializerState state, Class clazz, Object o) throws UnmarshallException {
        JSONObject jso = (JSONObject) o;
        String java_class = jso.getString("javaClass");
        if (java_class == null)
            throw new UnmarshallException("no type hint");
        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 = jso.getJSONArray("list");
        if (jsonlist == null)
            throw new UnmarshallException("list missing");
        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());
        }
        return al;
    }
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 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

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

TOP

Related Classes of java.util.AbstractList$SubAbstractList$SubAbstractListIterator

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.