Skip to content
Snippets Groups Projects
DatabaseDocument.java 93 KiB
Newer Older
  • Learn to ignore specific revisions
  • tjc's avatar
    tjc committed
                               "="+alias.getSynonym().getName());
    
    tjc's avatar
    tjc committed
            }*/
    
    tjc's avatar
    tjc committed
            
            System.out.println(" "); 
    
    tjc's avatar
    tjc committed
          }
    
    tjc's avatar
    tjc committed
        }
        catch(SQLException sqle)
        {
          sqle.printStackTrace();
        }
    
        catch(RuntimeException re)
        {
          re.printStackTrace();
        }
    
    tjc's avatar
    tjc committed
        catch(ConnectException e)
        {
          e.printStackTrace();
        }
    
    tjc's avatar
    tjc committed
      }
    
    
      public Document getParent()
      {
        return null;
      }
    
    tjc's avatar
    tjc committed
      /**
       * Find from a list the FeatureLoc with a given srcFeature
       * @param locs
       * @param srcfeature_id
       * @return
       */
    
      public static FeatureLoc getFeatureLoc(List locs, int srcfeature_id)
      {
        for(int i=0; i<locs.size(); i++)
        {
          FeatureLoc loc = (FeatureLoc)locs.get(i);
          if(loc.getFeatureBySrcFeatureId().getFeatureId() == srcfeature_id)
            return loc;
        }
        return null;
      }
    
    
    
      public String getSrcFeatureId()
      {
        return srcFeatureId;
      }
    
    
    
      private JPasswordField getPfield()
      {
        return pfield;
      }
    
    tjc's avatar
    tjc committed
    
    
      /**
       * Return true if this looks like a single schema postgres
       * database
       * @return
       */
      public boolean isSingleSchema()
      {
        return singleSchema;
      }
    
    tjc's avatar
    tjc committed
      
      /**
       * Ensure exon featurelocs are in the correct order
       */
      class LocationComarator implements Comparator
      {
    
        public int compare(Object o1, Object o2)
        {
          int loc1 = ((FeatureLoc)o1).getFmin().intValue();
          int loc2 = ((FeatureLoc)o2).getFmin().intValue();
          
          if(loc2 == loc1)
            return 0;
          int strand = ((FeatureLoc)o1).getStrand().intValue();
          
          if(strand < 0)
          {
            if(loc2 > loc1)
              return 1;
            else
              return -1;
          }
          else
          {
            if(loc2 > loc1)
              return -1;
            else
              return 1;
          }
    
    tjc's avatar
    tjc committed
        } 
      }
      
      class CvTermThread extends Thread 
      {
        private GmodDAO dao;
        CvTermThread(final GmodDAO dao) 
        {
          this.dao = dao;
        }
    
        public void run() 
        {
          getCvterms(dao);
    
    tjc's avatar
    tjc committed
        }
      }
    
    tjc's avatar
    tjc committed
    
      public void setRange(Range range)
      {
        this.range = range;
      }
    
    tjc's avatar
    tjc committed
    
    
      public Hashtable getIdFeatureStore()
      {
        return idFeatureStore;
      }
    
    
      public boolean isLazyFeatureLoad()
      {
        return lazyFeatureLoad;
      }
    
    
      public void setLazyFeatureLoad(boolean lazyFeatureLoad)
      {
        this.lazyFeatureLoad = lazyFeatureLoad;
      }
    
    tjc's avatar
    tjc committed
    }