Example usage for java.lang Short MAX_VALUE

List of usage examples for java.lang Short MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Short MAX_VALUE.

Prototype

short MAX_VALUE

To view the source code for java.lang Short MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a short can have, 215-1.

Usage

From source file:lineage2.gameserver.network.clientpackets.SendWareHouseDepositList.java

/**
 * Method readImpl.//from   w w w. j  a v  a2 s .  c o m
 */
@Override
protected void readImpl() {
    _count = readD();
    if (((_count * 12) > _buf.remaining()) || (_count > Short.MAX_VALUE) || (_count < 1)) {
        _count = 0;
        return;
    }
    _items = new int[_count];
    _itemQ = new long[_count];
    for (int i = 0; i < _count; i++) {
        _items[i] = readD();
        _itemQ[i] = readQ();
        if ((_itemQ[i] < 1) || (ArrayUtils.indexOf(_items, _items[i]) < i)) {
            _count = 0;
            return;
        }
    }
}

From source file:com.antsdb.saltedfish.sql.vdm.Record.java

public final static long alloc(Heap heap, int nFields) {
    if (nFields >= Short.MAX_VALUE) {
        throw new IllegalArgumentException();
    }/*w w  w  .  j av  a2 s.  co  m*/
    int bytes = OFFSET_FIELDS + nFields * 8;
    long p = heap.alloc(bytes);
    Unsafe.putByte(p, TYPE_RECORD);
    Unsafe.putShort(p + OFFSET_SIZE, (short) nFields);
    reset(p);
    return p;
}

From source file:ie.philb.testorderingsoapclient.ui.nav.products.ProductListCellRenderer.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//w  w  w .j a  va2 s  .  co  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    lblTitle = new javax.swing.JLabel();
    lblUnitPrice = new javax.swing.JLabel();
    lblCode = new javax.swing.JLabel();

    setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 2, 1, 2));

    lblTitle.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
    lblTitle.setText("The Product Title");

    lblUnitPrice.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    lblUnitPrice.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    lblUnitPrice.setText("1.53");

    lblCode.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    lblCode.setText("ABC12345");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                    Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                    .addComponent(lblCode, javax.swing.GroupLayout.PREFERRED_SIZE, 80,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblUnitPrice, javax.swing.GroupLayout.PREFERRED_SIZE, 44,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addComponent(lblTitle).addGap(1, 1, 1)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblUnitPrice).addComponent(lblCode))));
}

From source file:lineage2.gameserver.network.clientpackets.SendWareHouseWithDrawList.java

/**
 * Method readImpl.//from  ww  w . ja v a2s .  c om
 */
@Override
protected void readImpl() {
    _count = readD();
    if (((_count * 12) > _buf.remaining()) || (_count > Short.MAX_VALUE) || (_count < 1)) {
        _count = 0;
        return;
    }
    _items = new int[_count];
    _itemQ = new long[_count];
    for (int i = 0; i < _count; i++) {
        _items[i] = readD();
        _itemQ[i] = readQ();
        if ((_itemQ[i] < 1) || (ArrayUtils.indexOf(_items, _items[i]) < i)) {
            _count = 0;
            break;
        }
    }
}

From source file:lineage2.gameserver.network.clientpackets.RequestPrivateStoreBuy.java

/**
 * Method readImpl./*from   w ww .j a  va  2s .c  om*/
 */
@Override
protected void readImpl() {
    _sellerId = readD();
    _count = readD();
    if (((_count * 20) > _buf.remaining()) || (_count > Short.MAX_VALUE) || (_count < 1)) {
        _count = 0;
        return;
    }
    _items = new int[_count];
    _itemQ = new long[_count];
    _itemP = new long[_count];
    for (int i = 0; i < _count; i++) {
        _items[i] = readD();
        _itemQ[i] = readQ();
        _itemP[i] = readQ();
        if ((_itemQ[i] < 1) || (_itemP[i] < 1) || (ArrayUtils.indexOf(_items, _items[i]) < i)) {
            _count = 0;
            break;
        }
    }
}

From source file:EspectroForm.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//  w  ww  .j  a v  a  2  s . co m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    spectroPanel = new javax.swing.JPanel();
    okButton = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setMaximumSize(new java.awt.Dimension(500, 375));
    setMinimumSize(new java.awt.Dimension(500, 375));
    setResizable(false);

    javax.swing.GroupLayout spectroPanelLayout = new javax.swing.GroupLayout(spectroPanel);
    spectroPanel.setLayout(spectroPanelLayout);
    spectroPanelLayout.setHorizontalGroup(spectroPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 540, Short.MAX_VALUE));
    spectroPanelLayout.setVerticalGroup(spectroPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 390, Short.MAX_VALUE));

    okButton.setText("OK");
    okButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            okButtonActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(spectroPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addGap(198, 198, 198).addComponent(okButton,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(199, 199, 199)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap()
                    .addComponent(spectroPanel, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGap(18, 18, 18).addComponent(okButton).addGap(33, 33, 33)));

    pack();
}

From source file:menusearch.ui.MenuGraph.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from   w  ww. ja  v a  2 s .c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    label1 = new java.awt.Label();
    jButton1 = new javax.swing.JButton();

    label1.setText("label1");

    jButton1.setText("Line Graph");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(307, 307, 307).addComponent(jButton1)
                    .addContainerGap(320, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(40, 40, 40).addComponent(jButton1)
                    .addContainerGap(391, Short.MAX_VALUE)));
}

From source file:cmsc105_mp2.Plotting.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor./*  w w w .  j a  va2  s. com*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jScrollPane1 = new javax.swing.JScrollPane();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE));

    pack();
}

From source file:Visao.Relatorio.Grafico_QuantidadeReclamacoesSexo.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.//from  w w w.  j  a v  a  2s. co m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Quantidade de Reclamaes por Sexo");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0,
            400, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 300,
            Short.MAX_VALUE));

    pack();
}

From source file:lineage2.gameserver.network.clientpackets.RequestPrivateStoreBuySellList.java

/**
 * Method readImpl.//from  w  w w. j  a v  a 2  s.  co m
 */
@Override
protected void readImpl() {
    _buyerId = readD();
    _count = readD();
    if (((_count * 28) > _buf.remaining()) || (_count > Short.MAX_VALUE) || (_count < 1)) {
        _count = 0;
        return;
    }
    _items = new int[_count];
    _itemQ = new long[_count];
    _itemP = new long[_count];
    for (int i = 0; i < _count; i++) {
        _items[i] = readD();
        readD();
        readH();
        readH();
        _itemQ[i] = readQ();
        _itemP[i] = readQ();
        if ((_itemQ[i] < 1) || (_itemP[i] < 1) || (ArrayUtils.indexOf(_items, _items[i]) < i)) {
            _count = 0;
            break;
        }
    }
}