001/* 002 * $Id$ 003 */ 004 005package edu.jas.gb; 006 007 008import edu.jas.poly.GenPolynomial; 009import edu.jas.structure.RingElem; 010 011 012/** 013 * Container for a polynomial and its signature. 014 * @typeparam <C> coefficient type 015 */ 016public class SigPoly<C extends RingElem<C>> { 017 018 019 public final GenPolynomial<C> sigma; 020 021 022 public final GenPolynomial<C> poly; 023 024 025 /** 026 * Constructor. 027 * @param s a polynomial signature. 028 * @param p a polynomial. 029 */ 030 public SigPoly(GenPolynomial<C> s, GenPolynomial<C> p) { 031 this.sigma = s; 032 this.poly = p; 033 } 034 035 036 /** 037 * getter for sigma 038 */ 039 GenPolynomial<C> getSigma() { 040 return sigma; 041 } 042 043 044 /** 045 * getter for polynomial 046 */ 047 GenPolynomial<C> getPoly() { 048 return poly; 049 } 050 051 052 /** 053 * Get the String representation. 054 * @see java.lang.Object#toString() 055 */ 056 @Override 057 public String toString() { 058 StringBuffer s = new StringBuffer("sigma("); 059 s.append(sigma.toString() + "):: "); 060 s.append(poly.toString()); 061 return s.toString(); 062 } 063 064}