Java Code Examples for java.util.Map.Entry.getValue()

The following are Jave code examples for showing how to use getValue() of the java.util.Map.Entry class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.

+ Save this method
Example 1
Project: SAPManagerPack-master View Source Vote up 7 votes
public void renderParticles(Entity viewingEntity, float partTicks, boolean alpha) {
    float rotX = ActiveRenderInfo.rotationX;
    float rotZ = ActiveRenderInfo.rotationZ;
    float rotYZ = ActiveRenderInfo.rotationYZ;
    float rotXY = ActiveRenderInfo.rotationXY;
    float rotXZ = ActiveRenderInfo.rotationXZ;
    EntityFX.interpPosX = viewingEntity.lastTickPosX + (viewingEntity.posX - viewingEntity.lastTickPosX) * partTicks;
    EntityFX.interpPosY = viewingEntity.lastTickPosY + (viewingEntity.posY - viewingEntity.lastTickPosY) * partTicks;
    EntityFX.interpPosZ = viewingEntity.lastTickPosZ + (viewingEntity.posZ - viewingEntity.lastTickPosZ) * partTicks;

    Collection<Entry<Integer, Pair<ResourceLocation, Boolean>>> currLayers = Collections2.filter(this.fxLayers.entrySet(), new SortingFilter(alpha));

    for( Entry<Integer, Pair<ResourceLocation, Boolean>> layer : currLayers ) {
        Pair<ResourceLocation, Boolean> layerData = layer.getValue();
        Collection<EntityParticle> particles = this.particles.get(layer.getKey());
        if( !particles.isEmpty() ) {
            Tessellator tessellator = Tessellator.instance;
            tessellator.startDrawingQuads();

            for( final EntityParticle particle : particles ) {
                if( particle == null ) {
                    continue;
                }

                tessellator.setBrightness(particle.getBrightnessForRender(partTicks));

                try {
                    particle.renderParticle(tessellator, partTicks, rotX, rotXZ, rotZ, rotYZ, rotXY);
                } catch( Throwable throwable ) {
                    throw new RuntimeException("Couldn't render particle!", throwable);
                }
            }

            this.textureManager.bindTexture(layerData.getValue0());
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            if( layerData.getValue1() ) {
                GL11.glEnable(GL11.GL_BLEND);
                OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
            }

            SAPUtils.EVENT_BUS.post(new SAPFxLayerRenderEvent.Pre(layer.getKey(), tessellator));
            tessellator.draw();
            SAPUtils.EVENT_BUS.post(new SAPFxLayerRenderEvent.Post(layer.getKey()));

            if( layerData.getValue1() ) {
                GL11.glDisable(GL11.GL_BLEND);
            }
        }
    }
}
 
Example 2
Project: aws-toolkit-eclipse-master View Source Vote up 7 votes
public String toString() {
    String buffer = "";
    for (Entry<String, SchemaProperty> entry : properties.entrySet()) {
        buffer += " - " + entry.getKey() + ": " + entry.getValue() + "\n"; 
    }
    
    return buffer;
}
 
Example 3
Project: aws-toolkit-eclipse-master View Source Vote up 6 votes
private static String substituteUserConfiguration(String originalContent,
        Map<String, String> paramAnchorTextAndValues) {

    for (Entry<String, String> entry : paramAnchorTextAndValues.entrySet()) {
        String anchorText = entry.getKey();
        String value = entry.getValue();

        originalContent = originalContent.replace(anchorText, value);
    }

    return originalContent;
}
 
Example 4
Project: de.htwg.se.muehle-master View Source Vote up 6 votes
@Test
public void testGridIsEmpty(){

    for(Entry<Tuple, Cell> entry : this.matrix.entrySet()){
        Tuple key = entry.getKey();
        Cell value = entry.getValue();
        assertTrue(value.getCell() == TokenValues.EMPTY);
        
        
    }

}
 
Example 5
Project: TinyProtocolAPI-master View Source Vote up 6 votes
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg)
		throws Exception {
	final Channel channel = ctx.channel();
	handleLoginStart(channel, msg);

	for (Entry<PacketListener, List<Method>> listener : IN.entrySet()) {
		for (Method method : listener.getValue()) {
			PacketHandler ann = method
					.getAnnotation(PacketHandler.class);
			if (!ann.packet().getName()
					.equals(msg.getClass().getSimpleName()))
				continue;

			PacketEvent evt = new PacketEvent(player, msg);
			method.setAccessible(true);
			method.invoke(listener.getKey(), evt);
			method.setAccessible(false);
			msg = evt.getPacket();
		}
	}
	if (msg != null) {
		super.channelRead(ctx, msg);
	}
}
 
Example 6
Project: TinyProtocolAPI-master View Source Vote up 6 votes
@Override
public void write(ChannelHandlerContext ctx, Object msg,
		ChannelPromise promise) throws Exception {
	for (Entry<PacketListener, List<Method>> listener : OUT.entrySet()) {
		for (Method method : listener.getValue()) {
			
			PacketHandler ann = method.getAnnotation(PacketHandler.class);
			if (!ann.packet().getName().equals(msg.getClass().getSimpleName()))
				continue;
			PacketEvent evt = new PacketEvent(player, msg);
			method.setAccessible(true);
			method.invoke(listener.getKey(), evt);
			msg = evt.getPacket();
		}
	}

	if (msg != null) {
		super.write(ctx, msg, promise);
	}
}
 
Example 7
Project: bixie-master View Source Vote up 6 votes
protected void consumeReport(Report r) {
	for (Entry<Integer, List<FaultExplanation>> entry : r.getReports().entrySet()) {
		if (!sortedReport.containsKey(entry.getKey())) {
			sortedReport.put(entry.getKey(), new HashMap<String, List<List<Integer>>>());
		}
		Map<String, List<List<Integer>>> sortedLinesPerFile = sortedReport.get(entry.getKey());
		for (FaultExplanation fe : entry.getValue()) {
			if (fe.locations.isEmpty()) {
				continue;
			}
			//get the sorted list of line numbers for this report.
			LinkedHashSet<Integer> lines = new LinkedHashSet<Integer>();
			for (SourceLocation line : fe.locations) {
				lines.add(line.StartLine);
			}
			LinkedList<Integer> sortedLines = new LinkedList<Integer>(lines);
			Collections.sort(sortedLines);
			//get the file name for this report.
			String fname = fe.fileName;
			
			if (!sortedLinesPerFile.containsKey(fname)) {
				sortedLinesPerFile.put(fname, new LinkedList<List<Integer>>());
			}
			sortedLinesPerFile.get(fname).add(sortedLines);
		}
		
	}
}
 
Example 8
Project: bixie-master View Source Vote up 6 votes
/**
 * Apply fault localization from the FSE13 paper to all reported 
 * inconsistencies.
 * @param tr 
 */
public void runFaultLocalization() {		
	for (Entry<Integer, Set<Set<BasicBlock>>> entry : this.inconsistentBlocks.entrySet()) {
		for (Set<BasicBlock> inconsistency : entry.getValue()) {
			try {
				runFaultLocalization(entry.getKey(), inconsistency);
			} catch (Throwable e) {
				return;
			}
		}
	}
}
 
Example 9
Project: virgo.kernel-master View Source Vote up 6 votes
/**
 * Updates the {@link StandardScopeServiceRepository} with the service information from the given config files.
 * 
 * @param scopeName the name of the scope.
 * @param configFiles the config files to scope.
 * @throws DeploymentException
 */
private void doScope(Map<ArtifactFS, List<ArtifactFSEntry>> configFiles) throws DeploymentException {
    SpringConfigServiceModelScanner scanner = new SpringConfigServiceModelScanner(this.scopeName, this.repository, this.eventLogger);
    Map<ArtifactFS, BundleManifest> manifests = loadBundleManifests(configFiles.keySet());
    for (Entry<ArtifactFS, List<ArtifactFSEntry>> entry : configFiles.entrySet()) {
        BundleManifest bundleManifest = manifests.get(entry.getKey());
        for (ArtifactFSEntry configFile : entry.getValue()) {
            InputStream is = configFile.getInputStream();
            try {
                scanner.scanConfigFile(bundleManifest.getBundleSymbolicName().getSymbolicName(), bundleManifest.getBundleVersion(),
                    configFile.getPath(), is);
            } finally {
                IOUtils.closeQuietly(is);
            }
        }
    }
}
 
Example 10
Project: virgo.kernel-master View Source Vote up 6 votes
private PackageSources computeUsesClosure(State state, PackageSources packages) {
    // Compute all the exports visible through transitive uses from directPackages
    PackageSources additionalPackages = constructEmptyPackageSources();
    Set<Entry<String, Set<SourcedPackage>>> keys = packages.entrySet();

    Set<String> knownPackages = new HashSet<String>();

    for (Entry<String, Set<SourcedPackage>> key : keys) {
        for (SourcedPackage sp : key.getValue()) {
            ExportPackageDescription source = sp.getSource();
            addUsedImportedPackages(state, additionalPackages, source, source, knownPackages);
        }
    }
    return additionalPackages;
}
 
Example 11
Project: richfaces-master View Source Vote up 6 votes
@Test
public void testMouseOverSpecificTdElement() {
    /*
     * Move mouse over all td elements and check whether the showName is same as text of particular td element then move
     * mouse out of td element and check whether the output is empty
     */

    for (Entry<String, WebElement> entry : page.getNames().entrySet()) {
        String name = entry.getKey();
        WebElement element = entry.getValue();
        activate(element);
        Graphene.waitGui().until("The text in output should be same as in the active td!").element(page.getOutput()).text()
            .equalTo(name);
    }
}
 
Example 12
Project: richfaces-master View Source Vote up 6 votes
public void toggleSort() {
    for (Entry<String, SortOrder> entry : sortOrders.entrySet()) {
        SortOrder newOrder;

        if (entry.getKey().equals(sortProperty)) {
            if (entry.getValue() == SortOrder.ascending) {
                newOrder = SortOrder.descending;
            } else {
                newOrder = SortOrder.ascending;
            }
        } else {
            newOrder = SortOrder.unsorted;
        }

        entry.setValue(newOrder);
    }
}