Create a feature map from an array of values. The array must have an even number of items, alternating keys and values i.e. [key1, value1, key2, value2, ...]. @param values an even number of items, alternating keys and values. @return a feature map containing the given items.
(Object... values)
| 668 | * @return a feature map containing the given items. |
| 669 | */ |
| 670 | public static FeatureMap featureMap(Object... values) { |
| 671 | FeatureMap fm = Factory.newFeatureMap(); |
| 672 | if(values != null) { |
| 673 | for(int i = 0; i < values.length; i++) { |
| 674 | fm.put(values[i], values[++i]); |
| 675 | } |
| 676 | } |
| 677 | return fm; |
| 678 | } |
| 679 | |
| 680 | /** |
| 681 | * Create a feature map from an existing map (typically one that does not |