001: /*
002: * @(#) $Header: /cvs/jai-operators/src/main/ca/forklabs/media/jai/SimpleCollectionImage.java,v 1.4 2007/07/04 19:57:40 forklabs Exp $
003: *
004: * Copyright (C) 2007 Forklabs Daniel Léonard
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: */
020:
021: package ca.forklabs.media.jai;
022:
023: import java.util.Arrays;
024: import java.util.Collection;
025: import java.util.LinkedList;
026: import javax.media.jai.CollectionImage;
027:
028: /**
029: * Class {@code SimpleCollectionImage} is a simple {@link CollectionImage}.
030: *
031: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.SimpleCollectionImage">Daniel Léonard</a>
032: * @version $Revision: 1.4 $
033: */
034: public class SimpleCollectionImage extends CollectionImage {
035:
036: //---------------------------
037: // Constructors
038: //---------------------------
039:
040: /**
041: * Constructor.
042: */
043: @SuppressWarnings("unchecked")
044: public SimpleCollectionImage() {
045: this (new Object[0]);
046: }
047:
048: /**
049: * Contructor.
050: * @param images the initial images.
051: */
052: @SuppressWarnings("unchecked")
053: public SimpleCollectionImage(Object... images) {
054: // the list needs to be mutable - only Arrays.asList(images) is not!
055: this (new LinkedList(Arrays.asList(images)));
056: }
057:
058: /**
059: * Constructor.
060: * @param images the initial images.
061: */
062: public SimpleCollectionImage(Collection<?> images) {
063: super (images);
064: }
065:
066: //---------------------------
067: // Accessors and mutators
068: //---------------------------
069:
070: /**
071: * Gets the underlying collection image.
072: * @return the underlying collection image.
073: */
074: protected Collection<?> getImages() {
075: Collection<?> images = this .imageCollection;
076: return images;
077: }
078:
079: /**
080: * Changes the underlying collection image.
081: * @param images the new images.
082: */
083: protected void setImages(Collection<?> images) {
084: this .imageCollection = images;
085: }
086:
087: }
088:
089: /*
090: * $Log: SimpleCollectionImage.java,v $
091: * Revision 1.4 2007/07/04 19:57:40 forklabs
092: * Removed unused imports.
093: *
094: * Revision 1.3 2007/07/03 18:58:46 forklabs
095: * Added accessors and mutators as well as more contructors.
096: *
097: * Revision 1.2 2007/06/07 23:13:57 forklabs
098: * Fixed a bug, the default constructor initializes the underlying collection.
099: *
100: * Revision 1.1 2007/06/05 20:23:47 forklabs
101: * A concrete collection image class.
102: *
103: */
|