Wesley Hill
Wesley Hill

Reputation: 1819

What would you call a collection class which represents a set but where the order matters?

A collection that can have duplicates and where the order matters is called a List.
A collection that can have duplicates and where the order doesn't matter is called a Bag.
A collection that cannot have duplicates and where the order doesn't matter is called a Set.

What then for the fourth combination; what would you call the class of collection that cannot have duplicates and where the order matters?

If you can link to an example of your suggested name (the more widely-used the better), please do so.

Upvotes: 0

Views: 112

Answers (2)

skaffman
skaffman

Reputation: 403491

How about List-Ordered Set.

Example: Java's Apache Commons Collections library (class docs) (now obsolete since Java introduced its own LinkedHashSet class).

Upvotes: 0

Tudor Constantin
Tudor Constantin

Reputation: 26861

I would name it an ordered set

Upvotes: 2

Related Questions