Skip to main content
summaryrefslogblamecommitdiffstats
blob: e5acad71b5019d150de494423ba0084ad38b4fa2 (plain) (tree)























                                                                                 
        
                                                                                         





                                
           



















                                    




















                                                 















                                                                                              




                                                          
/*******************************************************************************
 * Copyright (c) 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.help.internal.base.remote;

public class RemoteIC {

	private boolean enabled = false;

	private String name = ""; //$NON-NLS-1$
	
	private String host = ""; //$NON-NLS-1$

	private String path = ""; //$NON-NLS-1$
	
	private String port;
	
	
    public RemoteIC(boolean enabled, String name, String host, String path, String port){
		
    	this.enabled = enabled;
	    this.name    = name;
	    this.host    = host;
	    this.path    = path;
	    this.port    = port;
	   
	}
	public String getHost() {
		return host;
	}

	public String getPath() {
		return path;
	}

	public String getPort() {
		return port;
	}

	public String getName() {
		return name;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public void setPort(String port) {
		this.port = port;
	}
	

	//I added this method, which overrides the original "equal" method in the class Object
	
   public boolean equals(Object anotherObject)throws ClassCastException {
        if (!(anotherObject instanceof RemoteIC))
            return false;
        if ( !(((RemoteIC) anotherObject).getName().equals(this.getName())))
            return false;    	
        if ( !(((RemoteIC) anotherObject).getHost().equals(this.getHost())))
        	return false;
        if ( !(((RemoteIC) anotherObject).getPath().equals(this.getPath())))
        	return false;
        if ( !(((RemoteIC) anotherObject).getPort().equals(this.getPort())))
            return false;    	
        if ( !(((RemoteIC) anotherObject).isEnabled()==this.isEnabled()))
        	return false;
        
        //if we made it here, the the objects are the same
          return true;
   }
}

Back to the top