Class AlignmentMap<T>

java.lang.Object
ca.phon.alignment.AlignmentMap<T>
Direct Known Subclasses:
PhoneMap, SyllableMap

public class AlignmentMap<T> extends Object
Represents alignments between two arrays of similar objects.
  • Field Details

    • INDEL_VALUE

      public static final int INDEL_VALUE
      The value for an indel
      See Also:
    • SPACER_VALUE

      public static final int SPACER_VALUE
      The value for a spacer
      See Also:
    • topElements

      protected T[] topElements
      The 'top' list of elements to align
    • bottomElements

      protected T[] bottomElements
      The 'bottom' list of elements to align
    • topAlignment

      protected Integer[] topAlignment
      The 'top' alignment values
    • bottomAlignment

      protected Integer[] bottomAlignment
      The 'bottom' alignment values
  • Constructor Details

    • AlignmentMap

      public AlignmentMap()
      Constructor
  • Method Details

    • getBottomAlignment

      public Integer[] getBottomAlignment()
      Get the value of the bottom alignment
    • setBottomAlignment

      public void setBottomAlignment(Integer[] bottomAlignment)
      Set the bottom alignment
    • getBottomElements

      public T[] getBottomElements()
      Get the bottom elements
    • setBottomElements

      public void setBottomElements(T[] bottomElements)
      Set the bottom elements
    • getTopAlignment

      public Integer[] getTopAlignment()
      Get the top alignment
    • setTopAlignment

      public void setTopAlignment(Integer[] topAlignment)
      Set the top alignment
    • getTopElements

      public T[] getTopElements()
      Get the top elements
    • setTopElements

      public void setTopElements(T[] topElements)
      Set the top elements
    • getAligned

      public List<T> getAligned(T[] eles)
    • getAligned

      public List<T> getAligned(Iterable<T> iterable)
      Return the list of object that are aligned with the given iterable list of object.
      Parameters:
      eles -
      Returns:
      aligned lements
    • getAligned

      public List<T> getAligned(List<T> eles)
      Return the list of objects that are aligned with the given list of objects. This method does not return null values for indel/spacers.
      Parameters:
      eles -
      Returns:
      aligned elements
    • getAlignedElement

      public Optional<T> getAlignedElement(T ele)
      Get the element aligned with the given element.
      Parameters:
      ele -
      Returns:
      element (if present)
    • getTopAlignmentElements

      public List<T> getTopAlignmentElements()
      Get the top alignment as an array of elements
    • getBottomAlignmentElements

      public List<T> getBottomAlignmentElements()
      Get the bottom alignment as an array of elements
    • getAlignmentLength

      public int getAlignmentLength()
      Returns the length of the alignment.
      Returns:
      int
    • getAlignedElements

      public List<T> getAlignedElements(int alignmentIndex)
      Returns the set of aligned elements at the given alignment position.
      Parameters:
      alignmentIndex -
      Returns:
      T[0] the top alignment element, T[1] the bottom alignment element