A synecdoche is a figure of speech in which a term for a part of something refers to the whole of something or vice versa.