CharRange

Defines the attributes for creating a virtual machine. An instance of this class is passed to resource.createInstance(), resource.createTemplate(), resource.clone().

Description

This class represents a set of strings which exist inclusively between an upper and lower boundary string. Strings within the range are ordered as follows:

  1. Longer strings always appear after shorter strings. For example, “aaaa” appears after “bbb”. This differs from traditional dictionary order, but is more useful..

  2. Strings of the same length are sorted in dictionary order, according to the defined lexical order of the character set.

  3. The lexical order of characters is determined by their position in charSet in the constructor.

  4. Character orderings are case sensitive. Two characters differing only by case (such as ”a” and “A”) have no special relation to each other. They are completely unique characters.

A typical use of this class is to define a range of character strings and split it up into many smaller subranges for parallel processing. The following is an example of this usage:

   range = CharRange("ACGT", "", "TTTTTTT");
   pspace = ParameterSpace()
   pspace.appendDimension("dna",range)
   pspace.setMaxJobletSize(10000)
   self.schedule(MyJoblet,pspace,())

The above code defines a string range consisting of all DNA sequences up to length 7. Then adds the range to a ParameterSpace which sets the split up (JobletSize) into unique subsets of 10000 sequences, and passes to schedule to schedule the parallel processing.

Constructor

CharRange(String charSet, String first, String last): Creates a new string range definition.

Defines a range of strings starting with first and ending with last. Longer strings are "greater than" shorter strings, and lexical ordering among equal-length strings is determined by the ordering of characters in charSet.

If last is "greater than" first then the set is defined in reverse order, such that longer strings appear first, and strings of the same length appear in the reverse lexical order of that defined by charSet.

Parameters: charSet - The character set over which the range is defined. Lexical order of characters is determined by their position in this string, with leftmost characters being ordered first. first - The first string in the set. last - The last string in the set..

Raises: Thrown - if first or last contain characters not in charSet.

Methods

Inherited from PySequence class:

__delitem__, __delslice__, __eq__, __finditem__, __finditem__, __ge__, __getitem__, __getslice__, __gt__, __le__, __lt__, __ne__, __nonzero__, __setitem__, __setitem__, __setslice__, __tojava__, classDictInit, del, delRange, fastSequence, fixindex, get, getslice, getStart, getStep, getStop, isMappingType, isNumberType, repeat, set, setslice, sliceLength

Inherited from PyObject class :

__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delattr__, __delitem__, __delslice__, __dir__, __div__, __divmod__, __findattr__, __findattr__, __finditem__, __float__, __getattr__, __getattr__, __getitem__, __getslice__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ilshift__, __imod__, __imul__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __len__, __long__, __lshift__, __mod__, __mul__, __neg__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __repr__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rxor__, __setattr__, __setattr__, __setitem__, __setslice__, __str__, __sub__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _dodel, _doget, _doget, _doset, _eq, _ge, _gt, _in, _is, _isnot, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _xor, addKeys, equals, getPyClass, hashCode, impAttr, invoke, invoke, invoke, invoke, invoke, isCallable, isSequenceType, safeRepr

See Also