github.com/MontFerret/ferret@v0.18.0/pkg/runtime/collections/collection.go (about)

     1  package collections
     2  
     3  import (
     4  	"github.com/MontFerret/ferret/pkg/runtime/core"
     5  	"github.com/MontFerret/ferret/pkg/runtime/values"
     6  )
     7  
     8  type (
     9  	// Measurable represents an interface of a value that can has length.
    10  	Measurable interface {
    11  		Length() values.Int
    12  	}
    13  
    14  	IndexedCollection interface {
    15  		core.Value
    16  		Measurable
    17  		Get(idx values.Int) core.Value
    18  		Set(idx values.Int, value core.Value) error
    19  	}
    20  
    21  	KeyedCollection interface {
    22  		core.Value
    23  		Measurable
    24  		Keys() []values.String
    25  		Get(key values.String) (core.Value, values.Boolean)
    26  		Set(key values.String, value core.Value)
    27  	}
    28  )