コード例 #1
0
ファイル: ListParameter.java プロジェクト: max90727/fosstrak
 /**
  * Creates a copy of the internal list of parameters. The list items are represented as String.
  *
  * @return List of String
  * @throws TextCommandParserException If list contains a parameter with wrong type.
  */
 public List toStringList() throws TextCommandParserException {
   try {
     List stringList = new ArrayList(size());
     Iterator it = iterator();
     while (it.hasNext()) {
       ValueParameter p = (ValueParameter) it.next();
       stringList.add(p.getStringValue());
     }
     return stringList;
   } catch (ClassCastException e) {
     throw new TextCommandParserException("Parameter in the list has wrong type.");
   }
 }
コード例 #2
0
ファイル: ListParameter.java プロジェクト: max90727/fosstrak
 /**
  * Creates a copy of the internal list of parameters. The list items are represented as <code>
  * byte[]</code> used in <source>source.writeID(...)</code>.
  *
  * @return List of <code>byte[]</code>
  * @throws TextCommandParserException If list contains a parameter with wrong type.
  * @throws JAXBException If list contains a parameter with wrong type.
  */
 public List toHexStringListType() throws TextCommandParserException {
   try {
     List hexList = new ArrayList(size());
     Iterator it = iterator();
     while (it.hasNext()) {
       ValueParameter p = (ValueParameter) it.next();
       byte[] hexArray = HexUtil.hexToByteArray(p.getStringValue());
       hexList.add(hexArray);
     }
     return hexList;
   } catch (ClassCastException e) {
     throw new TextCommandParserException("Parameter in the list has wrong type.");
   }
 }