Tabnine Logo
Collections.checkedSet
Code IndexAdd Tabnine to your IDE (free)

How to use
checkedSet
method
in
java.util.Collections

Best Java code snippets using java.util.Collections.checkedSet (Showing top 20 results out of 315)

origin: google/guava

 @Override
 public Set<String> create(String[] elements) {
  Set<String> innerSet = new HashSet<>();
  Collections.addAll(innerSet, elements);
  return Collections.checkedSet(innerSet, String.class);
 }
})
origin: wildfly/wildfly

classes.add(Collections.checkedNavigableSet(Collections.emptyNavigableSet(), Void.class).getClass());
classes.add(Collections.checkedQueue(new LinkedList<>(), Void.class).getClass());
classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass());
classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());
origin: protostuff/protostuff

checkedSet = Collections.checkedSet(es, Size.class);
checkedSortedSet = Collections.checkedSortedSet(ts, String.class);
checkedList = Collections.checkedList(ll, String.class);
origin: org.geotools/gt2-geometry

@SuppressWarnings("unchecked")
public Set<Point> getElements() {
  //return (Set<Point>) super.elements;
  return Collections.checkedSet( (Set<Point>) super.elements, Point.class );
}
origin: org.geotools/gt2-geometry

  @SuppressWarnings("unchecked")
  public Set<? extends Primitive> getElements() {
    return Collections.checkedSet( (Set<Primitive>) super.elements, Primitive.class );
  }
}
origin: org.bitbucket.dollar/dollar

@Override
public Dollar.SetWrapper<T> checked(Class<T> requiredClass) {
  set = Collections.checkedSet(set, requiredClass);
  return this;
}
origin: org.geotools/gt2-geometry

@SuppressWarnings("unchecked")
public Set<OrientableSurface> getElements() {
  //return (Set<OrientableSurface>) super.elements;
  return Collections.checkedSet( (Set<OrientableSurface>) super.elements, OrientableSurface.class );
      
}
origin: org.geotools/gt2-geometry

@SuppressWarnings("unchecked")
public Set<OrientableCurve> getElements() {
  return (Set<OrientableCurve>)
    Collections.checkedSet( (Set<OrientableCurve>) elements, OrientableCurve.class ); 
}
origin: sdedit/sdedit

public Set<PropertyChangeListener> getPropertyChangeListeners() {
  return Collections.checkedSet(listeners, PropertyChangeListener.class);
}
origin: biz.aQute.bnd/biz.aQute.bnd

public static <T> Set<T> set(Class<T> c) {
  return Collections.checkedSet(new LinkedHashSet<>(), c);
}
origin: biz.aQute.bnd/bnd

public static <T> Set<T> set(Class<T> c) {
  return Collections.checkedSet(new LinkedHashSet<T>(), c);
}
origin: biz.aQute.bnd/org.osgi.impl.bundle.repoindex.cli

public static <T> Set<T> set(Class<T> c) {
  return Collections.checkedSet(new HashSet<T>(), c);
}
origin: biz.aQute.bnd/biz.aQute.bndlib

public static <T> Set<T> set(Class<T> c) {
  return Collections.checkedSet(new LinkedHashSet<>(), c);
}
origin: biz.aQute/bndlib

public static <T> Set<T> set(Class<T> c) {
  return Collections.checkedSet(new HashSet<T>(), c);
}
origin: biz.aQute.bnd/biz.aQute.resolve

public static <T> Set<T> set(Class<T> c) {
  return Collections.checkedSet(new LinkedHashSet<>(), c);
}
origin: com.google.guava/guava-testlib

 @Override
 public Set<String> create(String[] elements) {
  Set<String> innerSet = new HashSet<>();
  Collections.addAll(innerSet, elements);
  return Collections.checkedSet(innerSet, String.class);
 }
})
origin: com.google.guava/guava-testlib-jdk5

 @Override public Set<String> create(String[] elements) {
  Set<String> innerSet = new HashSet<String>();
  Collections.addAll(innerSet, elements);
  return Collections.checkedSet(innerSet, String.class);
 }
})
origin: org.glassfish.common/amx-core

/**
Create a checked Set<String>, first verifying that all elements
are in fact String.
@param s the Set
@throws ClassCastException
 */
public static <T> Set<T> checkedSet(final Set<?> s, final Class<T> theClass)
{
  final Set<T> cs = checkSet(s, theClass);
  return Collections.checkedSet(cs, theClass);
}
origin: org.glassfish.main.common/amx-core

/**
Create a checked Set<String>, first verifying that all elements
are in fact String.
@param s the Set
@throws ClassCastException
 */
public static <T> Set<T> checkedSet(final Set<?> s, final Class<T> theClass)
{
  final Set<T> cs = checkSet(s, theClass);
  return Collections.checkedSet(cs, theClass);
}
origin: com.github.rinde/rinsim-problem

static ImmutableMap<ParcelDTO, DefaultParcel> contentsToMap(PDPModel pm,
  DefaultVehicle vehicle) {
 // this is ok since we actually check the type
 @SuppressWarnings({ "unchecked", "rawtypes" })
 final Set<DefaultParcel> ps = Collections.checkedSet(
   (Set) newLinkedHashSet(pm.getContents(vehicle)), DefaultParcel.class);
 return toMap(ps);
}
java.utilCollectionscheckedSet

Javadoc

Returns a dynamically typesafe view of the specified set. Trying to insert an element of the wrong type into this set throws a ClassCastException. At creation time the types in s are not checked for correct type.

Popular methods of Collections

  • emptyList
    Returns the empty list (immutable). This list is serializable.This example illustrates the type-safe
  • sort
  • singletonList
    Returns an immutable list containing only the specified object. The returned list is serializable.
  • unmodifiableList
    Returns an unmodifiable view of the specified list. This method allows modules to provide users with
  • emptyMap
    Returns the empty map (immutable). This map is serializable.This example illustrates the type-safe w
  • emptySet
    Returns the empty set (immutable). This set is serializable. Unlike the like-named field, this metho
  • unmodifiableMap
    Returns an unmodifiable view of the specified map. This method allows modules to provide users with
  • singleton
    Returns an immutable set containing only the specified object. The returned set is serializable.
  • unmodifiableSet
    Returns an unmodifiable view of the specified set. This method allows modules to provide users with
  • singletonMap
    Returns an immutable map, mapping only the specified key to the specified value. The returned map is
  • addAll
    Adds all of the specified elements to the specified collection. Elements to be added may be specifie
  • reverse
    Reverses the order of the elements in the specified list. This method runs in linear time.
  • addAll,
  • reverse,
  • unmodifiableCollection,
  • shuffle,
  • enumeration,
  • list,
  • synchronizedMap,
  • synchronizedList,
  • reverseOrder,
  • emptyIterator

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now