Android Open Source - DIYgenomics_Android Mapping Item






From Project

Back to project page DIYgenomics_Android.

License

The source code is released under:

/** * Copyright (C) 2010 DIYgenomics diygenomics.org * Copyright (C) 2010 Melanie Swan mxswan@gmail * Copyright (C) 2010 Michael Kolb * Copyright (C) 2010 Lawrence S. Wong * All rights reserved. * * M...

If you think the Android project DIYgenomics_Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.diygenomics.pg;
/* www .  ja  v  a2s.c o m*/
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;


@SuppressWarnings("serial")
public class MappingItem implements Serializable {

  public String item;
  private Variant mVariant;
  private int mVariantIndex;

  public HashMap<String,ArrayList<Study>> companyRefs;
  
  public MappingItem(String catitem, int variantIndex, Variant variant) {
    item = catitem;
    mVariant = variant;
    companyRefs = new HashMap<String,ArrayList<Study>>();
    mVariantIndex = variantIndex;
  }
  
  public ArrayList<String> getCompanies() {
    ArrayList<String> res = new ArrayList<String>(6);
    for (String comp : companyRefs.keySet()) {
      res.add(comp);
    }
    return res;
  }
  
  public void addCompanyStudy(String company, Study study) {
    ArrayList<Study> slist = companyRefs.get(company);
    if (slist == null) {
      slist = new ArrayList<Study>();
      companyRefs.put(company,slist);
    }
    slist.add(study);
  }

  public int getVariantIndex() {
    return mVariantIndex;
  }
  
  public Variant getVariant() {
    return mVariant;
  }

  public boolean hasStudy(String company) {
    return (companyRefs.get(company) != null);
  }
  
  public boolean hasCompanyStudy(String company, Study study) {
    ArrayList<Study> sts = companyRefs.get(company);
    if (sts != null) {
      return sts.contains(study);
    }
    return false;
  }
  
  public int getCompanyStudiesCount(String company) {
    ArrayList<Study> sts = companyRefs.get(company);
    if (sts != null) {
      return sts.size();
    } else {
      return 0;
    }
  }
  
  
}




Java Source Code List

android.widget.BasicExpandableList.java
android.widget.BasicListView.java
org.diygenomics.pg.CategoriesActivity.java
org.diygenomics.pg.CategoryItemActivity.java
org.diygenomics.pg.Category.java
org.diygenomics.pg.Constants.java
org.diygenomics.pg.Data.java
org.diygenomics.pg.DotUtils.java
org.diygenomics.pg.Genome.java
org.diygenomics.pg.ImportActivity.java
org.diygenomics.pg.InfoHandler.java
org.diygenomics.pg.Main.java
org.diygenomics.pg.MappingItem.java
org.diygenomics.pg.StudiesActivity.java
org.diygenomics.pg.Study.java
org.diygenomics.pg.Variant.java
org.diygenomics.pg.utils.CSVParser.java
org.diygenomics.pg.utils.ConditionVariantTableRowComparator.java
org.diygenomics.pg.utils.Flurry.java
org.diygenomics.pg.utils.MLog.java
org.diygenomics.pg.utils.Row.java