Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

December/2024
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
29 3031    

[ Archives News
for 'Java Technology' ]

home > news > java technology > generic range class

Generic Range Class

Often code has a bad smell,nbsp;then it gets time to replace customnbsp;lines by common patterns. Sometimes it even makes sense to even replace a single line of code by a class just wrapping that single line (which actually increases code size), if that makes readers better understand what the code does. Unfortunately often such patterns are publiclynbsp;known butnbsp;do not exist as ready to use classes in the JRE, sonbsp;one needs to write them again and again. To not make people having to type again and again, I typically uploadnbsp;mine tonbsp;the web, so everybody is free to share it. One example is the Range pattern (see Martin FOWLER#039;s web site for a deeper introduction to that pattern). The Range Pattern In short, a Range is something that is described by an upper and lower bound. Sometimes, a range is open, i. e. it only has one bound or even none at all. Typically, ranges are used to check single values against them, like Is my birthday while I am on holidays? (the holidays are a range described by the first and last date, thenbsp;birthday is a single date). Or, Is this car in the wanted price range (neither too crappy, i. e. cheap, nor too expensive)? (the price range is described by the lowest sensible price and the maximum amount you want to pay, the actual price of a specific car is a single price). So, a range is a pattern, and it is independent of t...


Date: January, 01 2011
Url: http://www.java.net/blog/mkarg/archive/2011/01/01/generic-ranget-class


Others News

©2002-2019Java-Virtual-Machine.net web design software | free website generator | bootstrap navbar template | bootstrap navbar | bootstrap button