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

This code example shows how to use the following methods:
/** 
 * 
 */ 
public class ActionRequestValidationException extends ElasticSearchException { 
 
    private final List<String> validationErrors = new ArrayList<String>();
 
    public ActionRequestValidationException() { 
        super(null); 
    } 
 
    public void addValidationError(String error) {
        validationErrors.add(error);
    } 
 
    public void addValidationErrors(Iterable<String> errors) {
        for (String error : errors) {
            validationErrors.add(error);
        } 
    } 
Full Snippet Info
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
    private final String cause;
 
    private final Map<String, Object> context;
 
    private final ArrayList<File> files = new ArrayList<File>();
 
    protected AbstractDump(long timestamp, String cause, @Nullable Map<String, Object> context) {
        this.timestamp = timestamp;
        this.cause = cause;
        if (context == null) {
            context = ImmutableMap.of();
        } 
        this.context = context;
    } 
 
    @Override 
    public long timestamp() { 
        return timestamp;
    } 
Full Snippet Info
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: add, get, isEmpty, size
	 * the call to {@code afterTestClass()} throws an exception, it will also be tracked. 
	 * Multiple exceptions will be combined into a {@link MultipleFailureException}. 
	 */ 
	@Override 
	public void evaluate() throws Throwable {
		List<Throwable> errors = new ArrayList<Throwable>();
		try { 
			this.next.evaluate();
		} 
		catch (Throwable e) {
			errors.add(e);
		} 
 
		try { 
			this.testContextManager.afterTestClass();
		} 
		catch (Exception e) {
			errors.add(e);
		} 
 

9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    List<MultiTermVectorsResponse.Failure> failures; 
 
    MultiTermVectorsShardResponse() { 
        locations = new IntArrayList(); 
        responses = new ArrayList<TermVectorResponse>(); 
        failures = new ArrayList<MultiTermVectorsResponse.Failure>(); 
    } 
 
    public void add(int location, TermVectorResponse response) { 
        locations.add(location); 
        responses.add(response); 
        failures.add(null); 
    } 
 
    public void add(int location, MultiTermVectorsResponse.Failure failure) { 
        locations.add(location); 
        responses.add(null); 
        failures.add(failure); 
    } 
 
Full Snippet Info
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: add
  } 
   
  @Test 
  public void testCreateJob() throws IOException { 
    JobConf job;
    ArrayList<String> dummyArgs = new ArrayList<String>();
    dummyArgs.add("-input"); dummyArgs.add("dummy");
    dummyArgs.add("-output"); dummyArgs.add("dummy");
    dummyArgs.add("-mapper"); dummyArgs.add("dummy");
    dummyArgs.add("-reducer"); dummyArgs.add("dummy");
    ArrayList<String> args;
     
    args = new ArrayList<String>(dummyArgs);
    args.add("-inputformat");
    args.add("org.apache.hadoop.mapred.KeyValueTextInputFormat");
    job = StreamJob.createJob(args.toArray(new String[] {}));
    assertEquals(KeyValueTextInputFormat.class, job.getInputFormat().getClass());
     
    args = new ArrayList<String>(dummyArgs);
    args.add("-inputformat");
Full Snippet Info
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: add, get, isEmpty, size
	 * {@link MultipleFailureException}. 
	 */ 
	@Override 
	public void evaluate() throws Throwable {
		Throwable testException = null;
		List<Throwable> errors = new ArrayList<Throwable>();
		try { 
			this.next.evaluate();
		} 
		catch (Throwable e) {
			testException = e;
			errors.add(e);
		} 
 
		try { 
			this.testContextManager.afterTestMethod(this.testInstance, this.testMethod, testException);
		} 
		catch (Exception e) {
			errors.add(e);
		} 

9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: add
	 */ 
	public static void cacheAccess() { 
		String key = "magicKey";
		Cache.set(key,"magicValue","1mn");
		 
		ArrayList<Boolean> complex = new ArrayList<Boolean>();
		complex.add(true);
		complex.add(false);
		Cache.set("complex", complex);
		 
		renderText("OK"); 
	} 
	 
	/** 
	 * Check we can get the last email sent to an address with Selenium (for 
	 * example to help user registration test) 
	 */ 
	public static void emailAccess() { 
        notifiers.Welcome.seleniumTest(); 
        renderText("OK"); 
Full Snippet Info
9
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    List<GetResponse> responses; 
    List<MultiGetResponse.Failure> failures; 
 
    MultiGetShardResponse() { 
        locations = new IntArrayList(); 
        responses = new ArrayList<GetResponse>(); 
        failures = new ArrayList<MultiGetResponse.Failure>(); 
    } 
 
    public void add(int location, GetResponse response) { 
        locations.add(location); 
        responses.add(response); 
        failures.add(null); 
    } 
 
    public void add(int location, MultiGetResponse.Failure failure) { 
        locations.add(location); 
        responses.add(null); 
        failures.add(failure); 
    } 
Full Snippet Info
10
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: isEmpty, size
        return !matches.isEmpty();
    } 
 
    public <T extends ProjectIdentifier> T selectProject(ProjectRegistry<? extends T> registry) {
        checkPreconditions(registry);
        List<T> matches = new ArrayList<T>();
        select(registry, matches);
        if (matches.isEmpty()) {
            throw new InvalidUserDataException(formatNoMatchesMessage()); 
        } 
        if (matches.size() != 1) {
            throw new InvalidUserDataException(formatMultipleMatchesMessage(matches));
        } 
        return matches.get(0);
    } 
 
    protected void checkPreconditions(ProjectRegistry<?> registry) {
    } 
 
    protected abstract String formatMultipleMatchesMessage(Iterable<? extends ProjectIdentifier> matches);
Full Snippet Info
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods: add, addAll, size, toArray
  private class NodeHealthMonitorExecutor extends TimerTask {
 
    String exceptionStackTrace = "";
 
    public NodeHealthMonitorExecutor(String[] args) {
      ArrayList<String> execScript = new ArrayList<String>();
      execScript.add(nodeHealthScript);
      if (args != null) {
        execScript.addAll(Arrays.asList(args));
      } 
      shexec = new ShellCommandExecutor(execScript
          .toArray(new String[execScript.size()]), null, null, scriptTimeout);
    } 
 
    @Override 
    public void run() { 
      HealthCheckerExitStatus status = HealthCheckerExitStatus.SUCCESS;
      try { 
        shexec.execute();
      } catch (ExitCodeException e) {
Full Snippet Info
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Java 8 ArrayList Questions & Answers:

Other Java 8 ArrayList Examples

21:	
22:		// Reading file paths from SDCard
23:		public ArrayList<String> getFilePaths() {
24:			ArrayList<String> filePaths = new ArrayList<String>();
25:	
-
22:		// Reading file paths from SDCard
23:		public ArrayList<String> getFilePaths() {
24:			ArrayList<String> filePaths = new ArrayList<String>();
25:	
26:			File directory = new File(
-
22:		// Reading file paths from SDCard
23:		public ArrayList<String> getFilePaths() {
24:			ArrayList filePaths = new ArrayList<String>();
25:	
26:			File directory = new File(

Read More

41:		 */
42:		private void prepareListData() {
43:			listDataHeader = new ArrayList<String>();
44:			listDataChild = new HashMap<String, List<String>>();
45:	
-
50:	
51:			// Adding child data
52:			List top250 = new ArrayList<String>();
53:			top250.add("The Shawshank Redemption");
54:			top250.add("The Godfather");
-
59:			top250.add("12 Angry Men");
60:	
61:			List nowShowing = new ArrayList<String>();
62:			nowShowing.add("The Conjuring");
63:			nowShowing.add("Despicable Me 2");
-
67:			nowShowing.add("The Wolverine");
68:	
69:			List comingSoon = new ArrayList<String>();
70:			comingSoon.add("2 Guns");
71:			comingSoon.add("The Smurfs 2");

Read More

11:	public class AddItemizedOverlay extends ItemizedOverlay<OverlayItem> {
12:		   
13:		   private ArrayList<OverlayItem> mapOverlays = new ArrayList<OverlayItem>();
14:		   
15:		   private Context context;
-
11:	public class AddItemizedOverlay extends ItemizedOverlay<OverlayItem> {
12:		   
13:		   private ArrayList mapOverlays = new ArrayList<OverlayItem>();
14:		   
15:		   private Context context;

Read More

See Code Examples for Java 8 ArrayList Methods: