What is the 'formal' name of a list that has only one element?
Java Collections
calls this a singleton list, although I don't think this is a formal name.
public static List singletonList(T o) Returns an immutable list containing only the specified object. The returned list is serializable.
I much prefer "single element list".
Edit: It appears that singleton is a valid mathematical term for a single element set.
I would call it a unitList
(to avoid confusion with the Singleton pattern) in mathematics a set containing
only a single element is also known as a unit set
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With