简体   繁体   中英

Create a Java Bean to be of type HashSet and get error in editor

This is my code:

package ca.wfsystems.core;

import lotus.domino.Base;
import lotus.domino.Session;
import lotus.domino.Database;
import lotus.domino.View;
import lotus.domino.NotesException;
import lotus.domino.ViewEntry;
import lotus.domino.ViewEntryCollection;

import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.Vector;



import com.ibm.xsp.extlib.util.ExtLibUtil;
import ca.wfsystems.core.*;


**public class ssAppMenu implements Serializable , HashSet<String>{**

private static final long serialVersionUID = 1L;

    public ssAppMenu(){

    }

}

The public class line gives this error: The type HashSet cannot be a superinterface of ssAppMenu; a superinterface must be an interface

All I want is a set of values in a list in the order I place them. I don't need a construct. From what I have read I believe the HashSet does that but not sure how to format the public class line.

HashSet is an implementation of interface Set. You need to define

public class ssAppMenu extends LinkedHashSet<String> implements Serializable

HashSet is a class, not an interface. Don't implement, extend it. http://docs.oracle.com/javase/7/docs/api/java/util/HashSet.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM