Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.LinkedMap$MapEntry


      {
        final DatabaseMetaData data = conn.getMetaData();
        final boolean isHsql = ("HSQL Database Engine".equals(data.getDatabaseProductName()));
        if (data.supportsSchemasInTableDefinitions())
        {
          final LinkedMap schemas = new LinkedMap();
          final ResultSet rs = data.getSchemas();
          while (rs.next())
          {
            final String schemaName = rs.getString(1).trim();
            if (isHsql && "INFORMATION_SCHEMA".equals(schemaName))
            {
              continue;
            }

            schemas.put(schemaName, Boolean.TRUE);
          }
          rs.close();

          // bring up schema selection dialog only if preferences is set
          final String[] schemasArray = (String[]) schemas.keys(new String[schemas.size()]);
          if (schemas.size() > 1)
          {
            final Preferences properties = Preferences.userRoot().node("org/pentaho/reporting/ui/datasources/jdbc/Settings"); // NON-NLS
            if (properties.getBoolean("show-schema-dialog", false))
            {
              final SchemaSelectionDialog schemaSelectionDialog = new SchemaSelectionDialog(JdbcDataSourceDialog.this, schemasArray);
              schema = schemaSelectionDialog.getSchema();
            }
          }
          else if (schemas.size() == 1)
          {
            // Usually PUBLIC schema
            schema = schemasArray[0];
          }
        }
View Full Code Here


   *
   * @throws SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    final LinkedMap map = (LinkedMap) parameters.getObject();
    staticDataFactory = new NamedStaticDataFactory();
    if (map.isEmpty())
    {
      staticDataFactory.setQuery(queryName, className + '#' + methodName);
    }
    else
    {
      String query = className + '#' + methodName + '(';
      final Object[] objects = map.keys();
      for (int i = 0; i < objects.length; i++)
      {
        if (i != 0)
        {
          query += ",";
View Full Code Here

  private LinkedMap parameters;

  public StaticDataSetParametersReadHandler()
  {
    properties = new ArrayList<TypedPropertyReadHandler>();
    parameters = new LinkedMap();
  }
View Full Code Here

      {
        final DatabaseMetaData data = conn.getMetaData();
        final boolean isHsql = ("HSQL Database Engine".equals(data.getDatabaseProductName()));
        if (data.supportsSchemasInTableDefinitions())
        {
          final LinkedMap schemas = new LinkedMap();
          final ResultSet rs = data.getSchemas();
          while (rs.next())
          {
            final String schemaName = rs.getString(1).trim();
            if (isHsql && "INFORMATION_SCHEMA".equals(schemaName))
            {
              continue;
            }

            schemas.put(schemaName, Boolean.TRUE);
          }
          rs.close();

          // bring up dialog
          final String[] schemasArray = (String[]) schemas.keys(new String[schemas.size()]);
          if (schemas.size() > 1)
          {
            final SchemaSelectionDialog schemaSelectionDialog =
                new SchemaSelectionDialog(JdbcDataSourceDialog.this, schemasArray);
            schema = schemaSelectionDialog.getSchema();
          }
          else if (schemas.size() == 1)
          {
            schema = schemasArray[0];
          }
        }
      }
View Full Code Here

  /**
   * Creates an empty attribute list with no default values.
   */
  public AttributeList()
  {
    this.entryList = new LinkedMap();
    this.lookupKey = new AttributeEntry(null, "lookup", "value");
  }
View Full Code Here

  }

  public void testValidity()
      throws Exception
  {
    final LinkedMap map = new LinkedMap(16, 1024);
    map.put("1", "A");
    map.put("2", "B");
    map.put("3", "C");
    map.put("4", "D");
    map.put("5", "E");
    map.put("6", "F");
    map.put("1", "A");
    final Object[] expectedKeys = {"2", "3", "4", "5", "6", "1"};
    final Object[] a2 = map.keys();
    if (Arrays.equals(expectedKeys, a2) == false)
    {
      throw new Exception();
    }

    if (ObjectUtilities.equal(map.get("1"), "A") == false)
    {
      throw new NullPointerException();
    }
    if (ObjectUtilities.equal(map.get("2"), "B") == false)
    {
      throw new NullPointerException();
    }
    if (ObjectUtilities.equal(map.get("3"), "C") == false)
    {
      throw new NullPointerException();
    }
    if (ObjectUtilities.equal(map.get("4"), "D") == false)
    {
      throw new NullPointerException();
    }
    if (ObjectUtilities.equal(map.get("5"), "E") == false)
    {
      throw new NullPointerException();
    }
    if (ObjectUtilities.equal(map.get("6"), "F") == false)
    {
      throw new NullPointerException();
    }
    if (ObjectUtilities.equal(map.get("1"), "A") == false)
    {
      throw new NullPointerException();
    }


    map.remove("1");
    map.remove("2");


    final Object[] expectedKeys2 = {"3", "4", "5", "6"};
    final Object[] a3 = map.keys();
    if (Arrays.equals(expectedKeys2, a3) == false)
    {
      throw new Exception();
    }

    map.remove("5");
   
    Object[] arrayCache = map.values(new String[map.size()]);

    map.remove("3");
    map.remove("6");
    map.remove("4");

    if (map.keys().length != 0)
    {
      throw new Exception();
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.base.util.LinkedMap$MapEntry

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.