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

edu.jas.poly.OverlapList Maven / Gradle / Ivy

The newest version!
/*
 * $Id: OverlapList.java 4149 2012-09-01 09:01:54Z kredel $
 */

package edu.jas.poly;


import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;


/**
 * Container for lists of overlap words.
 * List of Overlaps.
 * @author Heinz Kredel
 */

public class OverlapList implements Serializable {

    public final List ols;


    /**
     * Constructor.
     */
    public OverlapList() {
        ols = new ArrayList();
    }


    /**
     * Add to list.
     */
    public void add(Overlap ol) {
        ols.add(ol);
    }


    /**
     * Get the string representation.
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return ols.toString();
    }


    /**
     * Is word overlap list.
     * @param u word
     * @param v word
     * @return true if l1 * u * r1 = l2 * v * r2 for all overlaps, else false.
     */
    public boolean isOverlap(Word u, Word v) {
        for (Overlap ol : ols ) {
            if ( !ol.isOverlap(u,v) ) {
                return false;
            }
        }
        return true;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy