1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.browsing.ui.common.labelers;
14 import java.util.Arrays;
17 import org.simantics.browsing.ui.content.Labeler;
19 public class LabelerContent {
21 public static LabelerContent NO_CONTENT = new LabelerContent(0, Labeler.NO_LABELS);
23 public final int category;
24 public final Map<String, String> labels;
26 public LabelerContent(int category, Map<String, String> labels) {
27 this.category = category;
32 public String toString() {
33 return "LabelerContent[" + Arrays.toString(labels.values().toArray()) + "]";
37 public int hashCode() {
38 return category + 31 * labels.hashCode();
42 public boolean equals(Object object) {
46 else if (object == null)
48 else if (!(object instanceof LabelerContent))
51 LabelerContent lc = (LabelerContent)object;
52 return category == lc.category && labels.equals(lc.labels);