1 /*
2 * ObjectLab, http://www.objectlab.co.uk/open is supporting FlatPack.
3 *
4 * Based in London, we are world leaders in the design and development
5 * of bespoke applications for the securities financing markets.
6 *
7 * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a>
8 * ___ _ _ _ _ _
9 * / _ \| |__ (_) ___ ___| |_| | __ _| |__
10 * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \
11 * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) |
12 * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/
13 * |__/
14 *
15 * www.ObjectLab.co.uk
16 *
17 * $Id: ColorProvider.java 74 2006-10-24 22:19:05Z benoitx $
18 *
19 * Copyright 2006 the original author or authors.
20 *
21 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
22 * use this file except in compliance with the License. You may obtain a copy of
23 * the License at
24 *
25 * http://www.apache.org/licenses/LICENSE-2.0
26 *
27 * Unless required by applicable law or agreed to in writing, software
28 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
29 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
30 * License for the specific language governing permissions and limitations under
31 * the License.
32 */
33 package net.sf.flatpack;
34
35 import java.util.Properties;
36
37 import net.sf.flatpack.ordering.OrderBy;
38
39 public interface DataSet extends Record, RecordDataSet {
40
41 /**
42 * Goes to the top of the data set. This will put the pointer one record
43 * before the first in the set. Next() will have to be called to get the
44 * first record after this call.
45 */
46 void goTop();
47
48 /**
49 * Goes to the last record in the dataset
50 */
51 void goBottom();
52
53 /**
54 * Moves back to the previous record in the set return true if move was a
55 * success, false if not
56 *
57 * @return boolean
58 */
59 boolean previous();
60
61 /**
62 * Removes a row from the dataset. Once the row is removed the pointer will
63 * be sitting on the record previous to the deleted row.
64 */
65 void remove();
66
67 /**
68 * Returns the index the pointer is on for the array
69 *
70 * @return int
71 */
72 int getIndex();
73
74 /**
75 * Returns the total number of rows parsed in from the file
76 *
77 *
78 * @return int - Row Count
79 */
80 int getRowCount();
81
82 /**
83 * Returns true or false as to whether or not the line number contains an
84 * error. The import will skip the line if it contains an error and it will
85 * not be processed
86 *
87 * @param lineNo -
88 * int line number
89 * @return boolean
90 */
91 boolean isAnError(int lineNo);
92
93 /**
94 * Orders the data by column(s) specified. This will reposition the cursor
95 * to the top of the DataSet when executed. This is currently not supported
96 * when specifying <RECORD> elements in the mapping. An exception will be
97 * thrown if this situation occurs
98 *
99 * @param ob -
100 * OrderBy object
101 * @see net.sf.flatpack.ordering.OrderBy
102 * @see net.sf.flatpack.ordering.OrderColumn
103 */
104 void orderRows(OrderBy ob);
105
106 /**
107 * Sets data in the DataSet to lowercase
108 */
109 void setLowerCase();
110
111 /**
112 * Sets data in the DataSet to uppercase
113 */
114 void setUpperCase();
115
116 /**
117 * Sets the absolute position of the record pointer
118 *
119 * @param localPointer -
120 * int
121 */
122 void absolute(int localPointer);
123
124 /**
125 * Setting this to True will parse text as is and throw a
126 * NumberFormatException. Setting to false, which is the default, will
127 * remove any non numeric character from the field. The remaining numeric
128 * chars's will be returned. If it is an empty string,or there are no
129 * numeric chars, 0 will be returned for getInt() and getDouble()
130 *
131 * @param strictNumericParse
132 * The strictNumericParse to set.
133 */
134 void setStrictNumericParse(boolean strictNumericParse);
135
136 /**
137 * Sets the properties from the pzconvert.properties file.
138 * This file specifies the PZConverter implementation to use
139 * for a particular class
140 *
141 * @param props
142 * Property mapping for String to Object conversion
143 */
144 void setPZConvertProps(Properties props);
145
146 /**
147 * Changes the value of the given column only for the
148 * given row which the pointer is currently sitting on.
149 *
150 * @param column
151 * Column name to set the value for
152 * @param value
153 * Value to change the column to
154 */
155 void setValue(String column, String value);
156
157 /**
158 * Clears out the rows in memory from the last parse.
159 *
160 */
161 void clearRows();
162
163 /**
164 * Clears out the parse errors from memory
165 *
166 */
167 void clearErrors();
168
169 /**
170 * Clears both the errors and rows from memory
171 *
172 */
173 void clearAll();
174 }