blob: 91986907c694fe038feb831b9ede2f673fced516 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 KPIT Technologies.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Jan Mauersberger- initial API and implementation
* Sascha Baumgart- initial API and implementation
*******************************************************************************/
/*
*
*/
package org.eclipse.opencert.vocabulary.diagram.navigator;
import java.util.Collection;
import java.util.LinkedList;
/**
* @generated
*/
public class VocabularyNavigatorGroup extends VocabularyAbstractNavigatorItem {
/**
* @generated
*/
private String myGroupName;
/**
* @generated
*/
private String myIcon;
/**
* @generated
*/
private Collection myChildren = new LinkedList();
/**
* @generated
*/
VocabularyNavigatorGroup(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
*/
public boolean equals(Object obj) {
if (obj instanceof org.eclipse.opencert.vocabulary.diagram.navigator.VocabularyNavigatorGroup) {
org.eclipse.opencert.vocabulary.diagram.navigator.VocabularyNavigatorGroup anotherGroup = (org.eclipse.opencert.vocabulary.diagram.navigator.VocabularyNavigatorGroup) obj;
if (getGroupName().equals(anotherGroup.getGroupName())) {
return getParent().equals(anotherGroup.getParent());
}
}
return super.equals(obj);
}
/**
* @generated
*/
public int hashCode() {
return getGroupName().hashCode();
}
}