Package edu.jas.ps

Class Coefficients<C extends RingElem<C>>

  • Type Parameters:
    C - ring element type
    All Implemented Interfaces:
    java.io.Serializable

    public abstract class Coefficients<C extends RingElem<C>>
    extends java.lang.Object
    implements java.io.Serializable
    Abstract class for generating functions for coefficients of power series. Was an interface, now this class handles the caching itself.
    Author:
    Heinz Kredel
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.HashMap<java.lang.Integer,​C> coeffCache
      Cache for already computed coefficients.
    • Constructor Summary

      Constructors 
      Constructor Description
      Coefficients()
      Public no arguments constructor.
      Coefficients​(java.util.HashMap<java.lang.Integer,​C> cache)
      Public constructor with pre-filled cache.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract C generate​(int index)
      Generate coefficient.
      C get​(int index)
      Get cached coefficient or generate coefficient.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • coeffCache

        public final java.util.HashMap<java.lang.Integer,​C extends RingElem<C>> coeffCache
        Cache for already computed coefficients.
    • Constructor Detail

      • Coefficients

        public Coefficients()
        Public no arguments constructor.
      • Coefficients

        public Coefficients​(java.util.HashMap<java.lang.Integer,​C> cache)
        Public constructor with pre-filled cache.
        Parameters:
        cache - pre-filled coefficient cache.
    • Method Detail

      • get

        public C get​(int index)
        Get cached coefficient or generate coefficient.
        Parameters:
        index - of requested coefficient.
        Returns:
        coefficient at index.
      • generate

        protected abstract C generate​(int index)
        Generate coefficient.
        Parameters:
        index - of requested coefficient.
        Returns:
        coefficient at index.