Namespace org.accordproject.time(0.2.0)

Found 6 declarations!

Download CTO Download UML Download JSON Schema Download Typescript Download Java Download Go Download XML Schema

Declared Types

      
      import org.accordproject.time.Month from /time@0.2.0.cto
      import org.accordproject.time.Day from /time@0.2.0.cto
      import org.accordproject.time.TemporalUnit from /time@0.2.0.cto
      import org.accordproject.time.Duration from /time@0.2.0.cto
      import org.accordproject.time.PeriodUnit from /time@0.2.0.cto
      import org.accordproject.time.Period from /time@0.2.0.cto
      
      

Dependencies

  • None

Source

    
      /*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

namespace org.accordproject.time

/**
 * Months of the year
 */
enum Month {
  o January
  o February
  o March
  o April
  o May
  o June
  o July
  o August
  o September
  o October
  o November
  o December
}

/**
 * Days of the week
 */
enum Day {
  o Monday
  o Tuesday
  o Wednesday
  o Thursday
  o Friday
  o Saturday
  o Sunday
}

/**
 * Units for a duration.
 */
enum TemporalUnit {
  o seconds
  o minutes
  o hours
  o days
  o weeks
}

/**
 * A duration. For example, 6 hours.
 */
concept Duration {
  o Long amount
  o TemporalUnit unit
}

/**
 * Units for a time period.
 */
enum PeriodUnit {
  o days
  o weeks
  o months
  o quarters
  o years
}

/**
 * A time period. For example, 2 months.
 */
concept Period {
  o Long amount
  o PeriodUnit unit
}