Record Class RValue.Logical
java.lang.Object
java.lang.Record
com.eco.bio7.rffm.RValue.Logical
- All Implemented Interfaces:
RValue
- Enclosing interface:
RValue
-
Nested Class Summary
Nested classes/interfaces inherited from interface RValue
RValue.Int, RValue.List, RValue.Logical, RValue.Null, RValue.Num, RValue.Other, RValue.Raw, RValue.StrModifier and TypeInterfaceDescriptionstatic final recordAn integer vector (also a factor: the codes with the attribute "levels").static final recordA list (also a data frame: class "data.frame" with names and row.names).static final recordA logical vector: 1 (TRUE), 0 (FALSE), NA_INTEGER (NA).static final recordNULL.static final recordA numeric (double) vector, a matrix with the attribute "dim".static final recordAn object which is not transferred (e.g., a function or an environment): only its type.static final recordA raw vector.static final recordA character vector (null is NA). -
Field Summary
Fields inherited from interface RValue
NA_INTEGER, NA_REAL, NA_REAL_BITS, NULLModifier and TypeFieldDescriptionstatic final intNA of integer and logical vectors (as in R).static final doubleNA_real_ of R (a NaN with a payload, distinct from NaN).static final longThe bit pattern of NA_real_ in R.static final RValueNULL of R. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean[]The values as booleans (NA is false).Returns the value of theattributesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisNA(int i) intlength()The number of elements (0 for NULL).final StringtoString()Returns a string representation of this record class.int[]values()Returns the value of thevaluesrecord component.Methods inherited from interface RValue
attribute, booleans, bytes, dim, doubles, element, element, elements, firstDouble, firstInt, firstString, inherits, ints, isCharacter, isDataFrame, isFactor, isList, isLogical, isMatrix, isNull, isNumeric, isRaw, isTrue, matrix, names, strings, typeName, with, withDim, withNamesModifier and TypeMethodDescriptiondefault RValueThe attribute or null.default boolean[]booleans()The values as booleans: logical values (NA: false), numbers (not 0: true).default byte[]bytes()The bytes of a raw vector.default int[]dim()The dimensions (the "dim" attribute) or null.default double[]doubles()The values as numbers: numeric, integer and logical vectors (NA: NA_REAL), character vectors are parsed (not a number: NA_REAL).default RValueelement(int index) An element of a list (from 0).default RValueAn element of a list by name, or null.elements()The elements of a list (also the columns of a data frame).default doubleThe first number (seeRValue.doubles()).default intfirstInt()The first integer (seeRValue.ints()).default StringThe first text (seeRValue.strings()).default booleanReturns true if the "class" attribute contains the class.default int[]ints()The values as integers: integer and logical vectors, numbers are truncated (NA, NaN: NA_INTEGER).default booleanA character vector.default booleandefault booleanisFactor()default booleanisList()A list (also a data frame).default booleandefault booleanisMatrix()A matrix (two dimensions).default booleanisNull()default booleanNumbers: a numeric or an integer vector (not a factor).default booleanisRaw()default booleanisTrue()True if the first value is TRUE (a logical vector, e.g., of is.numeric(x)).default double[][]matrix()A matrix as rows: [row][column] (numbers with two dimensions).default String[]names()The names (the "names" attribute) or null.default String[]strings()The values as text: a character vector (NA: null), the labels of a factor, numbers and logical values as text (NA: "NA").default StringtypeName()The type of R, e.g., "double", "character", "list" (for messages).default RValueThis value with one attribute more (or replaced; null removes it).default RValuewithDim(int... dim) This value as a matrix or an array with the dimensions.default RValueThis value with names.
-
Constructor Details
-
Logical
-
Logical
public Logical(boolean... values)
-
-
Method Details
-
length
-
isNA
public boolean isNA(int i) -
asBooleans
public boolean[] asBooleans()The values as booleans (NA is false). -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
values
public int[] values()Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
attributes
Returns the value of theattributesrecord component.- Specified by:
attributesin interfaceRValue- Returns:
- the value of the
attributesrecord component
-