Package org.rcsb.cif.model
Interface Column<T>
- Type Parameters:
T- the array type of this column (int[], double[], String[])
- All Known Subinterfaces:
FloatColumn,IntColumn,StrColumn
- All Known Implementing Classes:
BinaryColumn,BinaryFloatColumn,BinaryIntColumn,BinaryStrColumn,Column.EmptyColumn,DelegatingColumn,DelegatingFloatColumn,DelegatingIntColumn,DelegatingStrColumn,TextColumn
public interface Column<T>
Represents a column of information in a
CifFile, e.g. the coordinates in x-dimension of all atoms.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classColumn.EmptyColumnThis dummy instance is created and returned if an absent Column is requested for a Category. -
Method Summary
Modifier and Type Method Description TgetArray()Access to the underlying data array.StringgetColumnName()The name of thisColumn.intgetRowCount()The number of rows in thisColumn.StringgetStringData(int row)Access to entries of thisColumnwithout any assumptions about the content type.ValueKindgetValueKind(int row)States theValueKindfor a particular row.default booleanisDefined()Queries this column whether it is defined.default Stream<String>stringData()Access to all entries of this column asStringvalues.default Stream<ValueKind>valueKinds()
-
Method Details
-
getColumnName
String getColumnName()The name of thisColumn.- Returns:
- the
Stringwhich is used to acquire this column from its parentCategory
-
getRowCount
int getRowCount()- Returns:
- the length of this
Column
-
getStringData
Access to entries of thisColumnwithout any assumptions about the content type. No checks about the validity of the row argument are made. Values smaller than 0 or larger or equal to the row count will raise exceptions.- Parameters:
row- index of the element to retrieve- Returns:
- the
Stringrepresentation of the corresponding row
-
stringData
Access to all entries of this column asStringvalues.- Returns:
- a
Streamof allStringvalues
-
getValueKind
States theValueKindfor a particular row. Elements may either be 'present', 'not_specified' (.) or 'unknown' (?). -
valueKinds
- Returns:
- a
Streamwith a number of ValueKinds equal to row count
-
isDefined
default boolean isDefined()Queries this column whether it is defined. To avoidNullPointerExceptionbeing thrown left, right, and center, categories and columns not present in a parsed file will be presented by an undefined state.- Returns:
falseif thisColumnhas row count 0 and no data in it
-
getArray
T getArray()Access to the underlying data array. Useful, when you are sure that your dealing with binary data and want the most efficient access to all data in this column. For text data, this will be 'slow' as it requires the creation of the requested array by parsing all data in this column.- Returns:
- an array of the appropriate type (int[], double[], String[])
-