Java 8 AbstractSequentialList - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AbstractSequentialList class.

This code example shows how to use the following methods:iterator
	} 
	 
	 
	@Override 
	public Iterator<TYPE> iterator() {
		return ll.iterator();
	} 
	 
	 
	public int size() { 
		return ll.size();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:addAll
        } 
 
        strV.remove(null);
        asl.addAll(0, strV);
 
        asl = new LinkedList();
 
        try { 
            asl.addAll(-10, strV);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {
            //expected 
        } 
 
        try { 
            asl.addAll(1, strV);
            fail("IndexOutOfBoundsException expected");
        } catch (IndexOutOfBoundsException e) {
            //expected 
        } 
    } 
5
CodeRank
This code example shows how to use the following methods:addAll, addAll
        String[] someList = { "Aardvark",  //$NON-NLS-1$ 
                "Bear",  //$NON-NLS-1$ 
                "Chimpanzee",  //$NON-NLS-1$ 
                "Duck" }; //$NON-NLS-1$ 
        Collection<String> c = Arrays.asList(someList); 
        al.addAll(c); 
        assertTrue("Should return true", al.addAll(2, c)); //$NON-NLS-1$ 
    } 
     
 
    /** 
     * @tests java.util.AbstractSequentialList#get(int) 
     */ 
    public void test_get() { 
        AbstractSequentialList list = new MyAbstractSequentialList(); 
        list.add(1); 
        list.add("value"); 
        assertEquals(1, list.get(0)); 
        assertEquals("value", list.get(1)); 
 
4
CodeRank
This code example shows how to use the following methods:iterator
_resolver.bindItem(_key, ob);
        _item = ob;
        Object id = _key.key;
        if (_referringProperties != null) {
            Iterator<Referring> it = _referringProperties.iterator();
            _referringProperties = null;
            while (it.hasNext()) {
                it.next().handleResolvedForwardReference(id, ob);
            } 
        } 
    } 
 
    public Object resolve(){
         return (_item = _resolver.resolveId(_key));
    } 
 
    public boolean hasReferringProperties() { 
        return (_referringProperties != null) && !_referringProperties.isEmpty();
    } 
4
CodeRank
This code example shows how to use the following methods:add
    public ResourceCloser() { 
        resources = new LinkedList<Object>();
    } 
     
    public <E> E register(E resource) {
        resources.add(0, resource);
        return resource;
    } 
 
    @Override 
    public void close() { 
        for (Object resource : resources) { 
            close(resource); 
        } 
        resources.clear(); 
    } 
     
    public void close(Object ...resources2) { 
        for (Object resource : resources2) { 
            close(resource); 
4
CodeRank
This code example shows how to use the following methods:remove
        } 
 
        // list dont't support remove operation 
        try { 
            AbstractSequentialList mylist = new MockAbstractSequentialList(); 
            mylist.remove(0); 
            fail("Should throw UnsupportedOperationException."); 
        } catch (UnsupportedOperationException e) { 
            // expected 
        } 
    } 
     
    public void test_set() throws Exception { 
		MyAbstractSequentialList list = new MyAbstractSequentialList(); 
		try { 
			list.set(0, new Object()); 
			fail("should throw IndexOutOfBoundsException"); 
		} catch (IndexOutOfBoundsException e) { 
			// expected 
		} 
4
CodeRank
This code example shows how to use the following methods:iterator
        } 
    } 
 
    @Override 
    public Iterator<long[]> iterator() {
        return list.iterator();
    } 
 
    @Override 
    public String toString() {
        StringBuffer sb = new StringBuffer();
 
        for (long[] entry : this) {
            sb.append(entry[0]);
            sb.append(" => ");
            sb.append(entry[1]);
            sb.append("\n");
        } 
        return sb.toString();
    } 
4
CodeRank
This code example shows how to use the following methods:iterator
This code example shows how to use the following methods:iterator
			queue.clear();
		} 
	} 
	 
	public Iterator<T> iterator() {
		return queue.iterator();
	} 
	 
	/** 
	 * Pulls the next element from the queue. 
	 * This call blocks until an element is available. 
	 *  
	 * @return the first element in the queue 
	 *  
	 * @throws InterruptedException if interrupted while blocked 
	 */ 
	public T pull() throws InterruptedException { 
		synchronized (queue) {
			while (queue.isEmpty()) {
				queue.wait();
4
CodeRank
This code example shows how to use the following methods:iterator
        return _path;
    } 
 
    public Iterator<String> iterator()
    { 
        return _path.iterator();
    } 
 
} 
4
CodeRank
See Code Examples for Java 8 AbstractSequentialList Methods: