github.com/alexandrestein/gods@v1.0.1/sets/sets.go (about)

     1  // Copyright (c) 2015, Emir Pasic. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package sets provides an abstract Set interface.
     6  //
     7  // In computer science, a set is an abstract data type that can store certain values and no repeated values. It is a computer implementation of the mathematical concept of a finite set. Unlike most other collection types, rather than retrieving a specific element from a set, one typically tests a value for membership in a set.
     8  //
     9  // Reference: https://en.wikipedia.org/wiki/Set_%28abstract_data_type%29
    10  package sets
    11  
    12  import "github.com/alexandrestein/gods/containers"
    13  
    14  // Set interface that all sets implement
    15  type Set interface {
    16  	Add(elements ...interface{})
    17  	Remove(elements ...interface{})
    18  	Contains(elements ...interface{}) bool
    19  
    20  	containers.Container
    21  	// Empty() bool
    22  	// Size() int
    23  	// Clear()
    24  	// Values() []interface{}
    25  }