SparkseePython  6.0.2
Public Member Functions | Static Public Attributes | List of all members
sparksee.Objects Class Reference

Object identifier set class. More...

Public Member Functions

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

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

def sparksee.Objects.__iter__ (   self)

Gets a new ObjectsIterator.

Returns
ObjectsIterator instance
def 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.
def sparksee.Objects.any (   self)

Gets an element from the collection.

Returns
Any element from the collection.
Exceptions
RuntimeErrornull
RuntimeErrorwhether the collection is empty.
def sparksee.Objects.close (   self)

Closes the Objects instance.

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

def 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.
def 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.
def 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.
def sparksee.Objects.contains (   self,
  objs 
)

Check if this objects contains the other one.

Parameters
objsObjects collection.
Returns
True if it contains the given object.
def 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.

Referenced by sparksee.Objects.copy().

def sparksee.Objects.copy (   self)

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

Returns
The new Objects instance.

References sparksee.Objects.copy().

def sparksee.Objects.count (   self)

Gets the number of elements into the collection.

Returns
The number of elements into the collection.
def 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.
def 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.
def 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.
def 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.
def 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.
def sparksee.Objects.iterator (   self)

Gets an ObjectsIterator.

Returns
ObjectsIterator instance.
def 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.
def 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.
def 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.
def 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.
def 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.