pkg dateTime Range - yshehab/SchoolRoomBooking GitHub Wiki

Range Class

Overview

A Range is a generic, type-safe, pseudo-collection of any class or Enum that implements the Repeat interface. A Range is mutable, un-indexed, thread-compatible and does not have duplicates.

<T> means T is a Class or Enum that implements Repeat.

Package

DateTimePackage

Static Members

None

Static Methods

None

Attributes

private Set<T> range

Links

none

Constructor

public Range<T>(T start, T end, RepeatRate rate)

    Post-condition: creates a new range using the supplied arguments.

Range<T>()

    Post-condition: creates a new empty range

Protocol

public Range<T> intersects(Range<T> range)

    Post-condition: returns a Range of the values of range that intersect with the receiver.

public int size()

    Post-condition: returns the number of elements in the receiver.

public boolean contains(T term)

    Post-condition: returns true if term is an element of the receiver, otherwise false.

public void add(T term)

    Post-condition: adds term to the receiver unless it is already there.

public void remove(T term)

    Post-condition: removes term from the receiver if it is there.

public String toString()

    Post-condition: returns a string representation of the receiver.

Examples

Discussion

  • No isEmpty() method, ...?
⚠️ **GitHub.com Fallback** ⚠️