Skip to content

Instantly share code, notes, and snippets.

@KentaroArai
Created October 10, 2010 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KentaroArai/619116 to your computer and use it in GitHub Desktop.
Save KentaroArai/619116 to your computer and use it in GitHub Desktop.
// g100pon #4 マップ操作(基礎編:CRUD系操作とイテレーション)
def map = [atami:"onsen", hokkaido:"ski", price:100]
// atamiを読む
println map.get("atami")
// hokkaidoを更新
map["hokkaido"] = "kani"
println map.get("hokkaido")
// hokkaidoを削除
map.remove("hokkaido")
println map.containsKey("hokkaido")
// iteration
map.each {println it}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment