Just to add to the excellent answer above, concerning Shakespeare's Hamlet, we might be tempted to condemn Hamlet for his cruelty to Ophelia under any circumstances, if we look at Hamlet's behavior from our modern, contemporary perspective. But we should remember that Shakespeare is only a couple of generations removed from Henry VIII.
Hamlet is a prince, heir to the throne. The setting is Denmark, of course, but Shakespeare is English. Hamlet possesses the power and authority to do just about anything he wants. And he is certainly living in a patriarchal society.
Hamlet's treatment of Ophelia is nasty, at best, to us, but probably would have not been so to Shakespeare's audience. And at least he didn't chop off her head.
Hamlet's ranting at Ophelia in Act 3, scene 1, leaves many readers feeling cold toward Hamlet. However, I think, his treatment of her may be understandable, if not justified. She is acting as a pawn for her father Polonius who is trying to curry favor with the king. She knowingly is part of a trap to eavesdrop on Hamlet. She begins the meeting with Hamlet by giving back the tokens of his affection that he had given to her. I'm not sure that many men would react to this statement in a positive way. Hamlet reacts with hurt and surprise, but he quickly surmises when he asks Ophelia where her father is that they are not alone. How he determines that Claudius and Polonius are eavesdropping is not clear, but I'd like to believe that when he asks Ophelia where her father is, Ophelia, unaccomstomed to lying, inadvertantly glances toward her enclaved father, revealing both spies.
So much of Hamlet's accompanying tirade is meant for the ears of Polonius and Claudius, not Ophelia. What Hamlet tells Ophelia several times is "Farewell, get thee to a nunnery." His repetition of this line throughout this scene shows his sincerity. He truly wants her away from the corruptions of the court, and he is telling her goodbye, that their relationship is over.
He cannot attempt to reconcile with a woman whose first allegiance is to her father, a crony of the king. If Hamlet is to be successful in his revenge against Claudius, a relationship with Ophelia is impossible. Hamlet is frustrated, hurt, angry, and tense. But he is also very smart, and in this case, he is right in his decision. This scene is quite poignant in that we see how the poor decisions of the older generation affect the relationships of the younger generation.