Package java.lang

Examples of java.lang.IllegalArgumentException


    Object o = props.getProperty("maxThreads");
    if (o != null) {
      int n = java.lang.Integer.parseInt((String)o);
      if (n < 1)
        throw new IllegalArgumentException("maxThreads must be an integral value greater than 0");
      _maxThreads = n;
    }

    o = props.getProperty("minThreads");
    if (o != null) {
      int n = java.lang.Integer.parseInt((String)o);
      if (n < 0)
        throw new IllegalArgumentException("minThreads must be an integral value greater than or equal to 0");
      if (n > _maxThreads)
        throw new IllegalArgumentException("minThreads cannot be greater than maxThreads");
      _minThreads = n;
    }

    o = props.getProperty("maxIdleTime");
    if (o != null) {
      int n = java.lang.Integer.parseInt((String)o);
      if (n < 1)
        throw new IllegalArgumentException("maxIdleTime must be an integral value greater than 0");
      _maxIdleTime = n;
    }

    o = props.getProperty("debug");
    if (o != null) {
View Full Code Here


    public void setErrorListener(ErrorListener listener)
  throws IllegalArgumentException {
        if (listener == null) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.ERROR_LISTENER_NULL_ERR,
          "Transformer");
            throw new IllegalArgumentException(err.toString());
  }
        _errorListener = listener;
    }
View Full Code Here

    public String getOutputProperty(String name)
  throws IllegalArgumentException
    {
  if (!validOutputProperty(name)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
      throw new IllegalArgumentException(err.toString());
  }
  return _properties.getProperty(name);
    }
View Full Code Here

    if (validOutputProperty(name)) {
        _properties.setProperty(name, properties.getProperty(name));
    }
    else {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
        throw new IllegalArgumentException(err.toString());
    }
      }
  }
  else {
      _properties = _propertiesClone;
View Full Code Here

    public void setOutputProperty(String name, String value)
  throws IllegalArgumentException
    {
  if (!validOutputProperty(name)) {
      ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNKNOWN_PROP_ERR, name);
      throw new IllegalArgumentException(err.toString());
  }
  _properties.setProperty(name, value);
    }
View Full Code Here

   */
  public void setArcRecordHeader(String arcRecordHeader)
      throws IllegalArgumentException, ParseException {

    if (arcRecordHeader == null || arcRecordHeader.equals(""))
      throw new IllegalArgumentException("ARC v1 record header string is empty.");

    String[] metadata = arcRecordHeader.split(" ");

    if (metadata.length != 5) {
      LOG.info(" [ "+arcRecordHeader+" ] ");
      throw new IllegalArgumentException("ARC v1 record header must be 5 fields.");
    }

    SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");

    this._url            =  metadata[0];
View Full Code Here

   */
  public void setPayload(InputStream in)
      throws IllegalArgumentException, ParseException, IOException {

    if (in == null)
      throw new IllegalArgumentException("ArcRecord cannot be created from NULL/missing input stream.");

    int bufferSize = this._contentLength;

    this._payload = new byte[bufferSize];

View Full Code Here

    String outputPath = null;
    String configFile = null;

    // Read the command line arguments.
    if (args.length <  1)
      throw new IllegalArgumentException("Example JAR must be passed an output path.");

    outputPath = args[0];

    if (args.length >= 2)
      configFile = args[1];
View Full Code Here

        int length = max - min;
        if (length < 0) { length = 0; }
        length = (int)Math.ceil((double)length / (double)step);

        if (length != from.len()) {
            throw new IllegalArgumentException();
        }

        int j = 0;
        for (int i = min;  i < max;  i += step) {
            to.set(i, from.get(j));
View Full Code Here

        }
    }

    public static ArrayBoolean1d getfancy(ArrayBoolean1d array, ArrayBoolean1d selection) throws IllegalArgumentException {
        if (array.len() != selection.len()) {
            throw new IllegalArgumentException();
        }

        int count = 0;
        for (int i = 0;  i < selection.len();  i++) {
            if (selection.get(i)) { count += 1; }
View Full Code Here

TOP

Related Classes of java.lang.IllegalArgumentException

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.