Java List Tail tail(List list)

Here you can find the source of tail(List list)

Description

tail

License

Open Source License

Declaration

static public <T> List<T> tail(List<T> list) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * SiniaUtils/*from  w  w  w . j a va2s .c  om*/
 * Copyright (c) 2011-2 Siniatech Ltd  
 * http://www.siniatech.com/products/siniautils
 *
 * All rights reserved. This project and the accompanying materials are made 
 * available under the terms of the MIT License which can be found in the root  
 * of the project, and at http://www.opensource.org/licenses/mit-license.php
 *
 ******************************************************************************/

import java.util.ArrayList;
import java.util.List;

public class Main {
    static public <T> List<T> tail(List<T> list) {
        List<T> tail = new ArrayList<>(list);
        tail.remove(head(list));
        return tail;
    }

    static public <T> T head(List<T> list) {
        return list.size() == 0 ? null : list.get(0);
    }
}

Related

  1. tail(List list, int tailLength)
  2. tail(List lines, int number)
  3. tail(List lst, int from)
  4. tail(List l)
  5. tail(List list)
  6. tail(List list)
  7. tail(List list)