replaced ^\s for ^<tab> in code examples

pull/64/head
Eugenio Cano-Manuel 8 years ago
parent c4fc0ef8b1
commit 576b606224

@ -87,13 +87,13 @@ Implements [Container](#containers) interface.
```go ```go
type List interface { type List interface {
Get(index int) (interface{}, bool) Get(index int) (interface{}, bool)
Remove(index int) Remove(index int)
Add(values ...interface{}) Add(values ...interface{})
Contains(values ...interface{}) bool Contains(values ...interface{}) bool
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{})
containers.Container containers.Container
// Empty() bool // Empty() bool
@ -114,7 +114,7 @@ package main
import ( import (
"github.com/emirpasic/gods/lists/arraylist" "github.com/emirpasic/gods/lists/arraylist"
"github.com/emirpasic/gods/utils" "github.com/emirpasic/gods/utils"
) )
func main() { func main() {
@ -135,8 +135,8 @@ func main() {
_ = list.Size() // 0 _ = list.Size() // 0
list.Add("a") // ["a"] list.Add("a") // ["a"]
list.Clear() // [] list.Clear() // []
list.Insert(0, "b") // ["b"] list.Insert(0, "b") // ["b"]
list.Insert(0, "a") // ["a","b"] list.Insert(0, "a") // ["a","b"]
} }
``` ```
@ -172,8 +172,8 @@ func main() {
_ = list.Size() // 0 _ = list.Size() // 0
list.Add("a") // ["a"] list.Add("a") // ["a"]
list.Clear() // [] list.Clear() // []
list.Insert(0, "b") // ["b"] list.Insert(0, "b") // ["b"]
list.Insert(0, "a") // ["a","b"] list.Insert(0, "a") // ["a","b"]
} }
``` ```
@ -209,8 +209,8 @@ func main() {
_ = list.Size() // 0 _ = list.Size() // 0
list.Add("a") // ["a"] list.Add("a") // ["a"]
list.Clear() // [] list.Clear() // []
list.Insert(0, "b") // ["b"] list.Insert(0, "b") // ["b"]
list.Insert(0, "a") // ["a","b"] list.Insert(0, "a") // ["a","b"]
} }
``` ```
@ -222,7 +222,7 @@ Implements [Container](#containers) interface.
```go ```go
type Set interface { type Set interface {
Add(elements ...interface{}) Add(elements ...interface{})
Remove(elements ...interface{}) Remove(elements ...interface{})
Contains(elements ...interface{}) bool Contains(elements ...interface{}) bool
@ -370,7 +370,7 @@ Implements [Container](#containers) interface.
```go ```go
type Map interface { type Map interface {
Put(key interface{}, value interface{}) Put(key interface{}, value interface{})
Get(key interface{}) (value interface{}, found bool) Get(key interface{}) (value interface{}, found bool)
Remove(key interface{}) Remove(key interface{})
Keys() []interface{} Keys() []interface{}
@ -445,9 +445,9 @@ func main() {
m.Empty() // true m.Empty() // true
m.Size() // 0 m.Size() // 0
// Other: // Other:
m.Min() // Returns the minimum key and its value from map. m.Min() // Returns the minimum key and its value from map.
m.Max() // Returns the maximum key and its value from map. m.Max() // Returns the maximum key and its value from map.
} }
``` ```
@ -584,11 +584,11 @@ func main() {
tree.Empty() // true tree.Empty() // true
tree.Size() // 0 tree.Size() // 0
// Other: // Other:
tree.Left() // gets the left-most (min) node tree.Left() // gets the left-most (min) node
tree.Right() // get the right-most (max) node tree.Right() // get the right-most (max) node
tree.Floor(1) // get the floor node tree.Floor(1) // get the floor node
tree.Ceiling(1) // get the ceiling node tree.Ceiling(1) // get the ceiling node
} }
``` ```
@ -898,7 +898,7 @@ Typical usage:
it := list.Iterator() it := list.Iterator()
for it.Next() { for it.Next() {
index, value := it.Index(), it.Value() index, value := it.Index(), it.Value()
... ...
} }
``` ```
@ -925,7 +925,7 @@ Typical usage:
it := tree.Iterator() it := tree.Iterator()
for it.Next() { for it.Next() {
key, value := it.Key(), it.Value() key, value := it.Key(), it.Value()
... ...
} }
``` ```
@ -952,7 +952,7 @@ Typical usage of iteration in reverse:
it := list.Iterator() it := list.Iterator()
for it.End(); it.Prev(); { for it.End(); it.Prev(); {
index, value := it.Index(), it.Value() index, value := it.Index(), it.Value()
... ...
} }
``` ```
@ -973,7 +973,7 @@ Typical usage of iteration in reverse:
it := tree.Iterator() it := tree.Iterator()
for it.End(); it.Prev(); { for it.End(); it.Prev(); {
key, value := it.Key(), it.Value() key, value := it.Key(), it.Value()
... ...
} }
``` ```
@ -1354,13 +1354,13 @@ package main
import ( import (
"github.com/emirpasic/gods/lists/arraylist" "github.com/emirpasic/gods/lists/arraylist"
"github.com/emirpasic/gods/utils" "github.com/emirpasic/gods/utils"
) )
func main() { func main() {
list := arraylist.New() list := arraylist.New()
list.Add(2, 1, 3) list.Add(2, 1, 3)
values := GetSortedValues(container, utils.StringComparator) // [1, 2, 3] values := GetSortedValues(container, utils.StringComparator) // [1, 2, 3]
} }
``` ```

Loading…
Cancel
Save