angabe ue09
This commit is contained in:
41
uebung09/src/collection/SetFactory.java
Normal file
41
uebung09/src/collection/SetFactory.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package collection;
|
||||
|
||||
public class SetFactory {
|
||||
|
||||
private SetFactory() { /* don't instantiate */ }
|
||||
|
||||
/**
|
||||
* Returns the empty set.
|
||||
*
|
||||
* @param <T> the element type of the returned set.
|
||||
* @return the empty set.
|
||||
*/
|
||||
static <T> Set<T> create() {
|
||||
// TODO implement
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the singleton set containing the specified element.
|
||||
*
|
||||
* @param element an element (must not be null)
|
||||
* @param <T> the element type of the returned set.
|
||||
* @return the singleton set containing the specified element.
|
||||
*/
|
||||
static <T> Set<T> create(T element) {
|
||||
// TODO implement
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a set containing the specified elements. The specified elements may contain equal elements.
|
||||
*
|
||||
* @param elems elements of the returned set (may contain equal elements)
|
||||
* @param <T> the element type of the returned set.
|
||||
* @return a set containing the specified elements.
|
||||
*/
|
||||
static <T> Set<T> create(T... elems) {
|
||||
// TODO implement
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user