Package edu.jas.poly

Class WordPolyIterator<C extends RingElem<C>>

  • All Implemented Interfaces:
    java.util.Iterator<WordMonomial<C>>

    public class WordPolyIterator<C extends RingElem<C>>
    extends java.lang.Object
    implements java.util.Iterator<WordMonomial<C>>
    Iterator over monomials of a polynomial. Adaptor for val.entrySet().iterator().
    Author:
    Heinz Kredel
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Iterator<java.util.Map.Entry<Word,​C>> ms
      Internal iterator over polynomial map.
    • Constructor Summary

      Constructors 
      Constructor Description
      WordPolyIterator​(java.util.SortedMap<Word,​C> m)
      Constructor of polynomial iterator.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Test for availability of a next monomial.
      WordMonomial<C> next()
      Get next monomial element.
      void remove()
      Remove the last monomial returned from underlying set if allowed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • ms

        protected final java.util.Iterator<java.util.Map.Entry<Word,​C extends RingElem<C>>> ms
        Internal iterator over polynomial map.
    • Constructor Detail

      • WordPolyIterator

        public WordPolyIterator​(java.util.SortedMap<Word,​C> m)
        Constructor of polynomial iterator.
        Parameters:
        m - SortetMap of a polynomial.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Test for availability of a next monomial.
        Specified by:
        hasNext in interface java.util.Iterator<C extends RingElem<C>>
        Returns:
        true if the iteration has more monomials, else false.
      • next

        public WordMonomial<Cnext()
        Get next monomial element.
        Specified by:
        next in interface java.util.Iterator<C extends RingElem<C>>
        Returns:
        next monomial.
      • remove

        public void remove()
        Remove the last monomial returned from underlying set if allowed.
        Specified by:
        remove in interface java.util.Iterator<C extends RingElem<C>>