排序和非唯一键 [英] Sorting and non-unique keys

查看:109
本文介绍了排序和非唯一键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我有一个包含各种属性的集合(比如

字符串,DateTime和Timespan)。我想在应用程序的不同点以各种顺序访问集合

,即有时我想要在日期时间顺序中循环遍历集合中的值

而在TimeSpan订单的其他时间。


理想情况下我想要多个键 - 例如DateTime中的Timespan

订单但也许是要求太多。


我想要使用的一些按键并不是唯一的。


所以我想我有三个问题


1.什么是一般收集整个系列的最佳方式

2.无论如何要用多个键排序

3有什么办法可以用非独特的钥匙进行排序


非常感谢你们给我的任何信息。


问候,


加里

解决方案

不要只有一个数据集合,

但另外,你可以对几个关键的收藏品进行排序并提供对数据收集的访问权限吗?


Adrian。


< ga ******* @ gmail.com写信息

新闻:11 ********************** @ h54g2000cwb.googlegr oups.com ...


嗨大家好,


我有一个包含各种属性的集合(东西比如

strings,DateTime和Timespan)。我想在应用程序的不同点以各种顺序访问集合

,即有时我想要在日期时间顺序中循环遍历集合中的值

而在TimeSpan订单的其他时间。


理想情况下我想要多个键 - 例如DateTime中的Timespan

订单但也许是要求太多。


我想要使用的一些按键并不是唯一的。


所以我想我有三个问题


1.什么是一般收集整个系列的最佳方式

2.无论如何要用多个键排序

3有什么办法可以用非独特的钥匙进行排序


非常感谢你们给我的任何信息。


问候,


Gary



Gary,


你可以使用一个排序列表。


如果你有更多的钥匙,你可以创建铁道部e以某种方式,即

持有数据,而其他人持有关键

值对中对该数据的引用。

Cor


< ga ******* @ gmail.comschreef in bericht

news:11 ***** *****************@h54g2000cwb.googlegr oups.com ...


大家好,


我有一个包含各种属性的集合(例如

字符串,DateTime和Timespan)。我想在应用程序的不同点以各种顺序访问集合

,即有时我想要在日期时间顺序中循环遍历集合中的值

而在TimeSpan订单的其他时间。


理想情况下我想要多个键 - 例如DateTime中的Timespan

订单但也许是要求太多。


我想要使用的一些按键并不是唯一的。


所以我想我有三个问题


1.什么是一般收集整个系列的最佳方式

2.无论如何要用多个键排序

3有什么办法可以用非独特的钥匙进行排序


非常感谢你们给我的任何信息。


问候,


Gary



但是排序列表需要一个唯一的密钥吗?


非唯一键的任何选项?


Gary


11月12日晚上10点31分,Cor Ligthert [MVP] < notmyfirstn ... @ planet.nl>

写道:


Gary,


您可以使用已排序的列表。


如果您有更多的密钥,您可以创建更多的密钥,其中有一个

保存数据,其他人在关键的

价值对中持有对那一个的引用。


Cor


< garyho ... @ gmail.comschreef在berichtnews:11 ********************** @ h54g2000cwb.g ooglegroups.com ...


嗨大家好,


我有一个包含各种属性的集合(像
$ b $这样的东西b strings,DateTime和Timespan)。我想在应用程序的不同点以各种顺序访问集合

,即有时我想要在日期时间顺序中循环遍历集合中的值

而在TimeSpan订单的其他时间。


理想情况下,我想要多个键 - 例如DateTime中的Timespan

顺序,但可能是要求太多。


我想要使用的一些键也不是唯一的。


所以我想我有三个问题


1. Whats对一般集合进行分类的最佳方法

2.无论如何都要用多个键排序

3.有没有办法用非唯一键进行排序


非常感谢你们给我的任何信息。


问候,


Gary


Hi Guys,

I have a collection that contains various attributes (stuff like
strings, DateTime and Timespan) . I would like to access the collection
in various orders at different points in the application ie sometimes I
want to cycle through the values in the collection in DateTime order
while at other times in TimeSpan order.

Ideally I would like multiple keys - such as Timespan within DateTime
order but maybe that is asking too much.

Also some of the keys I would like to use are not unique.

So I guess I have three questions

1. Whats the best way of sorting a collection in general
2. Is there anyway to sort with multiple keys
3. Is there any way to do sorts with non-unique keys

Would really appreciate any info you guys could give me.

Regards,

Gary

解决方案

Would it be an idea not to have just one data collection,
but to have, in addition, several key collections that you
can sort and that give access to your data collection?

Adrian.

<ga*******@gmail.comwrote in message
news:11**********************@h54g2000cwb.googlegr oups.com...

Hi Guys,

I have a collection that contains various attributes (stuff like
strings, DateTime and Timespan) . I would like to access the collection
in various orders at different points in the application ie sometimes I
want to cycle through the values in the collection in DateTime order
while at other times in TimeSpan order.

Ideally I would like multiple keys - such as Timespan within DateTime
order but maybe that is asking too much.

Also some of the keys I would like to use are not unique.

So I guess I have three questions

1. Whats the best way of sorting a collection in general
2. Is there anyway to sort with multiple keys
3. Is there any way to do sorts with non-unique keys

Would really appreciate any info you guys could give me.

Regards,

Gary



Gary,

You can use a sorted list.

If you have more keys, you can create more in a way that there is one that
holds the data and others which holds the references to that one in the key
value pair.

Cor

<ga*******@gmail.comschreef in bericht
news:11**********************@h54g2000cwb.googlegr oups.com...

Hi Guys,

I have a collection that contains various attributes (stuff like
strings, DateTime and Timespan) . I would like to access the collection
in various orders at different points in the application ie sometimes I
want to cycle through the values in the collection in DateTime order
while at other times in TimeSpan order.

Ideally I would like multiple keys - such as Timespan within DateTime
order but maybe that is asking too much.

Also some of the keys I would like to use are not unique.

So I guess I have three questions

1. Whats the best way of sorting a collection in general
2. Is there anyway to sort with multiple keys
3. Is there any way to do sorts with non-unique keys

Would really appreciate any info you guys could give me.

Regards,

Gary



But a sorted list requires a unique key right?

Any options for non unique keys?

Gary

On Nov 12, 10:31 pm, "Cor Ligthert [MVP]" <notmyfirstn...@planet.nl>
wrote:

Gary,

You can use a sorted list.

If you have more keys, you can create more in a way that there is one that
holds the data and others which holds the references to that one in the key
value pair.

Cor

<garyho...@gmail.comschreef in berichtnews:11**********************@h54g2000cwb.g ooglegroups.com...

Hi Guys,

I have a collection that contains various attributes (stuff like
strings, DateTime and Timespan) . I would like to access the collection
in various orders at different points in the application ie sometimes I
want to cycle through the values in the collection in DateTime order
while at other times in TimeSpan order.

Ideally I would like multiple keys - such as Timespan within DateTime
order but maybe that is asking too much.

Also some of the keys I would like to use are not unique.

So I guess I have three questions

1. Whats the best way of sorting a collection in general
2. Is there anyway to sort with multiple keys
3. Is there any way to do sorts with non-unique keys

Would really appreciate any info you guys could give me.

Regards,

Gary


这篇关于排序和非唯一键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆