\HeaderA{XIntegerViews-class}{The XIntegerViews class}{XIntegerViews.Rdash.class}
\aliasA{"!=,integer,XIntegerViews-method}{XIntegerViews-class}{"!=,integer,XIntegerViews.Rdash.method}
\aliasA{"!=,XInteger,XIntegerViews-method}{XIntegerViews-class}{"!=,XInteger,XIntegerViews.Rdash.method}
\aliasA{"!=,XIntegerViews,integer-method}{XIntegerViews-class}{"!=,XIntegerViews,integer.Rdash.method}
\aliasA{"!=,XIntegerViews,XInteger-method}{XIntegerViews-class}{"!=,XIntegerViews,XInteger.Rdash.method}
\aliasA{"!=,XIntegerViews,XIntegerViews-method}{XIntegerViews-class}{"!=,XIntegerViews,XIntegerViews.Rdash.method}
\aliasA{==,integer,XIntegerViews-method}{XIntegerViews-class}{==,integer,XIntegerViews.Rdash.method}
\aliasA{==,XInteger,XIntegerViews-method}{XIntegerViews-class}{==,XInteger,XIntegerViews.Rdash.method}
\aliasA{==,XIntegerViews,integer-method}{XIntegerViews-class}{==,XIntegerViews,integer.Rdash.method}
\aliasA{==,XIntegerViews,XInteger-method}{XIntegerViews-class}{==,XIntegerViews,XInteger.Rdash.method}
\aliasA{==,XIntegerViews,XIntegerViews-method}{XIntegerViews-class}{==,XIntegerViews,XIntegerViews.Rdash.method}
\aliasA{class:XIntegerViews}{XIntegerViews-class}{class:XIntegerViews}
\aliasA{show,XIntegerViews-method}{XIntegerViews-class}{show,XIntegerViews.Rdash.method}
\aliasA{Views,integer-method}{XIntegerViews-class}{Views,integer.Rdash.method}
\aliasA{Views,XInteger-method}{XIntegerViews-class}{Views,XInteger.Rdash.method}
\aliasA{XIntegerViews}{XIntegerViews-class}{XIntegerViews}
\keyword{methods}{XIntegerViews-class}
\keyword{classes}{XIntegerViews-class}
\begin{Description}\relax
The XIntegerViews class is the basic container for storing a set of views
(start/end locations) on the same XInteger object.
\end{Description}
\begin{Details}\relax
An XIntegerViews object contains a set of views (start/end locations) on the
same \LinkA{XInteger}{XInteger} object called "the subject integer vector" or simply
"the subject".
Each view is defined by its start and end locations: both are integers such
that start <= end.
An XIntegerViews object is in fact a particular case of a \LinkA{Views}{Views}
object (the XIntegerViews class contains the \LinkA{Views}{Views} class) so it
can be manipulated in a similar manner: see \code{?\LinkA{Views}{Views}} for
more information.
Note that two views can overlap and that a view can be "out of limits"
i.e. it can start before the first element of the subject or/and end
after its last element.
\end{Details}
\begin{Section}{Other methods}
In the code snippets below,
\code{x}, \code{object}, \code{e1} and \code{e2} are XIntegerViews objects,
and \code{i} can be a numeric or logical vector.

\describe{
\item[] \code{x[[i]]}:
Extract a view as an \LinkA{XInteger}{XInteger} object.
\code{i} must be a single numeric value (a numeric vector of length 1).
Can't be used for extracting a view that is "out of limits" (raise an
error). The returned object has the same \LinkA{XInteger}{XInteger} subtype as
\code{subject(x)}.

\item[] \code{e1 == e2}:
A vector of logicals indicating the result of the view by
view comparison. The views in the shorter of the two XIntegerViews
object being compared are recycled as necessary.

\item[] \code{e1 != e2}:
Equivalent to \code{!(e1 == e2)}.

}
\end{Section}
\begin{Author}\relax
P. Aboyoun
\end{Author}
\begin{SeeAlso}\relax
\LinkA{Views-class}{Views.Rdash.class},
\LinkA{XInteger-class}{XInteger.Rdash.class},
\LinkA{Views-utils}{Views.Rdash.utils}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  ## One standard way to create an XIntegerViews object is to use
  ## the Views() constructor:
  subject <- as(c(45, 67, 84, 67, 45, 78), "XInteger")
  v4 <- Views(subject, start=3:0, end=5:8)
  v4
  subject(v4)
  length(v4)
  start(v4)
  end(v4)
  width(v4)

  ## Attach a comment to views #3 and #4:
  names(v4)[3:4] <- "out of limits"
  names(v4)

  ## A more programatical way to "tag" the "out of limits" views:
  names(v4)[start(v4) < 1 | length(subject(v4)) < end(v4)] <- "out of limits"
  ## or just:
  names(v4)[length(subject(v4)) < width(v4)] <- "out of limits"

  ## Extract a view as an XInteger object:
  v4[[2]]

  ## It is an error to try to extract an "out of limits" view:
  #v4[[3]] # Error!

  ## Here the first view doesn't even overlap with the subject:
  subject <- as(c(97, 97, 97, 45, 45, 98), "XInteger")
  Views(subject, start=-3:4, end=-3:4 + c(3:6, 6:3))
\end{ExampleCode}
\end{Examples}

