object

package
v0.0.2-0...-db6250e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: CC0-1.0, CC0-1.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Containser

type Containser interface {
	Contains(x Element) bool // Contains returns true iff x is an element of this parent, or can naturally be regarded as an element of this parent.
}

Containser is the interface satisfied by the Contains method.

type Element

type Element interface {
	fmt.Stringer
	hash.Hasher
	Parent() Parent // Parent returns the parent of this object.
}

Element is the interface satisfied by an object that belongs to a Parent.

func SliceToElementSlice

func SliceToElementSlice(S interface{}) ([]Element, error)

SliceToElementSlice copies the entries of the given slice S, all of which are assumed to satisfy the Element interface, into a new slice of Elements. The new slice will have the same capacity as S. This will return an error if S is not a slice, or if the entries of S do not satisfy the Element interface.

type Parent

type Parent interface {
	fmt.Stringer
	Containser
	ToElement(x Element) (Element, error)        // ToElement returns x as an element of this parent, or an error if x cannot naturally be regarded as an element of this parent.
	AreEqual(x Element, y Element) (bool, error) // AreEqual returns true iff x and y are both contained in the parent, and x = y.
}

Parent is the interface satisfied by an object that has child Elements.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL