本文整理了Java中java.util.EnumSet.setRange()
方法的一些代码示例,展示了EnumSet.setRange()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EnumSet.setRange()
方法的具体详情如下:
包路径:java.util.EnumSet
类名称:EnumSet
方法名:setRange
暂无
代码示例来源:origin: robovm/robovm
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: com.gluonhq/robovm-rt
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: MobiVM/robovm
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: ibinti/bugvm
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: com.bugvm/bugvm-rt
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: com.jtransc/jtransc-rt
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
代码示例来源:origin: FlexoVM/flexovm
/**
* Creates an enum set containing all the elements within the range defined
* by {@code start} and {@code end} (inclusive). All the elements must be in
* order.
*
* @param start
* the element used to define the beginning of the range.
* @param end
* the element used to define the end of the range.
* @return an enum set with elements in the range from start to end.
* @throws NullPointerException
* if any one of {@code start} or {@code end} is {@code null}.
* @throws IllegalArgumentException
* if {@code start} is behind {@code end}.
*/
public static <E extends Enum<E>> EnumSet<E> range(E start, E end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("start is behind end");
}
EnumSet<E> set = EnumSet.noneOf(start.getDeclaringClass());
set.setRange(start, end);
return set;
}
内容来源于网络,如有侵权,请联系作者删除!