Changeset 1364
- Timestamp:
- 04/20/07 22:08:34
- Files:
-
- external/ical4j/ical4j-1.0-beta1 (modified) (1 prop)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Component.java (modified) (3 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/ComponentFactory.java (modified) (5 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/LocationTypeList.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Parameter.java (modified) (3 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/ParameterFactoryImpl.java (modified) (26 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Property.java (modified) (5 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/PropertyFactoryImpl.java (modified) (15 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Recur.java (modified) (7 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/component/Observance.java (modified) (3 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/component/VVenue.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/parameter/Abbrev.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/parameter/Type.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/parameter/Vvenue.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Attach.java (modified) (2 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Country.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/ExtendedAddress.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Locality.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Location.java (modified) (4 diffs)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/LocationTypes.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Name.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Postalcode.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Region.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/StreetAddress.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Tel.java (added)
- external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Url.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
external/ical4j/ical4j-1.0-beta1
- Property svn:ignore set to .eclipsebin .classpath
external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Component.java
r1267 r1364 66 66 public static final String VALARM = "VALARM"; 67 67 68 public static final String VVENUE = "VVENUE"; 69 68 70 public static final String EXPERIMENTAL_PREFIX = "X-"; 69 71 … … 122 124 return properties; 123 125 } 124 126 125 127 /** 126 128 * Convenience method for retrieving a list of named properties. … … 132 134 return getProperties().getProperties(name); 133 135 } 134 136 135 137 /** 136 138 * Convenience method for retrieving a named property. external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/ComponentFactory.java
r1267 r1364 43 43 import net.fortuna.ical4j.model.component.VTimeZone; 44 44 import net.fortuna.ical4j.model.component.VToDo; 45 import net.fortuna.ical4j.model.component.VVenue; 45 46 import net.fortuna.ical4j.model.component.XComponent; 46 47 import net.fortuna.ical4j.util.CompatibilityHints; … … 56 57 57 58 private boolean allowIllegalNames; 58 59 59 60 /** 60 61 * Constructor made private to prevent instantiation. … … 70 71 return instance; 71 72 } 72 73 73 74 public Component createComponent(final String name) { 74 75 return createComponent(name, new PropertyList()); … … 108 109 else if (Component.VTIMEZONE.equals(name)) { 109 110 return new VTimeZone(properties); 111 } 112 else if (Component.VVENUE.equals(name)) { 113 return new VVenue(properties); 110 114 } 111 115 else if (isExperimentalName(name)) { … … 147 151 return createComponent(name, properties); 148 152 } 149 153 150 154 /** 151 155 * @param name external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Parameter.java
r1267 r1364 48 48 49 49 /** 50 * Region abbreviation. 51 */ 52 public static final String ABBREV = "ABBREV"; 53 54 /** 50 55 * Alternate text representation. 51 56 */ … … 138 143 139 144 /** 145 * Type. 146 */ 147 public static final String TYPE = "TYPE"; 148 149 /** 140 150 * Reference to time zone object. 141 151 */ … … 146 156 */ 147 157 public static final String VALUE = "VALUE"; 158 159 /** 160 * Reference to vvenue component 161 */ 162 public static final String VVENUE = "VVENUE"; 148 163 149 164 /** external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/ParameterFactoryImpl.java
r1267 r1364 1 1 /* 2 2 * $Id $ 3 * 3 * 4 4 * [05-Apr-2004] 5 5 * … … 40 40 import java.util.Map; 41 41 42 import net.fortuna.ical4j.model.parameter.Abbrev; 42 43 import net.fortuna.ical4j.model.parameter.AltRep; 43 44 import net.fortuna.ical4j.model.parameter.Cn; … … 60 61 import net.fortuna.ical4j.model.parameter.TzId; 61 62 import net.fortuna.ical4j.model.parameter.Value; 63 import net.fortuna.ical4j.model.parameter.Vvenue; 62 64 import net.fortuna.ical4j.model.parameter.XParameter; 63 65 … … 70 72 71 73 private static ParameterFactoryImpl instance = new ParameterFactoryImpl(); 72 74 73 75 private Map factories; 74 76 … … 78 80 private ParameterFactoryImpl() { 79 81 factories = new HashMap(); 82 factories.put(Parameter.ABBREV, createAbbrevFactory()); 80 83 factories.put(Parameter.ALTREP, createAltRepFactory()); 81 84 factories.put(Parameter.CN, createCnFactory()); … … 96 99 factories.put(Parameter.RSVP, createRsvpFactory()); 97 100 factories.put(Parameter.SENT_BY, createSentByFactory()); 101 factories.put(Parameter.TYPE, createTzIdFactory()); 98 102 factories.put(Parameter.TZID, createTzIdFactory()); 99 103 factories.put(Parameter.VALUE, createValueFactory()); 100 } 101 104 factories.put(Parameter.VVENUE, createVvenueFactory()); 105 } 106 107 /** 108 * @return 109 */ 110 private ParameterFactory createAbbrevFactory() { 111 return new ParameterFactory() { 112 /* (non-Javadoc) 113 * @see net.fortuna.ical4j.model.ParameterFactory#createParameter(java.lang.String, java.lang.String) 114 */ 115 public Parameter createParameter(final String name, final String value) throws URISyntaxException { 116 return new Abbrev(value); 117 } 118 }; 119 } 120 102 121 /** 103 122 * @return … … 113 132 }; 114 133 } 115 134 116 135 /** 117 136 * @return … … 128 147 }; 129 148 } 130 149 131 150 /** 132 151 * @return … … 159 178 }; 160 179 } 161 180 162 181 /** 163 182 * @return … … 174 193 }; 175 194 } 176 195 177 196 /** 178 197 * @return … … 189 208 }; 190 209 } 191 210 192 211 /** 193 212 * @return … … 204 223 }; 205 224 } 206 225 207 226 /** 208 227 * @return … … 226 245 }; 227 246 } 228 247 229 248 /** 230 249 * @return … … 241 260 }; 242 261 } 243 262 244 263 /** 245 264 * @return … … 269 288 }; 270 289 } 271 290 272 291 /** 273 292 * @return … … 284 303 }; 285 304 } 286 305 287 306 /** 288 307 * @return … … 299 318 }; 300 319 } 301 320 302 321 /** 303 322 * @return … … 336 355 }; 337 356 } 338 357 339 358 /** 340 359 * @return … … 358 377 }; 359 378 } 360 379 361 380 /** 362 381 * @return … … 380 399 }; 381 400 } 382 401 383 402 /** 384 403 * @return … … 405 424 }; 406 425 } 407 426 408 427 /** 409 428 * @return … … 433 452 }; 434 453 } 435 454 436 455 /** 437 456 * @return … … 470 489 }; 471 490 } 472 491 492 /** 493 * @return 494 */ 495 private ParameterFactory createVvenueFactory() { 496 return new ParameterFactory() { 497 /* (non-Javadoc) 498 * @see net.fortuna.ical4j.model.ParameterFactory#createParameter(java.lang.String, java.lang.String) 499 */ 500 public Parameter createParameter(final String name, final String value) 501 throws URISyntaxException { 502 return new Vvenue(value); 503 } 504 }; 505 } 506 473 507 /** 474 508 * @return … … 485 519 }; 486 520 } 487 521 488 522 /** 489 523 * @return … … 543 577 }; 544 578 } 545 579 546 580 /** 547 581 * @return Returns the instance. … … 575 609 } 576 610 } 577 611 578 612 /** 579 613 * @param name external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Property.java
r1267 r1364 168 168 public static final String EXPERIMENTAL_PREFIX = "X-"; 169 169 170 /** 171 * the following are vvenue only properties. 172 */ 173 public static final String COUNTRY = "COUNTRY"; 174 175 public static final String EXTENDED_ADDRESS = "EXTENDED-ADDRESS"; 176 177 public static final String LOCALITY = "LOCALITY"; 178 179 public static final String LOCATION_TYPE = "LOCATION-TYPE"; 180 181 public static final String NAME = "NAME"; 182 183 public static final String POSTALCODE = "POSTALCODE"; 184 185 public static final String REGION = "REGION"; 186 187 public static final String STREET_ADDRESS = "STREET-ADDRESS"; 188 189 public static final String TEL = "TEL"; 190 170 191 private String name; 171 192 … … 193 214 this.parameters = aList; 194 215 } 195 216 196 217 /** 197 218 * Creates a deep copy of the specified property. That is, the name, … … 261 282 return parameters; 262 283 } 263 284 264 285 /** 265 286 * Convenience method for retrieving a list of named parameters. … … 271 292 return getParameters().getParameters(name); 272 293 } 273 294 274 295 /** 275 296 * Convenience method for retrieving a single parameter. … … 281 302 return getParameters().getParameter(name); 282 303 } 283 304 284 305 /** 285 306 * Sets the current value of the property. external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/PropertyFactoryImpl.java
r1267 r1364 49 49 import net.fortuna.ical4j.model.property.Completed; 50 50 import net.fortuna.ical4j.model.property.Contact; 51 import net.fortuna.ical4j.model.property.Country; 51 52 import net.fortuna.ical4j.model.property.Created; 52 53 import net.fortuna.ical4j.model.property.Description; … … 58 59 import net.fortuna.ical4j.model.property.ExDate; 59 60 import net.fortuna.ical4j.model.property.ExRule; 61 import net.fortuna.ical4j.model.property.ExtendedAddress; 60 62 import net.fortuna.ical4j.model.property.FreeBusy; 61 63 import net.fortuna.ical4j.model.property.Geo; 62 64 import net.fortuna.ical4j.model.property.LastModified; 65 import net.fortuna.ical4j.model.property.Locality; 63 66 import net.fortuna.ical4j.model.property.Location; 64 67 import net.fortuna.ical4j.model.property.Method; 68 import net.fortuna.ical4j.model.property.Name; 65 69 import net.fortuna.ical4j.model.property.Organizer; 66 70 import net.fortuna.ical4j.model.property.PercentComplete; 71 import net.fortuna.ical4j.model.property.Postalcode; 67 72 import net.fortuna.ical4j.model.property.Priority; 68 73 import net.fortuna.ical4j.model.property.ProdId; … … 70 75 import net.fortuna.ical4j.model.property.RRule; 71 76 import net.fortuna.ical4j.model.property.RecurrenceId; 77 import net.fortuna.ical4j.model.property.Region; 72 78 import net.fortuna.ical4j.model.property.RelatedTo; 73 79 import net.fortuna.ical4j.model.property.Repeat; … … 76 82 import net.fortuna.ical4j.model.property.Sequence; 77 83 import net.fortuna.ical4j.model.property.Status; 84 import net.fortuna.ical4j.model.property.StreetAddress; 78 85 import net.fortuna.ical4j.model.property.Summary; 86 import net.fortuna.ical4j.model.property.Tel; 79 87 import net.fortuna.ical4j.model.property.Transp; 80 88 import net.fortuna.ical4j.model.property.Trigger; … … 119 127 factories.put(Property.COMPLETED, createCompletedFactory()); 120 128 factories.put(Property.CONTACT, createContactFactory()); 129 factories.put(Property.COUNTRY, createCountryFactory()); 121 130 factories.put(Property.CREATED, createCreatedFactory()); 122 131 factories.put(Property.DESCRIPTION, createDescriptionFactory()); … … 128 137 factories.put(Property.EXDATE, createExDateFactory()); 129 138 factories.put(Property.EXRULE, createExRuleFactory()); 139 factories.put(Property.EXTENDED_ADDRESS, createExtendedAddressFactory()); 130 140 factories.put(Property.FREEBUSY, createFreeBusyFactory()); 131 141 factories.put(Property.GEO, createGeoFactory()); 132 142 factories.put(Property.LAST_MODIFIED, createLastModifiedFactory()); 143 factories.put(Property.LOCALITY, createLocalityFactory()); 133 144 factories.put(Property.LOCATION, createLocationFactory()); 134 145 factories.put(Property.METHOD, createMethodFactory()); 146 factories.put(Property.NAME, createNameFactory()); 135 147 factories.put(Property.ORGANIZER, createOrganizerFactory()); 136 148 factories 137 149 .put(Property.PERCENT_COMPLETE, createPercentCompleteFactory()); 150 factories.put(Property.POSTALCODE, createPostalcodeFactory()); 138 151 factories.put(Property.PRIORITY, createPriorityFactory()); 139 152 factories.put(Property.PRODID, createProdIdFactory()); 140 153 factories.put(Property.RDATE, createRDateFactory()); 141 154 factories.put(Property.RECURRENCE_ID, createRecurrenceIdFactory()); 155 factories.put(Property.REGION, createRegionFactory()); 142 156 factories.put(Property.RELATED_TO, createRelatedToFactory()); 143 157 factories.put(Property.REPEAT, createRepeatFactory()); … … 147 161 factories.put(Property.SEQUENCE, createSequenceFactory()); 148 162 factories.put(Property.STATUS, createStatusFactory()); 163 factories.put(Property.STREET_ADDRESS, createStreetAddressFactory()); 149 164 factories.put(Property.SUMMARY, createSummaryFactory()); 165 factories.put(Property.TEL, createTelFactory()); 150 166 factories.put(Property.TRANSP, createTranspFactory()); 151 167 factories.put(Property.TRIGGER, createTriggerFactory()); … … 397 413 * @return 398 414 */ 415 private PropertyFactory createCountryFactory() { 416 return new PropertyFactory() { 417 /* 418 * (non-Javadoc) 419 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 420 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 421 */ 422 public Property createProperty(final String name, 423 final ParameterList parameters, final String value) 424 throws IOException, URISyntaxException, ParseException { 425 return new Country(parameters, value); 426 } 427 428 /* 429 * (non-Javadoc) 430 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 431 */ 432 public Property createProperty(final String name) { 433 return new Country(); 434 } 435 }; 436 } 437 438 /** 439 * @return 440 */ 399 441 private PropertyFactory createCreatedFactory() { 400 442 return new PropertyFactory() { … … 631 673 * @return 632 674 */ 675 private PropertyFactory createExtendedAddressFactory() { 676 return new PropertyFactory() { 677 /* 678 * (non-Javadoc) 679 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 680 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 681 */ 682 public Property createProperty(final String name, 683 final ParameterList parameters, final String value) 684 throws IOException, URISyntaxException, ParseException { 685 return new ExtendedAddress(parameters, value); 686 } 687 688 /* 689 * (non-Javadoc) 690 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 691 */ 692 public Property createProperty(final String name) { 693 return new ExtendedAddress(); 694 } 695 }; 696 } 697 698 /** 699 * @return 700 */ 633 701 private PropertyFactory createFreeBusyFactory() { 634 702 return new PropertyFactory() { … … 709 777 * @return 710 778 */ 779 private PropertyFactory createLocalityFactory() { 780 return new PropertyFactory() { 781 /* 782 * (non-Javadoc) 783 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 784 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 785 */ 786 public Property createProperty(final String name, 787 final ParameterList parameters, final String value) 788 throws IOException, URISyntaxException, ParseException { 789 return new Locality(parameters, value); 790 } 791 792 /* 793 * (non-Javadoc) 794 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 795 */ 796 public Property createProperty(final String name) { 797 return new Locality(); 798 } 799 }; 800 } 801 802 /** 803 * @return 804 */ 711 805 private PropertyFactory createLocationFactory() { 712 806 return new PropertyFactory() { … … 761 855 * @return 762 856 */ 857 private PropertyFactory createNameFactory() { 858 return new PropertyFactory() { 859 /* 860 * (non-Javadoc) 861 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 862 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 863 */ 864 public Property createProperty(final String name, 865 final ParameterList parameters, final String value) 866 throws IOException, URISyntaxException, ParseException { 867 return new Name(parameters, value); 868 } 869 870 /* 871 * (non-Javadoc) 872 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 873 */ 874 public Property createProperty(final String name) { 875 return new Name(); 876 } 877 }; 878 } 879 880 /** 881 * @return 882 */ 763 883 private PropertyFactory createOrganizerFactory() { 764 884 return new PropertyFactory() { … … 813 933 * @return 814 934 */ 935 private PropertyFactory createPostalcodeFactory() { 936 return new PropertyFactory() { 937 /* 938 * (non-Javadoc) 939 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 940 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 941 */ 942 public Property createProperty(final String name, 943 final ParameterList parameters, final String value) 944 throws IOException, URISyntaxException, ParseException { 945 return new Postalcode(parameters, value); 946 } 947 948 /* 949 * (non-Javadoc) 950 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 951 */ 952 public Property createProperty(final String name) { 953 return new Postalcode(); 954 } 955 }; 956 } 957 958 /** 959 * @return 960 */ 815 961 private PropertyFactory createPriorityFactory() { 816 962 return new PropertyFactory() { … … 917 1063 * @return 918 1064 */ 1065 private PropertyFactory createRegionFactory() { 1066 return new PropertyFactory() { 1067 /* 1068 * (non-Javadoc) 1069 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 1070 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 1071 */ 1072 public Property createProperty(final String name, 1073 final ParameterList parameters, final String value) 1074 throws IOException, URISyntaxException, ParseException { 1075 return new Region(parameters, value); 1076 } 1077 1078 /* 1079 * (non-Javadoc) 1080 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 1081 */ 1082 public Property createProperty(final String name) { 1083 return new Region(); 1084 } 1085 }; 1086 } 1087 1088 /** 1089 * @return 1090 */ 919 1091 private PropertyFactory createRelatedToFactory() { 920 1092 return new PropertyFactory() { … … 1099 1271 * @return 1100 1272 */ 1273 private PropertyFactory createStreetAddressFactory() { 1274 return new PropertyFactory() { 1275 /* 1276 * (non-Javadoc) 1277 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 1278 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 1279 */ 1280 public Property createProperty(final String name, 1281 final ParameterList parameters, final String value) 1282 throws IOException, URISyntaxException, ParseException { 1283 return new StreetAddress(parameters, value); 1284 } 1285 1286 /* 1287 * (non-Javadoc) 1288 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 1289 */ 1290 public Property createProperty(final String name) { 1291 return new StreetAddress(); 1292 } 1293 }; 1294 } 1295 1296 /** 1297 * @return 1298 */ 1101 1299 private PropertyFactory createSummaryFactory() { 1102 1300 return new PropertyFactory() { … … 1118 1316 public Property createProperty(final String name) { 1119 1317 return new Summary(); 1318 } 1319 }; 1320 } 1321 1322 /** 1323 * @return 1324 */ 1325 private PropertyFactory createTelFactory() { 1326 return new PropertyFactory() { 1327 /* 1328 * (non-Javadoc) 1329 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String, 1330 * net.fortuna.ical4j.model.ParameterList, java.lang.String) 1331 */ 1332 public Property createProperty(final String name, 1333 final ParameterList parameters, final String value) 1334 throws IOException, URISyntaxException, ParseException { 1335 return new Tel(parameters, value); 1336 } 1337 1338 /* 1339 * (non-Javadoc) 1340 * @see net.fortuna.ical4j.model.PropertyFactory#createProperty(java.lang.String) 1341 */ 1342 public Property createProperty(final String name) { 1343 return new Tel(); 1120 1344 } 1121 1345 }; external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/Recur.java
r1267 r1364 134 134 private Map experimentalValues = new HashMap(); 135 135 136 // Calendar field we increment based on frequency. 137 private int calIncField; 138 136 139 /** 137 140 * Constructs a new instance from the specified string value. … … 464 467 public final DateList getDates(final Date periodStart, 465 468 final Date periodEnd, final Value value) { 466 return getDates(periodStart, periodStart, periodEnd, value );469 return getDates(periodStart, periodStart, periodEnd, value, -1); 467 470 } 468 471 … … 475 478 public final DateList getDates(final Date seed, final Period period, 476 479 final Value value) { 477 return getDates(seed, period.getStart(), period.getEnd(), value );480 return getDates(seed, period.getStart(), period.getEnd(), value, -1); 478 481 } 479 482 … … 492 495 public final DateList getDates(final Date seed, final Date periodStart, 493 496 final Date periodEnd, final Value value) { 497 return getDates(seed, periodStart, periodEnd, value, -1); 498 } 499 500 /** 501 * Returns a list of start dates in the specified period represented by this recur. This method includes a base date 502 * argument, which indicates the start of the fist occurrence of this recurrence. The base date is used to inject 503 * default values to return a set of dates in the correct format. For example, if the search start date (start) is 504 * Wed, Mar 23, 12:19PM, but the recurrence is Mon - Fri, 9:00AM - 5:00PM, the start dates returned should all be at 505 * 9:00AM, and not 12:19PM. 506 * @return a list of dates represented by this recur instance 507 * @param seed the start date of this Recurrence's first instance 508 * @param periodStart the start of the period 509 * @param periodEnd the end of the period 510 * @param value the type of dates to generate (i.e. date/date-time) 511 * @param maxCount limits the number of instances returned. Up to one years 512 * worth extra may be returned. Less than 0 means no limit 513 */ 514 public final DateList getDates(final Date seed, final Date periodStart, 515 final Date periodEnd, final Value value, 516 final int maxCount) { 494 517 495 518 DateList dates = new DateList(value); … … 517 540 int invalidCandidateCount = 0; 518 541 Date candidate = null; 519 while ( true) {542 while ((maxCount < 0) || (dates.size() < maxCount)) { 520 543 Date candidateSeed = Dates.getInstance(cal.getTime(), value); 521 544 … … 581 604 // initialise interval.. 582 605 int calInterval = (getInterval() >= 1) ? getInterval() : 1; 583 if (SECONDLY.equals(getFrequency())) { 584 cal.add(Calendar.SECOND, calInterval); 585 } 586 else if (MINUTELY.equals(getFrequency())) { 587 cal.add(Calendar.MINUTE, calInterval); 588 } 589 else if (HOURLY.equals(getFrequency())) { 590 cal.add(Calendar.HOUR_OF_DAY, calInterval); 591 } 592 else if (DAILY.equals(getFrequency())) { 593 cal.add(Calendar.DAY_OF_YEAR, calInterval); 594 } 595 else if (WEEKLY.equals(getFrequency())) { 596 cal.add(Calendar.WEEK_OF_YEAR, calInterval); 597 } 598 else if (MONTHLY.equals(getFrequency())) { 599 cal.add(Calendar.MONTH, calInterval); 600 } 601 else if (YEARLY.equals(getFrequency())) { 602 cal.add(Calendar.YEAR, calInterval); 603 } 606 cal.add(calIncField, calInterval); 604 607 } 605 608 … … 1017 1020 "A recurrence rule MUST contain a FREQ rule part."); 1018 1021 } 1019 else if (!frequency.equals(SECONDLY) && !frequency.equals(MINUTELY) 1020 && !frequency.equals(HOURLY) && !frequency.equals(DAILY) 1021 && !frequency.equals(WEEKLY) && !frequency.equals(MONTHLY) 1022 && !frequency.equals(YEARLY)) { 1022 if (SECONDLY.equals(getFrequency())) { 1023 calIncField = Calendar.SECOND; 1024 } 1025 else if (MINUTELY.equals(getFrequency())) { 1026 calIncField = Calendar.MINUTE; 1027 } 1028 else if (HOURLY.equals(getFrequency())) { 1029 calIncField = Calendar.HOUR_OF_DAY; 1030 } 1031 else if (DAILY.equals(getFrequency())) { 1032 calIncField = Calendar.DAY_OF_YEAR; 1033 } 1034 else if (WEEKLY.equals(getFrequency())) { 1035 calIncField = Calendar.WEEK_OF_YEAR; 1036 } 1037 else if (MONTHLY.equals(getFrequency())) { 1038 calIncField = Calendar.MONTH; 1039 } 1040 else if (YEARLY.equals(getFrequency())) { 1041 calIncField = Calendar.YEAR; 1042 } 1043 else { 1023 1044 throw new IllegalArgumentException("Invalid FREQ rule part '" 1024 1045 + frequency + "' in recurrence rule"); external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/component/Observance.java
r1267 r1364 79 79 private Map onsets = new TreeMap(); 80 80 81 /* If this is set we have rrules. If we get a date after this rebuild onsets */ 82 private Date onsetLimit; 83 81 84 private boolean rdatesCached = false; 82 85 … … 146 149 147 150 long start = System.currentTimeMillis(); 151 152 if ((onsetLimit != null) && (date.after(onsetLimit))) { 153 onsets.clear(); 154 rdatesCached = false; 155 } 148 156 149 157 Date onset = getCachedOnset(date); … … 195 203 Calendar cal = Dates.getCalendarInstance(date); 196 204 cal.setTime(date); 197 cal.add(Calendar.YEAR, 1 );198 Date endRecur= Dates.getInstance(cal.getTime(), dateType);205 cal.add(Calendar.YEAR, 10); 206 onsetLimit = Dates.getInstance(cal.getTime(), dateType); 199 207 DateList recurrenceDates = rrule.getRecur().getDates(onset, 200 endRecur, dateType);208 onsetLimit, dateType); 201 209 for (Iterator j = recurrenceDates.iterator(); j.hasNext();) { 202 210 Date rruleOnset = (Date) j.next(); external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Attach.java
r1267 r1364 62 62 /** 63 63 * Defines an ATTACH iCalendar component property. 64 * 64 * 65 65 * <pre> 66 66 * 4.8.1.1 Attachment 67 * 67 * 68 68 * Property Name: ATTACH 69 * 69 * 70 70 * Purpose: The property provides the capability to associate a document 71 71 * object with a calendar component. 72 * 72 * 73 73 * Value Type: The default value type for this property is URI. The 74 74 * value type can also be set to BINARY to indicate inline binary 75 75 * encoded content information. 76 * 76 * 77 77 * Property Parameters: Non-standard, inline encoding, format type and 78 78 * value data type property parameters can be specified on this 79 79 * property. 80 * 80 * 81 81 * Conformance: The property can be specified in a "VEVENT", "VTODO", 82 82 * "VJOURNAL" or "VALARM" calendar components. 83 * 83 * 84 84 * Description: The property can be specified within "VEVENT", "VTODO", 85 85 * "VJOURNAL", or "VALARM" calendar components. This property can be 86 86 * specified multiple times within an iCalendar object. 87 * 87 * 88 88 * Format Definition: The property is defined by the following notation: 89 * 89 * 90 90 * attach = "ATTACH" attparam ":" uri CRLF 91 * 91 * 92 92 * attach =/ "ATTACH" attparam ";" "ENCODING" "=" "BASE64" 93 93 * ";" "VALUE" "=" "BINARY" ":" binary 94 * 94 * 95 95 * attparam = *( 96 * 96 * 97 97 * ; the following is optional, 98 98 * ; but MUST NOT occur more than once 99 * 99 * 100 100 * (";" fmttypeparam) / 101 * 101 * 102 102 * ; the following is optional, 103 103 * ; and MAY occur more than once 104 * 104 * 105 105 * (";" xparam) 106 * 106 * 107 107 * ) 108 108 * </pre> 109 * 109 * 110 110 * @author benf 111 111 */ … … 234 234 .createBinaryDecoder( 235 235 (Encoding) getParameter(Parameter.ENCODING)); 236 binary = decoder.decode( getBinary());236 binary = decoder.decode(aValue.getBytes()); 237 237 } 238 238 catch (UnsupportedEncodingException uee) { external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Location.java
r1267 r1364 1 1 /* 2 2 * $Id: Location.java,v 1.9 2006/11/05 06:04:42 fortuna Exp $ 3 * 3 * 4 4 * Created: [Apr 6, 2004] 5 5 * … … 45 45 /** 46 46 * Defines a LOCATION iCalendar component property. 47 * 47 * 48 48 * <pre> 49 49 * 4.8.1.7 Location 50 * 50 * 51 51 * Property Name: LOCATION 52 * 52 * 53 53 * Purpose: The property defines the intended venue for the activity 54 54 * defined by a calendar component. 55 * 55 * 56 56 * Value Type: TEXT 57 * 57 * 58 58 * Property Parameters: Non-standard, alternate text representation and 59 59 * language property parameters can be specified on this property. 60 * 60 * 61 61 * Conformance: This property can be specified in "VEVENT" or "VTODO" 62 62 * calendar component. 63 * 63 * 64 64 * Description: Specific venues such as conference or meeting rooms may 65 65 * be explicitly specified using this property. An alternate … … 70 70 * pointing to a MIME body part containing a vCard [RFC 2426] for the 71 71 * location. 72 * 72 * 73 73 * Format Definition: The property is defined by the following notation: 74 * 74 * 75 75 * location = "LOCATION locparam ":" text CRLF 76 * 76 * 77 77 * locparam = *( 78 * 78 * 79 79 * ; the following are optional, 80 80 * ; but MUST NOT occur more than once 81 * 81 * 82 82 * (";" altrepparam) / (";" languageparam) / 83 * 83 * 84 84 * ; the following is optional, 85 85 * ; and MAY occur more than once 86 * 86 * 87 87 * (";" xparam) 88 * 88 * 89 89 * ) 90 * 90 * 91 91 * Example: The following are some examples of this property: 92 * 92 * 93 93 * LOCATION:Conference Room - F123, Bldg. 002 94 * 94 * 95 95 * LOCATION;ALTREP="http://xyzcorp.com/conf-rooms/f123.vcf": 96 96 * Conference Room - F123, Bldg. 002 97 97 * </pre> 98 * 98 * 99 99 * @author Ben Fortuna 100 100 */ … … 141 141 ParameterValidator.getInstance().assertOneOrLess(Parameter.LANGUAGE, 142 142 getParameters()); 143 ParameterValidator.getInstance().assertOneOrLess(Parameter.VVENUE, 144 getParameters()); 143 145 144 146 /* external/ical4j/ical4j-1.0-beta1/net/fortuna/ical4j/model/property/Url.java
r1267 r1364 1 1 /* 2 2 * $Id: Url.java,v 1.11 2006/11/05 06:04:42 fortuna Exp $ 3 * 3 * 4 4 * Created: [Apr 6, 2004] 5 5 * … … 39 39 import java.net.URISyntaxException; 40 40 41 import net.fortuna.ical4j.model.Parameter; 41 42 import net.fortuna.ical4j.model.ParameterList; 42 43 import net.fortuna.ical4j.model.Property; 43 44 import net.fortuna.ical4j.model.ValidationException; 45 import net.fortuna.ical4j.util.ParameterValidator; 44 46 import net.fortuna.ical4j.util.Strings; 45 47 import net.fortuna.ical4j.util.Uris; … … 47 49 /** 48 50 * Defines a URL iCalendar component property. 49 * 51 * 50 52 * <pre> 51 53 * 4.8.4.6 Uniform Resource Locator 52 * 54 * 53 55 * Property Name: URL 54 * 56 * 55 57 * Purpose: This property defines a Uniform Resource Locator (URL) 56 58 * associated with the iCalendar object. 57 * 59 * 58 60 * Value Type: URI 59 * 61 * 60 62 * Property Parameters: Non-standard property parameters can be 61 63 * specified on this property. 62 * 64 * 63 65 * Conformance: This property can be specified once in the "VEVENT", 64 66 * "VTODO", "VJOURNAL" or "VFREEBUSY" calendar components. 65 * 67 * 66 68 * Description: This property may be used in a calendar component to 67 69 * convey a location where a more dynamic rendition of the calendar … … 71 73 * property and Content-Location MIME header are both specified, they 72 74 * MUST point to the same resource. 73 * 75 * 74 76 * Format Definition: The property is defined by the following notation: 75 * 77 * 76 78 * url = "URL" urlparam ":" uri CRLF 77 * 79 * 78 80 * urlparam = *(";" xparam) 79 * 81 * 80 82 * Example: The following is an example of this property: 81 * 83 * 82 84 * URL:http://abc.com/pub/calendars/jsmith/mytime.ics 83 85 * </pre> 84 * 86 * 85 87 * @author Ben Fortuna 86 88 */ … … 162 164 public final void validate() throws ValidationException { 163 165 // TODO: Auto-generated method stub 166 ParameterValidator.getInstance().assertOneOrLess(Parameter.TYPE, 167 getParameters()); 164 168 } 165 169 }
