blob: 77d6a2b58c6f2f6e57f49dccd41217098357a4da [file] [log] [blame]
/**
* <copyright>
*
* Copyright (c) 2013 itemis 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:
* itemis - Initial API and implementation
*
* </copyright>
*/
package org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.navigator;
import java.util.Collection;
import java.util.LinkedList;
/**
* @generated
*/
public class Hummingbird20NavigatorGroup extends Hummingbird20AbstractNavigatorItem {
/**
* @generated
*/
private String myGroupName;
/**
* @generated
*/
private String myIcon;
/**
* @generated
*/
private Collection myChildren = new LinkedList();
/**
* @generated
*/
Hummingbird20NavigatorGroup(String groupName, String icon, Object parent) {
super(parent);
myGroupName = groupName;
myIcon = icon;
}
/**
* @generated
*/
public String getGroupName() {
return myGroupName;
}
/**
* @generated
*/
public String getIcon() {
return myIcon;
}
/**
* @generated
*/
public Object[] getChildren() {
return myChildren.toArray();
}
/**
* @generated
*/
public void addChildren(Collection children) {
myChildren.addAll(children);
}
/**
* @generated
*/
public void addChild(Object child) {
myChildren.add(child);
}
/**
* @generated
*/
public boolean isEmpty() {
return myChildren.size() == 0;
}
/**
* @generated
*/
@Override
public boolean equals(Object obj) {
if (obj instanceof org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.navigator.Hummingbird20NavigatorGroup) {
org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.navigator.Hummingbird20NavigatorGroup anotherGroup = (org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.navigator.Hummingbird20NavigatorGroup) obj;
if (getGroupName().equals(anotherGroup.getGroupName())) {
return getParent().equals(anotherGroup.getParent());
}
}
return super.equals(obj);
}
/**
* @generated
*/
@Override
public int hashCode() {
return getGroupName().hashCode();
}
}