org.norther.tammi.core.rt.util
Interface EnumeratedList

All Superinterfaces:
Collection, Iterable, List

public interface EnumeratedList
extends List

An extended list interface to enumerated variable attributes. The list is automatically sorted if the corresponding attribute provides an appropriate comparator. Implementations are typically unmodifiable, except that localization of attribute names is allowed either directly or through iterators and localized enumerations can be sorted.

Author:
Ilkka Priha

Method Summary
 Object set(int index, Object value)
          Sets the value of the indexed attribute.
 String set(int index, String name)
          Sets the name of the indexed attribute.
 String[] set(int index, String[] names)
          Sets the name array of the indexed attribute.
 void sort()
          Sorts the enumeration if sorting is enabled in the corresponding attribute.
 EnumAttribute toAttribute(String str)
          Return the enumerated attribute from its indexed string representation, which is independent on the locale specific sorting.
 String[] toNameArray()
          Returns an array containing the enumerated names.
 String toString(EnumAttribute elem)
          Return the indexed string representation of the enumerated attribute, which is independent on the locale specific sorting.
 String toString(int index)
          Return the indexed string representation of the indexed attribute, which is independent on the locale specific sorting.
 Object[] toValueArray()
          Returns an array containing the enumerated values.
 Object[] toValueArray(Object[] array)
          Returns an array of the specified type containing the enumerated values.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, size, subList, toArray, toArray
 

Method Detail

sort

void sort()
Sorts the enumeration if sorting is enabled in the corresponding attribute. Applies the attribute specific comparator if defined.


set

String set(int index,
           String name)
Sets the name of the indexed attribute.

Parameters:
index - the index.
name - the name.
Returns:
the previous name.

set

String[] set(int index,
             String[] names)
Sets the name array of the indexed attribute.

Parameters:
index - the index.
names - the name array.
Returns:
the previous name array.

set

Object set(int index,
           Object value)
Sets the value of the indexed attribute.

Specified by:
set in interface List
Parameters:
index - the index.
value - the value.
Returns:
the previous value.

toString

String toString(int index)
Return the indexed string representation of the indexed attribute, which is independent on the locale specific sorting.

Parameters:
index - the index to convert.
Returns:
the string representation.

toString

String toString(EnumAttribute elem)
Return the indexed string representation of the enumerated attribute, which is independent on the locale specific sorting.

Parameters:
elem - the attribute to convert.
Returns:
the string representation or null if missing.

toAttribute

EnumAttribute toAttribute(String str)
Return the enumerated attribute from its indexed string representation, which is independent on the locale specific sorting.

Parameters:
str - the string representation to convert.
Returns:
the attribute or null if missing.

toNameArray

String[] toNameArray()
Returns an array containing the enumerated names.

Returns:
an array of enumerated names.

toValueArray

Object[] toValueArray()
Returns an array containing the enumerated values.

Returns:
an array of enumerated values.

toValueArray

Object[] toValueArray(Object[] array)
Returns an array of the specified type containing the enumerated values.

Parameters:
array - the specified array.
Returns:
an array of enumerated values.


Copyright © 2004 The Norther Organization. All rights reserved.