toSimpleList <- function(object, newclass, newtype, ...)
tryCatch(slot(object, "annotation"), error = function(e) list())
toCompressedList <- function(object, newclass, newtype, ...)
toNewTypeList <- function(object, simpleclass, compressedclass, newtype) {
if (verbose) message("updateObject(object = 'AnnotatedList')")
if (verbose) message("updateObject(object = 'LogicalList')")
if (!("metadata" %in% names(attributes(object)))) {
if (verbose) message("updateObject(object = 'IntegerList')")
if (verbose) message("updateObject(object = 'NumericList')")
if (verbose) message("updateObject(object = 'ComplexList')")
if (verbose) message("updateObject(object = 'CharacterList')")
if (verbose) message("updateObject(object = 'RawList')")
if (verbose) message("updateObject(object = 'RleList')")
if (verbose) message("updateObject(object = 'FilterRules')")
if (verbose) message("updateObject(object = 'IRanges')")
if (verbose) message("updateObject(object = 'NormalIRanges')")
if (verbose) message("updateObject(object = 'IntervalTree')")
if (verbose) message("updateObject(object = 'MaskCollection')")
nir_list = lapply(slot(object, "nir_list"), updateObject),
if (verbose) message("updateObject(object = 'RDApplyParams')")
if (verbose) message("updateObject(object = 'RangedData')")
object <- new("RangedData", ranges = ranges, values = values)
if (verbose) message("updateObject(object = 'RangedDataList')")
if (verbose) message("updateObject(object = 'RangesListList')")
if (verbose) message("updateObject(object = 'IRangesList')")
if (verbose) message("updateObject(object = 'Rle')")
if (verbose) message("updateObject(object = 'RleViews')")
if (verbose) message("updateObject(object = 'XDataFrame')")
if (verbose) message("updateObject(object = 'XDataFrameList')")
if (verbose) message("updateObject(object = 'SplitXDataFrameList')")

### Some low-level helper functions and classes.
### Unless stated otherwise, nothing in this section is exported.
#Turning off malloc-based Auto-Extending buffers again until I find the
#time to troubleshoot 'R CMD check' segfault on moscato1 and pitt.
### We define the coercion method below as a workaround to the following
###   setMethod("as.vector", "A", function(x, mode="any") x@stuff)
###     no method for coercing this S4 class to a vector
###   > selectMethod("coerce", c("A", "vector"))
###   function (from, to, strict = TRUE)
###   > setAs("ANY", "vector", function(from) as.vector(from))
### Manipulating the prototype of an S4 class.
### Gets or sets the default value of the given slot of the given class by
### reading or altering the prototype of the class. setDefaultSlotValue() is
### typically used in the .onLoad() hook of a package when the DLL of the
### package needs to be loaded *before* the default value of a slot can be
## Re-compute the complete definition of the class. methods::setValidity()
## does that after calling assignClassDef() so we do it too.
### 'makeNakedMat.FUN' must be a function returning a character matrix.
### Works as long as length(), "[" and as.numeric() work on 'x'.
## Elt width and nb of elt to display if they were all 0.
## Effective elt width and nb of elt to display
### showHeadLines and showTailLines robust to NA, Inf and non-integer