• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CollectionUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ch.njol.util.coll.CollectionUtils的典型用法代码示例。如果您正苦于以下问题:Java CollectionUtils类的具体用法?Java CollectionUtils怎么用?Java CollectionUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CollectionUtils类属于ch.njol.util.coll包,在下文中一共展示了CollectionUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
  if (mode == Changer.ChangeMode.DELETE) {
    return CollectionUtils.array(Object.class);
  }
  switch (ty) {
    case 0: {
      if (mode == Changer.ChangeMode.SET) {
        return CollectionUtils.array(Object.class);
      }
      break;
    }
    case 1:
    case 2:
    case 3:
      if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.REMOVE) {
        return CollectionUtils.array(Object.class);
      }
      break;
  }
  return null;
}
 
开发者ID:tim740,项目名称:skUtilities,代码行数:24,代码来源:SExprYaml.java


示例2: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@Nullable
public Class<?>[] acceptChange(final ChangeMode mode) {
	if (mode == ChangeMode.DELETE && (type.acceptChange & ~PLAYER) != 0 || mode == ChangeMode.RESET)
		return new Class[0];
	if (mode != ChangeMode.SET)
		return null;
	if ((type.acceptChange & PLAYER) != 0 && Player.class.isAssignableFrom(getExpr().getReturnType())) {
		changeType = PLAYER;
	} else if ((type.acceptChange & ITEMSTACK) != 0 && (getExpr().isSingle() && ChangerUtils.acceptsChange(getExpr(), ChangeMode.SET, ItemStack.class, ItemType.class) || Slot.class.isAssignableFrom(getExpr().getReturnType()))) {
		changeType = ITEMSTACK;
	} else if ((type.acceptChange & ENTITY) != 0 && LivingEntity.class.isAssignableFrom(getExpr().getReturnType())) {
		if (type == NameType.NAME && Player.class.isAssignableFrom(getExpr().getReturnType())) {
			Skript.error("Cannot change the Minecraft name of a player. Change the 'display name of <player>' or 'tablist name of <player>' instead.");
			return null;
		}
		changeType = ENTITY;
	}
	return changeType == 0 ? null : CollectionUtils.array(String.class);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:22,代码来源:ExprName.java


示例3: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == Changer.ChangeMode.DELETE || mode == Changer.ChangeMode.RESET) {
		return CollectionUtils.array(Object.class);
	}
	if (state == States.VALUE) {
		if (mode == Changer.ChangeMode.SET) {
			return CollectionUtils.array(Object.class);
		}
	} else if (state == States.LIST) {
		if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.REMOVE) {
			return CollectionUtils.array(Object.class);
		}
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:17,代码来源:ExprYaml.java


示例4: get

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@NotNull
@Override
protected ItemStack[] get(Event event) {
	ItemStack banner = new ItemStack(type);
	BannerMeta meta = (BannerMeta) banner.getItemMeta();
	meta.setBaseColor(CollectionUtils.getRandom(DyeColor.values()));
	for (int i = 0; i < new Random().nextInt(7); i++)
		meta.addPattern(new Pattern(CollectionUtils.getRandom(DyeColor.values()),
			CollectionUtils.getRandom(PatternType.values())
		));
	banner.setItemMeta(meta);
	return new ItemStack[]{banner};
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:14,代码来源:ExprRandomBanner.java


示例5: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode == Changer.ChangeMode.DELETE || mode == Changer.ChangeMode.RESET) {
		return CollectionUtils.array(Pattern.class);
	} else if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.SET) {
		return CollectionUtils.array(Pattern[].class);
	}
	return null;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:11,代码来源:SExprItemLayers.java


示例6: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode == Changer.ChangeMode.DELETE || mode == Changer.ChangeMode.RESET) {
		return CollectionUtils.array(Pattern.class);
	} else if (mode == Changer.ChangeMode.ADD || mode == Changer.ChangeMode.SET) {
		return CollectionUtils.array(Pattern[].class);
	} else {
		return null;
	}
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:12,代码来源:SExprBannerBlockLayers.java


示例7: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	return (mode == Changer.ChangeMode.SET || mode == Changer.ChangeMode.RESET)
		? CollectionUtils.array(Color.class)
		: null;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:8,代码来源:SExprBannerBlockBaseColor.java


示例8: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode != Changer.ChangeMode.REMOVE && mode != Changer.ChangeMode.REMOVE_ALL
		&& mode != Changer.ChangeMode.ADD) {
		return CollectionUtils.array(PotionEffectType.class);
	}
	return null;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:10,代码来源:SExprBeaconEffects.java


示例9: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode != Changer.ChangeMode.REMOVE && mode != Changer.ChangeMode.REMOVE_ALL) {
		return CollectionUtils.array(PotionEffect[].class);
	} else {
		return CollectionUtils.array(PotionEffectType[].class);
	}
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:9,代码来源:SExprPotionItemEffects.java


示例10: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode == Changer.ChangeMode.REMOVE) {
		return CollectionUtils.array(PotionEffectType.class);
	} else if (mode != Changer.ChangeMode.RESET) {
		return CollectionUtils.array(PotionEffect[].class);
	}
	return null;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:11,代码来源:SExprThrownPotionEffects.java


示例11: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode != Changer.ChangeMode.REMOVE_ALL && mode != Changer.ChangeMode.RESET
		&& mode != Changer.ChangeMode.DELETE) {
		return CollectionUtils.array(Number.class);
	}
	return null;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:10,代码来源:SExprItemEffectTypeAmplifier.java


示例12: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Nullable
@Override
public Class<?>[] acceptChange(Changer.ChangeMode mode) {
	if (mode != Changer.ChangeMode.REMOVE_ALL && mode != Changer.ChangeMode.RESET
		&& mode != Changer.ChangeMode.DELETE) {
		return CollectionUtils.array(Timespan.class);
	}
	return null;
}
 
开发者ID:Syst3ms,项目名称:QuarSK,代码行数:10,代码来源:SExprItemEffectTypeDuration.java


示例13: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final ChangeMode mode) {
    if (mode == ChangeMode.SET || mode == ChangeMode.DELETE || mode == ChangeMode.RESET) {
        return CollectionUtils.array(String.class);
    }
    return null;
}
 
开发者ID:Pikachu920,项目名称:Ersatz,代码行数:8,代码来源:ExprResult.java


示例14: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET) {
		return CollectionUtils.array(ItemType.class);
	}
	return null;
}
 
开发者ID:WheezyGold7931,项目名称:skLib,代码行数:9,代码来源:ExprClickedItem.java


示例15: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET) {
		return CollectionUtils.array(Location.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:8,代码来源:ExprRegeneratorPos2.java


示例16: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET || mode == ChangeMode.ADD || mode == ChangeMode.REMOVE) {
		return CollectionUtils.array(Number.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:8,代码来源:ExprBrewingFuelPower.java


示例17: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET || mode == ChangeMode.RESET) {
		return CollectionUtils.array(Boolean.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:8,代码来源:ExprInstaBreak.java


示例18: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET) {
		return CollectionUtils.array(Boolean.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:8,代码来源:ExprCustomNameVisible.java


示例19: getConvertedExpression

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
@Nullable
public <R> Expression<? extends R> getConvertedExpression(final Class<R>... to) {
    if (CollectionUtils.containsSuperclass(to, getReturnType()))
        return (Expression<? extends R>) this;
    return this.getConvertedExpr(to);
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:9,代码来源:BaseExpression.java


示例20: acceptChange

import ch.njol.util.coll.CollectionUtils; //导入依赖的package包/类
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
    if (mode == Changer.ChangeMode.SET) {
        if (isSingle) {
            return CollectionUtils.array(JSONObject.class);
        } else {
            return CollectionUtils.array(JSONObject[].class);
        }
    }
    return null;
}
 
开发者ID:MundoSK,项目名称:MundoSK,代码行数:11,代码来源:ExprJSONObjectOfPacket.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PingFailedListener类代码示例发布时间:2022-05-22
下一篇:
Java Required类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap