Java 8 LinkedList - 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 LinkedList class.

This code example shows how to use the following methods:
	/** 
	 * Contains strong references to stored objects. Each next object is added last. If hard cache size will exceed 
	 * limit then first object is deleted (but it continue exist at {@link #softMap} and can be collected by GC at any 
	 * time) 
	 */ 
	private final List<V> hardCache = Collections.synchronizedList(new LinkedList<V>());
 
	/** @param sizeLimit Maximum size for cache (in bytes) */ 
	public LimitedMemoryCache(int sizeLimit) {
		this.sizeLimit = sizeLimit;
		cacheSize = new AtomicInteger();
		if (sizeLimit > MAX_NORMAL_CACHE_SIZE) {
			L.w("You set too large memory cache size (more than %1$d Mb)", MAX_NORMAL_CACHE_SIZE_IN_MB);
		} 
	} 
 
	@Override 
	public boolean put(K key, V value) {
		boolean putSuccessfully = false;
		// Try to add value to hard cache 
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
/** 
 * @author <a href="ropalka@redhat.com">Richard Opalka</a> 
 */ 
abstract class AbstractDeployment { 
 
    private final List<EJBEndpoint> ejbEndpoints = new LinkedList<EJBEndpoint>();
    private final List<EJBEndpoint> unmodifiableEjbEndpoints = Collections.unmodifiableList(ejbEndpoints);
    private final List<POJOEndpoint> pojoEndpoints = new LinkedList<POJOEndpoint>();
    private final List<POJOEndpoint> unmodifiablePojoEndpoints = Collections.unmodifiableList(pojoEndpoints);
    private final Map<String, String> urlPatternToClassMapping = new HashMap<String, String>();
 
    public List<EJBEndpoint> getEjbEndpoints() {
        return unmodifiableEjbEndpoints;
    } 
 
    public List<POJOEndpoint> getPojoEndpoints() {
        return unmodifiablePojoEndpoints;
    } 
 
    public void addEndpoint(final EJBEndpoint ep) {
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:size
    /** 
     * pops the active object, which means that the parent object becomes active 
     * @return returns itself so you can chain 
     */ 
    public BasicDBObjectBuilder pop(){ 
        if ( _stack.size() <= 1 )
            throw new IllegalArgumentException( "can't pop last element" );
        _stack.removeLast();
        return this;
    } 
 
    /** 
     * gets the base object 
     * @return The base object 
     */ 
    public DBObject get(){ 
        return _stack.getFirst();
    } 
 
    /** 
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 
import java.util.LinkedList; 
import java.util.List; 
 
abstract public class CellNode implements Node { 
    final public List<String> columnNames = new LinkedList<String>(); 
} 
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:add, addAll, size, toArray
This code example shows how to use the following methods:toArray
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block 
      e.printStackTrace();
    } 
    Integer[] ports = new Integer[10];
    ports = activeRobots.toArray(ports);
    robotLock.release();
    return ports;
  } 
 
  public boolean isRobot(String ip) {
    return properties.getProperty(ip) != null;
  } 
 
  private boolean isPotentialRobot(String ip) {
    for (UnconfirmedRobot i : potentialRobots) {
      if (ip.equals(i.ipAddress)) {
        return true; 
      } 
    } 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:add
	public void setUp() { 
		kh = new GeneratedKeyHolder();
	} 
 
	public void testSingleKey(){ 
		List<Map<String, Object>> l = new LinkedList<Map<String, Object>>();
		Map<String, Object> m = new HashMap<String, Object>(1);
		m.put("key", 1); 
		l.add(m); 
		kh.getKeyList().addAll(l);
		assertEquals("single key should be returned", 1, kh.getKey().intValue());
	} 
 
	public void testSingleKeyNonNumeric(){ 
		List<Map<String, Object>> l = new LinkedList<Map<String, Object>>();
		Map<String, Object> m = new HashMap<String, Object>(1);
		m.put("key", "1"); 
		l.add(m); 
		kh.getKeyList().addAll(l);
		try { 
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:toString, add
public class OffsetCompareProberTest { 
 
	@Test
	public void testFindAlertList(){ 
		OffsetCompareProber ocp = new OffsetCompareProber(null);
		List<String> alertList = new LinkedList<String>();
		alertList.add("defaultWW");
		 
		List<String> wwList = new LinkedList<String>();
		wwList.add("defaultWW");
		wwList.add("groupWW");
		 
		List<String> topicList = new LinkedList<String>();
		topicList.add("groupTopic");
		 
		List<String> ignoreTopicList = new LinkedList<String>();
		ignoreTopicList.add("groupTopicIgnore");
		 
		Group group = new Group();
		group.setGroup("group1");

9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 
    private CliGuiContext cliGuiCtx;
 
    private CLIOutput output;
 
    private LinkedList<String> cmdHistory = new LinkedList<String>();
 
    public DoOperationActionListener(CliGuiContext cliGuiCtx) {
        this.cliGuiCtx = cliGuiCtx;
        this.output = cliGuiCtx.getOutput();
    } 
 
    public void actionPerformed(ActionEvent ae) {
        String command = cliGuiCtx.getCommandLine().getCmdText().getText();
        try { 
            cmdHistory.push(command);
            CommandExecutor.Response response = cliGuiCtx.getExecutor().doCommandFullResponse(command);
            postOutput(response);
        } catch (Exception e) {
            output.postCommandWithResponse(command, e.getMessage());
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:toString, add
public class OffsetCompareProberTest { 
 
	@Test 
	public void testFindAlertList(){ 
		OffsetCompareProber ocp = new OffsetCompareProber(null);
		List<String> alertList = new LinkedList<String>();
		alertList.add("defaultWW");
		 
		List<String> wwList = new LinkedList<String>();
		wwList.add("defaultWW");
		wwList.add("groupWW");
		 
		List<String> topicList = new LinkedList<String>();
		topicList.add("groupTopic");
		 
		List<String> ignoreTopicList = new LinkedList<String>();
		ignoreTopicList.add("groupTopicIgnore");
		 
		Group group = new Group();
		group.setGroup("group1");

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Java 8 LinkedList Questions & Answers:

See Code Examples for Java 8 LinkedList Methods: