Package ca.odell.glazedlists.hibernate

Source Code of ca.odell.glazedlists.hibernate.DefaultFactory

/* Glazed Lists                                                 (c) 2003-2007 */
/* http://publicobject.com/glazedlists/                      publicobject.com,*/
/*                                                     O'Dell Engineering Ltd.*/

package ca.odell.glazedlists.hibernate;

import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.EventList;

/**
* A factory for EventLists, that is used by instances of {@link EventListType} and
* {@link PersistentEventList} to instantiate EventLists.
*
* @author Holger Brands
*/
public interface EventListFactory {

    /**
     * Default implementation that always creates new EventLists with different
     * ReadWriteLocks and ListEventPublishers.
     */
    EventListFactory DEFAULT = new DefaultFactory();
   
    /**
     * Creates a new EventList.
     */
    EventList createEventList();

    /**
     * Create a new EventList with an initial capacity.
     */
    EventList createEventList(int initalCapacity);   
}

/**
* EventListFactory implementation that always creates new EventLists with different
* ReadWriteLocks and ListEventPublishers.
*
* @author Holger Brands
*/
final class DefaultFactory implements EventListFactory {

    /** {@inheritDoc} */
    public EventList createEventList() {
        return new BasicEventList();
    }

    /** {@inheritDoc} */
    public EventList createEventList(int initalCapacity) {
        return new BasicEventList(initalCapacity);
    }
}
TOP

Related Classes of ca.odell.glazedlists.hibernate.DefaultFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.