public void func_150876_a(EntityPlayerMP p_150876_1_)
{
int i = this.mcServer.getTickCounter();
Map<StatBase, Integer> map = Maps.<StatBase, Integer>newHashMap();
if (this.field_150886_g || i - this.field_150885_f > 300)
{
this.field_150885_f = i;
for (StatBase statbase : this.func_150878_c())
{
map.put(statbase, Integer.valueOf(this.readStat(statbase)));
}
}
p_150876_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(map));
}
java类com.google.common.collect.Maps的实例源码
StatisticsFile.java 文件源码
项目:DecompiledMinecraft
阅读 41
收藏 0
点赞 0
评论 0
ReplicatedUserPlugin.java 文件源码
项目:Equella
阅读 47
收藏 0
点赞 0
评论 0
@Override
public Map<String, RoleBean> getInformationForRoles(final Collection<String> roleIds)
{
String sql = config.getRoleInfo();
if( Check.isEmpty(sql) )
{
return null;
}
final Map<String, RoleBean> roles = Maps.newHashMapWithExpectedSize(roleIds.size());
handleIn(sql, roleIds, new RowCallbackHandler()
{
@Override
public void processRow(ResultSet set) throws SQLException
{
String id = set.getString(1);
String name = set.getString(2);
roles.put(id, new DefaultRoleBean(id, name));
}
});
return roles;
}
TokenEnhancerChainFilter.java 文件源码
项目:session-cloud
阅读 33
收藏 0
点赞 0
评论 0
/**
* Loop over the {@link #setTokenEnhancers(List) delegates} passing the result into the next member of the chain.
*
* @see org.springframework.security.oauth2.provider.token.TokenEnhancer#enhance(org.springframework.security.oauth2.common.OAuth2AccessToken,
* org.springframework.security.oauth2.provider.OAuth2Authentication)
*/
public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {
DefaultOAuth2AccessToken tempResult = (DefaultOAuth2AccessToken) accessToken;
final Map<String, Object> additionalInformation = new HashMap<String, Object>();
Map<String, String> details = Maps.newHashMap();
Object userDetails = authentication.getUserAuthentication().getDetails();
if (userDetails != null) {
details = (Map<String, String>) userDetails;
}
//you can do extra functions from authentication details
OAuth2AccessToken result = tempResult;
for (TokenEnhancer enhancer : delegates) {
result = enhancer.enhance(result, authentication);
}
return result;
}
GlobalItemParser.java 文件源码
项目:ProjectAres
阅读 48
收藏 0
点赞 0
评论 0
public Map<Enchantment, Integer> parseEnchantments(Element el, String name) throws InvalidXMLException {
Map<Enchantment, Integer> enchantments = Maps.newHashMap();
Node attr = Node.fromAttr(el, name, StringUtils.pluralize(name));
if(attr != null) {
Iterable<String> enchantmentTexts = Splitter.on(";").split(attr.getValue());
for(String enchantmentText : enchantmentTexts) {
int level = 1;
List<String> parts = Lists.newArrayList(Splitter.on(":").limit(2).split(enchantmentText));
Enchantment enchant = XMLUtils.parseEnchantment(attr, parts.get(0));
if(parts.size() > 1) {
level = XMLUtils.parseNumber(attr, parts.get(1), Integer.class);
}
enchantments.put(enchant, level);
}
}
for(Element elEnchantment : el.getChildren(name)) {
Pair<Enchantment, Integer> entry = parseEnchantment(elEnchantment);
enchantments.put(entry.first, entry.second);
}
return enchantments;
}
Chunk.java 文件源码
项目:DecompiledMinecraft
阅读 142
收藏 0
点赞 0
评论 0
public Chunk(World worldIn, int x, int z)
{
this.storageArrays = new ExtendedBlockStorage[16];
this.blockBiomeArray = new byte[256];
this.precipitationHeightMap = new int[256];
this.updateSkylightColumns = new boolean[256];
this.chunkTileEntityMap = Maps.<BlockPos, TileEntity>newHashMap();
this.queuedLightChecks = 4096;
this.tileEntityPosQueue = Queues.<BlockPos>newConcurrentLinkedQueue();
this.entityLists = (ClassInheritanceMultiMap[])(new ClassInheritanceMultiMap[16]);
this.worldObj = worldIn;
this.xPosition = x;
this.zPosition = z;
this.heightMap = new int[256];
for (int i = 0; i < this.entityLists.length; ++i)
{
this.entityLists[i] = new ClassInheritanceMultiMap(Entity.class);
}
Arrays.fill((int[])this.precipitationHeightMap, (int) - 999);
Arrays.fill(this.blockBiomeArray, (byte) - 1);
}
GuiFlatPresets.java 文件源码
项目:BaseClient
阅读 50
收藏 0
点赞 0
评论 0
private static void func_175354_a(String p_175354_0_, Item p_175354_1_, int p_175354_2_, BiomeGenBase p_175354_3_, List<String> p_175354_4_, FlatLayerInfo... p_175354_5_)
{
FlatGeneratorInfo flatgeneratorinfo = new FlatGeneratorInfo();
for (int i = p_175354_5_.length - 1; i >= 0; --i)
{
flatgeneratorinfo.getFlatLayers().add(p_175354_5_[i]);
}
flatgeneratorinfo.setBiome(p_175354_3_.biomeID);
flatgeneratorinfo.func_82645_d();
if (p_175354_4_ != null)
{
for (String s : p_175354_4_)
{
flatgeneratorinfo.getWorldFeatures().put(s, Maps.<String, String>newHashMap());
}
}
FLAT_WORLD_PRESETS.add(new GuiFlatPresets.LayerItem(p_175354_1_, p_175354_2_, p_175354_0_, flatgeneratorinfo.toString()));
}
InstanceRuntimeRpc.java 文件源码
项目:hashsdn-controller
阅读 31
收藏 0
点赞 0
评论 0
public Map<String, AttributeConfigElement> fromXml(final XmlElement configRootNode) throws DocumentedException {
Map<String, AttributeConfigElement> retVal = Maps.newHashMap();
// FIXME add identity map to runtime data
Map<String, AttributeReadingStrategy> strats = new ObjectXmlReader().prepareReading(yangToAttrConfig,
Collections.<String, Map<Date, IdentityMapping>>emptyMap());
for (Entry<String, AttributeReadingStrategy> readStratEntry : strats.entrySet()) {
List<XmlElement> configNodes = configRootNode.getChildElements(readStratEntry.getKey());
AttributeConfigElement readElement = readStratEntry.getValue().readElement(configNodes);
retVal.put(readStratEntry.getKey(), readElement);
}
resolveConfiguration(retVal);
return retVal;
}
AvroDiffMap.java 文件源码
项目:avro-diff
阅读 54
收藏 0
点赞 0
评论 0
private static void applyMapDiff(Schema.Field field, GenericRecord avroObj, GenericRecord fieldsValue, Map<Object, Object> modifiedObj, Object key) throws IOException {
Map<String, Object> changedKeys = ((MapDiff) fieldsValue).getChangedKeys();
for (String changedKey : changedKeys.keySet()) {
Class<?> clazz = changedKeys.get(changedKey).getClass();
if (clazz.isAssignableFrom(PrimitiveDiff.class)) {
AvroDiffPrimitive.applyPrimitiveDiff(field, avroObj, changedKeys.get(changedKey), changedKeys, changedKey);
modifiedObj.put(key, changedKeys);
} else if (clazz.isAssignableFrom(MapDiff.class)) {
AvroDiffMap.applyMapDiff(field, avroObj, (GenericRecord) changedKeys.get(changedKey), Maps.newHashMap(changedKeys), changedKey);
} else if (clazz.isAssignableFrom(ArrayDiff.class)) {
AvroDiffArray.applyArrayDiff(field, avroObj, (GenericRecord) changedKeys.get(changedKey), null);
} else if (clazz.isAssignableFrom(RecordDiff.class)) {
Object avroField = ((Map) avroObj.get(field.pos())).get(key);
GenericRecord genericRecord = AvroDiff.applyDiff((GenericRecord) ((Map) avroField).get(changedKey), (RecordDiff) changedKeys.get(changedKey),
((GenericRecord) ((Map) avroField).get(changedKey)).getSchema());
((Map) avroField).put(changedKey, genericRecord);
modifiedObj.put(key, avroField);
}
}
}
ItemResourceImpl.java 文件源码
项目:Equella
阅读 46
收藏 0
点赞 0
评论 0
/**
* Similar operation in the ItemLockResource
*
* @see com.tle.web.api.item.interfaces.ItemLockResource#get(UriInfo,
* String, int)
* @param uuid
* @param version
* @return
*/
private ItemLockBean getItemLock(EquellaItemBean equellaBean)
{
Item item = itemService.get(new ItemId(equellaBean.getUuid(), equellaBean.getVersion()));
final ItemLock lock = lockingService.get(item);
if( lock == null )
{
return null;
}
final URI loc = urlLinkService.getMethodUriBuilder(ItemLockResource.class, "get").build(item.getUuid(),
item.getVersion());
final ItemLockBean lockBean = new ItemLockBean();
final Map<String, String> linkMap = Maps.newHashMap();
linkMap.put("self", loc.toString());
lockBean.setOwner(new UserBean(lock.getUserID()));
lockBean.setUuid(lock.getUserSession());
lockBean.set("links", linkMap);
return lockBean;
}
DefaultJarSnapshotter.java 文件源码
项目:Reer
阅读 37
收藏 0
点赞 0
评论 0
JarSnapshot createSnapshot(HashCode hash, FileTree classes, final ClassFilesAnalyzer analyzer) {
final Map<String, HashCode> hashes = Maps.newHashMap();
classes.visit(new FileVisitor() {
public void visitDir(FileVisitDetails dirDetails) {
}
public void visitFile(FileVisitDetails fileDetails) {
analyzer.visitFile(fileDetails);
String className = fileDetails.getPath().replaceAll("/", ".").replaceAll("\\.class$", "");
HashCode classHash = hasher.hash(fileDetails.getFile());
hashes.put(className, classHash);
}
});
return new JarSnapshot(new JarSnapshotData(hash, hashes, analyzer.getAnalysis()));
}
StateMap.java 文件源码
项目:Backmemed
阅读 38
收藏 0
点赞 0
评论 0
protected ModelResourceLocation getModelResourceLocation(IBlockState state)
{
Map < IProperty<?>, Comparable<? >> map = Maps. < IProperty<?>, Comparable<? >> newLinkedHashMap(state.getProperties());
String s;
if (this.name == null)
{
s = ((ResourceLocation)Block.REGISTRY.getNameForObject(state.getBlock())).toString();
}
else
{
s = this.removeName(this.name, map);
}
if (this.suffix != null)
{
s = s + this.suffix;
}
for (IProperty<?> iproperty : this.ignored)
{
map.remove(iproperty);
}
return new ModelResourceLocation(s, this.getPropertyString(map));
}
ReturnExpect.java 文件源码
项目:pact-spring-mvc
阅读 27
收藏 0
点赞 0
评论 0
private void assertRequestHeaders(HttpHeaders actualHeaders, Object requestObject, Map<String, Matcher<? super List<String>>> additionalExpectedHeaders) {
Map<String, Matcher<? super List<String>>> expectedHeaders = new HashMap<>();
if (requestObject != null && requestObject instanceof HttpEntity) {
HttpEntity httpEntity = (HttpEntity) requestObject;
HttpHeaders headers = httpEntity.getHeaders();
Map<String, Matcher<List<String>>> stringMatcherMap = Maps.transformValues(headers, new Function<List<String>, Matcher<List<String>>>() {
@Override
public Matcher<List<String>> apply(List<String> input) {
return is(input);
}
});
expectedHeaders.putAll(stringMatcherMap);
}
expectedHeaders.putAll(additionalExpectedHeaders);
Set<String> headerNames = expectedHeaders.keySet();
for (String headerName : headerNames) {
Matcher<? super List<String>> headerValuesMatcher = expectedHeaders.get(headerName);
assertThat(format("Contains header %s", headerName), actualHeaders.containsKey(headerName), is(true));
assertThat(format("'%s' header value fails assertion", headerName), actualHeaders.get(headerName), headerValuesMatcher);
}
}
Token.java 文件源码
项目:hadoop-oss
阅读 40
收藏 0
点赞 0
评论 0
private static Class<? extends TokenIdentifier>
getClassForIdentifier(Text kind) {
Class<? extends TokenIdentifier> cls = null;
synchronized (Token.class) {
if (tokenKindMap == null) {
tokenKindMap = Maps.newHashMap();
for (TokenIdentifier id : ServiceLoader.load(TokenIdentifier.class)) {
tokenKindMap.put(id.getKind(), id.getClass());
}
}
cls = tokenKindMap.get(kind);
}
if (cls == null) {
LOG.warn("Cannot find class for token kind " + kind);
return null;
}
return cls;
}
SelectieTaakVerwerkerImpl.java 文件源码
项目:OperatieBRP
阅读 23
收藏 0
点赞 0
评论 0
private Set<Integer> filter(final List<SelectieAutorisatiebundel> autorisatiebundels, final Collection<Persoonslijst> lijstMetPersonen) {
final Set<Integer> ongeldigeSelectietaken = Sets.newHashSet();
final Map<Long, ZonedDateTime> gbaSystematiekMap = Maps.newHashMap();
for (Persoonslijst persoonslijst : lijstMetPersonen) {
//we berekenen dit nu altijd. We zouden ook kunnen detecteren dat peilmoment formeel niet is gezet vanuit beheer maar op 'nu' is gezet in
// selectie run voor alle taken.
final ZonedDateTime laatsteWijzigingGBASystematiek = persoonslijst.bepaalTijdstipLaatsteWijzigingGBASystematiek();
gbaSystematiekMap.put(persoonslijst.getId(), laatsteWijzigingGBASystematiek);
}
for (SelectieAutorisatiebundel autorisatiebundel : autorisatiebundels) {
//alleen voor standaard selectie relevant en als peilmoment formeel gezet
if (isStandaardSelectie(autorisatiebundel.getAutorisatiebundel().getDienst())
&& autorisatiebundel.getSelectieAutorisatieBericht().getPeilmomentFormeel() != null) {
bepaalOngeldigeSelectietaak(lijstMetPersonen, ongeldigeSelectietaken, gbaSystematiekMap, autorisatiebundel);
}
}
return ongeldigeSelectietaken;
}
PebbleTheme.java 文件源码
项目:de.flapdoodle.solid
阅读 44
收藏 0
点赞 0
评论 0
private String render(Renderable renderable, PebbleTemplate template) {
try {
StringWriter writer=new StringWriter();
PebbleWrapper it = PebbleWrapper.builder()
.markupRenderFactory(markupRenderFactory)
.context(renderable.context())
.addAllAllBlobs(renderable.blobs())
.build();
template.evaluate(writer, Maps.newLinkedHashMap(ImmutableMap.of("it",it)));
return writer.toString();
} catch (PebbleException | IOException | RuntimePebbleException px) {
throw new RuntimeException("rendering fails for "+template.getName(),px);
}
}
LoginUtil.java 文件源码
项目:easyweb
阅读 27
收藏 0
点赞 0
评论 0
/**
* 是否是验证码登录
* @param useruame 用户名
* @param isFail 计数加1
* @param clean 计数清零
* @return
*/
@SuppressWarnings("unchecked")
public static boolean isValidateCodeLogin(String useruame, boolean isFail, boolean clean){
Map<String, Integer> loginFailMap = (Map<String, Integer>) CacheUtils.get("loginFailMap");
if (loginFailMap==null){
loginFailMap = Maps.newHashMap();
CacheUtils.put("loginFailMap", loginFailMap);
}
Integer loginFailNum = loginFailMap.get(useruame);
if (loginFailNum==null){
loginFailNum = 0;
}
if (isFail){
loginFailNum++;
loginFailMap.put(useruame, loginFailNum);
}
if (clean){
loginFailMap.remove(useruame);
}
return loginFailNum >= 3;
}
MetricsConfig.java 文件源码
项目:hadoop
阅读 53
收藏 0
点赞 0
评论 0
/**
* Return sub configs for instance specified in the config.
* Assuming format specified as follows:<pre>
* [type].[instance].[option] = [value]</pre>
* Note, '*' is a special default instance, which is excluded in the result.
* @param type of the instance
* @return a map with [instance] as key and config object as value
*/
Map<String, MetricsConfig> getInstanceConfigs(String type) {
Map<String, MetricsConfig> map = Maps.newHashMap();
MetricsConfig sub = subset(type);
for (String key : sub.keys()) {
Matcher matcher = INSTANCE_REGEX.matcher(key);
if (matcher.matches()) {
String instance = matcher.group(1);
if (!map.containsKey(instance)) {
map.put(instance, sub.subset(instance));
}
}
}
return map;
}
ElementHelper.java 文件源码
项目:OperatieBRP
阅读 34
收藏 0
点赞 0
评论 0
private void mapSorteerAttributen() {
final Map<Integer, GroepElement> objectSorteerGroepTemp = Maps.newHashMap();
final ArrayListMultimap<GroepElement, AttribuutElement> sorteerElementenVoorGroep = ArrayListMultimap.create();
for (final AttribuutElement attribuutElement : idAttribuutMap.values()) {
if (attribuutElement.getElement().getElementWaarde().getSorteervolgorde() != null) {
objectSorteerGroepTemp.put(attribuutElement.getObjectType(), idGroepMap.get(attribuutElement.getGroepId()));
sorteerElementenVoorGroep.put(idGroepMap.get(attribuutElement.getGroepId()), attribuutElement);
}
}
objectSorteerGroepMap = ImmutableMap.copyOf(objectSorteerGroepTemp);
final Map<GroepElement, List<AttribuutElement>> gesorteerdeElementenVoorGroepTemp = new HashMap<>();
for (GroepElement groepElement : sorteerElementenVoorGroep.keySet()) {
final List<AttribuutElement> sorteerAttributen = sorteerElementenVoorGroep.get(groepElement);
sorteerAttributen.sort(
Comparator.comparing(o -> o.getElement().getElementWaarde().getSorteervolgorde()));
gesorteerdeElementenVoorGroepTemp.put(groepElement, sorteerAttributen);
}
sorteerAttributenVoorGroep = ImmutableMap.copyOf(gesorteerdeElementenVoorGroepTemp);
}
PopulatedCachesTest.java 文件源码
项目:guava-mock
阅读 30
收藏 0
点赞 0
评论 0
public void testValues_populated() {
for (LoadingCache<Object, Object> cache : caches()) {
Collection<Object> values = cache.asMap().values();
List<Entry<Object, Object>> warmed = warmUp(cache);
Collection<Object> expected = Maps.newHashMap(cache.asMap()).values();
assertThat(values).containsExactlyElementsIn(expected);
assertThat(values.toArray()).asList().containsExactlyElementsIn(expected);
assertThat(values.toArray(new Object[0])).asList().containsExactlyElementsIn(expected);
assertEquals(WARMUP_SIZE, values.size());
for (int i = WARMUP_MIN; i < WARMUP_MAX; i++) {
Object value = warmed.get(i - WARMUP_MIN).getValue();
assertTrue(values.contains(value));
assertTrue(values.remove(value));
assertFalse(values.remove(value));
assertFalse(values.contains(value));
}
checkEmpty(values);
checkEmpty(cache);
}
}
DefaultLogFilterAndRule.java 文件源码
项目:uavstack
阅读 46
收藏 0
点赞 0
评论 0
@SuppressWarnings("rawtypes")
@Override
public Map doAnalysis(Map<String, String> header, String log) {
List<String> logfields = Lists.newArrayList(separator.split(log));
Map<String, String> resultMap = Maps.newHashMap();
int i = 0;
// collection specified fields
for (int point : SpecifiedFields) {
// add irregular process
if (logfields.size() >= point)
resultMap.put(fieldsName[i++], logfields.get(point - 1));
}
// add line number
resultMap.put("_lnum", header.get(READ_LINE_NUMBER));
// add timestamp
if (timeStampField == TIMESTAMP_NEED) {
resultMap.put("_timestamp", header.get(READ_TIMESTAMP));
}
else if (timeStampField > TIMESTAMP_NEED) {
resultMap.put("_timestamp", logfields.get(timeStampField - 1));
}
this.getMainlogs().add(resultMap);
return resultMap;
}
StatisticsFile.java 文件源码
项目:DecompiledMinecraft
阅读 38
收藏 0
点赞 0
评论 0
public void func_150876_a(EntityPlayerMP p_150876_1_)
{
int i = this.mcServer.getTickCounter();
Map<StatBase, Integer> map = Maps.<StatBase, Integer>newHashMap();
if (this.field_150886_g || i - this.field_150885_f > 300)
{
this.field_150885_f = i;
for (StatBase statbase : this.func_150878_c())
{
map.put(statbase, Integer.valueOf(this.readStat(statbase)));
}
}
p_150876_1_.playerNetServerHandler.sendPacket(new S37PacketStatistics(map));
}
SpeedRestrictionTagger.java 文件源码
项目:fpm
阅读 30
收藏 0
点赞 0
评论 0
public Map<String, String> tag(Feature feature) {
TreeMultimap<String, Integer> speeds = TreeMultimap.create();
List<SpeedRestriction> restrictions = dbf.getSpeedRestrictions(feature.getLong("ID"));
boolean reversed = isReversed(feature);
for (SpeedRestriction restriction : restrictions) {
switch (restriction.getValidity()) {
case positive:
speeds.put(reversed ? "maxspeed:backward" : "maxspeed:forward", restriction.getSpeed());
break;
case negative:
speeds.put(reversed ? "maxspeed:forward" : "maxspeed:backward", restriction.getSpeed());
break;
case both:
speeds.put("maxspeed", restriction.getSpeed());
break;
}
}
Map<String, String> result = Maps.newHashMap();
for (String key : speeds.keySet()) {
result.put(key, String.valueOf(speeds.get(key).iterator().next()));
}
return result;
}
FailedMsgRetryManagerPerformanceTest.java 文件源码
项目:storm-dynamic-spout
阅读 24
收藏 0
点赞 0
评论 0
/**
* Run a bunch of retries.
*
* Disabled for now.
*/
public void runTest() throws InterruptedException {
// Create instance with default settings
RetryManager retryManager = new DefaultRetryManager();
retryManager.open(Maps.newHashMap());
// Do warm up
logger.info("WARMING UP");
doTest2(retryManager);
// Now start test
logger.info("STARTING TEST");
retryManager = new DefaultRetryManager();
retryManager.open(Maps.newHashMap());
doTest2(retryManager);
}
UnionCompositeAttributeResolvingStrategy.java 文件源码
项目:hashsdn-controller
阅读 34
收藏 0
点赞 0
评论 0
@Override
protected Map<String, Object> preprocessValueMap(final Map<?, ?> valueMap) {
CompositeType openType = getOpenType();
Preconditions.checkArgument(
valueMap.size() == 1 && valueMap.containsKey(JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION),
"Unexpected structure of incoming map, expecting one element under %s, but was %s",
JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION, valueMap);
Map<String, Object> newMap = Maps.newHashMap();
for (String key : openType.keySet()) {
if (openType.getDescription(key).equals(JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION)) {
newMap.put(key, valueMap.get(JavaAttribute.DESCRIPTION_OF_VALUE_ATTRIBUTE_FOR_UNION));
} else {
newMap.put(key, null);
}
}
return newMap;
}
VirtualPortWebResource.java 文件源码
项目:athena
阅读 41
收藏 0
点赞 0
评论 0
/**
* Returns a Object of the currently known infrastructure virtualPort.
*
* @param allowedAddressPairs the allowedAddressPairs json node
* @return a collection of allowedAddressPair
*/
public Collection<AllowedAddressPair> jsonNodeToAllowedAddressPair(JsonNode allowedAddressPairs) {
checkNotNull(allowedAddressPairs, JSON_NOT_NULL);
ConcurrentMap<Integer, AllowedAddressPair> allowMaps = Maps
.newConcurrentMap();
int i = 0;
for (JsonNode node : allowedAddressPairs) {
IpAddress ip = IpAddress.valueOf(node.get("ip_address").asText());
MacAddress mac = MacAddress.valueOf(node.get("mac_address")
.asText());
AllowedAddressPair allows = AllowedAddressPair
.allowedAddressPair(ip, mac);
allowMaps.put(i, allows);
i++;
}
log.debug("The jsonNode of allowedAddressPairallow is {}"
+ allowedAddressPairs.toString());
return Collections.unmodifiableCollection(allowMaps.values());
}
SoundManager.java 文件源码
项目:CustomWorldGen
阅读 72
收藏 0
点赞 0
评论 0
public SoundManager(SoundHandler p_i45119_1_, GameSettings p_i45119_2_)
{
this.invPlayingSounds = ((BiMap)this.playingSounds).inverse();
this.categorySounds = HashMultimap.<SoundCategory, String>create();
this.tickableSounds = Lists.<ITickableSound>newArrayList();
this.delayedSounds = Maps.<ISound, Integer>newHashMap();
this.playingSoundsStopTime = Maps.<String, Integer>newHashMap();
this.listeners = Lists.<ISoundEventListener>newArrayList();
this.pausedChannels = Lists.<String>newArrayList();
this.sndHandler = p_i45119_1_;
this.options = p_i45119_2_;
try
{
SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class);
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.sound.SoundSetupEvent(this));
}
catch (SoundSystemException soundsystemexception)
{
LOGGER.error(LOG_MARKER, (String)"Error linking with the LibraryJavaSound plug-in", (Throwable)soundsystemexception);
}
}
Kills.java 文件源码
项目:Juice
阅读 34
收藏 0
点赞 0
评论 0
@Override
@SuppressWarnings("unchecked")
public TaskKill handle(String requestUrl) {
Result<TaskKill> result = null;
try {
Map<String, String> map = Maps.newHashMap();
map.put("taskId", String.valueOf(taskId));
String url = requestUrl + URL_KILL;
result = Restty.create(url, map)
.addMediaType(Restty.jsonBody())
.post(new ParameterTypeReference<Result<TaskKill>>() {
});
} catch (IOException e) {
throw new JuiceClientException(ErrorCode.HTTP_REQUEST_ERROR.getCode(), e.getMessage());
}
return result != null ? result.getData() : null;
}
SQSTrigger.java 文件源码
项目:aws-codecommit-trigger-plugin
阅读 57
收藏 0
点赞 0
评论 0
private void initQueueMap() {
if (this.sqsQueues == null) {
return;
}
for (SQSTriggerQueue sqsQueue : this.sqsQueues) {
String version = sqsQueue.getVersion();
boolean compatible = com.ribose.jenkins.plugin.awscodecommittrigger.utils.StringUtils.checkCompatibility(version, com.ribose.jenkins.plugin.awscodecommittrigger.PluginInfo.compatibleSinceVersion);
sqsQueue.setCompatible(compatible);
}
this.sqsQueueMap = Maps.newHashMapWithExpectedSize(this.sqsQueues.size());
for (final SQSTriggerQueue queue : this.sqsQueues) {
this.sqsQueueMap.put(queue.getUuid(), queue);
}
}
GoogleDispatch.java 文件源码
项目:TranslateUtils
阅读 32
收藏 0
点赞 0
评论 0
@Override
protected Map<String, String> initParamsMap(String from, String targ, String query) {
Map<String,String> paramsMap = Maps.newHashMap();
paramsMap.put("client", "t");
paramsMap.put("sl", from);
paramsMap.put("t1",targ);
paramsMap.put("h1","zh_CH");
paramsMap.put("dt", "at");
//paramsMap.put("")
return null;
}
PopulatedCachesTest.java 文件源码
项目:googles-monorepo-demo
阅读 36
收藏 0
点赞 0
评论 0
@SuppressWarnings("unchecked") // generic array creation
public void testEntrySet_populated() {
for (LoadingCache<Object, Object> cache : caches()) {
Set<Entry<Object, Object>> entries = cache.asMap().entrySet();
List<Entry<Object, Object>> warmed = warmUp(cache, WARMUP_MIN, WARMUP_MAX);
Set<?> expected = Maps.newHashMap(cache.asMap()).entrySet();
assertThat(entries).containsExactlyElementsIn((Collection<Entry<Object, Object>>) expected);
assertThat(entries.toArray())
.asList()
.containsExactlyElementsIn((Collection<Object>) expected);
assertThat(entries.toArray(new Entry[0]))
.asList()
.containsExactlyElementsIn((Collection<Entry>) expected);
new EqualsTester()
.addEqualityGroup(cache.asMap().entrySet(), entries)
.addEqualityGroup(ImmutableSet.of())
.testEquals();
assertEquals(WARMUP_SIZE, entries.size());
for (int i = WARMUP_MIN; i < WARMUP_MAX; i++) {
Entry<Object, Object> newEntry = warmed.get(i - WARMUP_MIN);
assertTrue(entries.contains(newEntry));
assertTrue(entries.remove(newEntry));
assertFalse(entries.remove(newEntry));
assertFalse(entries.contains(newEntry));
}
checkEmpty(entries);
checkEmpty(cache);
}
}