def map = [name:"Gromit", likes:"cheese", id:1234]
I would like to access map in such a way that I can get the key
something like the output should be
map.keys returns array of string. basically i just want to get the keys
output:
name
likes
id
|
try map.keySet()
and if you want an array:
map.keySet() as String[]; // thx @tim_yates
Or, more groovy-ish:
map.each{
key, value -> print key;
}
|
|
answered Feb 4 '11 at 12:42
|
|
Get the last key of a Map
map.keySet().last() or map.keySet()[-1]
Get sub-map consists of the last key-value of a Map
map.subMap(map.keySet().last())
Get sub-map except the last key-value
map.minus(map.subMap(map.keySet().last()))
Get the last item of a list
list.last()
Get the sub-list without the last element
list.take(list.size()-1) or list[0..list.size()-1]
分享到:
相关推荐
计算机视觉3D点云经典书籍-Semantic 3D Object Maps for Everyday Manipulation in Human Living Environments 讲述了点云的几何计算原理 以及利用点云特征FPHF进行匹配即分类 用生活环境如厨房清理 开门等实例进行...
Approaches to Probabilistic Model Learning for Mobile Manipulation Robots,本书是概率模型应用于机器人方面不可多得的资料,作者Jürgen Sturm ,Springer-Verlag Berlin Heidelberg (2013)
SQL Queries for Mere Mortals has earned worldwide praise as the clearest, simplest tutorial on writing effective queries with the latest SQL standards and database applications. Now, author John L. ...
DICOM manipulation tools for MATLAB.zip
String manipulation operations in java.zip
Image Manipulation in Windows Mobile 5.0
Authentication Method for Splicing Manipulation with Inconsistencies in Color Shift
In deriving the dynamics, we will make explicit use of twists for repre- senting the kinematics of the manipulator and explore the role that the kinematics play in the equations of motion. We assume ...
Data Manipulation with R, is aimed at giving intermediate-to-advanced level users of R (who have knowledge about datasets) an opportunity to use state-of-the-art approaches in data manipulation....
Wordlist manipulation; Raptor is known to security experts for its outstanding features for years. Raptor 3 benefits of the experience gained since 1998 when the first version was released and was ...
Wolfgang Engel’s GPU Pro 360 Guide to Geometry ...such subdivision surfaces, which has been used for the key assets in Call of Duty on the Playstation 4 and runs at FullHD at 60 frames per second.
A Mathematical Introduction to Robotic Manipulation Richard M. Murray, Zexiang Li and S. Shankar Sastry
A class that provides simple color manipulation in RGB and HLS space (44KB)
idea 插件 StringManipulation 可以对String 进行编码 大小写 去除空格
ThA06 Deep Learning in Grasping and Manipulation II.rar
Springer Tracts in Advanced Robotics Volume 26 - Visual Perception and Robotic Manipulation 3D Object Recognition, Tracking and Hand-Eye Coordination
A Mathematical Introduction to Robotic Manipulation 超清晰完整大字打印版
In this paper, we theoretically propose and experimentally demonstrate the manipulation of a novel degree of freedom in ring resonators, which is the coupling from the clockwise input to the ...