001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (https://www.swig.org). 003 * Version 4.1.1 004 * 005 * Do not make changes to this file unless you know what you are doing - modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.quantlib; 010 011public final class TimeUnit { 012 public final static TimeUnit Days = new TimeUnit("Days"); 013 public final static TimeUnit Weeks = new TimeUnit("Weeks"); 014 public final static TimeUnit Months = new TimeUnit("Months"); 015 public final static TimeUnit Years = new TimeUnit("Years"); 016 public final static TimeUnit Hours = new TimeUnit("Hours"); 017 public final static TimeUnit Minutes = new TimeUnit("Minutes"); 018 public final static TimeUnit Seconds = new TimeUnit("Seconds"); 019 public final static TimeUnit Milliseconds = new TimeUnit("Milliseconds"); 020 public final static TimeUnit Microseconds = new TimeUnit("Microseconds"); 021 022 public final int swigValue() { 023 return swigValue; 024 } 025 026 public String toString() { 027 return swigName; 028 } 029 030 public static TimeUnit swigToEnum(int swigValue) { 031 if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue) 032 return swigValues[swigValue]; 033 for (int i = 0; i < swigValues.length; i++) 034 if (swigValues[i].swigValue == swigValue) 035 return swigValues[i]; 036 throw new IllegalArgumentException("No enum " + TimeUnit.class + " with value " + swigValue); 037 } 038 039 private TimeUnit(String swigName) { 040 this.swigName = swigName; 041 this.swigValue = swigNext++; 042 } 043 044 private TimeUnit(String swigName, int swigValue) { 045 this.swigName = swigName; 046 this.swigValue = swigValue; 047 swigNext = swigValue+1; 048 } 049 050 private TimeUnit(String swigName, TimeUnit swigEnum) { 051 this.swigName = swigName; 052 this.swigValue = swigEnum.swigValue; 053 swigNext = this.swigValue+1; 054 } 055 056 private static TimeUnit[] swigValues = { Days, Weeks, Months, Years, Hours, Minutes, Seconds, Milliseconds, Microseconds }; 057 private static int swigNext = 0; 058 private final int swigValue; 059 private final String swigName; 060} 061