Create an Icon for the given sort order and priority. The priority
is assumed to be in [0,3]

@param sortOrder The sort order
@param sortPriority The sort priority
@return The icon
431543
private Icon createIcon(SortOrder sortOrder, int sortPriority)
    {
        final Color color = UIManager.getColor("controlDkShadow");
        final int width = 12;
        final int height = 12;
        final int sizeX = Math.max(2, width - sortPriority * 2);
        final int sizeY = Math.max(2, height - sortPriority * 2);
        final int space = (height - sizeY) / 2;
        final Shape shape = 
            sortOrder == SortOrder.ASCENDING ?
                createArrowShape(sizeX, space, height-space) :
                createArrowShape(sizeX, height-space, space);
        return new Icon()
        {
            @Override
            public void paintIcon(Component c, Graphics gr, int x, int y)
            {
                Graphics2D g = (Graphics2D)gr;
                AffineTransform oldAT = g.getTransform();
                g.translate(x,y);
                g.setColor(color);
                g.fill(shape);
                g.setTransform(oldAT);
            }

            @Override
            public int getIconWidth()
            {
                return width;
            }

            @Override
            public int getIconHeight()
            {
                return height;
            }
        };        
    }
207222
private static int classPriority(Class<?> o1) {
    Priority p = o1.getAnnotation(Priority.class);
    if(p == null) {
      Class<?> pa = o1.getDeclaringClass();
      p = (pa != null) ? pa.getAnnotation(Priority.class) : null;
    }
    return p != null ? p.value() : Priority.DEFAULT;
  }
572971
protected void setPriority(int priority)
   {
      if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setPriority", ""+priority);
      this.priority = priority;
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setPriority");      
   }
1362134
protected SortOrder convertSortOrder() {
        final String sortOrder = getSortOrder();
        if (sortOrder == null) {
            return SortOrder.UNSORTED;
        }
        else {
            final SortOrder result = SortOrder.valueOf(sortOrder.toUpperCase(Locale.ENGLISH));
            return result;
        }
    }
318636
private Integer getPriority(Map<String, Object> mutableRData) {
    Integer priority = null;

    if (mutableRData.containsKey("priority")) { // SRVData
      priority = Integer.class.cast(mutableRData.remove("priority"));
    } else if (mutableRData.containsKey("preference")) { // MXData
      priority = Integer.class.cast(mutableRData.remove("preference"));
    }

    return priority;
  }
443500
public static Bitmap createIcon(IconRow icon, float density, IconCache iconCache) {
        return iconCache.createIcon(icon, density);
    }
634091
public void setVertexOrder(Comparator<String> comparator)
	{
	    if (vertex_ordered_list == null)
	        vertex_ordered_list = new ArrayList<String>(getGraph().getVertices());
	    Collections.sort(vertex_ordered_list, comparator);
	}
195967
public static <T> OrderBy<T> convertToEbeanOrderBy(Sort sort) {
        if (sort == null) {
            return null;
        }
        List<String> list = new ArrayList<>();

        Iterator<Sort.Order> orderIterator = sort.iterator();
        while (orderIterator.hasNext()) {
            Sort.Order so = orderIterator.next();
            list.add(so.getProperty() + " " + so.getDirection());
        }
        return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list));
    }
574715
private void obtainIcon(@NonNull final TypedArray typedArray) {
        int resourceId =
                typedArray.getResourceId(R.styleable.NavigationPreference_android_icon, -1);

        if (resourceId != -1) {
            Drawable icon = AppCompatResources.getDrawable(getContext(), resourceId);
            setIcon(icon);
        }
    }
1209510
@Override
    public Image getIcon(int iconType) {
        Pair<String, Image> pair = iconInformation.get(iconType);
        String imagePath = pair.first;
        Image imageOrNull = pair.second;
        if ((imageOrNull == null) && (imagePath != null)) {
            imageOrNull = loadImage(imagePath);
        }
        return imageOrNull;
    }
972175
private Icon getIcon( Severity severity ) {
        if( severity == Severity.ERROR ) {
            return getErrorIcon();
        }
        if( severity == Severity.WARNING ) {
            return getWarningIcon();
        }
        return getInfoIcon();
    }
506142
public static String getImage(Priority priority) {
        String image = getLabel("icon", priority);
        return image == null ? null : IconUtil.getIconPath(image);
    }
735882
@SuppressWarnings("checkstyle:MissingSwitchDefault")
    private PriorityQueue<CrawlCandidate> createPriorityQueue() {
        Function crawlDepthGetter
                = (Function<CrawlCandidate, Integer> & Serializable) CrawlCandidate::getCrawlDepth;
        Function priorityGetter
                = (Function<CrawlCandidate, Integer> & Serializable) CrawlCandidate::getPriority;

        switch (config.getCrawlStrategy()) {
            case BREADTH_FIRST:
                Comparator breadthFirstComparator = Comparator.comparing(crawlDepthGetter)
                        .thenComparing(priorityGetter, Comparator.reverseOrder());

                return new PriorityQueue<>(breadthFirstComparator);
            case DEPTH_FIRST:
                Comparator depthFirstComparator
                        = Comparator.comparing(crawlDepthGetter, Comparator.reverseOrder())
                                .thenComparing(priorityGetter, Comparator.reverseOrder());

                return new PriorityQueue<>(depthFirstComparator);
        }

        throw new IllegalArgumentException("Unsupported crawl strategy.");
    }
902955
public int getPriority()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getPriority");
    int priority = _sourceStream.getPriority();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "getPriority", new Integer(priority));
    return priority;
  }
972515
public static PriorityAttribute createPriorityAttribute(long priority)
			throws IllegalArgumentException {
		PriorityAttribute attribute = new PriorityAttribute();

		attribute.setPriority(priority);

		return attribute;
	}
633472
private Drawable getDefaultIcon1(Cursor cursor) {
        // Check the component that gave us the suggestion
        Drawable drawable = getActivityIconWithCache(mSearchable.getSearchActivity());
        if (drawable != null) {
            return drawable;
        }

        // Fall back to a default icon
        return mContext.getPackageManager().getDefaultActivityIcon();
    }
121760
public static ComparatorItem fromSort(Sort sort) {
    if (sort == null) {
      return null;
    }
    ComparatorItem comparatorItem = null;
    for (Order order : sort) {
      ComparatorItem item = fromSortOrder(order);
      if (item != null) {
        if (comparatorItem == null) {
          comparatorItem = item;
        } else {
          comparatorItem.getLastComparatorItem().setNextComparatorItem(item);
        }
      }
    }
    return comparatorItem;
  }