Examples of ByteArrayHashMap


Examples of org.gudy.azureus2.core3.util.ByteArrayHashMap

     
      boolean  got_new_or_changed_result  = false;
     
      SubscriptionResultImpl[] existing_results = manager.loadResults( subs );
         
      ByteArrayHashMap  result_key_map   = new ByteArrayHashMap();
      ByteArrayHashMap  result_key2_map = new ByteArrayHashMap();
     
      List  new_results = new ArrayList();

      for (int i=0;i<existing_results.length;i++){
       
        SubscriptionResultImpl r = existing_results[i];
       
        result_key_map.put( r.getKey1(), r );
       
        byte[]  key2 = r.getKey2();
       
        if ( key2 != null ){
         
          result_key2_map.put( key2, r );
        }
       
        new_results.add( r );
       
        if ( !r.isDeleted()){
         
          if ( r.getRead()){
           
            new_read++;
           
          }else{
           
            new_unread++;
          }
        }
      }
           
      for (int i=0;i<latest_results.length;i++){

        SubscriptionResultImpl r = latest_results[i];
       
          // we first of all insist on names uniqueness
       
        SubscriptionResultImpl existing = (SubscriptionResultImpl)result_key_map.get( r.getKey1());
       
        if ( existing == null ){
         
            // only if non-unique name do we fall back and use UID to remove duplicate
            // entries where the name has changed
         
          byte[]  key2 = r.getKey2();
         
          if ( key2 != null ){
           
            existing = (SubscriptionResultImpl)result_key2_map.get( key2 );
          }
        }
       
        if ( existing == null ){
         
          last_new_result = now;
         
          new_results.add( r );
         
          result_key_map.put( r.getKey1(), r );
         
          byte[]  key2 = r.getKey2();
         
          if ( key2 != null ){
           
            result_key2_map.put( key2, r );
          }
         
          got_new_or_changed_result = true;
       
          if ( r.getRead()){
View Full Code Here

Examples of org.gudy.azureus2.core3.util.ByteArrayHashMap

  public void
  deleteResults(
    String[] result_ids )
  {
    ByteArrayHashMap rids = new ByteArrayHashMap();
   
    for (int i=0;i<result_ids.length;i++){
     
      rids.put( Base32.decode( result_ids[i]), "" );
    }
 
    boolean  changed = false;

    synchronized( this ){
       
      SubscriptionResultImpl[] results = manager.loadResults( subs );

      for (int i=0;i<results.length;i++){
       
        SubscriptionResultImpl result = results[i];
       
        if ( !result.isDeleted() && rids.containsKey( result.getKey1())){
         
          changed = true;
         
          result.deleteInternal();
        }
View Full Code Here

Examples of org.gudy.azureus2.core3.util.ByteArrayHashMap

  public void
  markResults(
    String[]     result_ids,
    boolean[]    reads )
  {
    ByteArrayHashMap rid_map = new ByteArrayHashMap();
   
    for (int i=0;i<result_ids.length;i++){
     
      rid_map.put( Base32.decode( result_ids[i]), new Boolean( reads[i] ));
    }
 
    boolean  changed = false;

    List  newly_unread = new ArrayList();
   
    synchronized( this ){
           
      SubscriptionResultImpl[] results = manager.loadResults( subs );

      for (int i=0;i<results.length;i++){
       
        SubscriptionResultImpl result = results[i];
       
        if ( result.isDeleted()){
         
          continue;
        }
       
        Boolean  b_read = (Boolean)rid_map.get( result.getKey1());
       
        if ( b_read != null ){
         
          boolean  read = b_read.booleanValue();
         
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.