org.favabeans.base
Interface Column

All Superinterfaces:
Collection, Feature, List
All Known Implementing Classes:
BeanColumn

public interface Column
extends Feature, List

A Column of an object describes a column of information about it.


Method Summary
 void addListDataListener(ListDataListener l)
           
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void addPropertyChangeListener(String propertyName, PropertyChangeListener l)
           
 int[] getAscendingSort()
          Obtain a permutation on this Column (and its associated Folder) representing an ascending total ordering of its contents.
 Class getValueClass()
          Determine the most general Java class of the objects which are values of this Property.
 boolean isEnabled()
          Determine whether this Column is enabled.
 boolean isSortable()
          Determine whether the elements of the collection from which this Column is derived can be sorted based on the values of this Column.
 boolean isValueSettable()
          Determine whether the values of this Column can be set.
 boolean isValueSettable(int i, Object value)
          Check if the given value is an allowable argument to setValue(int,Object).
 PropertyEditor newEditor(int i)
          Obtain a PropertyEditor instance suitable for editing one of the values of ths Property object.
 void removeListDataListener(ListDataListener l)
           
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void removePropertyChangeListener(String propertyName, PropertyChangeListener l)
           
 void setValue(int i, Object value)
          Set a value of the Column.
 
Methods inherited from interface org.favabeans.base.Feature
getTarget
 
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, set, size, subList, toArray, toArray
 

Method Detail

getValueClass

public Class getValueClass()
Determine the most general Java class of the objects which are values of this Property. As a minimum, this operation should return Object.
Returns:
the appropriate class.

isEnabled

public boolean isEnabled()
Determine whether this Column is enabled. a "disabled" property is one which should be displayed in UI elements, but in a state which indicates that it is non-functional and/or non-applicable (e.g., by "graying out").
Returns:
true if this Column is enabled; false if it is disabled.

newEditor

public PropertyEditor newEditor(int i)
Obtain a PropertyEditor instance suitable for editing one of the values of ths Property object.
Parameters:
i - the index of the column value for which to obtain a PropertyEditor.
Returns:
a suitable PropertyEditor.

isValueSettable

public boolean isValueSettable()
Determine whether the values of this Column can be set. If this method returns false, calls to setValue will return silently with no effect.
Returns:
true if the values can be set; false otherwise.

isValueSettable

public boolean isValueSettable(int i,
                               Object value)
Check if the given value is an allowable argument to setValue(int,Object). This should be overridden to provide end-user feedback regarding the correctness of a value, where such information is available to the implementation.

The default behavior of this method is to return true, and throw an exception in setValue(Object) if necessary.

Parameters:
i - the index at which to set the candidate column value.
value - the candidate column value.
Returns:
false if the candidate value is known to be unacceptable; true otherwise.

setValue

public void setValue(int i,
                     Object value)
              throws PropertyValueException
Set a value of the Column.
Parameters:
i - the index at which to set the column value.
value - the desired new column value.
Throws:
PropertyValueException - if there was a problem setting the value, or if the value was not acceptable.

isSortable

public boolean isSortable()
Determine whether the elements of the collection from which this Column is derived can be sorted based on the values of this Column.
Returns:
true if sorting is supported; false otherwise.

getAscendingSort

public int[] getAscendingSort()
Obtain a permutation on this Column (and its associated Folder) representing an ascending total ordering of its contents. A descending ordering is by definition simply the reverse of this permutation.

To use this permutation to gain access to the elements in ascending order, given Column c, we would do --

for (int i = 0; i < c.size(); i++)
   System.out.println(c.get(c.getAscendingSort()[i]));

and, in descending order --

for (int i = c.size(); i-- > 0; )
   System.out.println(c.get(c.getAscendingSort()[i]));
Returns:
a permutation (as an array of integers).

addListDataListener

public void addListDataListener(ListDataListener l)

removeListDataListener

public void removeListDataListener(ListDataListener l)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener l)


Copyright © 2000-2001, Regents of the University of Minnesota. All Rights Reserved.