From b400bb775a404e6ed705cdb8067da18ef6972b62 Mon Sep 17 00:00:00 2001 From: Stephane Bailliez Date: Fri, 11 Jan 2002 21:03:57 +0000 Subject: [PATCH] - add getter for index and change attribute modifier. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270670 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/types/EnumeratedAttribute.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java b/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java index 0d341d8a1..418cf8baa 100644 --- a/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java +++ b/src/main/org/apache/tools/ant/types/EnumeratedAttribute.java @@ -75,7 +75,7 @@ public abstract class EnumeratedAttribute { /** * the index of the selected value in the array. */ - protected int index; + private int index = -1; /** * This is the only method a subclass needs to implement. @@ -130,9 +130,17 @@ public abstract class EnumeratedAttribute { } /** - * Retrieves the value. + * @return the selected value. */ public final String getValue() { return value; } + + /** + * @return the index of the selected value in the array. + * @see #getValues() + */ + public final int getIndex() { + return index; + } }