SparkseePython3 6.1.0
sparksee.Objects Class Reference

Object identifier set class. More...

Public Member Functions

 copy (self, objs)
 Performs the copy operation.
 count (self)
 Gets the number of elements into the collection.
 equals (self, objs)
 Checks if the given Objects contains the same information.
 any (self)
 Gets an element from the collection.
 contains (self, objs)
 Check if this objects contains the other one.
 combine_intersection (self, objs1, objs2)
 Creates a new Objects instance which is the intersection of the two given.
 __iter__ (self)
 Gets a new ObjectsIterator.
 iterator (self)
 Gets an ObjectsIterator.
 union (self, objs)
 Performs the union operation.
 combine_union (self, objs1, objs2)
 Creates a new Objects instance which is the union of the two given.
 intersection (self, objs)
 Performs the intersection operation.
 clear (self)
 Clears the collection removing all its elements.
 iterator_from_index (self, index)
 Gets an ObjectsIterator skipping index elements.
 exists (self, e)
 Gets if the given element exists into the collection.
 copy (self)
 Creates a new Objects instance as a copy of the given one.
 difference (self, objs)
 Performs the difference operation.
 combine_difference (self, objs1, objs2)
 Creates a new Objects instance which is the difference of the two given.
 sample (self, exclude, samples)
 Creates a new Objects instance which is a sample of the calling one.
 close (self)
 Closes the Objects instance.
 add (self, e)
 Adds an element into the collection.
 remove (self, e)
 Removes an element from the collection.
 iterator_from_element (self, e)
 Gets an ObjectsIterator starting from the given element.
 is_closed (self)
 Gets if Objects instance has been closed or not.

Static Public Attributes

int INVALID_OID = 0
 Invalid OID constant.

Detailed Description

Object identifier set class.

It stores a collection of Sparksee object identifiers as a set. As a set, there is no order and no duplicated elements.

This class should be used just to store large collections. Otherwise, it is strongly recommended to use common classes from the language API.

This class is not thread-safe.

ObjectsIterator must be used to traverse all the elements into the set.

When the Objects instance is closed, it closes all existing and non-closed ObjectsIterator instances too.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

◆ __iter__()

sparksee.Objects.__iter__ ( self)

Gets a new ObjectsIterator.

Returns
ObjectsIterator instance

◆ add()

sparksee.Objects.add ( self,
e )

Adds an element into the collection.

Parameters
e[in] Element to be added.
Returns
TRUE if the element is added, FALSE if the element was already into the collection.

◆ any()

sparksee.Objects.any ( self)

Gets an element from the collection.

Errorfor other issues.

Returns
Any element from the collection.
Exceptions
RuntimeErrornull
RuntimeErrorwhether the collection is empty.

◆ close()

sparksee.Objects.close ( self)

Closes the Objects instance.

It must be called to ensure the integrity of all data.

◆ combine_difference()

sparksee.Objects.combine_difference ( self,
objs1,
objs2 )

Creates a new Objects instance which is the difference of the two given.

Two given Objects belong to the same Session.

Parameters
objs1[in] Objects instance.
objs2[in] Objects instance.
Returns
New Objects instance.

◆ combine_intersection()

sparksee.Objects.combine_intersection ( self,
objs1,
objs2 )

Creates a new Objects instance which is the intersection of the two given.

Two given Objects belong to the same Session.

Parameters
objs1[in] Objects instance.
objs2[in] Objects instance.
Returns
New Objects instance.

◆ combine_union()

sparksee.Objects.combine_union ( self,
objs1,
objs2 )

Creates a new Objects instance which is the union of the two given.

Two given Objects belong to the same Session.

Parameters
objs1[in] Objects instance.
objs2[in] Objects instance.
Returns
New Objects instance.

◆ contains()

sparksee.Objects.contains ( self,
objs )

Check if this objects contains the other one.

Parameters
objsObjects collection.
Returns
True if it contains the given object.

◆ copy() [1/2]

sparksee.Objects.copy ( self)

Creates a new Objects instance as a copy of the given one.

Returns
The new Objects instance.

◆ copy() [2/2]

sparksee.Objects.copy ( self,
objs )

Performs the copy operation.

This updates the Objects calling instance and copies the given Objects instance.

Parameters
objs[in] Objects instance.
Returns
Number of elements into the collection once the operation has been executed.

◆ count()

sparksee.Objects.count ( self)

Gets the number of elements into the collection.

Returns
The number of elements into the collection.

◆ difference()

sparksee.Objects.difference ( self,
objs )

Performs the difference operation.

This updates the Objects calling instance removing those existing elements at the given Objects instance.

Parameters
objs[in] Objects instance.
Returns
Number of elements into the collection once the operation has been executed.

◆ equals()

sparksee.Objects.equals ( self,
objs )

Checks if the given Objects contains the same information.

Parameters
objs[in] Objects instance.
Returns
True if the objects are equal or false otherwise.

◆ exists()

sparksee.Objects.exists ( self,
e )

Gets if the given element exists into the collection.

Parameters
e[in] Element.
Returns
TRUE if the element exists into the collection, FALSE otherwise.

◆ intersection()

sparksee.Objects.intersection ( self,
objs )

Performs the intersection operation.

Updates the Objects calling instance setting those existing elements at both two collections and removing all others.

Parameters
objs[in] Objects instance.
Returns
Number of elements into the collection once the operation has been executed.

◆ is_closed()

sparksee.Objects.is_closed ( self)

Gets if Objects instance has been closed or not.

See also
close()
Returns
TRUE if the Objects instance has been closed, FALSE otherwise.

◆ iterator()

sparksee.Objects.iterator ( self)

Gets an ObjectsIterator.

Returns
ObjectsIterator instance.

◆ iterator_from_element()

sparksee.Objects.iterator_from_element ( self,
e )

Gets an ObjectsIterator starting from the given element.

Objects collection has no order, so this method is implementation-dependent. e[in] The first element to traverse in the resulting

Parameters
e[in] The first element to traverse in the resulting ObjectsIterator instance.
Returns
ObjectsIterator instance.

◆ iterator_from_index()

sparksee.Objects.iterator_from_index ( self,
index )

Gets an ObjectsIterator skipping index elements.

Objects collection has no order, so this method is implementation-dependent.

Parameters
index[in] The number of elements to skip from the beginning. It must be in the range [0..Size).
Returns
ObjectsIterator instance.

◆ remove()

sparksee.Objects.remove ( self,
e )

Removes an element from the collection.

Parameters
e[in] Element to be removed.
Returns
TRUE if the element is removed, FALSE if the element was not into the collection.

◆ sample()

sparksee.Objects.sample ( self,
exclude,
samples )

Creates a new Objects instance which is a sample of the calling one.

Parameters
exclude[in] If not NULL, elements into this collection will be excluded from the resulting one.
samples[in] Number of elements into the resulting collection.
Returns
Sample collection.

◆ union()

sparksee.Objects.union ( self,
objs )

Performs the union operation.

This adds all existing elements of the given Objects instance to the Objects calling instance

Parameters
objs[in] Objects instance.
Returns
Number of elements into the collection once the operation has been executed.