Count the total number of links between this object and another type of object.
@param type2 the other type of object
@param obj the object to execute this method on
@return the number of links for the given object
3970
@SuppressWarnings("unchecked")
	public Long countLinks(ParaObject obj, String type2) {
		if (obj == null || obj.getId() == null || type2 == null) {
			return 0L;
		}
		MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
		params.putSingle("count", "true");
		Pager pager = new Pager();
		String url = Utils.formatMessage("{0}/links/{1}", obj.getObjectURI(), type2);
		getItems((Map<String, Object>) getEntity(invokeGet(url, params), Map.class), pager);
		return pager.getCount();
	}
1242569
public static <T, IV> int countWith(
            Iterable<T> iterable,
            Predicate2<? super T, ? super IV> predicate,
            IV injectedValue)
    {
        if (iterable instanceof MutableCollection)
        {
            return ((MutableCollection<T>) iterable).countWith(predicate, injectedValue);
        }
        if (iterable instanceof ArrayList)
        {
            return ArrayListIterate.countWith((ArrayList<T>) iterable, predicate, injectedValue);
        }
        if (iterable instanceof List)
        {
            return ListIterate.countWith((List<T>) iterable, predicate, injectedValue);
        }
        if (iterable != null)
        {
            return IterableIterate.countWith(iterable, predicate, injectedValue);
        }
        throw new IllegalArgumentException("Cannot get a count from null");
    }
716893
public int count(Pair<T> obj, int count) {
        if (count < 1)
            throw new IllegalArgumentException("Count must be positive: " + count);
        long index = getIndex(obj);
        int oldCount = counts.get(index);
        int newCount = count + oldCount;
        counts.put(index, newCount);
        sum += count;
        return newCount;
    }
760688
public static int getLinkCount(File fileName) throws IOException {
    if (fileName == null) {
      throw new IOException(
          "invalid argument to getLinkCount: file name is null");
    }
    if (!fileName.exists()) {
      throw new FileNotFoundException(fileName + " not found.");
    }

    // construct and execute shell command
    String[] cmd = getHardLinkCommand.linkCount(fileName);
    String inpMsg = null;
    String errMsg = null;
    int exitValue = -1;
    BufferedReader in = null;
    BufferedReader err = null;

    Process process = Runtime.getRuntime().exec(cmd);
    try {
      exitValue = process.waitFor();
      in = new BufferedReader(new InputStreamReader(
                                  process.getInputStream()));
      inpMsg = in.readLine();
      err = new BufferedReader(new InputStreamReader(
                                   process.getErrorStream()));
      errMsg = err.readLine();
      if (inpMsg == null || exitValue != 0) {
        throw createIOException(fileName, inpMsg, errMsg, exitValue, null);
      }
      if (osType == OSType.OS_TYPE_SOLARIS) {
        String[] result = inpMsg.split("\\s+");
        return Integer.parseInt(result[1]);
      } else {
        return Integer.parseInt(inpMsg);
      }
    } catch (NumberFormatException e) {
      throw createIOException(fileName, inpMsg, errMsg, exitValue, e);
    } catch (InterruptedException e) {
      throw createIOException(fileName, inpMsg, errMsg, exitValue, e);
    } finally {
      process.destroy();
      if (in != null) in.close();
      if (err != null) err.close();
    }
  }
684208
public int compareTo(CmsMimeType obj) {

        if (obj == this) {
            return 0;
        }
        int result = m_type.compareTo(obj.m_type);
        if (result == 0) {
            result = m_extension.compareTo(obj.m_extension);
        }
        return result;
    }
241963
public int getCount(G g) {
        Set<T> typeCounts = g.edgeTypes();
        LinkedList<Map.Entry<G,Integer>> graphs = typesToGraphs.get(typeCounts);
        if (graphs == null) 
            return 0;
        
        for (Map.Entry<G,Integer> e : graphs) {
            if (isoTest.areIsomorphic(g, e.getKey())) 
                return e.getValue();
        }
        return 0;
    }
79443
public static ASN1OctetString getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof ASN1OctetString)
        {
            return (ASN1OctetString)obj;
        }

        if (obj instanceof ASN1TaggedObject)
        {
            return getInstance(((ASN1TaggedObject)obj).getObject());
        }

        if (obj instanceof ASN1Sequence)
        {
            Vector      v = new Vector();
            Enumeration e = ((ASN1Sequence)obj).getObjects();

            while (e.hasMoreElements())
            {
                v.addElement(e.nextElement());
            }

            return new BERConstructedOctetString(v);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    }
722764
public boolean compare(XObject obj2, Comparator comparator)
          throws javax.xml.transform.TransformerException
  {

    boolean result = false;
    int type = obj2.getType();

    if (XObject.CLASS_NODESET == type)
    {
      // %OPT% This should be XMLString based instead of string based...

      // From http://www.w3.org/TR/xpath: 
      // If both objects to be compared are node-sets, then the comparison 
      // will be true if and only if there is a node in the first node-set 
      // and a node in the second node-set such that the result of performing 
      // the comparison on the string-values of the two nodes is true.
      // Note this little gem from the draft:
      // NOTE: If $x is bound to a node-set, then $x="foo" 
      // does not mean the same as not($x!="foo"): the former 
      // is true if and only if some node in $x has the string-value 
      // foo; the latter is true if and only if all nodes in $x have 
      // the string-value foo.
      DTMIterator list1 = iterRaw();
      DTMIterator list2 = ((XNodeSet) obj2).iterRaw();
      int node1;
      java.util.Vector node2Strings = null;

      while (DTM.NULL != (node1 = list1.nextNode()))
      {
        XMLString s1 = getStringFromNode(node1);

        if (null == node2Strings)
        {
          int node2;

          while (DTM.NULL != (node2 = list2.nextNode()))
          {
            XMLString s2 = getStringFromNode(node2);

            if (comparator.compareStrings(s1, s2))
            {
              result = true;

              break;
            }

            if (null == node2Strings)
              node2Strings = new java.util.Vector();

            node2Strings.addElement(s2);
          }
        }
        else
        {
          int n = node2Strings.size();

          for (int i = 0; i < n; i++)
          {
            if (comparator.compareStrings(s1, (XMLString)node2Strings.elementAt(i)))
            {
              result = true;

              break;
            }
          }
        }
      }
      list1.reset();
      list2.reset();
    }
    else if (XObject.CLASS_BOOLEAN == type)
    {

      // From http://www.w3.org/TR/xpath: 
      // If one object to be compared is a node-set and the other is a boolean, 
      // then the comparison will be true if and only if the result of 
      // performing the comparison on the boolean and on the result of 
      // converting the node-set to a boolean using the boolean function 
      // is true.
      double num1 = bool() ? 1.0 : 0.0;
      double num2 = obj2.num();

      result = comparator.compareNumbers(num1, num2);
    }
    else if (XObject.CLASS_NUMBER == type)
    {

      // From http://www.w3.org/TR/xpath: 
      // If one object to be compared is a node-set and the other is a number, 
      // then the comparison will be true if and only if there is a 
      // node in the node-set such that the result of performing the 
      // comparison on the number to be compared and on the result of 
      // converting the string-value of that node to a number using 
      // the number function is true. 
      DTMIterator list1 = iterRaw();
      double num2 = obj2.num();
      int node;

      while (DTM.NULL != (node = list1.nextNode()))
      {
        double num1 = getNumberFromNode(node);

        if (comparator.compareNumbers(num1, num2))
        {
          result = true;

          break;
        }
      }
      list1.reset();
    }
    else if (XObject.CLASS_RTREEFRAG == type)
    {
      XMLString s2 = obj2.xstr();
      DTMIterator list1 = iterRaw();
      int node;

      while (DTM.NULL != (node = list1.nextNode()))
      {
        XMLString s1 = getStringFromNode(node);

        if (comparator.compareStrings(s1, s2))
        {
          result = true;

          break;
        }
      }
      list1.reset();
    }
    else if (XObject.CLASS_STRING == type)
    {

      // From http://www.w3.org/TR/xpath: 
      // If one object to be compared is a node-set and the other is a 
      // string, then the comparison will be true if and only if there 
      // is a node in the node-set such that the result of performing 
      // the comparison on the string-value of the node and the other 
      // string is true. 
      XMLString s2 = obj2.xstr();
      DTMIterator list1 = iterRaw();
      int node;

      while (DTM.NULL != (node = list1.nextNode()))
      {
        XMLString s1 = getStringFromNode(node);
        if (comparator.compareStrings(s1, s2))
        {
          result = true;

          break;
        }
      }
      list1.reset();
    }
    else
    {
      result = comparator.compareNumbers(this.num(), obj2.num());
    }

    return result;
  }
807344
@Override
    public int getChildCount(Object nodeObj) {
        if (debugger == null) {
            return 0;
        }
        VariableNode node = (VariableNode) nodeObj;
        return children(node).length;
    }
608159
@Override
	@SuppressWarnings("unchecked")
	@Pure
	public int indexOf(Object obj) {
		if (obj == null) {
			return -1;
		}
		final P element;
		try {
			element = (P) obj;
		} catch (ClassCastException exception) {
			return -1;
		}
		final Iterator<P> iter = this.tree.dataDepthFirstIterator();
		P data;
		int idx = 0;
		while (iter.hasNext()) {
			data = iter.next();
			if (data == element) {
				return idx;
			}
			++idx;
		}
		return -1;
	}
470089
public int countObjects(@Nonnull String query) {
        try (Stream<Path> stream = Files.list(file.toPath())) {
            return Math.toIntExact(stream.map(Path::toFile)
                                         .filter(currentFile -> isMatchingObject(query, currentFile))
                                         .count());
        } catch (IOException e) {
            throw Exceptions.handle(e);
        }
    }
1022524
public double count(T obj, double count) {
        if (count <= 0)
            throw new IllegalArgumentException("Count must be positive: " + count);
        double oldCount = counts.get(obj);
        double newCount = count + oldCount;
        counts.put(obj, newCount);
        sum += count;
        return newCount;
    }
384189
public long getAndIncrement(T obj) {
        long prev, next;
        do {
            prev = get(obj);
            next = prev + 1;
        } while (!compareAndSet(obj, prev, next));
        return prev;
    }
672439
function () {
            __objCount++;
            /**
             * Counter to be used as an index in each map. Is incremented each time a new entry is added to the object.
             * @protected
             * @type Number
             */
            this._nextIndex = 0;
            /**
             * Map to store entries whose keys are of type object or function. Note that, even if null is of type
             * object, it cannot store properties, and for this reason, an entry whose key is null is not stored here,
             * but in this._otherKeys.
             * @protected
             * @type Object
             */
            this._objectKeys = null;
            /**
             * Map to store entries whose keys are of type string.
             * @protected
             * @type Object
             */
            this._stringKeys = null;
            /**
             * Map to store entries whose keys are of type number.
             * @protected
             * @type Object
             */
            this._numberKeys = null;
            /**
             * Map to store entries whose keys are neither objects (with the exception of null), nor functions, nor
             * strings, nor numbers. Sample values for keys here: null and undefined (and maybe some other strange
             * type). For keys in that category, performances are very bad (must iterate over the whole _otherKeys stuff
             * to find a key).
             * @protected
             * @type Object
             */
            this._otherKeys = null;
            /**
             * Name of the metadata to use when storing information in object keys. It must be unique.
             * @protected
             * @type String
             */
            this._metaDataName = Aria.FRAMEWORK_PREFIX + "hash::" + __objCount;
        }
1253943
public int lastIndexOf(Object obj) {
        if (obj instanceof JavascriptObject) {
            return checkInteger(invokeJavascript("lastIndexOf", ((JavascriptObject) obj).getJSObject()), -1);
        }
        return checkInteger(invokeJavascript("lastIndexOf", obj), -1);
    }
1246565
@Override
    public void visitCode(Code obj) {
        Method m = getMethod();
        if (!Values.CONSTRUCTOR.equals(m.getName())) {
            super.visitCode(obj);
        }
    }
246601
@Override
    public void visitCode(Code obj) {
        state = State.SEEN_NOTHING;
        beanReference1 = null;
        beanReference2 = null;
        propName = null;
        propType = null;
        sawField = false;
        super.visitCode(obj);
    }