public abstract class SPSSVariable extends Object
| Modifier and Type | Field and Description |
|---|---|
Map<String,SPSSVariableCategory> |
categoryMap
The map of categories.
|
SPSSRecordType3 |
valueLabelRecord |
SPSSRecordType2 |
variableRecord |
| Constructor and Description |
|---|
SPSSVariable(SPSSFile file)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
abstract SPSSVariableCategory |
addCategory(byte[] byteValue,
String label)
Adds a category to the variable
|
String |
getAlignmentLabel() |
abstract SPSSVariableCategory |
getCategory(byte[] byteValue)
Gets a category for this variable based on a byte[8] value
|
Element |
getDDI2(Document doc,
FileFormatInfo dataFormat,
int offset)
Generates a DDI 2 element for this variable based on the specified
data format.
|
Element |
getDDI2(Document doc,
int offset)
Generates a DDI 2 element for this variable based on the SPSS data
format.
|
Element |
getDDI3CategoryScheme(Document doc)
Generates a DDI3 Category Scheme for this variable using default ID
|
Element |
getDDI3CodeScheme(Document doc)
Generates a DDI3 Code Scheme for this variable using default category and
code scheme identifiers
|
Element |
getDDI3DataItem(Document doc,
FileFormatInfo dataFormat,
int offset)
Generates a DDI3 Data Item for this variable.
|
String |
getDDI3DataType()
Gets the DDI data type for this variable that matches the controlled
vocabulary of the representation @type attribute as closely as possible.
|
String |
getDDI3DefaultCategorySchemeID()
Returns a default Category Scheme ID based on the file unique identifier.
|
String |
getDDI3DefaultCodeSchemeID()
Returns a default Code Scheme ID based on the file unique identifier.
|
Element |
getDDI3ProprietaryDataItem(Document doc)
Generates a DDI3 Proprietary Data Item for this variable.
|
org.opendatafoundation.data.spss.SPSSVariable.DDI3RepresentationType |
getDDI3RepresentationType()
Gets the DDI data type for this variable that matches the controlled
vocabulary of the representation @type attribute as closely as possible.
|
Element |
getDDI3Variable(Document doc)
Generates a DDI3 Variable element for this variable
|
int |
getDecimals()
Retrieves the SPSS write format number of decimals.
|
String |
getLabel() |
int |
getLength()
Retrieves the SPSS write format width.
|
int |
getLength(FileFormatInfo format)
Computes the variable length in the specific format
|
String |
getMeasureLabel() |
String |
getName() |
int |
getNumber() |
abstract int |
getNumberOfObservations() |
String |
getShortName() |
abstract String |
getSPSSFormat() |
abstract String |
getValueAsString(int recordNumber,
FileFormatInfo dataFormat) |
boolean |
hasValueLabels()
Determines if a variable is associated with a set of value labels
|
boolean |
isDate()
Determines if a variable is a date without time information
|
boolean |
isMissingValueCode(double value)
Determines if a numeric value is a missing value "code" (not a SYSMISS)
|
boolean |
isMissingValueCode(String str)
Determines if a String value is a missing value "code" (not a SYSMISS)
|
public SPSSRecordType2 variableRecord
public SPSSRecordType3 valueLabelRecord
public Map<String,SPSSVariableCategory> categoryMap
public SPSSVariable(SPSSFile file)
file - the SPSSFile this variable belongs topublic abstract SPSSVariableCategory addCategory(byte[] byteValue, String label) throws SPSSFileException
SPSSFileExceptionpublic String getAlignmentLabel()
public abstract SPSSVariableCategory getCategory(byte[] byteValue) throws SPSSFileException
SPSSFileExceptionpublic abstract int getNumberOfObservations()
public Element getDDI2(Document doc, int offset) throws SPSSFileException
doc - the document wrapping this elementoffset - the variable offset for starting position in the fileSPSSFileExceptionpublic Element getDDI2(Document doc, FileFormatInfo dataFormat, int offset) throws SPSSFileException
doc - the document wrapping this elementdataFormat - the SPSSFile.DataFormat this DDI is being generated foroffset - the variable offset for starting position in the fileSPSSFileExceptionpublic String getDDI3DefaultCategorySchemeID()
public String getDDI3DefaultCodeSchemeID()
public Element getDDI3CategoryScheme(Document doc)
doc - public Element getDDI3CodeScheme(Document doc) throws DOMException, SPSSFileException
doc - SPSSFileExceptionDOMExceptionpublic Element getDDI3DataItem(Document doc, FileFormatInfo dataFormat, int offset) throws DOMException, SPSSFileException
doc - dataFormat - offset - SPSSFileExceptionDOMExceptionpublic Element getDDI3ProprietaryDataItem(Document doc) throws DOMException, SPSSFileException
doc - SPSSFileExceptionDOMExceptionpublic Element getDDI3Variable(Document doc)
doc - public org.opendatafoundation.data.spss.SPSSVariable.DDI3RepresentationType getDDI3RepresentationType()
public String getDDI3DataType()
public int getDecimals()
public String getLabel()
public int getLength()
public int getLength(FileFormatInfo format)
public String getMeasureLabel()
public String getName()
public int getNumber()
public abstract String getSPSSFormat()
public String getShortName()
public abstract String getValueAsString(int recordNumber, FileFormatInfo dataFormat) throws SPSSFileException
recordNumber - SPSSFileExceptionpublic boolean hasValueLabels()
public boolean isDate()
public boolean isMissingValueCode(double value)
public boolean isMissingValueCode(String str)
Copyright © 2016. All rights reserved.