001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU Lesser General Public License (LGPL): http://www.gnu.org/licenses/
004    
005    package graphlab.library;
006    
007    /**
008     * Wrapper for basic properties of an edge.
009     *
010     * @author Omid Aladini
011     */
012    public class BaseEdgeProperties
013            implements Cloneable {
014        public int color;
015        public int weight;
016        public boolean mark;
017        /**
018         * You can store anything you want.
019         */
020        public Object obj;
021    
022        public BaseEdgeProperties(BaseEdgeProperties p) {
023            color = p.color;
024            weight = p.weight;
025            mark = p.mark;
026        }
027    
028        public BaseEdgeProperties(int color, int weight, boolean mark) {
029            this.color = color;
030            this.weight = weight;
031            this.mark = mark;
032        }
033    
034        /* (non-Javadoc)
035          * @see java.lang.Object#equals(java.lang.Object)
036          */
037        @Override
038        public boolean equals(Object obj) {
039            if (!(obj instanceof BaseEdgeProperties))
040                return false;
041    
042            BaseEdgeProperties b = (BaseEdgeProperties) obj;
043    
044            return b.color == color && weight == b.weight && b.mark == mark;
045    
046        }
047    
048    }