com.stata.sfi.Frame
.@Deprecated public final class DataFrame extends Object
All variable and observation numbering begins at 1 unless otherwise stated.
Modifier and Type | Method and Description |
---|---|
static int |
addVarByte(String rname,
String vname)
Deprecated.
Add a variable of type byte to a data frame.
|
static int |
addVarDouble(String rname,
String vname)
Deprecated.
Add a variable of type double to a data frame.
|
static int |
addVarFloat(String rname,
String vname)
Deprecated.
Add a variable of type float to a data frame.
|
static int |
addVarInt(String rname,
String vname)
Deprecated.
Add a variable of type int to a data frame.
|
static int |
addVarLong(String rname,
String vname)
Deprecated.
Add a variable of type long to a data frame.
|
static int |
addVarStr(String rname,
String vname,
int length)
Deprecated.
Add a variable of type str to a data frame.
|
static int |
addVarStrL(String rname,
String vname)
Deprecated.
Add a variable of type strL to a data frame.
|
static int |
allocate(String rname)
Deprecated.
Allocate a new data frame.
|
static int |
allocateStrL(StrLConnector dsc,
long size)
Deprecated.
Allocate a strL so that a buffer can be stored using
writeBytes ; the contents
of the strL will not be initialized. |
static int |
allocateStrL(StrLConnector dsc,
long size,
boolean binary)
Deprecated.
Allocate a strL so that a buffer can be stored using
writeBytes ; the contents
of the strL will not be initialized. |
static int |
dropVar(String rname,
int var)
Deprecated.
Drop the variable at the specified variable index.
|
static int |
free(String rname)
Deprecated.
Free a previously allocated data frame.
|
static double |
getNum(String rname,
int var,
long obs)
Deprecated.
Read a numeric value from a data frame.
|
static long |
getObsTotal(String rname)
Deprecated.
Get the number of observations in a data frame.
|
static String |
getStr(String rname,
int var,
long obs)
Deprecated.
Read a string value from a data frame.
|
static int |
getStrVarWidth(String rname,
int var)
Deprecated.
Get the width of a variable of type str.
|
static int |
getType(String rname,
int var)
Deprecated.
Get the numeric data type for the specified variable.
|
static int |
getVarCount(String rname)
Deprecated.
Get the number of variables in a data frame.
|
static String |
getVarFormat(String rname,
int var)
Deprecated.
Get the format for a variable in a data frame.
|
static int |
getVarIndex(String rname,
String varname)
Deprecated.
Look up the variable index for the specified name in the data frame.
|
static String |
getVarName(String rname,
int var)
Deprecated.
Get the variable name at a given variable index.
|
static boolean |
isVarTypeStr(String rname,
int var)
Deprecated.
Test if a variable is of type str.
|
static boolean |
isVarTypeString(String rname,
int var)
Deprecated.
Test if a variable is string or numeric.
|
static boolean |
isVarTypeStrL(String rname,
int var)
Deprecated.
Test if a variable is of type strL.
|
static int |
readBytes(StrLConnector dsc,
byte[] b)
Deprecated.
Read a sequence of bytes from a strL in the current Stata dataset.
|
static int |
readBytes(StrLConnector dsc,
byte[] b,
int off,
int len)
Deprecated.
Read a sequence of bytes from a strL in the current Stata dataset.
|
static int |
setObsTotal(String rname,
long obs)
Deprecated.
Set the number of observations in a data frame.
|
static int |
setVarFormat(String rname,
int var,
String format)
Deprecated.
Set the format for a variable in a data frame.
|
static int |
storeBytes(String rname,
int var,
long obs,
byte[] bytes,
boolean binary)
Deprecated.
Store a byte buffer to a strL in the current Stata dataset.
|
static int |
storeNum(String rname,
int var,
long obs,
double value)
Deprecated.
Store a numeric value in a data frame.
|
static int |
storeStr(String rname,
int var,
long obs,
String value)
Deprecated.
Store a string value in a data frame.
|
static int |
writeBytes(StrLConnector dsc,
byte[] b)
Deprecated.
Write a byte buffer to a strL in the current Stata dataset; the
strL must be allocated using
allocateStrL before
calling this method. |
static int |
writeBytes(StrLConnector dsc,
byte[] b,
int off,
int len)
Deprecated.
Write
len bytes from the specified byte buffer starting at
offset off to a strL in the current Stata dataset;
the strL must be allocated using
allocateStrL before
calling this method. |
@Synchronized public static int addVarByte(String rname, String vname)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.@Synchronized public static int addVarDouble(String rname, String vname)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.@Synchronized public static int addVarFloat(String rname, String vname)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.@Synchronized public static int addVarInt(String rname, String vname)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.@Synchronized public static int addVarLong(String rname, String vname)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.@Synchronized public static int addVarStr(String rname, String vname, int length)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.length
- Initial size of the variable. If the length is greater than
Data.getMaxStrLength()
, then a variable of type
strL will be created.@Synchronized public static int addVarStrL(String rname, String vname)
rname
- Reference name for the data frame.vname
- Name of the variable to be created.@Synchronized public static int allocate(String rname)
free
must be called to return the memory
associated with the data frame to the system.rname
- Reference name for the new data frame.@Synchronized public static int allocateStrL(StrLConnector dsc, long size)
writeBytes
; the contents
of the strL will not be initialized. By default, the data will be
marked as binary.dsc
- The StrLConnector representing a strL.size
- The size in bytes.@Synchronized public static int allocateStrL(StrLConnector dsc, long size, boolean binary)
writeBytes
; the contents
of the strL will not be initialized.dsc
- The StrLConnector representing a strL.size
- The size in bytes.binary
- Mark the data as binary.@Synchronized public static int dropVar(String rname, int var)
rname
- Reference name for the data frame.var
- Variable to drop.@Synchronized public static int free(String rname)
rname
- Reference name for the data frame.@ThreadSafe public static double getNum(String rname, int var, long obs)
rname
- Reference name for the data frame.var
- Variable to access.obs
- Observation to access.@ThreadSafe public static long getObsTotal(String rname)
rname
- Reference name for the data frame.@Synchronized public static String getStr(String rname, int var, long obs)
rname
- Reference name for the data frame.var
- Variable to access.obs
- Observation to access.String
. Returns null if an error occurs.@ThreadSafe public static int getStrVarWidth(String rname, int var)
rname
- Reference name for the data frame.var
- The index of the variable to test.@ThreadSafe public static int getType(String rname, int var)
rname
- Reference name for the data frame.var
- Variable to access.TYPE_BYTE
,
TYPE_INT
,
TYPE_LONG
,
TYPE_FLOAT
,
TYPE_DOUBLE
,
TYPE_STR
, or
TYPE_STRL
.@ThreadSafe public static int getVarCount(String rname)
rname
- Reference name for the data frame.@ThreadSafe public static String getVarFormat(String rname, int var)
rname
- Reference name for the data frame.var
- Index of the variable to look up.@Synchronized public static int getVarIndex(String rname, String varname)
rname
- Reference name for the data frame.varname
- Name of the variable.@ThreadSafe public static String getVarName(String rname, int var)
rname
- Reference name for the data frame.var
- Index of the variable to look up.@ThreadSafe public static boolean isVarTypeStr(String rname, int var)
rname
- Reference name for the data frame.var
- The index of the variable to test.@ThreadSafe public static boolean isVarTypeString(String rname, int var)
rname
- Reference name for the data frame.var
- The index of the variable to test.@ThreadSafe public static boolean isVarTypeStrL(String rname, int var)
rname
- Reference name for the data frame.var
- The index of the variable to test.@Synchronized public static int readBytes(StrLConnector dsc, byte[] b) throws IOException
dsc
- The StrLConnector representing a strL.b
- The buffer into which the data are read.IOException
- Throws an IOException if an error occurs.@Synchronized public static int readBytes(StrLConnector dsc, byte[] b, int off, int len) throws IOException
dsc
- The StrLConnector representing a strL.b
- The buffer into which the data are read.off
- The start offset in the destination array b.len
- The maximum number of bytes read.IOException
- Throws an IOException if an error occurs.@Synchronized public static int setObsTotal(String rname, long obs)
rname
- Reference name for the data frame.obs
- The number of observations to set.@Synchronized public static int setVarFormat(String rname, int var, String format)
rname
- Reference name for the data frame.var
- Index of the variable to format.format
- New format.@Synchronized public static int storeBytes(String rname, int var, long obs, byte[] bytes, boolean binary)
rname
- Reference name for the data frame.var
- Variable to access.obs
- Observation to access.bytes
- Bytes to store.binary
- Mark the data as binary.@ThreadSafe public static int storeNum(String rname, int var, long obs, double value)
rname
- Reference name for the data frame.var
- Variable to access.obs
- Observation to access.value
- Value to store.@Synchronized public static int storeStr(String rname, int var, long obs, String value)
rname
- Reference name for the data frame.var
- Variable to access.obs
- Observation to access.value
- Value to store.@Synchronized public static int writeBytes(StrLConnector dsc, byte[] b)
allocateStrL
before
calling this method. The buffer size may be smaller than the allocation
size for the strL so that calling this method multiple times will
write the data in chunks. The current position of each write will be
automatically maintained. Writing beyond the allocation size is not
permitted.dsc
- The StrLConnector representing a strL.b
- The buffer holding the data to store.@Synchronized public static int writeBytes(StrLConnector dsc, byte[] b, int off, int len)
len
bytes from the specified byte buffer starting at
offset off
to a strL in the current Stata dataset;
the strL must be allocated using
allocateStrL
before
calling this method. The buffer size may be smaller than the allocation
size for the strL so that calling this method multiple times will
write the data in chunks. The current position of each write will be
automatically maintained. Writing beyond the allocation size is not
permitted.dsc
- The StrLConnector representing a strL.b
- The buffer holding the data to store.off
- The offset into the buffer.len
- The number of bytes to write.