CT Hall CT Hall - 3 years ago 178
Groovy Question

Does Apache Groovy have categorical variables?

Does Apache Groovy support categorical variables? I'm familiar with R and it has leveled factorized vectors. I'd like to know if Apache Groovy has similar functionality.

Answer Source

Groovy has "enums" that let you define a preset amount of custom values.

Example:

public enum Day {
    SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
    THURSDAY, FRIDAY, SATURDAY 
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download