当前位置: 首页>>代码示例>>Java>>正文


Java Utils.getSuperType方法代码示例

本文整理汇总了Java中ch.njol.skript.util.Utils.getSuperType方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.getSuperType方法的具体用法?Java Utils.getSuperType怎么用?Java Utils.getSuperType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.njol.skript.util.Utils的用法示例。


在下文中一共展示了Utils.getSuperType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ExprJavaCall

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprJavaCall(ExprJavaCall<?> source, Class<? extends T>... types) {
  this.source = source;

  if (source != null) {
    this.targetArg = source.targetArg;
    this.args = source.args;
    this.type = source.type;
    this.suppressErrors = source.suppressErrors;
    this.staticDescriptor = source.staticDescriptor;
    this.dynamicDescriptor = source.dynamicDescriptor;
  }

  this.types = types;
  this.superType = (Class<T>) Utils.getSuperType(types);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:18,代码来源:ExprJavaCall.java

示例2: getConvertedExpr

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
protected <R> ConvertedExpression<Object, ? extends R> getConvertedExpr(final Class<R>... to) {
	if (isVariableLoop && !isIndex) {
		return new ConvertedExpression<Object, R>(this, (Class<R>) Utils.getSuperType(to), new Converter<Object, R>() {
			@Override
			@Nullable
			public R convert(final Object o) {
				return Converters.convert(o, to);
			}
		});
	} else {
		return super.getConvertedExpr(to);
	}
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:17,代码来源:ExprLoopValue.java

示例3: ExprExpression

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprExpression(ExprExpression<?> source, Class<? extends T>... types) {
  if (source != null) {
    index = source.index;
    plural = source.plural;
  }

  this.source = source;
  this.types = types;
  this.superType = (Class<T>) Utils.getSuperType(types);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:13,代码来源:ExprExpression.java

示例4: ExpressionHandler

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExpressionHandler(ExpressionHandler<?> source, Class<? extends T>... types) {
  this.source = source;

  if (source != null) {
    this.which = source.which;
    this.exprs = source.exprs;
    this.parseResult = source.parseResult;
  }

  this.types = types;
  this.superType = (Class<T>) Utils.getSuperType(types);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:15,代码来源:CustomExpression.java

示例5: ExprChangeValue

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprChangeValue(ExprChangeValue<?> source, Class<? extends T>... types) {
  if (source != null) {
    index = source.index;
    plural = source.plural;
  }

  this.source = source;
  this.types = types;
  this.superType = (Class<T>) Utils.getSuperType(types);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:13,代码来源:ExprChangeValue.java

示例6: ExprSpread

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@SafeVarargs
private ExprSpread(ExprSpread<?> source, Class<? extends T>... types) {
  this.source = source;

  if (source != null) {
    this.object = source.object;
  }

  this.types = types;
  this.superType = (Class<T>) Utils.getSuperType(types);
}
 
开发者ID:btk5h,项目名称:skript-mirror,代码行数:13,代码来源:ExprSpread.java

示例7: getConvertedExpression

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public <R> Literal<? extends R> getConvertedExpression(final Class<R>... to) {
	final Literal<? extends R>[] exprs = new Literal[expressions.length];
	final Class<?>[] classes = new Class[expressions.length];
	for (int i = 0; i < exprs.length; i++) {
		if ((exprs[i] = (Literal<? extends R>) expressions[i].getConvertedExpression(to)) == null)
			return null;
		classes[i] = exprs[i].getReturnType();
	}
	return new LiteralList<R>(exprs, (Class<R>) Utils.getSuperType(classes), and, this);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:14,代码来源:LiteralList.java

示例8: getConvertedExpression

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public <R> Expression<? extends R> getConvertedExpression(final Class<R>... to) {
	final Expression<? extends R>[] exprs = new Expression[expressions.length];
	for (int i = 0; i < exprs.length; i++)
		if ((exprs[i] = expressions[i].getConvertedExpression(to)) == null)
			return null;
	return new ExpressionList<R>(exprs, (Class<R>) Utils.getSuperType(to), and, this);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:11,代码来源:ExpressionList.java

示例9: getConvertedExpression

import ch.njol.skript.util.Utils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public <R> Literal<? extends R> getConvertedExpression(final Class<R>... to) {
	if (CollectionUtils.containsSuperclass(to, c))
		return (Literal<? extends R>) this;
	final R[] parsedData = Converters.convertArray(data, to, (Class<R>) Utils.getSuperType(to));
	if (parsedData.length != data.length)
		return null;
	return new ConvertedLiteral<T, R>(this, parsedData, (Class<R>) Utils.getSuperType(to));
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:12,代码来源:SimpleLiteral.java


注:本文中的ch.njol.skript.util.Utils.getSuperType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。