Package org.apache.commons.collections4

Examples of org.apache.commons.collections4.Transformer


            }

            vv.setBackground(Color.WHITE);


            Transformer labelTransformer = new ChainedTransformer<String, String>(new Transformer[]{
                        new ToStringLabeller<Node>() {

                            public String transform(Node v) {
                                return v.getLabel();
                                //return ((primitives.graph.Node)(v.getVertex())).getLabel();
View Full Code Here


    DirectedSparseGraph result = new DirectedSparseGraph();

     if ( model instanceof ChainedTransformer)
     {
       Transformer[] transformers = ((ChainedTransformer) model).getTransformers();
       Transformer lastTransformer = null;
       int counter = 0;
       for ( Transformer transformer: transformers)
       {
         result.addVertex(transformer);
         if ( lastTransformer != null)
View Full Code Here

            edgesWeigth.put(edgeName, Util.stringToInteger(columns[4]));

            graphMulti.addEdge(edgeName, commiter1, commiter2, type);
        }

        Transformer trans = createWeigthTransformer(graphMulti, edgesWeigth);

        BetweennessCentrality<String, String> btwGen = new BetweennessCentrality<>(graphMulti, trans);
        ClosenessCentrality<String, String> clsGen = new ClosenessCentrality<>(graphMulti, trans);
        DegreeScorer<String> dgrGen = new DegreeScorer<>(graphMulti);
View Full Code Here

  }

  //loads the files and removes words which occur less than 5 tims
  public void loadProgram() throws FileNotFoundException
  {
    Bag wordBag = new HashBag();

    //Load all the medical files in the directory
    File[] fileList = new File(recordsDir).listFiles();
    for (int i = 0; i<fileList.length; i++) {
      loadFile(fileList[i].toString(), wordBag);
    }

    //dump bag into frequent who appear in 5 or more medical records
    for (Object obj : wordBag.uniqueSet()) {
      if (wordBag.getCount(obj) > 4){
        frequent.add((String)obj);
      }
    }

  }
View Full Code Here

     * @param object  the input object
     * @return never
     * @throws FunctorException always
     */
    public boolean evaluate(final T object) {
        throw new FunctorException("ExceptionPredicate invoked");
    }
View Full Code Here

     *
     * @return never
     * @throws FunctorException always
     */
    public T create() {
        throw new FunctorException("ExceptionFactory invoked");
    }
View Full Code Here

        public T create() {
            try {
                return clazz.newInstance();
            } catch (final Exception ex) {
                throw new FunctorException("Cannot instantiate class: " + clazz, ex);
            }
        }
View Full Code Here

        try {
            final Class<?> cls = input.getClass();
            final Method method = cls.getMethod(iMethodName, iParamTypes);
            return (O) method.invoke(input, iArgs);
        } catch (final NoSuchMethodException ex) {
            throw new FunctorException("InvokerTransformer: The method '" + iMethodName + "' on '" +
                                       input.getClass() + "' does not exist");
        } catch (final IllegalAccessException ex) {
            throw new FunctorException("InvokerTransformer: The method '" + iMethodName + "' on '" +
                                       input.getClass() + "' cannot be accessed");
        } catch (final InvocationTargetException ex) {
            throw new FunctorException("InvokerTransformer: The method '" + iMethodName + "' on '" +
                                       input.getClass() + "' threw an exception", ex);
        }
    }
View Full Code Here

     * @param input  the input object to transform
     * @return never
     * @throws FunctorException always
     */
    public O transform(final I input) {
        throw new FunctorException("ExceptionTransformer invoked");
    }
View Full Code Here

     *
     * @param input  the input object
     * @throws FunctorException always
     */
    public void execute(final E input) {
        throw new FunctorException("ExceptionClosure invoked");
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections4.Transformer

Copyright © 2018 www.massapicom. 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.