com.hfg.bio.seq.format.feature.SeqFeatureImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
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;
}
}