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

gov.nih.nlm.nls.lvg.Db.EuiVector Maven / Gradle / Ivy

The newest version!
package gov.nih.nlm.nls.lvg.Db;
import java.util.*;
import gov.nih.nlm.nls.lvg.Util.*;
/*****************************************************************************
* This class provides a special Collection Vector for eui records.
*
* 

History: *

    *
* * @author NLM NLS Development Team * * @see InflectionRecord * * @version V-2010 ****************************************************************************/ public class EuiVector extends Vector { // public methods /** * Add a new EuiRecord into EuiVector. Combine categories and inflections * if they are same Eui * */ protected void Add(E obj) { EuiRecord newRec = (EuiRecord) obj; boolean existFlag = false; for(int i = 0; i < size(); i++) { EuiRecord rec = (EuiRecord) elementAt(i); if(rec.GetEui().equals(newRec.GetEui()) == true) { int cat = Bit.Add(rec.GetCategory(), newRec.GetCategory()); long infl = Bit.Add(rec.GetInflection(), newRec.GetInflection()); rec.SetCategory(cat); rec.SetInflection(infl); existFlag = true; break; } } if(existFlag == false) { addElement(obj); } } private final static long serialVersionUID = 5L; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy