
de.vandermeer.skb.collections.IsCollectionStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of skb-collections Show documentation
Show all versions of skb-collections Show documentation
Strategies for Java collections
The newest version!
/* Copyright 2014 Sven van der Meer
*
* 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.
*/
package de.vandermeer.skb.collections;
import java.util.Collection;
/**
* Root interface for collection strategies.
*
* @author Sven van der Meer <[email protected]>
* @version v0.0.4 build 150619 (19-Jun-15) for Java 1.8
*/
public interface IsCollectionStrategy extends IsMCStrategy {
/**
* Test if the collection is a list.
* @return true if list, false otherwise
*/
boolean isList();
/**
* Test if the collection is a set.
* @return true if set, false otherwise
*/
boolean isSet();
/**
* Test if the collection is a queue.
* @return true if queue, false otherwise
*/
boolean isQueue();
/**
* Returns a new collection for the given collection.
* @param type of the collection
* @param collection input collection
* @return new collection
*/
Collection get(Collection collection);
/**
* Returns a new collection of requested type.
* @param type of the collection
* @param T class for the collection type, used for initialisation
* @return new collection
*/
Collection get(Class T);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy