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

This code example shows how to use the following methods:get, size
10
CodeRank
This code example shows how to use the following methods:get, size
    } 
 
    @Override 
    public Expression rewriteParameter(Parameter node, Void context, ExpressionTreeRewriter<Void> treeRewriter)
    { 
        checkState(parameterValues.size() > node.getPosition(), "Too few parameter values");
        return coerceIfNecessary(node, parameterValues.get(node.getPosition()));
    } 
 
    private Expression coerceIfNecessary(Expression original, Expression rewritten)
    { 
        if (analysis == null) {
            return rewritten;
        } 
 
        Type coercion = analysis.getCoercion(original);
        if (coercion != null) {
            rewritten = new Cast(
                    rewritten,
                    coercion.getTypeSignature().toString(),
10
CodeRank
This code example shows how to use the following methods:get, size
    { 
    } 
 
    public static void assertPageEquals(List<? extends Type> types, Page actualPage, Page expectedPage)
    { 
        assertEquals(types.size(), actualPage.getChannelCount());
        assertEquals(actualPage.getChannelCount(), expectedPage.getChannelCount());
        for (int i = 0; i < actualPage.getChannelCount(); i++) {
            assertBlockEquals(types.get(i), actualPage.getBlock(i), expectedPage.getBlock(i));
        } 
    } 
} 
10
CodeRank
This code example shows how to use the following methods:size
This code example shows how to use the following methods:size
 
    @Override 
    public final WindowFunction createWindowFunction(List<Integer> argumentChannels)
    { 
        requireNonNull(argumentChannels, "inputs is null");
        checkArgument(argumentChannels.size() == signature.getArgumentTypes().size(),
                "Expected %s arguments for function %s, but got %s", 
                signature.getArgumentTypes().size(),
                signature.getName(),
                argumentChannels.size());
 
        return newWindowFunction(argumentChannels);
    } 
 
    /** 
     * Create window function instance using the supplied arguments.  The 
     * inputs have already validated. 
     */ 
    protected abstract WindowFunction newWindowFunction(List<Integer> inputs);
} 
10
CodeRank
This code example shows how to use the following methods:get, size
import static com.facebook.presto.operator.PageAssertions.assertPageEquals;
import static com.facebook.presto.operator.ProjectionFunctions.singleColumn;
import static com.facebook.presto.spi.type.BigintType.BIGINT;
import static com.facebook.presto.spi.type.VarcharType.VARCHAR;
import static com.facebook.presto.testing.TestingConnectorSession.SESSION;
 
public class TestGenericPageProcessor
{ 
    private static final int POSITIONS = 100;
    private final List<Type> types = ImmutableList.of(BIGINT, VARCHAR);
    private final PageProcessor processor = new GenericPageProcessor(TRUE_FUNCTION, ImmutableList.of(singleColumn(types.get(0), 0), singleColumn(types.get(1), 1)));
 
    private final PageBuilder pageBuilder = new PageBuilder(types);
 
    @Test 
    public void testProcess() 
            throws ExceptionPage page = createPage(types, false);
        processor.process(SESSION, page, 0, page.getPositionCount(), pageBuilder);

10
CodeRank
This code example shows how to use the following methods:get, size
 
    private void decodeElementValueInto(int depth, int fieldIndex, BlockBuilder builder, Slice slice, int offset, int length)
            throws RcFileCorruptionException
    { 
        // ignore extra fields 
        if (fieldIndex > structFields.size()) {
            return; 
        } 
 
        if (isNullSequence(slice, offset, length)) {
            builder.appendNull();
        } 
        else { 
            structFields.get(fieldIndex).decodeValueInto(depth + 1, builder, slice, offset, length);
        } 
    } 
} 
10
CodeRank
This code example shows how to use the following methods:get, size
    public boolean matches(PlanNode node, Session session, Metadata metadata, ExpressionAliases expressionAliases)
    { 
        if (node instanceof ApplyNode) {
            ApplyNode applyNode = (ApplyNode) node;
 
            if (correlation.size() != applyNode.getCorrelation().size()) {
                return false; 
            } 
 
            int i = 0;
            for (String alias : correlation) {
                expressionAliases.put(alias, applyNode.getCorrelation().get(i++).toSymbolReference());
            } 
            return true; 
        } 
        return false; 
    } 
 
    @Override 
    public String toString()
10
CodeRank
This code example shows how to use the following methods:get
10
CodeRank
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

Related Java 8 List Questions & Answers:

Other Java 8 List Examples

15:	
16:		// supported file formats
17:		public static final List<String> FILE_EXTN = Arrays.asList("jpg", "jpeg",
18:				"png");
19:	}

Read More

17:		ExpandableListAdapter listAdapter;
18:		ExpandableListView expListView;
19:		List<String> listDataHeader;
20:		HashMap<String, List<String>> listDataChild;
21:	
-
50:	
51:			// Adding child data
52:			List<String> top250 = new ArrayList<String>();
53:			top250.add("The Shawshank Redemption");
54:			top250.add("The Godfather");
-
59:			top250.add("12 Angry Men");
60:	
61:			List<String> nowShowing = new ArrayList<String>();
62:			nowShowing.add("The Conjuring");
63:			nowShowing.add("Despicable Me 2");
-
67:			nowShowing.add("The Wolverine");
68:	
69:			List<String> comingSoon = new ArrayList<String>();
70:			comingSoon.add("2 Guns");
71:			comingSoon.add("The Smurfs 2");

Read More

1:		 public List<Contact> getAllContacts() {
2:			List<Contact> contactList = new ArrayList<Contact>();
3:			// Select All Query
-
1:		 public List<Contact> getAllContacts() {
2:			List<Contact> contactList = new ArrayList<Contact>();
3:			// Select All Query
4:			String selectQuery = "SELECT  * FROM " + TABLE_CONTACTS;

Read More

See Code Examples for Java 8 List Methods: