- update documentation and comments

pull/88/head
emirpasic 7 years ago
parent a6e6101bb0
commit 17852f48a5

@ -94,6 +94,7 @@ type List interface {
Sort(comparator utils.Comparator) Sort(comparator utils.Comparator)
Swap(index1, index2 int) Swap(index1, index2 int)
Insert(index int, values ...interface{}) Insert(index int, values ...interface{})
Set(index int, value interface{})
containers.Container containers.Container
// Empty() bool // Empty() bool

@ -189,7 +189,7 @@ func TestListSet(t *testing.T) {
if actualValue := list.Size(); actualValue != 3 { if actualValue := list.Size(); actualValue != 3 {
t.Errorf("Got %v expected %v", actualValue, 3) t.Errorf("Got %v expected %v", actualValue, 3)
} }
list.Set(4, "d") // ignore list.Set(4, "d") // ignore
list.Set(1, "bb") // update list.Set(1, "bb") // update
if actualValue := list.Size(); actualValue != 3 { if actualValue := list.Size(); actualValue != 3 {
t.Errorf("Got %v expected %v", actualValue, 3) t.Errorf("Got %v expected %v", actualValue, 3)

@ -293,7 +293,7 @@ func (list *List) Insert(index int, values ...interface{}) {
} }
} }
// Sets value at specified index position // Set value at specified index position
// Does not do anything if position is negative or bigger than list's size // Does not do anything if position is negative or bigger than list's size
// Note: position equal to list's size is valid, i.e. append. // Note: position equal to list's size is valid, i.e. append.
func (list *List) Set(index int, value interface{}) { func (list *List) Set(index int, value interface{}) {

@ -261,7 +261,7 @@ func (list *List) Insert(index int, values ...interface{}) {
} }
} }
// Sets value at specified index // Set value at specified index
// Does not do anything if position is negative or bigger than list's size // Does not do anything if position is negative or bigger than list's size
// Note: position equal to list's size is valid, i.e. append. // Note: position equal to list's size is valid, i.e. append.
func (list *List) Set(index int, value interface{}) { func (list *List) Set(index int, value interface{}) {

Loading…
Cancel
Save