/**
         * Compares two non-<code>null</code> <code>Boolean</code> objects
         * according to the value of {@link #sortsTrueFirst()}.
         *
         * @param b1  the first bool to compare
         * @param b2  the second bool to compare
         * @return negative if obj1 is less, positive if greater, zero if equal
         * @throws NullPointerException when either argument <code>null</code>
         */
        public int compare(java.lang.Boolean b1, bool b2)
        {
            bool v1 = b1.Equals(true);
            bool v2 = b2;

            return((v1 ^ v2) ? ((v1 ^ trueFirst) ? 1 : -1) : 0);
        }
コード例 #2
0
 // init properties
 private void init(String p, java.lang.Boolean a, java.lang.Integer l, java.lang.Integer c)
 {    //throws IOException {
     // check access
     manager = LogManager.getLogManager();
     manager.checkAccess();
     initProperties(p, a, l, c);
     initOutputFiles();
 }
コード例 #3
0
        private void initProperties(String p, java.lang.Boolean a, java.lang.Integer l, java.lang.Integer c)
        {
            base.initProperties("ALL", null, "java.util.logging.XMLFormatter",
                                null);
            String className = this.getClass().getName();

            pattern = (null == p) ? getStringProperty(className + ".pattern",
                                                      DEFAULT_PATTERN) : p;
            if (null == pattern || "".equals(pattern))
            {
                // logging.19=Pattern cannot be empty
                throw new java.lang.NullPointerException("Pattern cannot be empty");
            }
            append = (null == a) ? getBooleanProperty(className + ".append",
                                                      DEFAULT_APPEND) : a.booleanValue();
            count = (null == c) ? getIntProperty(className + ".count",
                                                 DEFAULT_COUNT) : c.intValue();
            limit = (null == l) ? getIntProperty(className + ".limit",
                                                 DEFAULT_LIMIT) : l.intValue();
            count = count < 1 ? DEFAULT_COUNT : count;
            limit = limit < 0 ? DEFAULT_LIMIT : limit;
            files = new java.io.File[count];
        }
コード例 #4
0
 /**
  *  Looks up the given key in the given map, converting the result into
  *  a boolean, using the default value if the the conversion fails.
  *
  *  @param map  the map whose value to look up
  *  @param key  the key of the value to look up in that map
  *  @param defaultValue  what to return if the value is null or if the
  *     conversion fails
  *  @return  the value in the map as a boolean, or defaultValue if the
  *    original value is null, the map is null or the bool conversion
  *    fails
  */
 public static bool getBoolean(java.util.Map<Object, Object> map, Object key, bool defaultValue)
 {
     java.lang.Boolean answer = getBoolean(map, key);
     if (answer == null)
     {
         answer = new java.lang.Boolean(defaultValue);
     }
     return answer.booleanValue();
 }