aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Validation for 2 Array Values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Validation for 2 Array Values" Watch "Validation for 2 Array Values" New topic
Author

Validation for 2 Array Values

Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 143

Hi All ,

I have requirement where i have multiple Low Limit and High Limit and input fields where structure can be like below

Low Limit ----> Hight Limit

LowLimitval1 ----> HighLimitVal1
LowLimitval2 ----> HighLimitVal2
LowLimitval3 ----> HighLimitVal3

These values (Low Limit & Hight Limit ) i am getting in 2 arrays , one for low limit and other for high limit .

The Validation i need to put is like below
Low Limit and High Limit denotes range .
So the for example :
1)
LL HL
0 0 ----> possible
1 2 ---->possible

2)
LL HL
0 0 ----> possible
0 2 ---->Not possible as LL limit shold start wid new value

3)
LL HL
0 2 ----> possible
3 1 ---->Not possible as HL cant be less than LL


4)
LL HL
0 3 ----> possible
2 4 ---->Not possible this is the case of the Overlapping , which should not happen
ht

5)
LL HL
0 3 ----> possible
5 6 ---->Not possible as there is gap in low limit and high limit(3-5 --> 4 is missing)

If anybody has done this type of validation . Please suggest best method ..


Thanks in advance....

- Chetan
Karn Kumar
Ranch Hand

Joined: Aug 06, 2009
Posts: 143

Hi All,

Finally i got other way to work with this .

I got all the Values in the request on the server side . Which i used for the creation of the XML tags which is combination of the 2 child tags HL and LL .

After that as my product provides the sorting functionality , so used it and then finally used the below condition if whole structure is valid or not on the server side.

1)First LL - > Should be equal to some start value. So that we will check start
2)Last HL--> Should be equal to some end value .
3)Most important question --> Current LL - Previous HL = 1 this condition should be applied . If not following then validation failed.

Hope it might help someone .

Thanks ..

- Chetan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation for 2 Array Values
 
Similar Threads
Writing recursive generated data to csv or text
Duplicate problem
String issue in Java code
please explain me how the binarySearch method works in the below program?
Sending data from an ArrayList to a file