Package project.gluebooster.events

Examples of project.gluebooster.events.PropertyChangeEventSourceByFunction


   public void testSimpleGraph() throws Exception
   {
      //The graph are 2 successive square functions
     
      BigDecimalUnaryOperation/*<BigDecimal>*/ squareFunction1 = new BigDecimalUnaryOperation(BigDecimalUnaryOperation.Operation.squared);
      PropertyChangeEventSourceByFunction squareEventSource1 = new PropertyChangeEventSourceByFunction("first", squareFunction1);
      Implements3<Predicate, HasPropertyChangeListener, Flushable> squareVertex1 = new Implements3<Predicate, HasPropertyChangeListener, Flushable>(squareEventSource1);
      squareEventSource1.setEventSource(squareVertex1);
     
      BoostRef edge1 = new BoostRef();
     
      BigDecimalUnaryOperation/*<BigDecimal>*/ squareFunction2 = new BigDecimalUnaryOperation(BigDecimalUnaryOperation.Operation.squared);
      PropertyChangeEventSourceByFunction squareEventSource2 = new PropertyChangeEventSourceByFunction("second", squareFunction2);
      Implements3<Predicate, HasPropertyChangeListener, Flushable> squareVertex2 = new Implements3<Predicate, HasPropertyChangeListener, Flushable>(squareEventSource2);
      squareEventSource2.setEventSource(squareVertex2);


     DirectedSparseGraph<Implements3<Predicate, HasPropertyChangeListener, Flushable>, BoostRef> graph = new DirectedSparseGraph<Implements3<Predicate, HasPropertyChangeListener, Flushable>, BoostRef>();
     graph.addVertex(squareVertex1);
     graph.addVertex(squareVertex2);
View Full Code Here


   public void testSimpleGraph2() throws Exception
   {
      //The graph are 3 successive square functions
     
      BigDecimalUnaryOperation/*<BigDecimal>*/ squareFunction1 = new BigDecimalUnaryOperation(BigDecimalUnaryOperation.Operation.squared);
      PropertyChangeEventSourceByFunction squareEventSource1 = new PropertyChangeEventSourceByFunction("first", squareFunction1);
      Implements3<Predicate, HasPropertyChangeListener, Flushable> squareVertex1 = new Implements3<Predicate, HasPropertyChangeListener, Flushable>(squareEventSource1);
      squareEventSource1.setEventSource(squareVertex1);
     
      BoostRef edge1 = new BoostRef(true);
     
     
      BigDecimalUnaryOperation/*<BigDecimal>*/ squareFunction2 = new BigDecimalUnaryOperation(BigDecimalUnaryOperation.Operation.squared);
      PropertyChangeEventSourceByFunction squareEventSource2 = new PropertyChangeEventSourceByFunction("second", squareFunction2);
      Implements3<Predicate, HasPropertyChangeListener, Flushable> squareVertex2 = new Implements3<Predicate, HasPropertyChangeListener, Flushable>(squareEventSource2);
      squareEventSource2.setEventSource(squareVertex2);

      BoostRef edge2 = new BoostRef(true);
     
      BigDecimalUnaryOperation/*<BigDecimal>*/ squareFunction3 = new BigDecimalUnaryOperation(BigDecimalUnaryOperation.Operation.squared);
      PropertyChangeEventSourceByFunction squareEventSource3 = new PropertyChangeEventSourceByFunction("third", squareFunction3);
      Implements3<Predicate, HasPropertyChangeListener, Flushable> squareVertex3 = new Implements3<Predicate, HasPropertyChangeListener, Flushable>(squareEventSource3);
      squareEventSource3.setEventSource(squareVertex3);

     DirectedSparseGraph<Implements3<Predicate, HasPropertyChangeListener, Flushable>, BoostRef> graph = new DirectedSparseGraph<Implements3<Predicate, HasPropertyChangeListener, Flushable>, BoostRef>();
     graph.addVertex(squareVertex1);
     graph.addVertex(squareVertex2);
     graph.addVertex(squareVertex3);
View Full Code Here

        //AssemblingPropertyChangeEventSourceByFunction TODO use this event source in case of Futures
        Implements4<Predicate, HasPropertyChangeListener, Flushable, HasEventSource> vertex;
        if ( function instanceof Future)
          vertex = new Implements4<Predicate, HasPropertyChangeListener, Flushable, HasEventSource>(new AssemblingPropertyChangeEventSourceByFunction(function));
        else
          vertex = new Implements4<Predicate, HasPropertyChangeListener, Flushable, HasEventSource>(new PropertyChangeEventSourceByFunction( function));
        if (function instanceof HasInternalInformation)
           vertex.setInternalInformation( ((HasInternalInformation) function).getInternalInformation());
        vertex.as4().setEventSource(vertex);
        newGraph.addVertex(vertex);
View Full Code Here

TOP

Related Classes of project.gluebooster.events.PropertyChangeEventSourceByFunction

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.