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:br.com.lnprojetos.springbootswing.ui.PessoaUI.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.// ww  w  .  j  a v a2s  .c o m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jButton1 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);

    jButton1.setText("jButton1");
    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(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(50, 50, 50).addComponent(jButton1)
                    .addContainerGap(278, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jButton1)
                    .addContainerGap(259, Short.MAX_VALUE)));

    pack();
}

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

/**
 * Method readImpl.//from  w ww .ja  v a 2  s.  c om
 */
@Override
protected void readImpl() {
    _package = readD() == 1;
    _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] < 0) || (ArrayUtils.indexOf(_items, _items[i]) < i)) {
            _count = 0;
            break;
        }
    }
}

From source file:JQGraphicModule.QueryTableApp.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  .c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">                          
private void initComponents() {

    lineas = new javax.swing.JPanel();
    l = new javax.swing.JRadioButton();
    b = new javax.swing.JRadioButton();
    p = new javax.swing.JRadioButton();
    jButton1 = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    javax.swing.GroupLayout lineasLayout = new javax.swing.GroupLayout(lineas);
    lineas.setLayout(lineasLayout);
    lineasLayout.setHorizontalGroup(lineasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 397, Short.MAX_VALUE));
    lineasLayout.setVerticalGroup(lineasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 263, Short.MAX_VALUE));

    l.setText("Linear");
    l.setToolTipText("");
    l.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            lActionPerformed(evt);
        }
    });

    b.setText("Bar");
    b.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bActionPerformed(evt);
        }
    });

    p.setText("Pie");
    p.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pActionPerformed(evt);
        }
    });

    jButton1.setText("Graphicate");
    jButton1.setToolTipText("");
    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(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(l).addComponent(b).addComponent(p).addComponent(jButton1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 73, Short.MAX_VALUE)
                    .addComponent(lineas, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                            .addComponent(lineas, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(61, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup().addComponent(l)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(b)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(p)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton1).addGap(86, 86, 86)))));

    pack();
}

From source file:tests.GraphSettings.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  . j  av a 2  s .  c o m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jTextField1 = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();

    jTextField1.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyTyped(java.awt.event.KeyEvent evt) {
            jTextField1KeyTyped(evt);
        }
    });

    jLabel1.setText("Value 1");

    jLabel2.setText("value 2");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(24, 24, 24)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jTextField1).addComponent(jTextField2,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE))
                    .addContainerGap(236, Short.MAX_VALUE)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(27, 27, 27)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2).addComponent(jTextField2,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(205, Short.MAX_VALUE)));

    pack();
}

From source file:com.thinkbiganalytics.spark.validation.HCatDataTypeTest.java

@Test
public void testIsValueConvertibleToSmallIntType() throws Exception {

    HCatDataType smallintType = HCatDataType.getDataTypes().get("smallint");

    assertTrue(smallintType.isValueConvertibleToType("0"));
    assertTrue(smallintType.isValueConvertibleToType(Short.MAX_VALUE + ""));
    assertTrue(smallintType.isValueConvertibleToType(Short.MIN_VALUE + ""));

    assertTrue(smallintType.isValueConvertibleToType(null));
    assertTrue(smallintType.isValueConvertibleToType(""));

    assertFalse(smallintType.isValueConvertibleToType("21.1"));
    assertFalse(smallintType.isValueConvertibleToType("-20.001"));
    assertFalse(smallintType.isValueConvertibleToType(Integer.MAX_VALUE + ""));

}

From source file:com.porepw.porli.frame.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 av a  2  s . c o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jPanel1 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jPanel1.setLayout(null);

    jButton1.setText("jButton1");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jPanel1.add(jButton1);
    jButton1.setBounds(20, 60, 90, 60);

    jPanel2.setLayout(new java.awt.BorderLayout());
    jPanel1.add(jPanel2);
    jPanel2.setBounds(130, 10, 490, 390);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 590, Short.MAX_VALUE));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE));

    pack();
}

From source file:BrokerFrame.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 v a 2 s.  c o  m*/
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jButton1 = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Broker");

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

    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    jScrollPane1.setViewportView(jTextArea1);

    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(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 110,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(307, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup().addGap(14, 14, 14).addComponent(jScrollPane1)
                    .addContainerGap()));
    layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addGap(27, 27, 27)
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 48,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 234,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(24, Short.MAX_VALUE)));

    pack();
}

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

/**
 * Method readImpl./* ww  w  .jav a2 s .co  m*/
 */
@Override
protected void readImpl() {
    _objectId = readD();
    _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:jcine.CineForm.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 . j  av a  2s.  com
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    tEntryPoint = new javax.swing.JTextField();
    bLoad = new javax.swing.JButton();
    pHall = new javax.swing.JPanel();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jLabel1.setText("URL de servicio");

    tEntryPoint.setText("http://localhost:3000/asientos.json");
    tEntryPoint.setToolTipText("");

    bLoad.setText("Cargar");
    bLoad.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bLoadActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout pHallLayout = new javax.swing.GroupLayout(pHall);
    pHall.setLayout(pHallLayout);
    pHallLayout.setHorizontalGroup(pHallLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE));
    pHallLayout.setVerticalGroup(pHallLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 568, Short.MAX_VALUE));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(48, 48, 48).addComponent(jLabel1).addGap(18, 18, 18)
                    .addComponent(tEntryPoint, javax.swing.GroupLayout.PREFERRED_SIZE, 507,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(bLoad)
                    .addContainerGap(307, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup().addComponent(pHall, javax.swing.GroupLayout.DEFAULT_SIZE,
                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
                    .addComponent(tEntryPoint, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(bLoad)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(pHall, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap()));

    pack();
}

From source file:org.lightadmin.core.util.NumberUtils.java

@SuppressWarnings("unchecked")
public static <T extends Number> T convertNumberToTargetClass(Number number, Class<T> targetClass)
        throws IllegalArgumentException {
    Assert.notNull(number, "Number must not be null");
    Assert.notNull(targetClass, "Target class must not be null");

    if (targetClass.isInstance(number)) {
        return (T) number;
    } else if (targetClass.equals(byte.class)) {
        long value = number.longValue();
        if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
            raiseOverflowException(number, targetClass);
        }//w  w w . ja va2 s .c  o  m
        return (T) new Byte(number.byteValue());
    } else if (targetClass.equals(short.class)) {
        long value = number.longValue();
        if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) {
            raiseOverflowException(number, targetClass);
        }
        return (T) new Short(number.shortValue());
    } else if (targetClass.equals(int.class)) {
        long value = number.longValue();
        if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
            raiseOverflowException(number, targetClass);
        }
        return (T) new Integer(number.intValue());
    } else if (targetClass.equals(long.class)) {
        return (T) new Long(number.longValue());
    } else if (targetClass.equals(float.class)) {
        return (T) Float.valueOf(number.toString());
    } else if (targetClass.equals(double.class)) {
        return (T) Double.valueOf(number.toString());
    } else {
        return org.springframework.util.NumberUtils.convertNumberToTargetClass(number, targetClass);
    }
}