পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, January 19, 2017

Java.util.EnumSet Class

Introduction

The java.util.EnumSet class is a specialized Set implementation for use with enum types.Following are the important points about EnumSet:

  • All of the elements in an enum set must come from a single enum type that is specified, explicitly or implicitly, when the set is created.
  • Enum sets are represented internally as bit vectors.
  • EnumSet is not synchronized.If multiple threads access an enum set concurrently, and at least one of the threads modifies the set, it should be synchronized externally.

Class declaration

Following is the declaration for java.util.EnumSet class:
public abstract class EnumSet<E extends Enum<E>>
   extends AbstractSet<E>
   implements Cloneable, Serializable

Class methods

S.N. Method & Description
1 static <E extends Enum<E>> EnumSet<E> allOf(Class<E> elementType)
This method creates an enum set containing all of the elements in the specified element type.
2 EnumSet<E> clone()
This method returns a copy of this set.
3 static <E extends Enum<E>> EnumSet<E> complementOf(EnumSet<E> s)
This method creates an enum set with the same element type as the specified enum set, initially containing all the elements of this type that are not contained in the specified set.
4 static <E extends Enum<E>> EnumSet<E> copyOf(Collection<E> c)
This method creates an enum set initialized from the specified collection.
5 static <E extends Enum<E>> EnumSet<E> copyOf(EnumSet<E> s)
This method creates an enum set with the same element type as the specified enum set, initially containing the same elements (if any).
6 static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType)
This method creates an empty enum set with the specified element type.
7 static <E extends Enum<E>> EnumSet<E> of(E e)
This method creates an enum set initially containing the specified element.
8 static <E extends Enum<E>> EnumSet<E> of(E first, E... rest)
This method creates an enum set initially containing the specified elements.
9 static <E extends Enum<E>> EnumSet<E> of(E e1, E e2)
This method creates an enum set initially containing the specified elements.
10 static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3)
This method creates an enum set initially containing the specified elements.
11 static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3, E e4)
This method creates an enum set initially containing the specified elements.
12 static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3, E e4, E e5)
This method creates an enum set initially containing the specified elements.
13 static <E extends Enum<E>> EnumSet<E> range(E from, E to)
This method creates an enum set initially containing all of the elements in the range defined by the two specified endpoints.

Methods inherited

This class inherits methods from the following classes:
  • java.util.AbstractSet
  • java.util.AbstractCollection
  • java.util.Object
  • java.util.Set

No comments:

Post a Comment