Results 1 to 9 of 9
Thread: Patterns
- 10-20-2008, 07:08 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 29
- Rep Power
- 0
- 10-20-2008, 07:17 PM #2
Senior Member
- Join Date
- Aug 2008
- Location
- Stockholm, Sweden
- Posts
- 119
- Rep Power
- 0
Check out String and Pattern classes in the API.
- 10-20-2008, 07:43 PM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 10-20-2008, 08:15 PM #4
What is the relationship between: aabba and aabbaabbaa?
How do you generate one from the other?
It would look like the first string is reversed and concatentated to itself.
What does "finish the pattern" mean?
- 10-20-2008, 11:29 PM #5
Member
- Join Date
- Sep 2008
- Posts
- 29
- Rep Power
- 0
srry, i meant continue the pattern, like if you entered abbabb then it will find a pattern
- 10-21-2008, 12:49 AM #6
So is the pattern for that: abb ?entered abbabb then it will find a pattern
What is your design or ideas so far?
- 10-21-2008, 05:16 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I think he wants to find a pattern 'aabba' and modified it to get the output as 'aabbaabbaa'
Better to explain it well, lots of misunderstand here.
- 10-23-2008, 11:11 AM #8
Member
- Join Date
- Oct 2008
- Posts
- 19
- Rep Power
- 0
i don't understand your means! ~~~
you can print it twice if you entered the 'aabba' ! The pattern is your input something!CODE
but it's very worthless!Java Code:Pattern p = Pattern.compile(input); Matcher m = p.matcher(input); while(m.find()) { System.out.print(input + input); } while()
- 10-23-2008, 11:37 AM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
As Norm says in his last post, it's depends on the design.
The way you explain is not much bad actually. But think if you found the same string 100 times. So how many string objects you have to instantiate. Even Java has garbage collector, I don't think it's a good idea.
Similar Threads
-
Bean Patterns
By Sysem in forum New To JavaReplies: 0Last Post: 05-26-2008, 07:33 PM -
Patterns to application with swing and hibernate
By Peter in forum JDBCReplies: 2Last Post: 07-04-2007, 06:58 AM -
Design patterns
By Freddie in forum New To JavaReplies: 2Last Post: 05-12-2007, 06:21 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks