All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hfg.bio.seq.format.feature.SeqFeatureImpl Maven / Gradle / Ivy

There is a newer version: 20240423
Show newest version
package com.hfg.bio.seq.format.feature;


import com.hfg.util.collection.CollectionUtil;

import java.util.ArrayList;
import java.util.List;

public abstract class SeqFeatureImpl implements SeqFeature
{
   private FeatureKey       mName;
   private SeqFeatureLocation mLocation;
   private List mQualifiers;

   //---------------------------------------------------------------------------
   public SeqFeatureImpl(FeatureKey inName, SeqFeatureLocation inLocation)
   {
      mName = inName;
      mLocation = inLocation;
   }

   //---------------------------------------------------------------------------
   public FeatureKey name()
   {
      return mName;
   }

   //---------------------------------------------------------------------------
   public SeqFeatureLocation getLocation()
   {
      return mLocation;
   }

   //---------------------------------------------------------------------------
   public SeqFeature addQualifier(FeatureQualifier inValue)
   {
      if (null == mQualifiers)
      {
         mQualifiers = new ArrayList(25);
      }

      mQualifiers.add(inValue);

      return this;
   }

   //---------------------------------------------------------------------------
   public List getQualifiers()
   {
      return mQualifiers;
   }

   //---------------------------------------------------------------------------
   public List getQualifiers(String inQualifierName)
   {
      List qualifiers = null;

      if (CollectionUtil.hasValues(mQualifiers))
      {
         for (FeatureQualifier qualifier : mQualifiers)
         {
            if (qualifier.name().equals(inQualifierName))
            {
               if (null == qualifiers)
               {
                  qualifiers = new ArrayList(25);
               }

               qualifiers.add(qualifier);
            }
         }
      }

      return qualifiers;
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy