Examples of Settings


Examples of org.enhydra.jawe.Settings

        boolean rightAllignment = false;

        Color bkgCol = new Color(245, 245, 245);
        if (pc != null) {
            Settings settings = pc.getSettings();

            rightAllignment = settings.getSettingBoolean("XMLBasicPanel.RightAllignment");

            if (settings instanceof PanelSettings) {
                bkgCol = ((PanelSettings) settings).getBackgroundColor();
            }
View Full Code Here

Examples of org.fest.swing.core.Settings

    driver = new ComponentDriver(robot);
  }

  @Test
  public void should_return_settings_from_Robot() {
    Settings settings = new Settings();
    when(robot.settings()).thenReturn(settings);
    assertThat(driver.settings()).isSameAs(settings);
  }
View Full Code Here

Examples of org.gradle.mvn3.org.apache.maven.settings.Settings

    public File getLocalMavenRepository() throws CannotLocateLocalMavenRepositoryException{
        if (systemProperties.containsKey("maven.repo.local")) {
            return new File(systemProperties.get("maven.repo.local"));
        }
        try {
            Settings settings = settingsProvider.buildSettings();
            String repoPath = settings.getLocalRepository();
            if (repoPath != null) {
                return new File(resolvePlaceholders(repoPath.trim()));
            } else {
                File defaultLocation = new File(System.getProperty("user.home"), "/.m2/repository").getAbsoluteFile();
                LOGGER.debug(String.format("No local repository in Settings file defined. Using default path: %s", defaultLocation));
View Full Code Here

Examples of org.hibernate.cfg.Settings

      testee.setConfigurationElements(config);
      testee.start();
     
      SessionFactory factory = testee.getInstance();
      assertTrue(factory instanceof SessionFactoryImplementor);
      Settings settings = ((SessionFactoryImplementor) factory).getSettings();
      assertTrue(settings.getTransactionFactory() instanceof JTATransactionFactory);
      assertTrue(settings.isSecondLevelCacheEnabled());
     
      assertTrue(settings.isFlushBeforeCompletionEnabled());
      assertTrue(settings.isAutoCloseSessionEnabled());
     
      Properties props = testee.getConfigurationProperties();
      assertEquals(HashtableCacheProvider.class.getName(), props.getProperty(Environment.CACHE_PROVIDER));
      assertEquals("after_statement", props.getProperty("hibernate.connection.release_mode"));
      // Disabled, as use of JTA causes hibernate to ignore hibernate.connection.release_mode=after_statement
View Full Code Here

Examples of org.intellij.sonar.persistence.Settings

    final Map<String, Set<SonarIssue>> index = Maps.newConcurrentMap();
    for (PsiFile psiFile : files) {
      String fullFilePath = psiFile.getVirtualFile().getPath();
      ImmutableSet.Builder<SonarIssue> entriesBuilder = ImmutableSet.builder();
      final Settings settings = SettingsUtil.getSettingsFor(psiFile);
      if (settings == null) continue;
      final Collection<Resource> resources = settings.getResources();
      if (resources == null || resources.isEmpty()) {
        matchFileByResource(fullFilePath, entriesBuilder, new Resource());
      } else {
        for (Resource resource : resources) {
          matchFileByResource(fullFilePath, entriesBuilder, resource);
View Full Code Here

Examples of org.jboss.aesh.console.settings.Settings

                        console.getShell().out().println("^C");
                        console.clearBufferAndDisplayPrompt();
                    }
                });
                */
        Settings settings = builder.create();
        CommandRegistry registry = new AeshCommandRegistryBuilder()
                .command(ExitCommand.class)
                .command(fooCommand, FooCommand.class)
                .command(LsCommand.class)
                .command(TestConsoleCommand.class)
View Full Code Here

Examples of org.jooq.conf.Settings

    public String version(SchemaDefinition schema) {
        return "" +
            DSL.using(
                new DefaultConfiguration()
                    .set(connection)
                    .set(new Settings().withStatementType(STATIC_STATEMENT))
            ).fetchValue(
                // [#2906] TODO Plain SQL statements do not yet support named parameters
                sql.replace(":schema_name", "?"), param("schema_name", schema.getInputName())
            );
    }
View Full Code Here

Examples of org.jquantlib.Settings

        //final Calendar calendar = new Target();
        // final Date today = calendar.adjust(Date.todaysDate());
        // final Date today = calendar.adjust(new Date(6,Month.June,2007));
        final Date today = new Date(22,Month.November,2004);
        final Settings settings = new Settings();
        settings.setEvaluationDate(today);

        final double faceAmount = 1000000.0;

        // with implicit settlement calculation:

      final Calendar bondCalendar = new NullCalendar();
      final DayCounter bondDayCount = new ActualActual(ActualActual.Convention.ISMA);
      final int settlementDays = 1;

    final Handle<YieldTermStructure> discountCurve = new Handle<YieldTermStructure>(Utilities.flatRate(today, 0.03, new Actual360()));

      // actual market values from the evaluation date

      final Frequency freq = Frequency.Semiannual;
      final Schedule sch1 = new Schedule(new Date(31, Month.October, 2004),
                    new Date(31, Month.October, 2006), new Period(freq), bondCalendar,
                    BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted, DateGeneration.Rule.Backward, false);

      final FixedRateBond bond1 = new FixedRateBond(settlementDays, faceAmount, sch1,
                          new double[] {0.025},
                          bondDayCount, BusinessDayConvention.ModifiedFollowing,
                          100.0, new Date(1, Month.November, 2004));

    final PricingEngine bondEngine = new DiscountingBondEngine(discountCurve);

      bond1.setPricingEngine(bondEngine);

      final double marketPrice1 = 99.203125;
      final double marketYield1 = 0.02925;

      final Schedule sch2 = new Schedule(new Date(15, Month.November, 2004),
          new Date(15, Month.November, 2009), new Period(freq), bondCalendar,
          BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted, DateGeneration.Rule.Backward, false);

      final FixedRateBond bond2 = new FixedRateBond(settlementDays, faceAmount, sch2,
                          new double [] {0.035},
                          bondDayCount, BusinessDayConvention.ModifiedFollowing,
                          100.0, new Date(15, Month.November, 2004));

      bond2.setPricingEngine(bondEngine);

      final double marketPrice2 = 99.6875;
      final double marketYield2 = 0.03569;

      // calculated values

      final double cachedPrice1a = 99.204505, cachedPrice2a = 99.687192;
      final double cachedPrice1b = 98.943393, cachedPrice2b = 101.986794;
      final double cachedYield1a = 0.029257,  cachedYield2a = 0.035689;
      final double cachedYield1b = 0.029045,  cachedYield2b = 0.035375;
      final double cachedYield1c = 0.030423,  cachedYield2c = 0.030432;

      // check
      final double tolerance = 1.0e-6;
      double price, yield;

      price = bond1.cleanPrice(marketYield1,
                               bondDayCount, Compounding.Compounded, freq);
      if (Math.abs(price-cachedPrice1a) > tolerance) {
        fail("failed to reproduce cached price:"
                     + "\n    calculated: " + price
                     + "\n    expected:   " + cachedPrice1a
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (price-cachedPrice1a));
      }

      price = bond1.getCleanPrice();
      if (Math.abs(price-cachedPrice1b) > tolerance) {
        fail("failed to reproduce cached price:"
                     + "\n    calculated: " + price
                     + "\n    expected:   " + cachedPrice1b
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (price-cachedPrice1b));
      }

      yield = bond1.yield(marketPrice1, bondDayCount, Compounding.Compounded, freq);
      if (Math.abs(yield-cachedYield1a) > tolerance) {
        fail("failed to reproduce cached compounded yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield1a
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield1a));
      }

      yield = bond1.yield(marketPrice1, bondDayCount, Compounding.Continuous, freq);
      if (Math.abs(yield-cachedYield1b) > tolerance) {
        fail("failed to reproduce cached continuous yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield1b
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield1b));
      }

      yield = bond1.yield(bondDayCount, Compounding.Continuous, freq);
      if (Math.abs(yield-cachedYield1c) > tolerance) {
        fail("failed to reproduce cached continuous yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield1c
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield1c));
      }


      price = bond2.cleanPrice(marketYield2, bondDayCount, Compounding.Compounded, freq);
      if (Math.abs(price-cachedPrice2a) > tolerance) {
        fail("failed to reproduce cached price:"
                     + "\n    calculated: " + price
                     + "\n    expected:   " + cachedPrice2a
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (price-cachedPrice2a));
      }

      price = bond2.getCleanPrice();
      if (Math.abs(price-cachedPrice2b) > tolerance) {
        fail("failed to reproduce cached price:"
                     + "\n    calculated: " + price
                     + "\n    expected:   " + cachedPrice2b
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (price-cachedPrice2b));
      }

      yield = bond2.yield(marketPrice2, bondDayCount, Compounding.Compounded, freq);
      if (Math.abs(yield-cachedYield2a) > tolerance) {
        fail("failed to reproduce cached compounded yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield2a
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield2a));
      }

      yield = bond2.yield(marketPrice2, bondDayCount, Compounding.Continuous, freq);
      if (Math.abs(yield-cachedYield2b) > tolerance) {
        fail("failed to reproduce cached continuous yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield2b
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield2b));
      }

      yield = bond2.yield(bondDayCount, Compounding.Continuous, freq);
      if (Math.abs(yield-cachedYield2c) > tolerance) {
        fail("failed to reproduce cached continuous yield:"
                     + "\n    calculated: " + yield
                     + "\n    expected:   " + cachedYield2c
                     + "\n    tolerance:  " + tolerance
                     + "\n    error:      " + (yield-cachedYield2c));
      }

      // with explicit settlement date:

      final Schedule sch3 = new Schedule(new Date(30,Month.November,2004),
                    new Date(30,Month.November,2006), new Period(freq),
                    new UnitedStates(UnitedStates.Market.GOVERNMENTBOND),
                    BusinessDayConvention.Unadjusted, BusinessDayConvention.Unadjusted, DateGeneration.Rule.Backward, false);

      final FixedRateBond bond3 = new FixedRateBond(settlementDays, faceAmount, sch3,
                          new double[] {0.02875},
                          new ActualActual(ActualActual.Convention.ISMA),
                          BusinessDayConvention.ModifiedFollowing,
                          100.0, new Date(30,Month.November,2004));

      bond3.setPricingEngine(bondEngine);

      final double marketYield3 = 0.02997;

      final Date settlementDate = new Date(30,Month.November,2004);
      final double cachedPrice3 = 99.764874;

      price = bond3.cleanPrice(marketYield3,
                               bondDayCount, Compounding.Compounded, freq, settlementDate);
      if (Math.abs(price-cachedPrice3) > tolerance) {
        fail("failed to reproduce cached price:"
                     + "\n    calculated: " + price + ""
                     + "\n    expected:   " + cachedPrice3 + ""
                     + "\n    error:      " + (price-cachedPrice3));
      }

      // this should give the same result since the issue date is the
      // earliest possible settlement date

      settings.setEvaluationDate(new Date(22,Month.November,2004));

      price = bond3.cleanPrice(marketYield3, bondDayCount, Compounding.Compounded, freq);
      if (Math.abs(price-cachedPrice3) > tolerance) {
        fail("failed to reproduce cached price:"
                     + "\n    calculated: " + price + ""
View Full Code Here

Examples of org.jquantlib.Settings

        final double underlyings[] = { 100.0 };
        final double /* @Rate */qRates[] = { 0.00, 0.05 };
        final double /* @Rate */rRates[] = { 0.01, 0.05, 0.15 };
        final double /* @Volatility */vols[] = { 0.11, 0.50, 1.20 };

        final Date today = new Settings().evaluationDate();

        final DayCounter dc = new Actual360();

        final SimpleQuote           spot  = new SimpleQuote(0.0);
        final SimpleQuote           qRate = new SimpleQuote(0.0);
View Full Code Here

Examples of org.jquantlib.Settings

        QL.require(fixingDays >= 2 , "wrong number of fixing days")// QA:[RG]::verified // TODO: message

        // TODO: code review :: please verify against QL/C++ code
        tenor.normalize();

        final Date evaluationDate = new Settings().evaluationDate();

        // TODO: code review :: please verify against QL/C++ code
        // 1. seems like we should have this.evaluationDate
        // 2. we should get rid of static calls and singletons
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.