【问题标题】:Implementing Index in VB.NET在 VB.NET 中实现索引
【发布时间】:2011-02-16 14:47:10
【问题描述】:
Public Class IndexableLinkedList(Of T)
  Inherits LinkedList(Of T)

 '??? implement an index 'property' '

End Class

【问题讨论】:

  • 在实施此操作之前,您可能需要查看有关 indexed linked lists 的另一个 SO 问题。

标签: .net vb.net


【解决方案1】:

您可能(?)寻找的信息是索引器属性需要标记为Default

Public Default Property Item(ByVal index As Integer) As T
    Get
        ' Return something
    End Get
    Set(ByVal value As T)
        ' Set something
    End Set
End Property

也就是说,在性能方面,将索引器与链表结合使用可能不是一个好主意。

【讨论】:

  • 这正是我要找的。​​span>
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-28
  • 1970-01-01
相关资源
最近更新 更多