Examples of Penalty


Examples of com.structis.fichesst.server.bean.domain.Penalty

        }

        List<Penalty> penaltyList = persistence.getPenalties();
        if (penaltyList != null) {
          for (Iterator<Penalty> iterator = penaltyList.iterator(); iterator.hasNext();) {
            Penalty penalty = iterator.next();
            penalty.setFicheSt(null);
            iterator.remove();
          }
        }
      }
     
View Full Code Here

Examples of com.structis.fichesst.server.bean.domain.Penalty

   *
   * @param listPenalty
   * @return
   */
  private String [] createPenalite(List<Penalty> listPenalty){
    Penalty penalty = null;
    String srcPenalty = "";
    double amount = 0.0;
    for (int j = 0; j < listPenalty.size(); j++) {         
      penalty = listPenalty.get(j);
      /*srcPenalty += penalty.getDate() + Constants.SEPRATE + penalty.getAmount() + Constants.SEPRATE + penalty.getComment() + Constants.SEPRATE;*/
      srcPenalty += append(penalty.getDate(),penalty.getAmount(),penalty.getComment());
      amount += penalty.getAmount();
    }
    String [] arr = {srcPenalty,amount + ""};
    return arr;
  }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

     * If no such value is set, 0 is returned.
     * @param className the fully qualified class name of the implementation class
     * @return the additional penalty value
     */
    public Penalty getAdditionalPenalty(String className) {
        Penalty p = (Penalty)this.additionalPenalties.get(className);
        return (p != null ? p : Penalty.ZERO_PENALTY);
    }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

     * different possible pipelines.
     * @param registry the image implementation registry
     * @return the overall penalty (a non-negative integer)
     */
    public Penalty getConversionPenalty(ImageImplRegistry registry) {
        Penalty penalty = Penalty.ZERO_PENALTY;
        if (loader != null) {
            penalty = penalty.add(loader.getUsagePenalty());
            if (registry != null) {
                penalty = penalty.add(
                        registry.getAdditionalPenalty(loader.getClass().getName()));
            }
        }
        Iterator iter = converters.iterator();
        while (iter.hasNext()) {
            ImageConverter converter = (ImageConverter)iter.next();
            penalty = penalty.add(converter.getConversionPenalty());
            if (registry != null) {
                penalty = penalty.add(
                        registry.getAdditionalPenalty(converter.getClass().getName()));
            }
        }
        return penalty;
    }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

    /**
     * Tests for the {@link Penalty} class.
     * @throws Exception if an error occurs
     */
    public void testPenalty() throws Exception {
        Penalty p1 = Penalty.toPenalty(100);
        assertEquals(100, p1.getValue());
        Penalty p2 = p1.add(Penalty.toPenalty(50));
        assertEquals(150, p2.getValue());

        p1 = Penalty.toPenalty(0);
        assertEquals(0, p1.getValue());

        p1 = Penalty.INFINITE_PENALTY;
        assertEquals(Integer.MAX_VALUE, p1.getValue());
        assertTrue(p1.isInfinitePenalty());
        p2 = p1.add(p2);
        assertEquals(Integer.MAX_VALUE, p2.getValue());
        assertTrue(p2.isInfinitePenalty());
    }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

        }
        for (int i = count - 1; i >= 0; i--) {
            if (candidates[i] == null) {
                continue;
            }
            Penalty penalty = candidates[i].getConversionPenalty(getRegistry());
            if (penalty.isInfinitePenalty()) {
                continue; //Exclude candidate on infinite penalty
            }
            if (penalty.getValue() <= minPenalty) {
                pipeline = candidates[i];
                minPenalty = penalty.getValue();
            }
        }
        if (log.isDebugEnabled()) {
            log.debug("Chosen pipeline: " + pipeline);
        }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

     * different possible pipelines.
     * @param registry the image implementation registry
     * @return the overall penalty (a non-negative integer)
     */
    public Penalty getConversionPenalty(ImageImplRegistry registry) {
        Penalty penalty = Penalty.ZERO_PENALTY;
        if (loader != null) {
            penalty = penalty.add(loader.getUsagePenalty());
            if (registry != null) {
                penalty = penalty.add(
                        registry.getAdditionalPenalty(loader.getClass().getName()));
            }
        }
        Iterator iter = converters.iterator();
        while (iter.hasNext()) {
            ImageConverter converter = (ImageConverter)iter.next();
            penalty = penalty.add(converter.getConversionPenalty());
            if (registry != null) {
                penalty = penalty.add(
                        registry.getAdditionalPenalty(converter.getClass().getName()));
            }
        }
        return penalty;
    }
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

            //Rebuild edge directory
            DefaultEdgeDirectory dir = new DefaultEdgeDirectory();
            Iterator iter = converters.iterator();
            while (iter.hasNext()) {
                ImageConverter converter = (ImageConverter)iter.next();
                Penalty penalty = Penalty.toPenalty(converter.getConversionPenalty());
                penalty = penalty.add(
                        registry.getAdditionalPenalty(converter.getClass().getName()));
                dir.addEdge(new ImageConversionEdge(converter, penalty));
            }

            converterEdgeDirectoryVersion = registry.getImageConverterModifications();
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

            //Find the best pipeline for each flavor
            ImageProviderPipeline pipeline = newImageConverterPipeline(imageInfo, flavors[i]);
            if (pipeline == null) {
                continue; //No suitable pipeline found for flavor
            }
            Penalty p = pipeline.getConversionPenalty(this.manager.getRegistry());
            if (!p.isInfinitePenalty()) {
                candidates.add(pipeline);
            }
        }
        return (ImageProviderPipeline[])candidates.toArray(
                new ImageProviderPipeline[candidates.size()]);
View Full Code Here

Examples of org.apache.xmlgraphics.image.loader.util.Penalty

     * If no such value is set, 0 is returned.
     * @param className the fully qualified class name of the implementation class
     * @return the additional penalty value
     */
    public Penalty getAdditionalPenalty(String className) {
        Penalty p = (Penalty)this.additionalPenalties.get(className);
        return (p != null ? p : Penalty.ZERO_PENALTY);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.