Java Collections.synchronizedList Examples

Java Collections.synchronizedList - 30 examples found. These are the top rated real world Java examples of java.util.Collections.synchronizedList extracted from open source projects. You can rate examples to help us improve the quality of examples.
 public RankingModelImpl(Workspace workspace) {
   this.workspace = workspace;
   this.listeners = Collections.synchronizedList(new ArrayList<RankingListener>());
   this.autoRankings = Collections.synchronizedList(new ArrayList<AutoRanking>());
   this.interpolator = Interpolator.LINEAR;
   this.autoTransformer = new RankingAutoTransformer(this);
 }
Example #2
0
  private void hantei() {
    double treeLen = totalTreeLength();
    // if the current tree length is less than the previous minimum tree,
    // then copy the current tree to the min tree
    if (treeLen < minTreeLen) {
      // the current tree is now the minimum tree
      numBetterTreesFound++;
      minTreeLen = treeLen;
      synchronized (this) {
        // copy all the x,y coords and whether they're steiner min nodes
        this.minPoints = Collections.synchronizedList(new ArrayList<Point>());
        for (Point p : this.points) {
          this.minPoints.add(p.copy());
        }

        // update the number of nodes in SMT
        numNodesInSMT = this.points.size();

        // copy over all the edges
        this.minEdges = Collections.synchronizedList(new ArrayList<Edge>());
        for (int i = 0; i < this.points.size() - 1; i++) {
          this.minEdges.add(this.edges.get(i).copy());
        }
      }
      // repaint this em effin' tree
      repaintIfNecessary(true);
    }
  } // hantei
Example #3
0
  /** Default constructor. */
  protected SIPTransactionStack() {
    super();
    this.transactionTableSize = -1;
    // a set of methods that result in dialog creation.
    this.dialogCreatingMethods = new HashSet<String>();
    // Standard set of methods that create dialogs.
    this.dialogCreatingMethods.add(Request.REFER);
    this.dialogCreatingMethods.add(Request.INVITE);
    this.dialogCreatingMethods.add(Request.SUBSCRIBE);
    // Notify may or may not create a dialog. This is handled in
    // the code.
    // Create the transaction collections

    clientTransactions = Collections.synchronizedList(new ArrayList<SIPClientTransaction>());
    serverTransactions = Collections.synchronizedList(new ArrayList<SIPServerTransaction>());
    // Dialog dable.
    this.dialogTable = new Hashtable<String, SIPDialog>();

    clientTransactionTable = new Hashtable<String, SIPTransaction>();
    serverTransactionTable = new Hashtable<String, SIPTransaction>();

    // Start the timer event thread.

    this.timer = new Timer();
    this.pendingRecordScanner = new Thread(new PendingRecordScanner(this));
    this.pendingRecordScanner.setDaemon(true);
    this.pendingTransactions = new HashSet<SIPServerTransaction>();
    pendingRecords = Collections.synchronizedList(new ArrayList<PendingRecord>());
    pendingRecordScanner.setName("PendingRecordScanner");
    pendingRecordScanner.start();
    // endif
    //

  }
 public DataNode(Communicator communicator) {
   super(communicator);
   mapTasks = Collections.synchronizedList(new ArrayList<MapTask>());
   reduceTasks = Collections.synchronizedList(new ArrayList<ReduceTask>());
   jobExecutors = new HashMap<Integer, List<ExecutorService>>();
   mapLock = new ReentrantLock();
   reduceLock = new ReentrantLock();
 }
Example #5
0
 /**
  * Creates a new instance of Sender, a packet sending queue.
  *
  * @param group ThreadGroup of this Session
  * @param socket Connection to the outside world
  */
 public Sender(ThreadGroup group, DatagramSocket socket) {
   super(group, group.getName() + "-Sender");
   m_socket = socket;
   m_packetsSent = 0;
   m_packets = Collections.synchronizedList(new LinkedList<DatagramPacket>());
   m_highPriorityPackets = Collections.synchronizedList(new LinkedList<DatagramPacket>());
   start();
 }
Example #6
0
 private void init(final String groupName, final boolean collapsed) {
   this.groupName = groupName;
   this.collapsed = collapsed;
   this.collapseable = true;
   this.rowMembers = Collections.synchronizedList(new ArrayList<T>());
   this.staticRowMembers = Collections.synchronizedList(new ArrayList<T>());
   this.childGroups = Collections.synchronizedList(new ArrayList<IRowGroup<T>>());
   this.data = new HashMap<String, Object>();
 }