Package java.util.concurrent

Examples of java.util.concurrent.CopyOnWriteArraySet


     */
    public void addViewUpdateListener(ViewUpdateListener viewUpdateListener) {

        synchronized(viewUpdateListenersSync) {
            if (viewUpdateListeners==null)
                viewUpdateListeners = new CopyOnWriteArraySet();
            viewUpdateListeners.add(viewUpdateListener);
        }
    }
View Full Code Here


   * In separate inner class to avoid runtime dependency on JDK 1.5.
   */
  private static abstract class JdkConcurrentCollectionFactory {

    private static Set createCopyOnWriteArraySet() {
      return new CopyOnWriteArraySet();
    }
View Full Code Here

   * In separate inner class to avoid runtime dependency on JDK 1.5.
   */
  private static abstract class JdkConcurrentCollectionFactory {

    private static Set createCopyOnWriteArraySet() {
      return new CopyOnWriteArraySet();
    }
View Full Code Here

        _delegate.addRoot(corrRoot);
        return corrRoot;
    }
   
    public Set<Join<?,?>> getCorrelatedJoins() {
        return _corrJoins == null ? Collections.emptySet() : new CopyOnWriteArraySet(_corrJoins);
    }
View Full Code Here

   public void addPerInstanceJoinpointAspect(Joinpoint joinpoint, AspectDefinition def)
   {
      Set joinpoints = (Set) perInstanceJoinpointAspectDefinitions.get(def);
      if (joinpoints == null)
      {
         joinpoints = new CopyOnWriteArraySet();
         initPerInstanceJoinpointAspectDefinitionsMap();
         perInstanceJoinpointAspectDefinitions.put(def, joinpoints);
         def.registerAdvisor(this);
      }
      joinpoints.add(joinpoint);
View Full Code Here

   {
      initPerInstanceJoinpointAspectDefinitionsMap();
      Set setJoinpoints = (Set) perInstanceJoinpointAspectDefinitions.get(def);
      if (setJoinpoints == null)
      {
         setJoinpoints = new CopyOnWriteArraySet();
         perInstanceJoinpointAspectDefinitions.put(def, setJoinpoints);
         def.registerAdvisor(this);
      }
      setJoinpoints.addAll(joinpoints);
   }
View Full Code Here

         lockWrite();
         try
         {
            if (perInstanceAspectDefinitions == UnmodifiableEmptyCollections.EMPTY_COPYONWRITE_ARRAYSET)
            {
               perInstanceAspectDefinitions = new CopyOnWriteArraySet();
            }
         }
         finally
         {
            unlockWrite();
View Full Code Here

        _delegate.addRoot(corrRoot);
        return corrRoot;
    }
   
    public Set<Join<?,?>> getCorrelatedJoins() {
        return _corrJoins == null ? Collections.emptySet() : new CopyOnWriteArraySet(_corrJoins);
    }
View Full Code Here

    //TODO: Use the much better-written MusicPanel populateDropdownBox to refactor this mess
    @Override
    protected void populateDropdownBox()
    {
        currentDropdown.removeAllItems();
        Set heroList = new CopyOnWriteArraySet();
        //Build list of heroes and populate dropwdown with it               
        File file = new File(vpkPath);
        VPKArchive vpk = new VPKArchive();

        System.out.println(file);

        try
        {
            vpk.load(file);
        }
        catch (Exception ex)
        {
            System.err.println("Can't open archive: " + ex.getMessage());
            return;
        }

        for (VPKEntry entry : vpk.getEntries())
        {
            if (entry.getPath().contains("scripts/game_sounds_heroes/"))
            {
                heroList.add(entry.getName());
            }
        }
        //Format and prettify hero list
        for (Object hero : heroList)
        {
            String heroString = hero.toString();
            heroString = heroString.replace("game_sounds_", "");
            NamedHero tempNamedHero = new NamedHero(heroString);
            heroList.remove(hero);
            heroList.add(tempNamedHero);
        }
        Object[] heroListArray = heroList.toArray();
        Arrays.sort(heroListArray);
        for (Object h : heroListArray)
        {
            NamedHero tempHero = (NamedHero) h;
            currentDropdown.addItem(tempHero);
View Full Code Here

   /**
    * Defines the concurrent set implementation
    */
   public static final Set createCopyOnWriteSet()
   {
      return new CopyOnWriteArraySet();
   }
View Full Code Here

TOP

Related Classes of java.util.concurrent.CopyOnWriteArraySet

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.