github.com/mymmsc/gox@v1.3.33/util/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 util
    11  
    12  // Set interface that all sets implement
    13  type Set interface {
    14  	Add(elements ...interface{})
    15  	Remove(elements ...interface{})
    16  	Contains(elements ...interface{}) bool
    17  
    18  	Container
    19  	// Empty() bool
    20  	// Size() int
    21  	// Clear()
    22  	// Values() []interface{}
    23  }