Revisiting Contrastive Learning through the Lens of Neighborhood Component Analysis: an Integrated Framework