public class NameSet
extends java.lang.Object
Constructor and Description |
---|
NameSet() |
NameSet(java.lang.String[] names) |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String name)
Adds an element to the
NameSet . |
boolean |
contains(java.lang.String name)
Determines whether a name in included in the
NameSet . |
java.lang.String[] |
elementArray()
Returns the number of elements in the
NameSet . |
java.util.Enumeration |
elements()
Lists the elements in the
NameSet . |
boolean |
equals(java.lang.Object other)
Overloads the core
java.lang.Object implementation to compare the entries in
the NameSet . |
int |
hashCode()
Overloads the core
java.lang.Object implementation to hash the entries in
the NameSet . |
void |
remove(java.lang.String name)
Removes an element from the
NameSet . |
void |
removeAll()
Removes all elements from the
NameSet . |
void |
replace(int index,
java.lang.String name)
Replaces a name at a supplied index in the
NameSet . |
int |
size()
Returns the size of the
NameSet . |
java.lang.String |
toString()
Returns a
String representation of the object. |
public NameSet()
public NameSet(java.lang.String[] names)
public void add(java.lang.String name)
NameSet
.public void replace(int index, java.lang.String name)
NameSet
.index
- the index within the NameSet
to replacename
- the new name to add to the setpublic boolean contains(java.lang.String name)
NameSet
.public int size()
NameSet
.public java.util.Enumeration elements()
NameSet
.public java.lang.String[] elementArray()
NameSet
.public void remove(java.lang.String name)
NameSet
.public void removeAll()
NameSet
.public java.lang.String toString()
String
representation of the object.toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
java.lang.Object
implementation to compare the entries in
the NameSet
.equals
in class java.lang.Object
public int hashCode()
java.lang.Object
implementation to hash the entries in
the NameSet
.hashCode
in class java.lang.Object