示例#1
0
  void ICmd$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.ICmd", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.ICmd.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.ICmd", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Interface");
    vo.bind("$capsule", om.findStrict("xdc.tools.ICmd$$capsule", "xdc.tools"));
    vo.bind("Instance", om.findStrict("xdc.tools.ICmd.Instance", "xdc.tools"));
    vo.bind("Params", om.findStrict("xdc.tools.ICmd.Params", "xdc.tools"));
    vo.bind(
        "PARAMS", ((Proto.Str) om.findStrict("xdc.tools.ICmd.Params", "xdc.tools")).newInstance());
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    inherits.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$interfaces")).add(vo);
    pkgV.bind("ICmd", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("ICmd");
    vo.seal(null);
  }
  /**
   * Parse type variables for generics
   *
   * @param variables
   * @return
   */
  protected static TypeVar[] ParseTypeVariables(TypeVariable[] variables, ParamTag[] tags) {
    TypeVar[] vars = null;

    if (variables != null && variables.length > 0) {
      ArrayList<TypeVar> varsList = new ArrayList<TypeVar>();

      for (TypeVariable variable : variables) {
        TypeVar var = new TypeVar();
        var.name = variable.typeName();
        Type[] bounds = variable.bounds();
        if (bounds != null && bounds.length > 0) {
          ArrayList<String> list = new ArrayList<String>();

          for (Type bound : bounds) {
            list.add(bound.qualifiedTypeName());
          }

          var.bounds = list.toArray(new String[] {});
        }
        for (ParamTag tag : tags)
          if (tag.parameterName().equals(var.name)) var.comment = tag.parameterComment();

        varsList.add(var);
      }

      vars = varsList.toArray(new TypeVar[] {});
    }

    return vars;
  }
示例#3
0
  // returns the stream of final pig script to be passed to Grunt
  private static BufferedReader runParamPreprocessor(
      BufferedReader origPigScript,
      ArrayList<String> params,
      ArrayList<String> paramFiles,
      String scriptFile,
      boolean createFile)
      throws org.apache.pig.tools.parameters.ParseException, IOException {
    ParameterSubstitutionPreprocessor psp = new ParameterSubstitutionPreprocessor(50);
    String[] type1 = new String[1];
    String[] type2 = new String[1];

    if (createFile) {
      BufferedWriter fw = new BufferedWriter(new FileWriter(scriptFile));
      psp.genSubstitutedFile(
          origPigScript,
          fw,
          params.size() > 0 ? params.toArray(type1) : null,
          paramFiles.size() > 0 ? paramFiles.toArray(type2) : null);
      return new BufferedReader(new FileReader(scriptFile));

    } else {
      StringWriter writer = new StringWriter();
      psp.genSubstitutedFile(
          origPigScript,
          writer,
          params.size() > 0 ? params.toArray(type1) : null,
          paramFiles.size() > 0 ? paramFiles.toArray(type2) : null);
      return new BufferedReader(new StringReader(writer.toString()));
    }
  }
  /* ------------------------------------------------------------ */
  public synchronized MBeanInfo getMBeanInfo() {
    log.debug("getMBeanInfo");

    if (_dirty) {
      _dirty = false;
      ModelMBeanAttributeInfo[] attributes =
          (ModelMBeanAttributeInfo[])
              _attributes.toArray(new ModelMBeanAttributeInfo[_attributes.size()]);
      ModelMBeanOperationInfo[] operations =
          (ModelMBeanOperationInfo[])
              _operations.toArray(new ModelMBeanOperationInfo[_operations.size()]);
      ModelMBeanNotificationInfo[] notifications =
          (ModelMBeanNotificationInfo[])
              _notifications.toArray(new ModelMBeanNotificationInfo[_notifications.size()]);

      _beanInfo =
          new ModelMBeanInfoSupport(
              _object.getClass().getName(),
              findDescription(null),
              attributes,
              null,
              operations,
              notifications);
    }

    return _beanInfo;
  }
示例#5
0
  void IRtscProductTemplate$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.IRtscProductTemplate", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.IRtscProductTemplate.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.IRtscProductTemplate", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Interface");
    vo.bind("$capsule", $$UNDEF);
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    inherits.clear();
    vo.bind(
        "TemplateInfo", om.findStrict("xdc.tools.IRtscProductTemplate.TemplateInfo", "xdc.tools"));
    tdefs.add(om.findStrict("xdc.tools.IRtscProductTemplate.TemplateInfo", "xdc.tools"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$interfaces")).add(vo);
    pkgV.bind("IRtscProductTemplate", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("IRtscProductTemplate");
    vo.seal(null);
  }
  /** Validate prerequisites entries (prerequisite.csv) */
  public void validatePrerequisites() {
    String file = "prerequisite.csv";

    // CHECK ALL ENTRIES FOR BLANK FIELDS
    for (int i = 0; i < entries.size(); i++) {
      boolean rowHasMissingFields = false;
      // Line Number. First row (index 0) is data row. So +2 to get line number.
      int line = i + 2;
      ArrayList<String> rowMessageList = new ArrayList<>();
      String[] row = entries.get(i);

      rowHasMissingFields = tool.rowHasMissingFields(row, rowMessageList);

      if (rowHasMissingFields) {
        blacklistedEntries.add(row);

        String[] message = rowMessageList.toArray(new String[0]);
        errorList.add(new BootstrapError(file, line, message));
      }
    }

    // STEP 2: CHECK ALL FOR invalidExamDate invalidStart, invalidEnd
    for (int i = 0; i < entries.size(); i++) {
      boolean rowHasInvalidCourse = false;
      boolean rowHasInvalidPrerequisite = false;
      boolean rowHasDuplicatePrimaryKey = false;

      int line = i + 2;
      ArrayList<String> rowMessageList = new ArrayList<>();
      String[] row = entries.get(i);

      // if not already blacklisted due to error
      if (!blacklistedEntries.contains(row)) {

        rowHasInvalidCourse = tool.rowHasInvalidCourse(row, rowMessageList);
        rowHasInvalidPrerequisite = tool.rowHasInvalidPrerequisite(row, rowMessageList);

        // if there are duplicates, the latest/bottomest row will be accepted.
        // The earlier rows will be errored.
        String foreignKey = "course";
        String primaryKey = "prerequisite";
        // rowHasDuplicatePrimaryKey =
        // tool.rowHasDuplicatePrimaryKey(foreignKey,primaryKey,row,rowMessageList);
        /*
         * NO NEED TO TEST FOR DUPLICATES
         */

        // Blacklist row if any of the validations blacklistedEntries are "true"
        if (rowHasInvalidCourse || rowHasInvalidPrerequisite || rowHasDuplicatePrimaryKey) {
          blacklistedEntries.add(row); // add row to blackList

          String[] message = rowMessageList.toArray(new String[0]);
          errorList.add(new BootstrapError(file, line, message));
        }
      }
    } // end of 2nd for-loop

    // method ends
  }
示例#7
0
 public boolean columnsDBParse(
     int
         idOfFile) // Функция, разбирающая xml файл с конфигами всех таблиц, сохраняющаяя названия
                   // таблиц, названия столбцов и типы столбцов
     {
   ArrayList<String[]> arrayList = new ArrayList<String[]>();
   ArrayList<String[]> typesArrayList = new ArrayList<String[]>();
   ArrayList<String> strings = new ArrayList<String>();
   ArrayList<String> typesStrings = new ArrayList<String>();
   ArrayList<String> list = new ArrayList<String>();
   try {
     XmlPullParser xpp = app.getResources().getXml(idOfFile);
     while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
       switch (xpp.getEventType()) {
         case XmlPullParser.START_TAG:
           if (xpp.getDepth() == 2) {
             list.add(xpp.getAttributeValue(0));
           }
           if (xpp.getDepth() == 3) {
             strings.add(xpp.getAttributeValue(0));
             typesStrings.add(xpp.getAttributeValue(1));
           }
           break;
         case XmlPullParser.END_TAG:
           if (xpp.getDepth() == 2) {
             String[] helpArray = new String[strings.size()];
             helpArray = strings.toArray(helpArray);
             arrayList.add(helpArray);
             helpArray = new String[typesStrings.size()];
             helpArray = typesStrings.toArray(helpArray);
             typesArrayList.add(helpArray);
             typesStrings = new ArrayList<String>();
             strings = new ArrayList<String>();
           }
           break;
         default:
           break;
       }
       xpp.next();
     }
     this.DBcolumns = arrayList;
     this.DBtypes = typesArrayList;
     String[] arr = new String[list.size()];
     arr = list.toArray(arr);
     this.tables = arr;
   } catch (XmlPullParserException e) {
     e.printStackTrace();
   } catch (IOException e) {
     e.printStackTrace();
   }
   if (this.DBcolumns == null || this.tables == null) {
     return false;
   } else {
     return true;
   }
 }
示例#8
0
  void Platform$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("ti.platforms.evm6424.Platform", "ti.platforms.evm6424");
    po = (Proto.Obj) om.findStrict("ti.platforms.evm6424.Platform.Module", "ti.platforms.evm6424");
    vo.init2(po, "ti.platforms.evm6424.Platform", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind(
        "$capsule",
        om.findStrict("ti.platforms.evm6424.Platform$$capsule", "ti.platforms.evm6424"));
    vo.bind(
        "Instance",
        om.findStrict("ti.platforms.evm6424.Platform.Instance", "ti.platforms.evm6424"));
    vo.bind(
        "Params", om.findStrict("ti.platforms.evm6424.Platform.Params", "ti.platforms.evm6424"));
    vo.bind(
        "PARAMS",
        ((Proto.Str) om.findStrict("ti.platforms.evm6424.Platform.Params", "ti.platforms.evm6424"))
            .newInstance());
    vo.bind("$package", om.findStrict("ti.platforms.evm6424", "ti.platforms.evm6424"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    vo.bind("Board", om.findStrict("xdc.platform.IPlatform.Board", "ti.platforms.evm6424"));
    tdefs.add(om.findStrict("xdc.platform.IPlatform.Board", "ti.platforms.evm6424"));
    vo.bind("Memory", om.findStrict("xdc.platform.IPlatform.Memory", "ti.platforms.evm6424"));
    tdefs.add(om.findStrict("xdc.platform.IPlatform.Memory", "ti.platforms.evm6424"));
    vo.bind("MemoryMap", om.findStrict("xdc.platform.IPlatform.MemoryMap", "ti.platforms.evm6424"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.platforms.evm6424")).add(vo);
    vo.bind("$$instflag", 1);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 1);
    vo.bind("$$romcfgs", "|");
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind(
        "$$meta_iobj", om.has("ti.platforms.evm6424.Platform$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    vo.bind(
        "Object", om.findStrict("ti.platforms.evm6424.Platform.Object", "ti.platforms.evm6424"));
    pkgV.bind("Platform", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("Platform");
  }
  String constructDN(final T o, final String parentDN, final Map<String, Attribute> attrMap)
      throws LDAPPersistException {
    final String existingDN = getEntryDN(o);
    if (existingDN != null) {
      return existingDN;
    }

    final ArrayList<String> rdnNameList = new ArrayList<String>(1);
    final ArrayList<byte[]> rdnValueList = new ArrayList<byte[]>(1);
    for (final FieldInfo i : rdnFields) {
      final Attribute a = attrMap.get(toLowerCase(i.getAttributeName()));
      if (a == null) {
        throw new LDAPPersistException(
            ERR_OBJECT_HANDLER_RDN_FIELD_MISSING_VALUE.get(type.getName(), i.getField().getName()));
      }

      rdnNameList.add(a.getName());
      rdnValueList.add(a.getValueByteArray());
    }

    for (final GetterInfo i : rdnGetters) {
      final Attribute a = attrMap.get(toLowerCase(i.getAttributeName()));
      if (a == null) {
        throw new LDAPPersistException(
            ERR_OBJECT_HANDLER_RDN_GETTER_MISSING_VALUE.get(
                type.getName(), i.getMethod().getName()));
      }

      rdnNameList.add(a.getName());
      rdnValueList.add(a.getValueByteArray());
    }

    final String[] rdnNames = new String[rdnNameList.size()];
    rdnNameList.toArray(rdnNames);

    final byte[][] rdnValues = new byte[rdnNames.length][];
    rdnValueList.toArray(rdnValues);

    final RDN rdn = new RDN(rdnNames, rdnValues);

    if (parentDN == null) {
      return new DN(rdn, defaultParentDN).toString();
    } else {
      try {
        final DN parsedParentDN = new DN(parentDN);
        return new DN(rdn, parsedParentDN).toString();
      } catch (LDAPException le) {
        debugException(le);
        throw new LDAPPersistException(
            ERR_OBJECT_HANDLER_INVALID_PARENT_DN.get(type.getName(), parentDN, le.getMessage()),
            le);
      }
    }
  }
示例#10
0
  public void sendEmail() throws MessagingException {
    if (msg.getFrom() == null)
      msg.setFrom(new InternetAddress("*****@*****.**"));
    msg.setHeader("X-mailer", "msgsend");
    msg.setRecipients(Message.RecipientType.TO, (Address[]) toList.toArray(new Address[0]));
    msg.setRecipients(Message.RecipientType.CC, (Address[]) ccList.toArray(new Address[0]));
    msg.setRecipients(Message.RecipientType.BCC, (Address[]) bccList.toArray(new Address[0]));
    msg.setSentDate(new Date());

    if (!toList.isEmpty()) Transport.send(msg);
  }
示例#11
0
文件: TreeUtil.java 项目: jexp/idea2
 public static TreePath[] selectMaximals(final TreePath[] paths) {
   if (paths == null) return new TreePath[0];
   final TreePath[] noDuplicates = removeDuplicates(paths);
   final ArrayList<TreePath> result = new ArrayList<TreePath>();
   for (final TreePath path : noDuplicates) {
     final ArrayList<TreePath> otherPaths = new ArrayList<TreePath>(Arrays.asList(noDuplicates));
     otherPaths.remove(path);
     if (!isDescendants(path, otherPaths.toArray(new TreePath[otherPaths.size()])))
       result.add(path);
   }
   return result.toArray(new TreePath[result.size()]);
 }
示例#12
0
文件: Genes.java 项目: dgaston/FGB
 static {
   int current_chr = -1;
   File hgnc =
       new File(CfgReader.getBasic(Consts.CURRENT_ASSEMBLY, Consts.FORMAT_HGNC).get_Path());
   ByteBufferChannel bbc = new ByteBufferChannel(hgnc, 0, hgnc.length());
   String[] temp = bbc.ToString(Consts.DEFAULT_ENCODE).split("\n");
   ArrayList<String> ChrList_temp = new ArrayList<String>();
   ArrayList<Integer> ChrStart_temp = new ArrayList<Integer>();
   ArrayList<Integer> ChrEnd_temp = new ArrayList<Integer>();
   ChrMap = new HashMap<String, Integer>();
   SymbolMap = new HashMap<String, Integer>();
   Symbols = new String[temp.length];
   Symbols_sorted = new String[temp.length];
   HGNCs = new String[temp.length];
   Entrezs = new String[temp.length];
   RefSeqs = new String[temp.length];
   UCSCs = new String[temp.length];
   Ensembls = new String[temp.length];
   Names = new String[temp.length];
   Chrs = new int[temp.length];
   Starts = new int[temp.length];
   Ends = new int[temp.length];
   for (int i = 0; i < temp.length; i++) {
     String[] line_temp = temp[i].split("\t");
     if (!ChrMap.containsKey(line_temp[0])) {
       if (i > 0) ChrEnd_temp.add(i - 1);
       ChrMap.put(line_temp[0], ++current_chr);
       ChrList_temp.add(line_temp[0]);
       ChrStart_temp.add(i);
     }
     Chrs[i] = current_chr;
     Starts[i] = Integer.parseInt(line_temp[1]);
     Ends[i] = Integer.parseInt(line_temp[2]);
     Symbols[i] = line_temp[3];
     Symbols_sorted[i] = line_temp[3];
     SymbolMap.put(line_temp[3], i);
     RefSeqs[i] = line_temp[4];
     UCSCs[i] = line_temp[5];
     Ensembls[i] = line_temp[6];
     Entrezs[i] = line_temp[7];
     HGNCs[i] = line_temp[8];
     Names[i] = line_temp[9];
   }
   ChrEnd_temp.add(temp.length - 1);
   Arrays.sort(Symbols_sorted);
   ChrList = new String[ChrList_temp.size()];
   ChrStarts = new Integer[ChrList.length];
   ChrEnds = new Integer[ChrList.length];
   ChrList_temp.toArray(ChrList);
   ChrStart_temp.toArray(ChrStarts);
   ChrEnd_temp.toArray(ChrEnds);
 }
示例#13
0
  /** Validate Student entries */
  public void validateStudent() {
    String file = "student.csv";

    // CHECK ALL ENTRIES FOR BLANK FIELDS
    for (int i = 0; i < entries.size(); i++) {
      boolean rowHasMissingFields = false;
      // Line Number. First row (index 0) is data row. So +2 to get line number.
      int line = i + 2;
      ArrayList<String> rowMessageList = new ArrayList<>();
      String[] row = entries.get(i);

      rowHasMissingFields = tool.rowHasMissingFields(row, rowMessageList);

      if (rowHasMissingFields) {
        blacklistedEntries.add(row);

        String[] message = rowMessageList.toArray(new String[0]);
        errorList.add(new BootstrapError(file, line, message));
      }
    }

    // STEP 2: CHECK ALL FOR duplicateUserid and invalidEDollar
    for (int i = 0; i < entries.size(); i++) {
      boolean rowHasDuplicateUserId = false;
      boolean rowHasInvalidEDollar = false;

      int line = i + 2;
      ArrayList<String> rowMessageList = new ArrayList<>();
      String[] row = entries.get(i);

      // if not already blacklisted due to error
      if (!blacklistedEntries.contains(row)) {

        // if there are duplicates, the latest/bottomest row will be accepted.
        // The earlier rows will be errored.
        rowHasDuplicateUserId = tool.rowHasDuplicatePrimaryKey("userid", row, line, rowMessageList);
        rowHasInvalidEDollar = tool.rowHasInvalidEDollar(row, rowMessageList);

        // Blacklist row if any of the validations blacklistedEntries are "true"
        if (rowHasInvalidEDollar || rowHasDuplicateUserId) {
          blacklistedEntries.add(row); // add row to blackList

          String[] message = rowMessageList.toArray(new String[0]);
          errorList.add(new BootstrapError(file, line, message));
        }
      }
    }

    // method ends
  }
示例#14
0
  void Agent$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("ti.sysbios.rta.Agent", "ti.sysbios.rta");
    po = (Proto.Obj) om.findStrict("ti.sysbios.rta.Agent.Module", "ti.sysbios.rta");
    vo.init2(po, "ti.sysbios.rta.Agent", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind("$capsule", om.findStrict("ti.sysbios.rta.Agent$$capsule", "ti.sysbios.rta"));
    vo.bind("$package", om.findStrict("ti.sysbios.rta", "ti.sysbios.rta"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    icfgs.clear();
    inherits.clear();
    vo.bind("Transport", om.findStrict("ti.sysbios.rta.Agent.Transport", "ti.sysbios.rta"));
    vo.bind(
        "Transport_RTDX", om.findStrict("ti.sysbios.rta.Agent.Transport_RTDX", "ti.sysbios.rta"));
    vo.bind(
        "Transport_STOP_MODE_ONLY",
        om.findStrict("ti.sysbios.rta.Agent.Transport_STOP_MODE_ONLY", "ti.sysbios.rta"));
    vo.bind(
        "Transport_USER", om.findStrict("ti.sysbios.rta.Agent.Transport_USER", "ti.sysbios.rta"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.sysbios.rta")).add(vo);
    vo.bind("$$instflag", 0);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 0);
    vo.bind("$$romcfgs", "|");
    vo.bind("$$nortsflag", 0);
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind("$$meta_iobj", om.has("ti.sysbios.rta.Agent$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    pkgV.bind("Agent", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("Agent");
  }
  void G711DEC$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo =
        (Value.Obj)
            om.findStrict(
                "ti.sdo.ce.examples.codecs.g711.G711DEC", "ti.sdo.ce.examples.codecs.g711");
    po =
        (Proto.Obj)
            om.findStrict(
                "ti.sdo.ce.examples.codecs.g711.G711DEC.Module", "ti.sdo.ce.examples.codecs.g711");
    vo.init2(po, "ti.sdo.ce.examples.codecs.g711.G711DEC", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind(
        "$capsule",
        om.findStrict(
            "ti.sdo.ce.examples.codecs.g711.G711DEC$$capsule", "ti.sdo.ce.examples.codecs.g711"));
    vo.bind(
        "$package",
        om.findStrict("ti.sdo.ce.examples.codecs.g711", "ti.sdo.ce.examples.codecs.g711"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.sdo.ce.examples.codecs.g711")).add(vo);
    vo.bind("$$instflag", 0);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 1);
    vo.bind("$$romcfgs", "|");
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind(
        "$$meta_iobj",
        om.has("ti.sdo.ce.examples.codecs.g711.G711DEC$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    pkgV.bind("G711DEC", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("G711DEC");
  }
示例#16
0
  void Cmdr$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("xdc.tools.Cmdr", "xdc.tools");
    po = (Proto.Obj) om.findStrict("xdc.tools.Cmdr.Module", "xdc.tools");
    vo.init2(po, "xdc.tools.Cmdr", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind("$capsule", om.findStrict("xdc.tools.Cmdr$$capsule", "xdc.tools"));
    vo.bind("Instance", om.findStrict("xdc.tools.Cmdr.Instance", "xdc.tools"));
    vo.bind("Params", om.findStrict("xdc.tools.Cmdr.Params", "xdc.tools"));
    vo.bind(
        "PARAMS", ((Proto.Str) om.findStrict("xdc.tools.Cmdr.Params", "xdc.tools")).newInstance());
    vo.bind("$package", om.findStrict("xdc.tools", "xdc.tools"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    icfgs.clear();
    inherits.clear();
    vo.bind("Context", om.findStrict("xdc.tools.Cmdr.Context", "xdc.tools"));
    vo.bind("SHELL", om.findStrict("xdc.tools.Cmdr.SHELL", "xdc.tools"));
    vo.bind("SCRIPT", om.findStrict("xdc.tools.Cmdr.SCRIPT", "xdc.tools"));
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "xdc.tools")).add(vo);
    vo.bind("$$instflag", 1);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 0);
    vo.bind("$$romcfgs", "|");
    vo.bind("$$nortsflag", 0);
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind("$$meta_iobj", om.has("xdc.tools.Cmdr$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.seal("length");
    vo.bind("Object", om.findStrict("xdc.tools.Cmdr.Object", "xdc.tools"));
    pkgV.bind("Cmdr", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("Cmdr");
  }
  void UNIVERSALConfig$$SINGLETONS() {
    Proto.Obj po;
    Value.Obj vo;

    vo = (Value.Obj) om.findStrict("ti.sdo.ce.universal.UNIVERSALConfig", "ti.sdo.ce.universal");
    po =
        (Proto.Obj)
            om.findStrict("ti.sdo.ce.universal.UNIVERSALConfig.Module", "ti.sdo.ce.universal");
    vo.init2(po, "ti.sdo.ce.universal.UNIVERSALConfig", $$DEFAULT, false);
    vo.bind("Module", po);
    vo.bind("$category", "Module");
    vo.bind("$capsule", $$UNDEF);
    vo.bind("$package", om.findStrict("ti.sdo.ce.universal", "ti.sdo.ce.universal"));
    tdefs.clear();
    proxies.clear();
    mcfgs.clear();
    icfgs.clear();
    inherits.clear();
    vo.bind("$$tdefs", Global.newArray(tdefs.toArray()));
    vo.bind("$$proxies", Global.newArray(proxies.toArray()));
    vo.bind("$$mcfgs", Global.newArray(mcfgs.toArray()));
    vo.bind("$$icfgs", Global.newArray(icfgs.toArray()));
    vo.bind("$$inherits", Global.newArray(inherits.toArray()));
    ((Value.Arr) pkgV.getv("$modules")).add(vo);
    ((Value.Arr) om.findStrict("$modules", "ti.sdo.ce.universal")).add(vo);
    vo.bind("$$instflag", 0);
    vo.bind("$$iobjflag", 1);
    vo.bind("$$sizeflag", 1);
    vo.bind("$$dlgflag", 0);
    vo.bind("$$iflag", 0);
    vo.bind("$$romcfgs", "|");
    vo.bind("$$nortsflag", 0);
    Proto.Str ps = (Proto.Str) vo.find("Module_State");
    if (ps != null) vo.bind("$object", ps.newInstance());
    vo.bind(
        "$$meta_iobj",
        om.has("ti.sdo.ce.universal.UNIVERSALConfig$$instance$static$init", null) ? 1 : 0);
    vo.bind("$$fxntab", Global.newArray());
    vo.bind("$$logEvtCfgs", Global.newArray());
    vo.bind("$$errorDescCfgs", Global.newArray());
    vo.bind("$$assertDescCfgs", Global.newArray());
    Value.Map atmap = (Value.Map) vo.getv("$attr");
    atmap.setElem("", "./UNIVERSALConfig.xdt");
    atmap.seal("length");
    vo.bind("TEMPLATE$", "./UNIVERSALConfig.xdt");
    pkgV.bind("UNIVERSALConfig", vo);
    ((Value.Arr) pkgV.getv("$unitNames")).add("UNIVERSALConfig");
  }
示例#18
0
 /** {@inheritDoc} */
 public Content getTagletOutput(Tag tag, TagletWriter writer) {
   ArrayList inlineTags = new ArrayList();
   inlineTags.add(new TextTag(tag.holder(), "<b>"));
   inlineTags.addAll(Arrays.asList(tag.inlineTags()));
   inlineTags.add(new TextTag(tag.holder(), "</b>"));
   return writer.commentTagsToOutput(tag, (Tag[]) inlineTags.toArray(new Tag[] {}));
 }
示例#19
0
 /**
  * Returns all editors.
  *
  * @return editors
  */
 EditorArea[] editors() {
   final ArrayList<EditorArea> edits = new ArrayList<EditorArea>();
   for (final Component c : tabs.getComponents()) {
     if (c instanceof EditorArea) edits.add((EditorArea) c);
   }
   return edits.toArray(new EditorArea[edits.size()]);
 }
  ISourceContainer[] getSourceContainers(String location, String id) throws CoreException {

    ISourceContainer[] containers = (ISourceContainer[]) fSourceContainerMap.get(location);
    if (containers != null) {
      return containers;
    }

    ArrayList result = new ArrayList();
    ModelEntry entry = MonitorRegistry.findEntry(id);

    boolean match = false;

    IMonitorModelBase[] models = entry.getWorkspaceModels();
    for (int i = 0; i < models.length; i++) {
      if (isPerfectMatch(models[i], new Path(location))) {
        IResource resource = models[i].getUnderlyingResource();
        // if the plug-in matches a workspace model,
        // add the project and any libraries not coming via a container
        // to the list of source containers, in that order
        if (resource != null) {
          addProjectSourceContainers(resource.getProject(), result);
        }
        match = true;
        break;
      }
    }

    if (!match) {
      File file = new File(location);
      if (file.isFile()) {
        // in case of linked plug-in projects that map to an external JARd plug-in,
        // use source container that maps to the library in the linked project.
        ISourceContainer container = getArchiveSourceContainer(location);
        if (container != null) {
          containers = new ISourceContainer[] {container};
          fSourceContainerMap.put(location, containers);
          return containers;
        }
      }

      models = entry.getExternalModels();
      for (int i = 0; i < models.length; i++) {
        if (isPerfectMatch(models[i], new Path(location))) {
          // try all source zips found in the source code locations
          IClasspathEntry[] entries = MDEClasspathContainer.getExternalEntries(models[i]);
          for (int j = 0; j < entries.length; j++) {
            IRuntimeClasspathEntry rte = convertClasspathEntry(entries[j]);
            if (rte != null) result.add(rte);
          }
          break;
        }
      }
    }

    IRuntimeClasspathEntry[] entries =
        (IRuntimeClasspathEntry[]) result.toArray(new IRuntimeClasspathEntry[result.size()]);
    containers = JavaRuntime.getSourceContainers(entries);
    fSourceContainerMap.put(location, containers);
    return containers;
  }
示例#21
0
  public WDBObject[] search(SimpleNode expression, Adapter scda) throws Exception {
    boolean hasWhereClause = (expression != null);
    WDBObject[] matchesArray = new WDBObject[0];
    ArrayList<WDBObject> matchesList = new ArrayList<WDBObject>();
    WDBObject[] indexFilteredArray;
    if (hasWhereClause) {
      indexFilteredArray =
          expression
              .filterObjectsWithIndexes(scda, this.indexes)
              .getFilteredResults(scda, this.indexes);
    } else {
      indexFilteredArray = null;
    }
    if (indexFilteredArray == null) {
      // Simple for loop for search
      WDBObject object;
      for (int i = 0; i < this.instances.size(); i++) {
        object = this.getInstance(i, scda);
        if (!hasWhereClause || (hasWhereClause && expression.eval(scda, object))) {
          matchesList.add(object);
        }
      }
    } else {
      // Simple for loop for search
      for (int i = 0; i < indexFilteredArray.length; i++) {
        if (!hasWhereClause || (hasWhereClause && expression.eval(scda, indexFilteredArray[i]))) {
          matchesList.add(indexFilteredArray[i]);
        }
      }
    }

    return (WDBObject[]) matchesList.toArray(matchesArray);
  }
 private String[] splitAndRemoveEmpty(String[] sts, String splitSeparator) {
   ArrayList<String> result = new ArrayList<String>();
   for (String st : sts) {
     result.addAll(Arrays.asList(splitAndRemoveEmpty(st, splitSeparator)));
   }
   return result.toArray(new String[result.size()]);
 }
示例#23
0
  @NotNull
  public UsageInfo[] findUsages() {
    myRenamers.clear();
    ArrayList<UsageInfo> result = new ArrayList<UsageInfo>();

    List<PsiElement> elements = new ArrayList<PsiElement>(myAllRenames.keySet());
    //noinspection ForLoopReplaceableByForEach
    for (int i = 0; i < elements.size(); i++) {
      PsiElement element = elements.get(i);
      final String newName = myAllRenames.get(element);
      final UsageInfo[] usages =
          RenameUtil.findUsages(
              element, newName, mySearchInComments, mySearchTextOccurrences, myAllRenames);
      final List<UsageInfo> usagesList = Arrays.asList(usages);
      result.addAll(usagesList);

      for (AutomaticRenamerFactory factory : myRenamerFactories) {
        if (factory.isApplicable(element)) {
          myRenamers.add(factory.createRenamer(element, newName, usagesList));
        }
      }

      for (AutomaticRenamerFactory factory :
          Extensions.getExtensions(AutomaticRenamerFactory.EP_NAME)) {
        if (factory.getOptionName() == null && factory.isApplicable(element)) {
          myRenamers.add(factory.createRenamer(element, newName, usagesList));
        }
      }
    }
    UsageInfo[] usageInfos = result.toArray(new UsageInfo[result.size()]);
    usageInfos = UsageViewUtil.removeDuplicatedUsages(usageInfos);
    return usageInfos;
  }
  @Nullable
  private ProblemDescriptor[] checkMember(
      final PsiDocCommentOwner docCommentOwner,
      final InspectionManager manager,
      final boolean isOnTheFly) {
    final ArrayList<ProblemDescriptor> problems = new ArrayList<ProblemDescriptor>();
    final PsiDocComment docComment = docCommentOwner.getDocComment();
    if (docComment == null) return null;

    final Set<PsiJavaCodeReferenceElement> references = new HashSet<PsiJavaCodeReferenceElement>();
    docComment.accept(getVisitor(references, docCommentOwner, problems, manager, isOnTheFly));
    for (PsiJavaCodeReferenceElement reference : references) {
      final List<PsiClass> classesToImport = new ImportClassFix(reference).getClassesToImport();
      final PsiElement referenceNameElement = reference.getReferenceNameElement();
      problems.add(
          manager.createProblemDescriptor(
              referenceNameElement != null ? referenceNameElement : reference,
              cannotResolveSymbolMessage("<code>" + reference.getText() + "</code>"),
              !isOnTheFly || classesToImport.isEmpty() ? null : new AddImportFix(classesToImport),
              ProblemHighlightType.LIKE_UNKNOWN_SYMBOL,
              isOnTheFly));
    }

    return problems.isEmpty() ? null : problems.toArray(new ProblemDescriptor[problems.size()]);
  }
示例#25
0
 /**
  * ************************************************************************ Lineas de Remesa
  *
  * @param whereClause where clause or null (starting with AND)
  * @return lines
  */
 public MRemesaLine[] getLines(String whereClause, String orderClause) {
   ArrayList list = new ArrayList();
   StringBuffer sql = new StringBuffer("SELECT * FROM C_RemesaLine WHERE C_Remesa_ID=? ");
   if (whereClause != null) sql.append(whereClause);
   if (orderClause != null) sql.append(" ").append(orderClause);
   PreparedStatement pstmt = null;
   try {
     pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
     pstmt.setInt(1, getC_Remesa_ID());
     ResultSet rs = pstmt.executeQuery();
     while (rs.next()) list.add(new MRemesaLine(getCtx(), rs));
     rs.close();
     pstmt.close();
     pstmt = null;
   } catch (Exception e) {
     log.saveError("getLines - " + sql, e);
   } finally {
     try {
       if (pstmt != null) pstmt.close();
     } catch (Exception e) {
     }
     pstmt = null;
   }
   //
   MRemesaLine[] lines = new MRemesaLine[list.size()];
   list.toArray(lines);
   return lines;
 } //	getLines
示例#26
0
 /**
  * Get Restriction Lines
  *
  * @param reload reload data
  * @return array of lines
  */
 public MGoalRestriction[] getRestrictions(boolean reload) {
   if (m_restrictions != null && !reload) return m_restrictions;
   ArrayList<MGoalRestriction> list = new ArrayList<MGoalRestriction>();
   //
   String sql =
       "SELECT * FROM PA_GoalRestriction "
           + "WHERE PA_Goal_ID=? AND IsActive='Y' "
           + "ORDER BY Org_ID, C_BPartner_ID, M_Product_ID";
   PreparedStatement pstmt = null;
   ResultSet rs = null;
   try {
     pstmt = DB.prepareStatement(sql, get_Trx());
     pstmt.setInt(1, getPA_Goal_ID());
     rs = pstmt.executeQuery();
     while (rs.next()) list.add(new MGoalRestriction(getCtx(), rs, get_Trx()));
   } catch (Exception e) {
     log.log(Level.SEVERE, sql, e);
   } finally {
     DB.closeStatement(pstmt);
     DB.closeResultSet(rs);
   }
   //
   m_restrictions = new MGoalRestriction[list.size()];
   list.toArray(m_restrictions);
   return m_restrictions;
 } //	getRestrictions
  /**
   * create a 1-d String array from a network, for easy transmission to R. triples (source,
   * edgeType, target) are filled in to an array of length 3 * # of interactions
   *
   * @param network a gaggle network
   * @return the edge attributes of the network as a string array
   */
  protected String[] networkEdgeAttributesToStringArray(Network network) {
    Interaction[] interactions = network.getInteractions();
    String source, target, type;
    String[] attributeNames = network.getEdgeAttributeNames();
    ArrayList<String> list = new ArrayList<String>();

    for (Interaction interaction : interactions) {
      source = interaction.getSource();
      type = interaction.getType();
      target = interaction.getTarget();
      String edgeName = source + " (" + type + ") " + target;
      String terseEdgeName = source + "::" + target + "::" + type;
      for (String name : attributeNames) {
        HashMap hash = network.getEdgeAttributes(name);
        if (hash.containsKey(edgeName)) {
          Object value = hash.get(edgeName);
          StringBuffer sb = new StringBuffer();
          sb.append(terseEdgeName);
          sb.append("::");
          sb.append(name);
          sb.append("::");
          sb.append(value.toString());
          list.add(sb.toString());
        } else {
          System.out.println("no " + name + " attribute for " + edgeName);
        }
      } // for a
    } // for r

    return list.toArray(new String[0]);
  } // networkEdgeAttributesToStringArray
示例#28
0
  // used to read in all dtf files and merge them.
  public static String[] mergeDTF() {
    // this section reads in all the text file names
    mergedDTF = new ArrayList<String>();
    File f = new File("/DogeTix/src/BackEnd/DTFFolder");
    FilenameFilter filter =
        new FilenameFilter() {
          public boolean accept(File dir, String name) {
            return name.toLowerCase().endsWith(".txt"); // or .dtf
          }
        };

    File[] files = f.listFiles(filter);
    Scanner scan;
    try {
      // for every dtf file in the directory
      for (File file : files) {
        scan = new Scanner(file);
        while (scan.hasNextLine()) {
          // add the line to the arraylist
          mergedDTF.add(scan.nextLine());
        }
      }
    } catch (IOException e) {
      System.out.println(e);
      System.exit(0);
    }

    // merge the files into mergedDTF string array
    return mergedDTF.toArray(new String[mergedDTF.size()]);
  }
示例#29
0
 /**
  * Get Accessible Goals
  *
  * @param ctx context
  * @return array of goals
  */
 public static MGoal[] getGoals(Ctx ctx) {
   ArrayList<MGoal> list = new ArrayList<MGoal>();
   String sql = "SELECT * FROM PA_Goal WHERE IsActive='Y' " + "ORDER BY SeqNo";
   sql =
       MRole.getDefault(ctx, false)
           .addAccessSQL(sql, "PA_Goal", false, true); // 	RW to restrict Access
   PreparedStatement pstmt = null;
   ResultSet rs = null;
   try {
     pstmt = DB.prepareStatement(sql, (Trx) null);
     rs = pstmt.executeQuery();
     while (rs.next()) {
       MGoal goal = new MGoal(ctx, rs, null);
       goal.updateGoal(false);
       list.add(goal);
     }
   } catch (Exception e) {
     s_log.log(Level.SEVERE, sql, e);
   } finally {
     DB.closeStatement(pstmt);
     DB.closeResultSet(rs);
   }
   MGoal[] retValue = new MGoal[list.size()];
   list.toArray(retValue);
   return retValue;
 } //	getGoals
示例#30
0
  /**
   * Creates a java process that executes the given main class and waits for the process to
   * terminate.
   *
   * @return a {@link ProcessOutputReader} that can be used to get the exit code and stdout+stderr
   *     of the terminated process.
   */
  public static ProcessOutputReader fg(Class main, String[] vmArgs, String[] mainArgs)
      throws IOException {
    File javabindir = new File(System.getProperty("java.home"), "bin");
    File javaexe = new File(javabindir, "java");

    int bits = Integer.getInteger("sun.arch.data.model", 0).intValue();
    String vmKindArg = (bits == 64) ? "-d64" : null;

    ArrayList argList = new ArrayList();
    argList.add(javaexe.getPath());
    if (vmKindArg != null) {
      argList.add(vmKindArg);
    }
    // argList.add("-Dgemfire.systemDirectory=" +
    // GemFireConnectionFactory.getDefaultSystemDirectory());
    argList.add("-Djava.class.path=" + System.getProperty("java.class.path"));
    argList.add("-Djava.library.path=" + System.getProperty("java.library.path"));
    if (vmArgs != null) {
      argList.addAll(Arrays.asList(vmArgs));
    }
    argList.add(main.getName());
    if (mainArgs != null) {
      argList.addAll(Arrays.asList(mainArgs));
    }
    String[] cmd = (String[]) argList.toArray(new String[argList.size()]);
    return new ProcessOutputReader(Runtime.getRuntime().exec(cmd));
  }