Top Fields Constructors Methods
org.python.core

public abstract Class BaseSet

extends PyObject
implements Set, Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc, java.util.Set, java.util.Collection, java.lang.Iterable
Known Direct Subclasses
org.python.core.PyFrozenSet, org.python.core.PySet
Imports
java.lang.reflect.Array, java.util.Collection, .Collections, .Iterator, .Set

Field Summary

Modifier and TypeField and Description
protected Set<PyObject>
_set

The underlying Set.

Inherited from org.python.core.PyObject:
attributesgcMonitorGlobalobjtypeTYPE

Constructor Summary

AccessConstructor and Description
protected
BaseSet(PyType type, Set<PyObject> set)

Create a new Python set of type from the specified Set object.

Method Summary

Modifier and TypeMethod and Description
public PyObject

Returns:

The intersection of the two sets as a new set.
__and__
(PyObject
A BaseSet instance.
other
)

Overrides org.python.core.PyObject.__and__.

The intersection of the this with other.

public int
__cmp__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__cmp__.

Equivalent to the standard Python __cmp__ method.

public boolean
__contains__(PyObject
the element to search for in this container.
other
)

Overrides org.python.core.PyObject.__contains__.

Equivalent to the standard Python __contains__ method.

public PyObject
__eq__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__eq__.

Equivalent to the standard Python __eq__ method.

public PyObject
__ge__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__ge__.

Equivalent to the standard Python __ge__ method.

public PyObject
__gt__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__gt__.

Equivalent to the standard Python __gt__ method.

public PyObject

Returns:

An iteration of the set.
__iter__
()

Overrides org.python.core.PyObject.__iter__.

Produce an iterable object.

public PyObject
__le__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__le__.

Equivalent to the standard Python __le__ method.

public int

Returns:

The length of the set.
__len__
()

Overrides org.python.core.PyObject.__len__.

The length of the set.

public PyObject
__lt__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__lt__.

Equivalent to the standard Python __lt__ method.

public PyObject
__ne__(PyObject
the object to compare this with.
other
)

Overrides org.python.core.PyObject.__ne__.

Equivalent to the standard Python __ne__ method.

public boolean

Returns:

true if the set is not empty, false otherwise
__nonzero__
()

Overrides org.python.core.PyObject.__nonzero__.

Determines if the instance is considered true by Python.

public PyObject

Returns:

The union of the two sets as a new set.
__or__
(PyObject
A BaseSet instance.
other
)

Overrides org.python.core.PyObject.__or__.

The union of this with other.

public PyObject

Returns:

a tuple of (constructor, (elements))
__reduce__
()

Overrides org.python.core.PyObject.__reduce__.

Used for pickling.

public PyObject

Returns:

The difference of the two sets as a new set.
__sub__
(PyObject
A BaseSet instance.
other
)

Overrides org.python.core.PyObject.__sub__.

The difference of the this with other.

public PyObject

Returns:

The symmetric difference of the two sets as a new set.
__xor__
(PyObject
A BaseSet instance.
other
)

Overrides org.python.core.PyObject.__xor__.

The symmetric difference of the this with other.

protected void
protected void
_update(PyObject[] args)

protected static Set<PyObject>
_update(Set<PyObject> set, PyObject data)

Update the underlying set with the contents of the iterable.

protected static Set<PyObject>
_update(Set<PyObject> set, PyObject[] data)

Update the underlying set with the contents of the array.

public boolean
add(Object
element to be added to this set
o
)

Implements java.util.Set.add.

Adds the specified element to this set if it is not already present (optional operation).

public boolean
addAll(Collection<E>
collection containing elements to be added to this set
c
)

Implements java.util.Set.addAll.

Adds all of the elements in the specified collection to this set if they're not already present (optional operation).

protected final BaseSet

Returns:

a BaseSet
asBaseSet
(PyObject
a PyObject
other
)

Casts other as BaseSet, throwing a TypeError tailored for the rich comparison methods when not applicable.

protected final PyFrozenSet

Returns:

A PyFrozenSet if appropriate, otherwise the pye is rethrown
asFrozen
(PyException
The exception thrown from a hashable operation.
pye
,
PyObject
The object which was unhashable.
value
)

Return a PyFrozenSet whose contents are shared with value when value is a BaseSet and pye is a TypeError.

pack-priv final PyObject
pack-priv final int
pack-priv final boolean
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final int
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final String
pack-priv final PyObject
pack-priv final PyObject
public void
clear()

Implements java.util.Set.clear.

Removes all of the elements from this set (optional operation).

public boolean
contains(Object
element whose presence in this set is to be tested
o
)

Implements java.util.Set.contains.

Returns true if this set contains the specified element.

public boolean
containsAll(Collection<E>
collection to be checked for containment in this set
c
)

Implements java.util.Set.containsAll.

Returns true if this set contains all of the elements of the specified collection.

public PyObject
public Set<PyObject>
public abstract int

Returns:

The hashCode of the set.
hashCode
()

Redeclares java.util.Set.hashCode.

Overrides org.python.core.PyObject.hashCode.

The hashCode of the set.

public boolean
isEmpty()

Implements java.util.Set.isEmpty.

Returns true if this set contains no elements.

public Iterator<E>
iterator()

Implements java.util.Set.iterator.

Returns an iterator over the elements in this set.

protected static BaseSet

Returns:

a new set
makeNewSet
(PyType
a set type
type
)

Create a new set of type.

protected static BaseSet

Returns:

a new set
makeNewSet
(PyType
a set type
type
,
PyObject
an iterable or null
iterable
)

Create a new set of type from iterable.

public boolean
public boolean
remove(Object
object to be removed from this set, if present
o
)

Implements java.util.Set.remove.

Removes the specified element from this set if it is present (optional operation).

public boolean
removeAll(Collection<E>
collection containing elements to be removed from this set
c
)

Implements java.util.Set.removeAll.

Removes from this set all of its elements that are contained in the specified collection (optional operation).

public boolean
retainAll(Collection<E>
collection containing elements to be retained in this set
c
)

Implements java.util.Set.retainAll.

Retains only the elements in this set that are contained in the specified collection (optional operation).

public int
size()

Implements java.util.Set.size.

Returns the number of elements in this set (its cardinality).

public PyObject
public Object[]
toArray()

Implements java.util.Set.toArray.

Returns an array containing all of the elements in this set.

public Object[]
toArray(Object[]
the array into which the elements of this set are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
a
)

Implements java.util.Set.toArray.

Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.

public String
toString()

Overrides org.python.core.PyObject.toString.

Returns a string representation of the object.

public int
traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PyObject:
__abs____add____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____call____coerce____coerce_ex____complex____delattr____delattr____delete____delitem____delitem____delslice____delslice____dir____div____divmod____ensure_finalizer____findattr____findattr____findattr_ex____finditem____finditem____finditem____float____floordiv____format____get____getattr____getattr____getitem____getitem____getnewargs____getslice____getslice____hash____hex____iadd____iand____idiv____idivmod____ifloordiv____ilshift____imod____imul____index____int____invert____ior____ipow____irshift____isub____iternext____itruediv____ixor____long____lshift____mod____mul____neg____not____oct____pos____pow____pow____radd____rand____rawdir____rdiv____rdivmod____reduce_ex____reduce_ex____repr____rfloordiv____rlshift____rmod____rmul____ror____rpow____rrshift____rshift____rsub____rtruediv____rxor____set____setattr____setattr____setitem____setitem____setitem____setslice____setslice____str____tojava____truediv____trunc____unicode___add_and_basic_add_basic_and_basic_div_basic_divmod_basic_floordiv_basic_iadd_basic_iand_basic_idiv_basic_idivmod_basic_ifloordiv_basic_ilshift_basic_imod_basic_imul_basic_ior_basic_ipow_basic_irshift_basic_isub_basic_itruediv_basic_ixor_basic_lshift_basic_mod_basic_mul_basic_or_basic_pow_basic_rshift_basic_sub_basic_truediv_basic_xor_callextra_cmp_coerce_div_divmod_doget_doget_doset_eq_floordiv_ge_gt_iadd_iand_idiv_idivmod_ifloordiv_ilshift_imod_imul_in_ior_ipow_irshift_is_isnot_isub_itruediv_ixor_jcall_jcallexc_jthrow_le_lshift_lt_mod_mul_ne_notin_or_pow_rshift_sub_truediv_unsupportedop_xoradaptToCoerceTupleasDoubleasIndexasIndexasIntasIntasIterableasLongasLongasNameasNameasStringasStringasStringOrNullasStringOrNullbit_lengthconjugatedelDictdelTypedispatch__init__equalsfastGetClassfastGetDictfinalizegetDictgetJavaProxygetTypeimpAttrimplementsDescrDeleteimplementsDescrGetimplementsDescrSetinvokeinvokeinvokeinvokeinvokeinvokeisCallableisDataDescrisIndexisIntegerisMappingTypeisNumberTypeisSequenceTypejdontdelmergeClassDictmergeDictAttrmergeListAttrnoAttributeErrorobject___contains__object___delattr__object___delattr__object___findattr__object___format__object___getattribute__object___hash__object___init__object___new__object___reduce__object___reduce_ex__object___setattr__object___setattr__object___subclasshook__object_toStringproxyInitreadonlyAttributeErrorrunsupportedopMessagesetDictsetTypeunsupportedopMessage