Skip to content

Instantly share code, notes, and snippets.

@sebersole
Created June 10, 2018 14:25
Show Gist options
  • Save sebersole/2b4bdf3fd05d02e086d5f6eedf7aa37f to your computer and use it in GitHub Desktop.
Save sebersole/2b4bdf3fd05d02e086d5f6eedf7aa37f to your computer and use it in GitHub Desktop.
CollectionSemantics contract
public interface CollectionSemantics<C> {
/**
* Get the classification of collections described by this semantic
*/
CollectionClassification getCollectionClassification();
C instantiateRaw(int anticipatedSize);
Iterator getElementIterator(C rawCollection);
void visitElements(C rawCollection, Consumer action);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment