Package omero :: Module rtypes
[hide private]
[frames] | no frames]

Module rtypes

source code

:

   /*
    *   $Id$
    *
    *   Copyright 2008 Glencoe Software, Inc. All rights reserved.
    *   Use is subject to license terms supplied in LICENSE.txt
    *
    */
Classes [hide private]
  RBoolI
  RDoubleI
  RFloatI
  RIntI
  RLongI
  RTimeI
  RInternalI
  RObjectI
  RStringI
  RClassI
  RArrayI
Guaranteed to never contain an empty list.
  RListI
Guaranteed to never contain an empty list.
  RSetI
Guaranteed to never contain an empty list.
  RMapI
  ObjectFactory
Functions [hide private]
 
rtype(val)
If None or an RType, return the argument itself.
source code
 
wrap(val, cache=None) source code
 
unwrap(val, cache=None) source code
 
rbool(val)
Returns the argument itself if None or an instance of RBool.
source code
 
rdouble(val)
Returns the argument itself if None or an instance of RDouble.
source code
 
rfloat(val)
Returns the argument itself if None or an instance of RFloat.
source code
 
rint(val)
Returns the argument itself if None or an instance of RInt.
source code
 
rlong(val)
Returns the argument itself if None or an instance of RLong.
source code
 
rtime(val)
Returns the argument itself if None or an instance of RTime.
source code
 
rinternal(val)
If argument is None, returns rnullinternal.
source code
 
robject(val)
If argument is None, returns rnullobject.
source code
 
rclass(val)
If argument is None or "", returns emptyclass.
source code
 
rstring(val)
If argument is None or "", returns emptystring.
source code
 
rarray(val=None, *args) source code
 
rlist(val=None, *args) source code
 
rset(val=None, *args) source code
 
rmap(val=None, **kwargs) source code
Variables [hide private]
  rtrue = RBoolI(True)
  rfalse = RBoolI(False)
  rlong0 = RLongI(0)
  rint0 = RIntI(0)
  remptystr = RStringI("")
  remptyclass = RClassI("")
  rnullinternal = RInternalI(None)
  rnullobject = RObjectI(None)
  ObjectFactories = {RBoolI: ObjectFactory(RBoolI, lambda: RBool...

Imports: omero, Ice, omero_RTypes_ice, omero_Scripts_ice


Function Details [hide private]

rtype(val)

source code 

If None or an RType, return the argument itself. Otherwise, attempts to dispatch to the other omero.rtypes.* static methods to create a proper {@link RType} subclass by checking the type of the input. If no conversion is found, a {@link ClientError} is thrown.

Note: unlike the statically typed languages, the rtype implementation in Python is somewhat limited by the lack of types (float v. double) All float-like values will produce an omero.RFloat subclass. Similar problems may arise with rlong and rint

rbool(val)

source code 

Returns the argument itself if None or an instance of RBool. Otherwise, checks the value for"trueness" and returns either rtrue or rfalse.

rdouble(val)

source code 

Returns the argument itself if None or an instance of RDouble. Otherwise, assigns a coerced float to the value of a new RDouble.

rfloat(val)

source code 

Returns the argument itself if None or an instance of RFloat. Otherwise, assigns a coerced float to the value of a new RFloat.

rint(val)

source code 

Returns the argument itself if None or an instance of RInt. If the argument is 0, rint0 is returned. Otherwise, assigns a coerced int to the value of a new RInt

rlong(val)

source code 

Returns the argument itself if None or an instance of RLong. If the argument is 0, rlong 0 is returned. Otherwise, assigns a coerced int to the value of a new RLong

rtime(val)

source code 

Returns the argument itself if None or an instance of RTime. Otherwise, assigns a coerced long to the value of a new RTime

rinternal(val)

source code 

If argument is None, returns rnullinternal. If an RInternal, returns the argument itself. Otherwise creates a new RInternal.

robject(val)

source code 

If argument is None, returns rnullobject. If an RObject, returns the argument itself. Otherwise creates a new RObject

rclass(val)

source code 

If argument is None or "", returns emptyclass. If an RClass, returns the argument itself. Otherwise creates a new RClass

rstring(val)

source code 

If argument is None or "", returns emptystring. If an RString, returns the argument itself. Otherwise creates a new RString


Variables Details [hide private]

ObjectFactories

Value:
{RBoolI: ObjectFactory(RBoolI, lambda: RBoolI(False)), RDoubleI: Objec\
tFactory(RDoubleI, lambda: RDoubleI(0.0)), RFloatI: ObjectFactory(RFlo\
atI, lambda: RFloatI(0.0)), RIntI: ObjectFactory(RIntI, lambda: RIntI(\
0)), RLongI: ObjectFactory(RLongI, lambda: RLongI(0)), RTimeI: ObjectF\
actory(RTimeI, lambda: RTimeI(0)), RClassI: ObjectFactory(RClassI, lam\
bda: RClassI("")), RStringI: ObjectFactory(RStringI, lambda: RStringI(\
"")), RInternalI: ObjectFactory(RInternalI, lambda: RInternalI(None)),\
 RObjectI: ObjectFactory(RObjectI, lambda: RObjectI(None)), RArrayI: O\
...