Package org.threeten.bp.format

Examples of org.threeten.bp.format.DateTimeFormatter


    //-----------------------------------------------------------------------
    // format(DateTimeFormatter)
    //-----------------------------------------------------------------------
    @Test
    public void test_format_formatter() {
        DateTimeFormatter f = DateTimeFormatter.ofPattern("H m s");
        String t = LocalTime.of(11, 30, 45).format(f);
        assertEquals(t, "11 30 45");
    }
View Full Code Here


  public static ExternalId generateEquityOptionTicker(final String underlyingTicker, final Expiry expiry, final OptionType optionType, final double strike) {
    ArgumentChecker.notNull(underlyingTicker, "underlyingTicker");
    ArgumentChecker.notNull(expiry, "expiry");
    ArgumentChecker.notNull(optionType, "optionType");
    Pair<String, String> tickerMarketSectorPair = splitTickerAtMarketSector(underlyingTicker);
    DateTimeFormatter expiryFormatter = DateTimeFormatter.ofPattern("MM/dd/yy");
    DecimalFormat strikeFormat = new DecimalFormat("0.###");
    String strikeString = strikeFormat.format(strike);
    StringBuilder sb = new StringBuilder();
    sb.append(tickerMarketSectorPair.getFirst())
        .append(' ')
View Full Code Here

      System.out.println(info);
    }
  }
 
  private static void printVersionListQuery(SnapshotUtils snapshotUtils, String optionValue) {
    DateTimeFormatter dateTimeFormatter = new DateTimeFormatterBuilder()
      .appendValue(YEAR, 4, 10, SignStyle.EXCEEDS_PAD)
      .appendLiteral('-')
      .appendValue(MONTH_OF_YEAR, 2)
      .appendLiteral('-')
      .appendValue(DAY_OF_MONTH, 2)
View Full Code Here

  }

  @Test(enabled = false)
  public void parRateSensitivityTest() {
    final DateTimeFormatter formatt = DateTimeFormatter.ofPattern("dd-MMM-yy");
    final StringBuilder out = new StringBuilder();
    final AnalyticCDSPricer pricer = new AnalyticCDSPricer(true);
    final CDSAnalyticFactory factory = new CDSAnalyticFactory(0.4);
    final int nPillars = PILLAR_DATES.length;
    out.append("\\begin{tabular}{");
View Full Code Here

  }

  @Test(enabled = false)
  public void pvSensitivityTest() {
    final double coupon = 0.01;
    final DateTimeFormatter formatt = DateTimeFormatter.ofPattern("dd-MMM-yy");
    final StringBuilder out = new StringBuilder();
    final AnalyticCDSPricer pricer = new AnalyticCDSPricer(true);
    final CDSAnalyticFactory factory = new CDSAnalyticFactory(0.4);
    final int nPillars = PILLAR_DATES.length;
    out.append("\\begin{tabular}{");
View Full Code Here

  }

  @Test(enabled = false)
  public void hedgingTest1() {
    final double coupon = 0.01;
    final DateTimeFormatter formatt = DateTimeFormatter.ofPattern("dd-MMM-yy");
    final StringBuilder out = new StringBuilder();

    final CDSAnalyticFactory factory = new CDSAnalyticFactory(0.4);
    final int nPillars = PILLAR_DATES.length;
    final double[][] res = new double[nPillars][nPillars];
View Full Code Here

    final double notional = 1e7;
    final double coupon = 1e-2;

    final ISDAPremiumLegSchedule schedule = new ISDAPremiumLegSchedule(startDate, endDate, paymentInt, stub, FOLLOWING, CALENDAR, true);

    final DateTimeFormatter formatt = DateTimeFormatter.ofPattern("dd-MMM-yy");

    final int n = schedule.getNumPayments();

    System.out.println("\\begin{tabular}{|c|c|c|c|c|}");
    System.out.println("\\hline");
View Full Code Here

    LocalDateDoubleTimeSeries existingDataPoints = ImmutableLocalDateDoubleTimeSeries.of(existingDates, existingValues);

    // Read in the time series directly from the file and construct a time series to compare with
    DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
    builder.appendPattern(DATE_FORMAT);
    DateTimeFormatter dateFormat = builder.toFormatter();

    String readId = "";
    List<LocalDate> dates = new ArrayList<LocalDate>();
    List<Double> values = new ArrayList<Double>();
    CSVReader csvReader = null;
View Full Code Here

  
  private SheetReader buildMockSheetReader(LocalDateDoubleTimeSeries lddts) {
   
    DateTimeFormatterBuilder builder = new DateTimeFormatterBuilder();
    builder.appendPattern(DATE_FORMAT);
    DateTimeFormatter dateFormat = builder.toFormatter();

    SheetReader mock = mock(SheetReader.class);
    OngoingStubbing<Map<String, String>> stub = when(mock.loadNextRow());
    for (Map.Entry<LocalDate, Double> entry : lddts) {
      Map<String, String> row = new HashMap<String, String>();
View Full Code Here

TOP

Related Classes of org.threeten.bp.format.DateTimeFormatter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.