    001    package org.broadinstitute.genee.matrix;
    002
    003    import java.util.Collection;
    004    import java.util.Comparator;
    005
    006    /**
    007     *
    008     * A collection of values of the same type.
    009     *
    010     */
    011    public interface Vector {
    012        /**
    013         * Returns the most specific superclass for all the values in this vector.
    014         *
    015         * @return the common ancestor class of the object values in this instance
    016         */
    017        public Class<?> getColumnClass();
    018
    019        /**
    020         * Returns the comparator used to compare values in this vector.
    021         *
    022         * @return the comparator
    023         */
    024        public Comparator<Object> getComparator();
    025
    026        /**
    027         * Returns the name of this vector.
    028         *
    029         * @return the name
    030         */
    031        public String getName();
    032
    033        /**
    034         * Returns a collection of all property keys in this vector.
    035         *
    036         * @return the collection of keys
    037         */
    038        public Collection<Object> getPropertyKeys();
    039
    040        /**
    041         * Gets the value for the specified key.
    042         *
    043         * @param key
    044         *            the key
    045         * @return the value
    046         */
    047        public Object getProperty(Object key);
    048
    049        /**
    050         * Returns the value at the specified index.
    051         *
    052         * @param index
    053         *            the index
    054         * @return the value.
    055         */
    056        public Object getValue(int index);
    057
    058        /**
    059         * Sets the most specific superclass for all the values in this vector.
    060         *
    061         * @param columnClass
    062         *            the common ancestor class of the object values in this
    063         *            instance
    064         */
    065        public void setColumnClass(Class<?> columnClass);
    066
    067        /**
    068         * Sets the comparator used to compare values in this vector.
    069         *
    070         * @param comparator
    071         *            the comparator
    072         */
    073        public void setComparator(Comparator<Object> comparator);
    074
    075        /**
    076         * Sets the property for the specified key.
    077         *
    078         * @param key
    079         *            the key
    080         * @param value
    081         *            the value
    082         */
    083        public void setProperty(Object key, Object value);
    084
    085        /**
    086         * Sets the value at the specified index.
    087         *
    088         * @param index
    089         *            the index
    090         * @param value
    091         *            the value
    092         */
    093        public void setValue(int index, Object value);
    094
    095        /**
    096         * Returns the number of elements in this vector.
    097         *
    098         * @return the size.
    099         */
    100        public int size();
    101    }