インデクサ
インデクサ (indexer) appoints a subscript like the sequence in the instance of a class and the structure body and is a function of programming language C# where I can access.
インデクサ is similar to the multiplex definition of the subscript operator of the C++, but can consider it to have developed at the following point. But it is not a comparable thing simply because the circumstances in the language design of C++ and C# affect it.
- I am really divided into a different method in time to substitute it when I get a value like a property in インデクサ.
- インデクサ can imitate the sequence that is hyperspace alone. It is necessary to concentrate art such as putting an object temporarily between to do a similar thing in C++.
The property with the argument of the Visual Basic .NET or the property with the index of C++/CLI exist as a function similar to インデクサ of C# by other languages.
For example, by the access of the element of the collection to express a list, I am defined by the language not to use インデクサ for by the following interface method.
1) Takeoff of the element of the index joint Object get(int index), An example: Object o = list.get(3); 2) I set Object o in the element of the index joint void set(int index, Object o), An example: list.set(2, o),
I can describe the access to the element on the list in the same way as access of the sequence in インデクサ of C#.
Object o = list[3]; list[2] = o;
At this chance I can use the value (including character string and the object) except the integer as an index and am used for collection to express the associative arrays such as hush tables.
Object o = map["key"];
This article is taken from the Japanese Wikipedia インデクサ
This article is distributed by cc-by-sa or GFDL license in accordance with the provisions of Wikipedia.
In addition, Tranpedia is simply not responsible for any show is only by translating the writings of foreign licenses that are compatible with CC-BY-SA license information.
0 개의 댓글:
댓글 쓰기