Top Description Inners Fields Constructors Methods
org.python.core

pack-priv abstract Class PyMapSet

Located in compilation unit of org.python.core.AbstractDict.

extends AbstractSet
Class Inheritance
Known Direct Subclasses
org.python.core.PyMapKeyValSet, org.python.core.PyMapEntrySet

PyMapSet serves as a wrapper around Set Objects returned by the java.util.Map interface of PyDictionary. entrySet, values and keySet methods return this type for the java.util.Map implementation. This class is necessary as a wrapper to convert PyObjects to java Objects for methods that return values, and convert Objects to PyObjects for methods that take values. The translation is necessary to provide java access to jython dictionary objects. This wrapper also provides the expected backing functionality such that changes to the wrapper set or reflected in PyDictionary.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final Collection<E>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.util.AbstractCollection.clear.

Implements java.util.Set.clear, java.util.Collection.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
)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Returns true if this set contains the specified element.

public Iterator<E>
iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Returns an iterator over the elements in this set.

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

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

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

public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

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

pack-priv abstract Object
pack-priv abstract Object
Inherited from java.util.AbstractSet:
equalshashCoderemoveAll

Field Detail

collback to summary
private final Collection<E> coll

Constructor Detail

PyMapSetback to summary
pack-priv PyMapSet(Collection<E> coll)

Method Detail

clearback to summary
public void clear()

Overrides java.util.AbstractCollection.clear.

Implements java.util.Set.clear, java.util.Collection.clear.

Doc from java.util.Set.clear.

Removes all of the elements from this set (optional operation). The set will be empty after this call returns.

Annotations
@Override
containsback to summary
public boolean contains(Object o)

Overrides java.util.AbstractCollection.contains.

Implements java.util.Set.contains, java.util.Collection.contains.

Doc from java.util.Set.contains.

Returns true if this set contains the specified element. More formally, returns true if and only if this set contains an element e such that Objects.equals(o, e).

Parameters
o:Object

element whose presence in this set is to be tested

Returns:boolean

true if this set contains the specified element

Annotations
@Override

iteratorback to summary
public Iterator<E> iterator()

Implements abstract java.util.AbstractCollection.iterator.

Implements java.util.Set.iterator, java.util.Collection.iterator.

Doc from java.util.Set.iterator.

Returns an iterator over the elements in this set. The elements are returned in no particular order (unless this set is an instance of some class that provides a guarantee).

Returns:Iterator<E>

an iterator over the elements in this set

Annotations
@Override

removeback to summary
public boolean remove(Object o)

Overrides java.util.AbstractCollection.remove.

Implements java.util.Set.remove, java.util.Collection.remove.

Doc from java.util.Set.remove.

Removes the specified element from this set if it is present (optional operation). More formally, removes an element e such that Objects.equals(o, e), if this set contains such an element. Returns true if this set contained the element (or equivalently, if this set changed as a result of the call). (This set will not contain the element once the call returns.)

Parameters
o:Object

object to be removed from this set, if present

Returns:boolean

true if this set contained the specified element

Annotations
@Override

sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.Set.size, java.util.Collection.size.

Doc from java.util.Set.size.

Returns the number of elements in this set (its cardinality). If this set contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this set (its cardinality)

Annotations
@Override

toJavaback to summary
pack-priv abstract Object toJava(Object obj)
toPythonback to summary
pack-priv abstract Object toPython(Object obj)
org.python.core back to summary

pack-priv Class PyMapSet.PySetIter

extends Object
implements Iterator
Class Inheritance
All Implemented Interfaces
java.util.Iterator

Field Summary

Modifier and TypeField and Description
pack-priv Iterator<E>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
hasNext()

Implements java.util.Iterator.hasNext.

Returns true if the iteration has more elements.

public Object
next()

Implements java.util.Iterator.next.

Returns the next element in the iteration.

public void
remove()

Overrides default java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

itrback to summary
pack-priv Iterator<E> itr

Constructor Detail

PySetIterback to summary
pack-priv PySetIter(Iterator<E> itr)

Method Detail

hasNextback to summary
public boolean hasNext()

Implements java.util.Iterator.hasNext.

Doc from java.util.Iterator.hasNext.

Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns:boolean

true if the iteration has more elements

nextback to summary
public Object next()

Implements java.util.Iterator.next.

Doc from java.util.Iterator.next.

Returns the next element in the iteration.

Returns:Object

the next element in the iteration

removeback to summary
public void remove()

Overrides default java.util.Iterator.remove.

Doc from java.util.Iterator.remove.

Removes from the underlying collection the last element returned by this iterator (optional operation). This method can be called only once per call to next.

The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.

The behavior of an iterator is unspecified if this method is called after a call to the forEachRemaining method.