public Property createProperty(final String name, final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new Sequence(parameters, value); }
@Override public int compareTo(Sequence o) { return Integer.compare(getSequenceNo(), o.getSequenceNo()); }
/** * @param aList a list of parameters for this component * @param aValue a value string for this component */ public Sequence(final ParameterList aList, final String aValue) { super(SEQUENCE, aList, PropertyFactoryImpl.getInstance()); setValue(aValue); }
@Override public CalendarComponent transform(CalendarComponent object) { PropertyList compProps = object.getProperties(); Sequence sequence = (Sequence) compProps .getProperty(Property.SEQUENCE); if (sequence == null) { compProps.add(new Sequence(0)); } else { compProps.remove(sequence); compProps.add(new Sequence(sequence.getSequenceNo() + 1)); } return object; } }
@Override public int compare(Component o1, Component o2) { int retVal = 0; Sequence defaultSequence = new Sequence(0); Sequence sequence1 = Optional.ofNullable((Sequence) o1.getProperty(Property.SEQUENCE)).orElse(defaultSequence); Sequence sequence2 = Optional.ofNullable((Sequence) o2.getProperty(Property.SEQUENCE)).orElse(defaultSequence); retVal = sequence1.compareTo(sequence2); if (retVal == 0) { DtStamp defaultDtStamp = new DtStamp(new DateTime(0)); DtStamp dtStamp1 = Optional.ofNullable((DtStamp) o1.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); DtStamp dtStamp2 = Optional.ofNullable((DtStamp) o2.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); retVal = dtStamp1.compareTo(dtStamp2); } return retVal; } }
@Override public CalendarComponent transform(CalendarComponent object) { PropertyList compProps = object.getProperties(); Sequence sequence = (Sequence) compProps .getProperty(Property.SEQUENCE); if (sequence == null) { compProps.add(new Sequence(0)); } else { compProps.remove(sequence); compProps.add(new Sequence(sequence.getSequenceNo() + 1)); } return object; } }
@Override public int compare(Component o1, Component o2) { int retVal = 0; Sequence defaultSequence = new Sequence(0); Sequence sequence1 = Optional.ofNullable((Sequence) o1.getProperty(Property.SEQUENCE)).orElse(defaultSequence); Sequence sequence2 = Optional.ofNullable((Sequence) o2.getProperty(Property.SEQUENCE)).orElse(defaultSequence); retVal = sequence1.compareTo(sequence2); if (retVal == 0) { DtStamp defaultDtStamp = new DtStamp(new DateTime(0)); DtStamp dtStamp1 = Optional.ofNullable((DtStamp) o1.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); DtStamp dtStamp2 = Optional.ofNullable((DtStamp) o2.getProperty(Property.DTSTAMP)).orElse(defaultDtStamp); retVal = dtStamp1.compareTo(dtStamp2); } return retVal; } }
public Property createProperty(final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new Sequence(parameters, value); }
/** * {@inheritDoc} */ public final Calendar transform(final Calendar calendar) { PropertyList calProps = calendar.getProperties(); Property method = calProps.getProperty(Property.METHOD); if (method != null) { calProps.remove(method); } calProps.add(Method.PUBLISH); // if a calendar component has already been published previously // update the sequence number.. for (Iterator i = calendar.getComponents().iterator(); i.hasNext();) { Component component = (Component) i.next(); PropertyList compProps = component.getProperties(); Sequence sequence = (Sequence) compProps .getProperty(Property.SEQUENCE); if (sequence == null) { compProps.add(new Sequence(0)); } else { compProps.remove(sequence); compProps.add(new Sequence(sequence.getSequenceNo() + 1)); } } return calendar; }
@Override public int compareTo(Sequence o) { return Integer.compare(getSequenceNo(), o.getSequenceNo()); }
/** * @param aList a list of parameters for this component * @param aValue a value string for this component */ public Sequence(final ParameterList aList, final String aValue) { super(SEQUENCE, aList, PropertyFactoryImpl.getInstance()); setValue(aValue); }
public Property createProperty(final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new Sequence(parameters, value); }
/** * {@inheritDoc} */ public final Calendar transform(final Calendar calendar) { PropertyList calProps = calendar.getProperties(); Property method = calProps.getProperty(Property.METHOD); if (method != null) { calProps.remove(method); } calProps.add(Method.PUBLISH); // if a calendar component has already been published previously // update the sequence number.. for (Component component : calendar.getComponents()) { PropertyList compProps = component.getProperties(); Sequence sequence = (Sequence) compProps .getProperty(Property.SEQUENCE); if (sequence == null) { compProps.add(new Sequence(0)); } else { compProps.remove(sequence); compProps.add(new Sequence(sequence.getSequenceNo() + 1)); } } return calendar; }
/** * {@inheritDoc} */ public final String getValue() { return String.valueOf(getSequenceNo()); }
/** * @param aValue a value string for this component */ public Sequence(final String aValue) { super(SEQUENCE, new Factory()); setValue(aValue); }
public Property createProperty() { return new Sequence(); } }
/** * {@inheritDoc} */ public final Calendar transform(final Calendar calendar) { PropertyList calProps = calendar.getProperties(); Property method = calProps.getProperty(Property.METHOD); if (method != null) { calProps.remove(method); } calProps.add(Method.PUBLISH); // if a calendar component has already been published previously // update the sequence number.. for (Component component : calendar.getComponents()) { PropertyList compProps = component.getProperties(); Sequence sequence = (Sequence) compProps .getProperty(Property.SEQUENCE); if (sequence == null) { compProps.add(new Sequence(0)); } else { compProps.remove(sequence); compProps.add(new Sequence(sequence.getSequenceNo() + 1)); } } return calendar; }
/** * {@inheritDoc} */ public final String getValue() { return String.valueOf(getSequenceNo()); }
/** * @param aList a list of parameters for this component * @param aValue a value string for this component */ public Sequence(final ParameterList aList, final String aValue) { super(SEQUENCE, aList, new Factory()); setValue(aValue); }
public Property createProperty(final ParameterList parameters, final String value) throws IOException, URISyntaxException, ParseException { return new Sequence(parameters, value); }