Top "Enumeration" questions

The process of enumerating values, for example from some collection.

iterating through Enumeration of hastable keys throws NoSuchElementException error

I am trying to iterate through a list of keys from a hash table using enumeration however I keep getting …

java hashtable enumeration key
Java getting the Enum name given the Enum Value

How can I get the name of a Java Enum type given its value? I have the following code which …

java enums enumeration
Search for a string in Enum and return the Enum

I have an enumeration: public enum MyColours { Red, Green, Blue, Yellow, Fuchsia, Aqua, Orange } and I have a string: string …

c# string enumeration
What is the best way to modify a list in a 'foreach' loop?

A new feature in C# / .NET 4.0 is that you can change your enumerable in a foreach without getting the exception. …

c# .net list enumeration enumerable
(How) can I count the items in an enum?

This question came to my mind, when I had something like enum Folders {FA, FB, FC}; and wanted to create …

c++ count enumeration
Case objects vs Enumerations in Scala

Are there any best-practice guidelines on when to use case classes (or case objects) vs extending Enumeration in Scala? They …

scala enumeration case-class
Changing objects value in foreach loop?

In one place i am using the list of string in that case the i am able to change the …

c# loops foreach enumeration
Intelligent way of removing items from a List<T> while enumerating in C#

I have the classic case of trying to remove an item from a collection while enumerating it in a loop: …

c# list foreach enumeration
Methods inside enum in C#

In Java, it's possible to have methods inside an enum. Is there such possibility in C# or is it just …

c# enums enumeration
How to get the name of enumeration value in Swift?

If I have an enumeration with raw Integer values: enum City: Int { case Melbourne = 1, Chelyabinsk, Bursa } let city = City.Melbourne …

swift enumeration