2018-09-18 22:42:38 +02:00
|
|
|
package collections
|
|
|
|
|
2018-10-25 03:30:05 +02:00
|
|
|
import (
|
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/core"
|
|
|
|
"github.com/MontFerret/ferret/pkg/runtime/values"
|
|
|
|
)
|
2018-09-18 22:42:38 +02:00
|
|
|
|
2018-10-25 03:30:05 +02:00
|
|
|
type (
|
|
|
|
Collection interface {
|
|
|
|
Length() values.Int
|
|
|
|
}
|
|
|
|
|
|
|
|
IndexedCollection interface {
|
|
|
|
Collection
|
|
|
|
Get(idx values.Int) core.Value
|
|
|
|
Set(idx values.Int, value core.Value) error
|
|
|
|
}
|
|
|
|
|
|
|
|
KeyedCollection interface {
|
|
|
|
Collection
|
|
|
|
Keys() []string
|
|
|
|
Get(key values.String) (core.Value, values.Boolean)
|
|
|
|
Set(key values.String, value core.Value)
|
|
|
|
}
|
|
|
|
)
|