Examples of SourceTime


Examples of org.graphstream.stream.sync.SourceTime

  this.workspace = workspace;
  this.sourceId = String.format("<Gephi json stream %x>",
    System.nanoTime());
  this.debug = false;

  this.sourceTime = new SourceTime(this.sourceId);
  currentStream = new ThreadProxyPipe();
  init();
  start();
    }
View Full Code Here

Examples of org.graphstream.stream.sync.SourceTime

        + ((int) (Math.random() * 1000))));
  }

  protected SourceBase(String sourceId) {
    this.sourceId = sourceId;
    this.sourceTime = new SourceTime(sourceId);
  }
View Full Code Here

Examples of org.graphstream.stream.sync.SourceTime

  }

  @Test
  public void testSync() {
    TestSinkTime tst = new TestSinkTime();
    SourceTime st = new SourceTime("test");

    if (tst.isSynchEnable()) {
      System.err.printf("sync is enable%n");

      assertTrue(tst.isNewEvent(st.getSourceId(), st.newEvent()));
      assertTrue(tst.isNewEvent(st.getSourceId(), st.newEvent()));
      assertTrue(tst.isNewEvent(st.getSourceId(), st.newEvent()));

      long timeId = st.newEvent();

      assertTrue(tst.isNewEvent(st.getSourceId(), timeId));
      assertFalse(tst.isNewEvent(st.getSourceId(), timeId));
    } else {
      System.err.printf("sync is disable%n");

      assertTrue(tst.isNewEvent(st.getSourceId(), st.newEvent()));
      assertTrue(tst.isNewEvent(st.getSourceId(), st.newEvent()));
      assertTrue(tst.isNewEvent(st.getSourceId(), st.newEvent()));

      long timeId = st.newEvent();

      assertTrue(tst.isNewEvent(st.getSourceId(), timeId));
      assertTrue(tst.isNewEvent(st.getSourceId(), timeId));
    }
  }
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.