Skip to main content
1 of 2
Jay Wick
  • 385
  • 2
  • 10

What data type is this?

I have a list of items I am adding to, however this special list will delete anything past a given capacity.

For the life of me, I can't think of the name of such a construct.

Consider

data = new SpecialListType(3); // set capacity to 3

data.Add("A");
data.Add("B");
data.Add("C");
data.Add("D");

data.Dump(); // returns {"B", "C", "D"}

What is this? Some form of a Set or Buffer? And is there a framework implementation of this in Java and .NET?

Jay Wick
  • 385
  • 2
  • 10