Package edu.jas.gb

Class WordPair<C extends RingElem<C>>

java.lang.Object
edu.jas.gb.WordPair<C>
Type Parameters:
C - coefficient type
All Implemented Interfaces:
Comparable<WordPair>

public class WordPair<C extends RingElem<C>> extends Object implements Comparable<WordPair>
Serializable subclass to hold pairs of word polynomials.
  • Field Details

  • Constructor Details

    • WordPair

      public WordPair(GenWordPolynomial<C> a, GenWordPolynomial<C> b, int i, int j)
      WordPair constructor.
      Parameters:
      a - word polynomial i.
      b - word polynomial j.
      i - first index.
      j - second index.
  • Method Details

    • toString

      public String toString()
      toString.
      Overrides:
      toString in class Object
    • pairNumber

      public void pairNumber(int n)
      Set removed pair number.
      Parameters:
      n - number of this pair generated in OrderedPairlist.
    • getPairNumber

      public int getPairNumber()
      Get removed pair number.
      Returns:
      n number of this pair generated in OrderedPairlist.
    • equals

      public boolean equals(Object ob)
      equals.
      Overrides:
      equals in class Object
      Parameters:
      ob - an Object.
      Returns:
      true if this is equal to o, else false.
    • compareTo

      public int compareTo(WordPair p)
      compareTo used in TreeMap // not used at moment. Comparison is based on the number of the pairs.
      Specified by:
      compareTo in interface Comparable<C extends RingElem<C>>
      Parameters:
      p - a WordPair.
      Returns:
      1 if (this < o), 0 if (this == o), -1 if (this > o).
    • hashCode

      public int hashCode()
      Hash code for this WordPair.
      Overrides:
      hashCode in class Object
      See Also: