`

KeyValuePair2

 
阅读更多
/**
* 键值对
*
* @author vernon.chen
*
*/
public class KeyValuePair2<K, V> {

private static Logger logger = LoggerFactory.getLogger(KeyValuePair2.class);

private K key;

private V value;

public KeyValuePair2() {
super();
}

public KeyValuePair2(K key, V value) {
super();
this.key = key;
this.value = value;
}

public K getKey() {
return key;
}

public void setKey(K key) {
this.key = key;
}

public V getValue() {
return value;
}

public void setValue(V value) {
this.value = value;
}

public static void main(String[] args) {
KeyValuePair2<String, String> kv2 = new KeyValuePair2<String, String>();
kv2.setKey("key");
kv2.setValue("value");

logger.debug(kv2.getKey());
logger.debug(kv2.getValue());

}
}
分享到:
评论

相关推荐

    利用KeyValuePair生成sql键值对csharpVS2015

    利用KeyValuePair生成sql键值对csharpVS2015,C#中直接将一长串sql写到程序里太长,用来换行,看起来舒服。第一次发没啥技术含量,没脸要分。

    Android自动Grid组件02

    List&lt;KeyValuePair&gt; lPair = new ArrayList&lt;KeyValuePair&gt;(); lPair.add(new KeyValuePair("ColumnName01", "表头01")); lPair.add(new KeyValuePair("ColumnName02", "表头02")); tableGrid.setDataSource...

    Android自动Grid组件

    List&lt;KeyValuePair&gt; lPair = new ArrayList&lt;KeyValuePair&gt;(); lPair.add(new KeyValuePair("ColumnName01", "表头01")); lPair.add(new KeyValuePair("ColumnName02", "表头02")); tableFixHeaders....

    自写一个模仿Dictionary与Foreach的实现及心得总结

    namespace _10_自己写Dictionary { class KeyValuePair { public KeyValuePair() { } public KeyValuePair(string key, string value) { this.key = key; this.value = value; } private string key; public string...

    C# 批量设置WinForm界面上的所有控件不可编辑

    List&lt;KeyValuePair, Boolean&gt;&gt; , List) 说明: 当窗体内的控件存在[ReadOnly]属性时,只设置[ReadOnly]属性,否则设置[Enabled]属性 方法中,List参数提供时,代表不修改其可编辑性,保持其状态为原始的可编辑或...

    可编辑控件

    C++ 编辑框 列表框 可选项 可编辑,属性列表, 正常情况下,我们的ListCtrl是不可编辑的。那么我们怎么来实现一个可编辑的ListCtrl类呢

    一个简单下拉弹出式索引效果

    [KeyValuePair keyValuePairWithKeyAndValue:@"test2" value:@"Test 2"], [KeyValuePair keyValuePairWithKeyAndValue:@"test3" value:@"Test 3"], nil]; //button 类型为 PopupPickerButton 传入数据进行...

    C#中Dictionary几种遍历的实现代码

    代码如下: Dictionary&lt;string&gt; list=new Dictionary;...}//KeyValuePair&lt;T&gt;foreach(KeyValuePair&lt;string&gt; kv in list){ Console.WriteLine(kv.Key+kv.Value);}//通过键的集合取foreach(string key in list.Keys){ 

    IronPython_UWP:使IronPython2.7在UWP上可用

    介绍: 该项目使IronPython2在UWP中运行,IronPython2的版本是2.7.11,发布日期为2020-11-17问题IronPython2默认不...解决方案删除本地访问部分删除一些反射代码修改整个IronPython的源代码,改变KeyValuePair&lt;,&gt;到

    C#实现自定义Dictionary类实例

    本文实例讲述了C#实现自定义Dictionary类。...MyDictionary类是一个具有两个参数的泛型类,内部机制采用以键值对(KeyValuePair)类型为元素的双向链表(LinkedList)实现 2.实现代码 class MyDictioinary { Linke

    word detection

    if (pair.Key.Length &lt; 2 || pair.Key.Length &gt; MaxWordLength) continue; double p = 0; for (int i=1; i; ++i) { double t = ps [pair.Key.Substring (0, i)] * ps [pair.Key.Substring (i)...

    utils.zip

    将数据字典枚举为KeyValuePair不会以任何特定顺序返回数据,并且使用System.Collection.Specialized的OrderedDictionary很麻烦。因此,我创建了自己的有序词典,称为ListDictionary,本技巧文章中对此进行了讨论。

    ASP.NET Dictionary 的基本用法示例介绍

    代码如下: Dictionary&lt;string&gt; o_Dic = new Dictionary(); //添加元素 o_Dic.Add(“01”, “aaa”); o_Dic.Add(“02″,”bbb”); //判断某个key是否存在 if (!... //遍歷 foreach (KeyValuePair&lt;string, strin

    C#将字母或数字加密成字母的方法

    本文实例讲述了C#将字母或数字加密成字母的... static List&lt;KeyValuePair&gt;&gt; MappingList;  #region 加密 public static string Encrypt(string str)  ///  /// 加密  ///  /// ”str”&gt;要加密的字符串&lt;/param&gt;

    ts-activex-gen:库+用于从COM类型库生成LibreOffice Doxygen XML的Typescript定义DefinitelyTyped包的UI

    ts-activex-gen ... 还允许为LibreOffice API生成定义。 通过遵循外部库中定义的类型并为其生成定义,确保类型定义是完整的。 还可以为类型库中的一个或多个特定类型生成定义。... KeyValuePair &lt; string , Na

    C#如何遍历Dictionary

    主要为大家详细介绍了C#遍历Dictionary的方法,.NET中的Dictionary是键/值对的集合,使用起来比较方便,Dictionary也可以用KeyValuePair来迭代遍历,感兴趣的小伙伴们可以参考一下

    Repeater绑定dictionary数据源代码及报错解决

    .aspx页面代码 代码如下: ”...# ((KeyValuePair&lt;int&gt;&gt;)Container.DataItem).Key %&gt; ”Repeater2″ runat=”server” xss=removed&gt;&gt;)Container.DataItem).Value %&gt;’&gt; &lt;ItemTemplate&gt; &lt;&#37;# (Container.

    BobBuilder_app

    Even faster Key/Value store nosql embedded database engine utilizing the new MGIndex data structure with MurMur2 Hashing and WAH Bitmap indexes for duplicates. See Also More like this More by this...

    集合类Array List HashTable实例操作练习

    命名空间System.Collections ArrayList 可变长度数组,使用类似于数组 属性 Capacity Count 方法 Add() AddRange() Remove() RemoveAt() Clear() Contains() ToArray() Hashtable 键值对(KeyValuePair)的集合,类似...

    fastCSharp

    .getArray(value =&gt; new KeyValuePair, int&gt;(diantou.dataProxy.user.get(value.Key), value.Value.Count)) .group(value =&gt; value.Key.grade0) .getArray(value =&gt; new userStat { grade0 = value.Key, count...

Global site tag (gtag.js) - Google Analytics