Configure the state priorities

@param priorities
array of String. eg, STATE,priorityValue
767998
public void configurePriorities(final String[] priorities) {
        // Set the non defined state in the property at 0 priority
        // Enumeration of existing state
        int priority;
        // Get the custom priority
        for (final String state : priorities) {
            // count the token separated by ","
            final StringTokenizer tmpPriorityTokens = new StringTokenizer(state.trim(), ",");
            if (tmpPriorityTokens.countTokens() == 2) {
                // To avoid the the pb of case
                final String tmpState = tmpPriorityTokens.nextToken().trim().toUpperCase();
                // If the custom state exist
                if (StateUtilities.isStateExist(tmpState)) {
                    try {
                        priority = Integer.valueOf(tmpPriorityTokens.nextToken().trim());
                    } catch (final NumberFormatException e) {
                        priority = 0;
                    }
                    putStatePriority(StateUtilities.getStateForName(tmpState), priority);
                }
            }
        }
    }
1339454
public void addSort(Object object, int sort, int priority) {
        key.addPrimitiveValue(String.format(SORT_LABEL, priority), object, sort, priority);
    }
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");      
   }
661432
def priority=(val)
      no_cmd = (val == default_priority) ? 'no' : ''
      pri = (val == default_priority) ? '' : val
      config_set('interface_ospf', 'priority',
                 @interface.name, no_cmd, pri)
    end
566438
public function priorityIn(array $values)
    {
        foreach ($values as $index => $value) {
            $values[$index] = (int) $value;
        }
        $this->add(new Criterium(self::CRITERIUM_PRIORITY_IN, $values));

        return $this;
    }
1059925
def priority(self,priority):
        
        with self.__lock:
            old_priorities = {}
            try:
                for thread in self.__threads:
                    old_priorities[thread] = thread.priority
                    thread.priority = priority
            except Exception:
                for (thread,old_priority) in old_priorities.iteritems():
                    try:
                        thread.priority = old_priority
                    except Exception:
                        pass
                raise
            else:
                self.__priority = priority
1284200
def set_priorities(SO_methods, ask):
    
    # if ask set to 1, then can change priorities
    SO_methods = [meth.strip() for meth in SO_methods]
    SO_defaults = ['SO-SUN', 'SO-GPS-DIFF', 'SO-SUN-SIGHT', 'SO-SIGHT', 'SO-SIGHT-BS',
                   'SO-CMD-NORTH', 'SO-MAG', 'SO-SM', 'SO-REC', 'SO-V', 'SO-CORE', 'SO-NO']
    SO_priorities, prior_list = [], []
    if len(SO_methods) >= 1:
        for l in range(len(SO_defaults)):
            if SO_defaults[l] in SO_methods:
                SO_priorities.append(SO_defaults[l])
    pri, change = 0, "1"
    if ask == 1:
        print("""These methods of sample orientation were found:
      They have been assigned a provisional priority (top = zero, last = highest number) """)
        for m in range(len(SO_defaults)):
            if SO_defaults[m] in SO_methods:
                SO_priorities[SO_methods.index(SO_defaults[m])] = pri
                pri += 1
        while change == "1":
            prior_list = SO_priorities
            for m in range(len(SO_methods)):
                print(SO_methods[m], SO_priorities[m])
            change = input("Change these?  1/[0] ")
            if change != "1":
                break
        SO_priorities = []
        for l in range(len(SO_methods)):
            print(SO_methods[l])
            print(" Priority?   ", prior_list)
            pri = int(input())
            SO_priorities.append(pri)
            del prior_list[prior_list.index(pri)]
    return SO_priorities
1311401
public void setClusterStates(java.util.Collection<String> clusterStates) {
        if (clusterStates == null) {
            this.clusterStates = null;
            return;
        }

        this.clusterStates = new com.amazonaws.internal.SdkInternalList<String>(clusterStates);
    }
716117
public void copy(Priority priority)

   {

      if (priority == null)

         throw new IllegalArgumentException("priority required in Priority");

      

      this.primaryKey = priority.primaryKey;

      this.name = priority.name;

      

   }
80050
public void setAssignmentStatuses(java.util.Collection<String> assignmentStatuses) {
        if (assignmentStatuses == null) {
            this.assignmentStatuses = null;
            return;
        }

        this.assignmentStatuses = new java.util.ArrayList<String>(assignmentStatuses);
    }
652716
public boolean changePriority(E key, double priority) {
    Entry<E> entry = getEntry(key);
    if (entry == null) {
      entry = makeEntry(key);
    }
    if (compare(priority, entry.priority) == 0) {
      return false;
    }
    entry.priority = priority;
    heapify(entry);
    return true;
  }
1225577
public void setMinPriority(String minPriority) {
        this.minPriority = minPriority;

        Integer value = priorityNameToValueMap.get(minPriority);
        if (value == null) {
            value = priorityNameToValueMap.get(DEFAULT_PRIORITY);
            if (value == null) {
                throw new IllegalStateException();
            }
        }

        this.minPriorityAsInt = value.intValue();

    }
622722
@Override
    public final void setPriority(int value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setPriority", Integer.valueOf(value));
        if ((value >= MfpConstants.MIN_PRIORITY) && (value <= MfpConstants.MAX_PRIORITY)) {
            /* Call the superclass's method to set the value into the field */
            super.setPriority(value);
        }
        else {
            IllegalArgumentException e = new IllegalArgumentException(Integer.toString(value));
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "setPriority", e);
            throw e;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setPriority");
    }
306258
public void setState(TransferState state) {
        synchronized (this) {
            this.state = state;
        }
        for ( TransferStateChangeListener listener : stateChangeListeners ) {
            listener.transferStateChanged(this, state);
        }
    }
376693
public void setStatusOrder(Status... statusOrder) {
		String[] order = new String[statusOrder.length];
		for (int i = 0; i < statusOrder.length; i++) {
			order[i] = statusOrder[i].getCode();
		}
		setStatusOrder(Arrays.asList(order));
	}
728201
public void setProperty(
            final String propertyName,
            final String value,
            final String priority) throws DOMException {
        try {
            CSSValueImpl expr = null;
            if (!value.isEmpty()) {
                final CSSOMParser parser = new CSSOMParser();
                expr = parser.parsePropertyValue(value);
            }
            Property p = getPropertyDeclaration(propertyName);
            final boolean important = PRIORITY_IMPORTANT.equalsIgnoreCase(priority);
            if (p == null) {
                p = new Property(propertyName, expr, important);
                addProperty(p);
            }
            else {
                p.setValue(expr);
                p.setImportant(important);
            }
        }
        catch (final Exception e) {
            throw new DOMExceptionImpl(
                    DOMException.SYNTAX_ERR,
                    DOMExceptionImpl.SYNTAX_ERROR,
                    e.getMessage());
        }
    }
1248645
public final void setMaxPriority(int pri) {
        int ngroupsSnapshot;
        ThreadGroup[] groupsSnapshot;
        synchronized (this) {
            checkAccess();
            // Android-changed: Clamp to MIN_PRIORITY, MAX_PRIORITY.
            // if (pri < Thread.MIN_PRIORITY || pri > Thread.MAX_PRIORITY) {
            //     return;
            // }
            if (pri < Thread.MIN_PRIORITY) {
                pri = Thread.MIN_PRIORITY;
            }
            if (pri > Thread.MAX_PRIORITY) {
                pri = Thread.MAX_PRIORITY;
            }

            maxPriority = (parent != null) ? Math.min(pri, parent.maxPriority) : pri;
            ngroupsSnapshot = ngroups;
            if (groups != null) {
                groupsSnapshot = Arrays.copyOf(groups, ngroupsSnapshot);
            } else {
                groupsSnapshot = null;
            }
        }
        for (int i = 0 ; i < ngroupsSnapshot ; i++) {
            groupsSnapshot[i].setMaxPriority(pri);
        }
    }