<commit_before>/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.service.protocol;

/**
 * The class is used to represent the state of the connection
 * of a given ProtocolProvider or Contact. It is up to the implementation to
 * determine the exact states that an object might go through. An IM provider
 * for example might go through states like, CONNECTING, ON-LINE, AWAY, etc, A
 * status instance is represented by an integer varying from 0 to
 * 100, a Status Name and a Status Description.
 *
 * The integer status variable is used so that the users of the service get the
 * notion of whether or not a given Status instance represents a state that
 * allows communication (above 20) and so that it could compare instances
 * between themselves (e.g. for sorting a ContactList for example).
 *
 * A state may not be created by the user. User may request a status change
 * giving parameters requested by the ProtocolProvider. Once a statue is
 * successfully entered by the provider, a ConnectivityStatus instacne is
 * conveyed to the user through a notification event.
 *
 * @author <NAME>
 */
public class PresenceStatus
        implements Comparable
{
    /**
     * An integer above which all values of the status coefficient indicate
     * that a status with connectivity (communication is possible).
     */
    public static final int ONLINE_THRESHOLD = 20;

    /**
     * An integer above which all values of the status coefficient indicate
     * both connectivity and availability.
     */
    public static final int AVAILABLE_THRESHOLD = 50;

    /**
     * An integer above which all values of the status coefficient indicate
     * eagerness to communicate
     */
    public static final int EAGER_TO_COMMUNICATE_THRESSHOLD = 80;

    /**
     * Represents the connectivity status on a scale from
     * 0 to 100  with 0 indicating complete disabiilty for communication and 100
     * maximum ability and user willingness. Implementors of this service should
     * respect the following indications for status values.
     * 0 - complete disability
     * 1:10 - initializing.
     * 1:20 - trying to enter a state where communication is possible (Connecting ..)
     * 20:50 - communication is possible but might be unwanted, inefficient or delayed(e.g. Away state in IM clients)
     * 50:80 - communication is possible (On - line)
     * 80:100 - communication is possible and user is eager to communicate. (Free for chat! Talk to me, etc.)
     */
    protected int status = 0;

    /**
     * The name of this status instance (e.g. Away, On-line, Invisible, etc.)
     */
    protected String statusName = null;

    /**
     * Creates an instance of this class using the specified parameters.
     * @param status the status variable representing the new instance
     * @param statusName the name of this PresenceStatus
     */<commit_msg>Added a max status limit<commit_after>/*
 * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package net.java.sip.communicator.service.protocol;

/**
 * The class is used to represent the state of the connection
 * of a given ProtocolProvider or Contact. It is up to the implementation to
 * determine the exact states that an object might go through. An IM provider
 * for example might go through states like, CONNECTING, ON-LINE, AWAY, etc, A
 * status instance is represented by an integer varying from 0 to
 * 100, a Status Name and a Status Description.
 *
 * The integer status variable is used so that the users of the service get the
 * notion of whether or not a given Status instance represents a state that
 * allows communication (above 20) and so that it could compare instances
 * between themselves (e.g. for sorting a ContactList for example).
 *
 * A state may not be created by the user. User may request a status change
 * giving parameters requested by the ProtocolProvider. Once a statue is
 * successfully entered by the provider, a ConnectivityStatus instacne is
 * conveyed to the user through a notification event.
 *
 * @author <NAME>
 */
public class PresenceStatus
        implements Comparable
{
    /**
     * An integer above which all values of the status coefficient indicate
     * that a status with connectivity (communication is possible).
     */
    public static final int ONLINE_THRESHOLD = 20;

    /**
     * An integer above which all values of the status coefficient indicate
     * both connectivity and availability.
     */
    public static final int AVAILABLE_THRESHOLD = 50;

    /**
     * An integer above which all values of the status coefficient indicate
     * eagerness to communicate
     */
    public static final int EAGER_TO_COMMUNICATE_THRESSHOLD = 80;

    /**
     * An integer indicating the maximum possible value of the status field.
     */
    public static final int MAX_STATUS_VALUE = 100;


    /**
     * Represents the connectivity status on a scale from
     * 0 to 100  with 0 indicating complete disabiilty for communication and 100
     * maximum ability and user willingness. Implementors of this service should
     * respect the following indications for status values.
     * 0      - complete disability
     * 1:10   - initializing.
     * 1:20   - trying to enter a state where communication is possible
     *          (Connecting ..)
     * 20:50  - communication is possible but might be unwanted, inefficient or
     *          delayed(e.g. Away state in IM clients)
     * 50:80  - communication is possible (On - line)
     * 80:100 - communication is possible and user is eager to communicate.
     *        (Free for chat! Talk to me, etc.)
     */
    protected int status = 0;

    /**
     * The name of this status instance (e.g. Away, On-line, Invisible, etc.)
     */
    protected String statusName = null;

    /**
     * Creates an instance of this class using the specified parameters.
     * @param status the status variable representing the new instance
     * @param statusName the name of this PresenceStatus
     */
{'fraction_non_alphanumeric': 0.058908275972466784, 'fraction_numerical': 0.013606531134944774, 'mean_word_length': 2.9872367581365666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4740629', 'n_tokens_mistral': 1640, 'n_tokens_neox': 1525, 'n_words': 803}