commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Zejda <d...@atlas.cz>
Subject [COLLECTIONS] apprising and aware (proposal)
Date Tue, 10 Aug 2004 17:31:39 GMT
Commons Collections (CCs) is a quite nice bunch of code. As examining 
avilable classes and interafaces, I noticed that most of collection 
variations I developed during years are present there, so possibly I'll 
upgrade some of my current projects to be using CCs instead of my 
proprietary ones.

The only bigger thing I'm missing in CCs are my "apprising" collections 
and related utility classes. The main idea behind them is to have the 
data structure able to serve listeners about internal changes, esp. adds 
and removals.

public interface ItemMovedSource
{
     public void addItemMovedListener(ItemMovedListener listener);
     public void removeItemMovedListener(ItemMovedListener listener);
}

public interface ApprisingCollection extends ItemMovedSource, ...
{
}

I also created the exteded versions of "apprisings", called "aware". 
They are able to report the property changes inside imbedded objects 
that implements the ProperyChangeSource interface.

public interface PropertyChangeSource
{
     public void addPropertyChangeListener(PropertyChangeListener 
listener);
     public void removePropertyChangeListener(PropertyChangeListener 
listener);
}

public interface AwareCollection extends ApprisingCollection, 
PropertyChangeSource
{
}

Apprising collection could be easily chained to get more functionality 
(e.g. filtering, sorting...) without restrictions on mutability of the 
backed collection - adds/removals are propagated in both directions.

What do you think? Would be such contribution (after several tunings to 
accomodate Jakarta & CCs conventions and style) to CCs desirable?

Regards
David Zejda

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message