All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jonathanxd.iutils.collection.ListUtils Maven / Gradle / Ivy

There is a newer version: 1.7
Show newest version
/*
 * 	TextLexer - Lexical Analyzer API for Java! 
 *     Copyright (C) 2016 TheRealBuggy/JonathanxD (https://github.com/JonathanxD/) 
 *
 * 	GNU GPLv3
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Affero General Public License as published
 *     by the Free Software Foundation.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Affero General Public License for more details.
 *
 *     You should have received a copy of the GNU Affero General Public License
 *     along with this program.  If not, see .
 */
package com.github.jonathanxd.iutils.collection;

import com.github.jonathanxd.iutils.iterator.BackableIterator;
import com.github.jonathanxd.iutils.iterator.SafeBackableIterator;

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

/**
 * Created by jonathan on 08/02/16.
 */
public class ListUtils {

    public static  SafeBackableIterator toSafeBackableIterator(List list) {
        return new ListSafeBackableIterator<>(list);
    }

    public static  BackableIterator toBackableIterator(List list) {
        return toSafeBackableIterator(list);
    }

    public static List from(char[] primitiveArray) {
        List list = new ArrayList<>();
        for (char primitiveElement : primitiveArray) {
            list.add(primitiveElement);
        }
        return list;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy