Package scriptella.util
Class ColumnsMap
java.lang.Object
scriptella.util.ColumnsMap
Represents a map of columns accessible by name and index.
This class is useful for queries producing results similar to ResultSet.
- Version:
- 1.0
- Author:
- Fyodor Kupolov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts this mapping to index->name column map.Finds column index by name.voidregisterColumn(String name, int index) Registers column to for later lookup.
-
Constructor Details
-
ColumnsMap
public ColumnsMap()
-
-
Method Details
-
registerColumn
Registers column to for later lookup.- Parameters:
name- column name.index- positive column index.- Throws:
IllegalArgumentException- if index has illegal value
-
find
Finds column index by name.- Parameters:
name- column name.- Returns:
- column index, or null if column not found.
-
asIndexNameMap
Converts this mapping to index->name column map.- Returns:
- index->name column map.
-