Adsorbed and Grafted Polymers at Equilibrium