Java List Combine combine(List commands, int startAt, int endAt)

Here you can find the source of combine(List commands, int startAt, int endAt)

Description

combine

License

Apache License

Declaration

public static String combine(List<String> commands, int startAt, int endAt) 

Method Source Code


//package com.java2s;
/*//from   www .ja  v a2  s .co m
Copyright 2001-2016 Bo Zimmerman
    
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
    
   http://www.apache.org/licenses/LICENSE-2.0
    
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
  */

import java.util.*;

public class Main {
    public static String combine(List<String> commands, int startAt, int endAt) {
        final StringBuffer Combined = new StringBuffer("");
        if (commands != null)
            for (int commandIndex = startAt; commandIndex < endAt; commandIndex++)
                Combined.append(commands.get(commandIndex) + " ");
        return Combined.toString().trim();
    }

    public static String combine(List<String> commands, int startAt) {
        final StringBuffer Combined = new StringBuffer("");
        if (commands != null)
            for (int commandIndex = startAt; commandIndex < commands.size(); commandIndex++)
                Combined.append(commands.get(commandIndex) + " ");
        return Combined.toString().trim();
    }
}

Related

  1. combine(final List dataChunks)
  2. combine(final List list, final List list2)
  3. combine(int sign, List exponentBits, List mantissaBits)
  4. combine(List r, char sep)
  5. combine(List> lists)
  6. combine(List strlist, String delimiter)
  7. combine(List tokens, String separator)
  8. combine(List a, List b)
  9. combine(List dest, Collection... src)