Regards, Richard
what does the long[] represent ?
Regards, Richard
Seid Myadiyev<br />SCJP, SCWCD, SCBCD, SCEA-Part 1
3. Upper/Lower case � String.startsWith(�) is case-sensitive; (is this acceptable by your specifications?)
Regards, Richard
Originally posted by Richard Jackson:
In my Assignment,there are not limitation statements about CASE-SENSITIVE.
Sun Certified Java Web Component Developer for J2EE v1.4<br />Sun Certified Java Developer for J2SE v1.4<br />Sun Certified Java Programmer for J2SE v1.4
Are you sure case-sensitivity may not be implied by your specifications?
All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field.
Regards, Richard
Sun Certified Java Web Component Developer for J2EE v1.4<br />Sun Certified Java Developer for J2SE v1.4<br />Sun Certified Java Programmer for J2SE v1.4
// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public long[] findByCriteria(String[] criteria);
Regards, Richard
Originally posted by Richard Jackson:
My misunderstanding problems are:
1) How to judge whether the criteria[n] is valid? (only by startsWith() method ?)
2) Must I read records firstly ?Do I need know the length of "record number array"?
3) Am I still use String.match() method?
Sun Certified Java Web Component Developer for J2EE v1.4<br />Sun Certified Java Developer for J2SE v1.4<br />Sun Certified Java Programmer for J2SE v1.4
For your last question, if you are referring to the String.matches(String regex) operation, this is also a design decision. To satisfy the criteria match requirements on server-side, IMO String.startsWith(String) is sufficient. On client-side you'll find the criteria specifications differ, and it will be your call on what route to follow (which API function(s) to use).
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Originally posted by Nicholas Cheung:
So, should I create a new function, say search(), in order to fulfill the client requirements, i.e. using String.indexOf(String) instead of String.startsWith(String)?
Or, I can simply use String.startsWith(String) as the search operation for the client?
Sun Certified Java Web Component Developer for J2EE v1.4<br />Sun Certified Java Developer for J2SE v1.4<br />Sun Certified Java Programmer for J2SE v1.4
Consider Paul's rocket mass heater. |