001/* 002 * ObjectLab, http://www.objectlab.co.uk/open is sponsoring the ObjectLab Kit. 003 * 004 * Based in London, we are world leaders in the design and development 005 * of bespoke applications for the securities financing markets. 006 * 007 * <a href="http://www.objectlab.co.uk/open">Click here to learn more</a> 008 * ___ _ _ _ _ _ 009 * / _ \| |__ (_) ___ ___| |_| | __ _| |__ 010 * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ 011 * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | 012 * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ 013 * |__/ 014 * 015 * www.ObjectLab.co.uk 016 * 017 * $Id$ 018 * 019 * Copyright 2006 the original author or authors. 020 * 021 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 022 * use this file except in compliance with the License. You may obtain a copy of 023 * the License at 024 * 025 * http://www.apache.org/licenses/LICENSE-2.0 026 * 027 * Unless required by applicable law or agreed to in writing, software 028 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 029 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 030 * License for the specific language governing permissions and limitations under 031 * the License. 032 */ 033package net.objectlab.kit.datecalc.common; 034 035import java.util.ArrayList; 036import java.util.Collections; 037import java.util.List; 038 039/** 040 * A series of Standard Tenors used by the financial industry. 041 * 042 * @author Benoit Xhenseval 043 * 044 */ 045public final class StandardTenor { 046 private static final List<Tenor> ALL; 047 048 public static final Tenor SPOT = new Tenor(0, TenorCode.SPOT); 049 050 public static final Tenor OVERNIGHT = new Tenor(0, TenorCode.OVERNIGHT); 051 052 public static final Tenor T_1D = new Tenor(1, TenorCode.DAY); 053 054 public static final Tenor T_2D = new Tenor(2, TenorCode.DAY); 055 056 public static final Tenor T_1W = new Tenor(1, TenorCode.WEEK); 057 058 public static final Tenor T_1M = new Tenor(1, TenorCode.MONTH); 059 060 public static final Tenor T_2M = new Tenor(2, TenorCode.MONTH); 061 062 // ----------------------------------------------------------------------- 063 // 064 // ObjectLab, world leaders in the design and development of bespoke 065 // applications for the securities financing markets. 066 // www.ObjectLab.co.uk 067 // 068 // ----------------------------------------------------------------------- 069 070 public static final Tenor T_3M = new Tenor(3, TenorCode.MONTH); 071 072 public static final Tenor T_6M = new Tenor(6, TenorCode.MONTH); 073 074 public static final Tenor T_9M = new Tenor(9, TenorCode.MONTH); 075 076 public static final Tenor T_1Y = new Tenor(1, TenorCode.YEAR); 077 078 public static final Tenor T_2Y = new Tenor(2, TenorCode.YEAR); 079 080 public static final Tenor T_3Y = new Tenor(3, TenorCode.YEAR); 081 082 public static final Tenor T_4Y = new Tenor(4, TenorCode.YEAR); 083 084 public static final Tenor T_5Y = new Tenor(5, TenorCode.YEAR); 085 086 public static final Tenor T_7Y = new Tenor(7, TenorCode.YEAR); 087 088 public static final Tenor T_10Y = new Tenor(10, TenorCode.YEAR); 089 090 public static final Tenor T_15Y = new Tenor(15, TenorCode.YEAR); 091 092 public static final Tenor T_20Y = new Tenor(20, TenorCode.YEAR); 093 094 public static final Tenor T_30Y = new Tenor(30, TenorCode.YEAR); 095 096 public static final Tenor T_50Y = new Tenor(50, TenorCode.YEAR); 097 098 private StandardTenor() { 099 } 100 101 public static List<Tenor> getAll() { 102 return ALL; 103 } 104 105 static { 106 final List<Tenor> list = new ArrayList<>(); 107 list.add(OVERNIGHT); 108 list.add(SPOT); 109 list.add(T_1D); 110 list.add(T_2D); 111 list.add(T_1W); 112 list.add(T_1M); 113 list.add(T_2M); 114 list.add(T_3M); 115 list.add(T_6M); 116 list.add(T_6M); 117 list.add(T_9M); 118 list.add(T_1Y); 119 list.add(T_2Y); 120 list.add(T_3Y); 121 list.add(T_4Y); 122 list.add(T_5Y); 123 list.add(T_7Y); 124 list.add(T_10Y); 125 list.add(T_20Y); 126 list.add(T_30Y); 127 list.add(T_50Y); 128 ALL = Collections.unmodifiableList(list); 129 } 130 131} 132 133/* 134 * ObjectLab, http://www.objectlab.co.uk/open is sponsoring the ObjectLab Kit. 135 * 136 * Based in London, we are world leaders in the design and development 137 * of bespoke applications for the securities financing markets. 138 * 139 * <a href="http://www.objectlab.co.uk/open">Click here to learn more about us</a> 140 * ___ _ _ _ _ _ 141 * / _ \| |__ (_) ___ ___| |_| | __ _| |__ 142 * | | | | '_ \| |/ _ \/ __| __| | / _` | '_ \ 143 * | |_| | |_) | | __/ (__| |_| |__| (_| | |_) | 144 * \___/|_.__// |\___|\___|\__|_____\__,_|_.__/ 145 * |__/ 146 * 147 * www.ObjectLab.co.uk 148 */