Package org.robovm.apple.foundation
Class NSSet<T extends NSObject>
- java.lang.Object
-
- org.robovm.rt.bro.NativeObject
-
- org.robovm.objc.ObjCObject
-
- org.robovm.apple.foundation.NSObject
-
- org.robovm.apple.foundation.NSSet<T>
-
- All Implemented Interfaces:
java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.Set<T>
,NSFastEnumeration
,NSObjectProtocol
,org.robovm.objc.ObjCProtocol
- Direct Known Subclasses:
NSMutableSet
public class NSSet<T extends NSObject> extends NSObject implements NSFastEnumeration, java.util.Set<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NSSet.AsSetMarshaler
static class
NSSet.AsStringListMarshaler
static class
NSSet.AsStringSetMarshaler
static class
NSSet.NSSetPtr<T extends NSObject>
-
Nested classes/interfaces inherited from class org.robovm.apple.foundation.NSObject
NSObject.Handle, NSObject.Marshaler, NSObject.NoRetainMarshaler, NSObject.NSKeyValueObserver, NSObject.NSObjectPtr, NSObject.SkipInit
-
-
Field Summary
-
Fields inherited from class org.robovm.apple.foundation.NSObject
FLAG_NO_RETAIN
-
-
Constructor Summary
Constructors Modifier Constructor Description NSSet()
NSSet(java.util.Collection<T> c)
protected
NSSet(NSObject.Handle h, long handle)
protected
NSSet(NSObject.SkipInit skipInit)
NSSet(T... objects)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T e)
boolean
addAll(java.util.Collection<? extends T> c)
protected void
afterMarshaled(int flags)
T
any()
java.util.List<java.lang.String>
asStringList()
java.util.Set<java.lang.String>
asStringSet()
Use this method to convert a NSSet of NSString items to a Set of String items.protected static void
checkNull(java.lang.Object o)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
protected java.util.AbstractSet<T>
createAdapter()
static NSSet<NSString>
fromStrings(java.lang.String... strings)
static NSSet<NSString>
fromStrings(java.util.Collection<java.lang.String> strings)
protected long
getCount()
NSArray<T>
getValues()
protected long
init(long objects, long cnt)
protected long
init(NSArray<?> array)
protected long
init(NSSet<?> set)
boolean
isEmpty()
protected NSObject
isMember(NSObject object)
java.util.Iterator<T>
iterator()
protected NSEnumerator<T>
objectEnumerator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<U> U[]
toArray(U[] a)
-
Methods inherited from class org.robovm.apple.foundation.NSObject
addKeyValueObserver, addKeyValueObserver, alloc, autorelease, autorelease, awakeFromNib, conformsToProtocol, copy, description, didChangeValue, didChangeValue, didChangeValues, doDispose, equals, forceSkipInit, getAutoContentAccessingProxy, getClassForCoder, getClassForKeyedArchiver, getKeyValueCoder, getObservationInfo, hash, hashCode, init, isEqual, isKindOfClass, isMemberOfClass, mutableCopy, performSelector, performSelector, performSelector, performSelector, performSelector, performSelector, performSelector, performSelectorInBackground, performSelectorOnMainThread, performSelectorOnMainThread, performSelectorV, performSelectorV, performSelectorV, release, release, removeKeyValueObserver, removeKeyValueObservers, respondsToSelector, retain, retain, retainCount, setObservationInfo, toString, willChangeValue, willChangeValue, willChangeValues
-
-
-
-
Constructor Detail
-
NSSet
public NSSet()
-
NSSet
protected NSSet(NSObject.Handle h, long handle)
-
NSSet
protected NSSet(NSObject.SkipInit skipInit)
-
NSSet
public NSSet(java.util.Collection<T> c)
-
NSSet
public NSSet(T... objects)
-
-
Method Detail
-
getCount
protected long getCount()
-
checkNull
protected static void checkNull(java.lang.Object o)
-
createAdapter
protected java.util.AbstractSet<T> createAdapter()
-
afterMarshaled
protected void afterMarshaled(int flags)
- Overrides:
afterMarshaled
in classNSObject
-
add
public boolean add(T e)
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<T> iterator()
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
size
public int size()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <U> U[] toArray(U[] a)
-
asStringSet
public java.util.Set<java.lang.String> asStringSet()
Use this method to convert a NSSet of NSString items to a Set of String items. Elements of this NSASet must be of type NSString, otherwise an exception will be thrown.- Returns:
- Throws:
java.lang.UnsupportedOperationException
- when the set items are not of type NSString.
-
asStringList
public java.util.List<java.lang.String> asStringList()
-
fromStrings
public static NSSet<NSString> fromStrings(java.util.Collection<java.lang.String> strings)
-
objectEnumerator
protected NSEnumerator<T> objectEnumerator()
-
init
protected long init(long objects, long cnt)
-
any
public T any()
-
init
protected long init(NSSet<?> set)
-
init
protected long init(NSArray<?> array)
-
-