List of usage examples for java.lang Boolean FALSE
Boolean FALSE
To view the source code for java.lang Boolean FALSE.
Click Source Link
From source file:com.comcast.oscar.examples.InsertDigitMapToConfigurationBinaryTest.java
/** * @param args/*from w w w.j a va 2 s. com*/ */ @SuppressWarnings("deprecation") public static void main(String[] args) { boolean debug = Boolean.FALSE; File fDigitMap = null; File fPacketCableTxt = null; File fPacketCableBin = null; //Get DigitMap try { fDigitMap = new File(new java.io.File(".").getCanonicalPath() + File.separatorChar + "testfiles" + File.separatorChar + "digitMap.txt"); } catch (IOException e) { e.printStackTrace(); } //OID String sOID = "enterprises.4491.2.2.8.2.1.1.3.1.1.2.1"; //Convert File to ByteArray byte[] bDigitMap = HexString.fileToByteArray(fDigitMap); //Need to get the JSON Dictionary Object, in this case, we need to use Snmp64 DictionarySQLQueries dsqSnmp64 = new DictionarySQLQueries( DictionarySQLQueries.PACKET_CABLE_DICTIONARY_TABLE_NAME); //Get JSON Dictionary Object JSONObject joDictSnmp64 = dsqSnmp64.getTlvDictionary(64); //Create JSON ARRAY for JSON Snmp64 Dictionary OIDToJSONArray otjoSnmp64 = new OIDToJSONArray(sOID, bDigitMap); try { joDictSnmp64 = otjoSnmp64.updateSnmpJsonObject(joDictSnmp64); } catch (JSONException e) { e.printStackTrace(); } // Validate: http://www.jsoneditoronline.org/ if (debug) System.out.println("Snmp64 - JSON-DICTIONARY: " + joDictSnmp64); /* Convert to TLV */ //Create a TlvAssembler for the JSON Dictionary TlvAssembler taSnmp64 = null; //Create an JSONArray Object - Need to make this more clean JSONArray jaSnmp64 = new JSONArray(); //Add JSONObject to JSONArray for TlvAssembler jaSnmp64.put(joDictSnmp64); //Get TlvAssembler() with Snmp64 TLV Encoding taSnmp64 = new TlvAssembler(jaSnmp64); //Display JSONObject if (debug) System.out.println("Snmp64: " + taSnmp64.toString()); /*Insert into Configuration File*/ /******************************** * Text To Binary ********************************/ try { fPacketCableTxt = new File(new java.io.File(".").getCanonicalPath() + File.separatorChar + "testfiles" + File.separatorChar + "IMS-PKT-CABLE-CONFIG-NO-DIGITMAP.txt"); } catch (IOException e) { e.printStackTrace(); } ConfigurationFileImport cfiPacketCable = null; try { try { cfiPacketCable = new ConfigurationFileImport(fPacketCableTxt); } catch (ConfigurationFileException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (FileNotFoundException e) { e.printStackTrace(); } ConfigurationFile cfSnmp64 = new ConfigurationFile(ConfigurationFile.PKT_CBL_VER_20, cfiPacketCable.getTlvBuilder()); //Add DigitMap cfSnmp64.add(taSnmp64); ConfigurationFile cfPacketCAble = new ConfigurationFile(ConfigurationFile.PKT_CBL_VER_20, cfiPacketCable.getTlvBuilder()); cfPacketCAble.commit(); try { fPacketCableBin = new File(new java.io.File(".").getCanonicalPath() + File.separatorChar + "testfiles" + File.separatorChar + File.separatorChar + "output" + File.separatorChar + "IMS-PKT-CABLE-CONFIG-WITH-DIGIT-MAP.bin"); } catch (IOException e) { e.printStackTrace(); } cfPacketCAble.setConfigurationFileName(fPacketCableBin); if (cfPacketCAble.writeToDisk()) { System.out.println("Write to File: "); } else { System.out.println("Write to File FAILED: "); } /******************************** * Binary To Text ********************************/ System.out.println( "+========================================================================================================================+"); try { fPacketCableBin = new File(new java.io.File(".").getCanonicalPath() + File.separatorChar + "testfiles" + File.separatorChar + "IMS-PKT-CABLE-CONFIG-NO-DIGITMAP.bin"); } catch (IOException e) { e.printStackTrace(); } ConfigurationFileExport cfePacketCable = new ConfigurationFileExport(fPacketCableBin); try { cfSnmp64 = new ConfigurationFile(ConfigurationFile.PKT_CBL_VER_20, cfePacketCable.getTlvBuilder()); } catch (TlvException e) { e.printStackTrace(); } //Add Snmp64 DigitMap cfSnmp64.add(taSnmp64); ConfigurationFileExport cfeSnmp64Insert = new ConfigurationFileExport(cfSnmp64); System.out.println(cfeSnmp64Insert.toPrettyPrint(0)); }
From source file:FieldTroubleToo.java
public static void main(String... args) { FieldTroubleToo ft = new FieldTroubleToo(); try {/*from w ww . ja va2 s . c o m*/ Class<?> c = ft.getClass(); Field f = c.getDeclaredField("b"); // f.setAccessible(true); // solution f.setBoolean(ft, Boolean.FALSE); // IllegalAccessException // production code should handle these exceptions more gracefully } catch (NoSuchFieldException x) { x.printStackTrace(); } catch (IllegalArgumentException x) { x.printStackTrace(); } catch (IllegalAccessException x) { x.printStackTrace(); } }
From source file:Main.java
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new Main(), BorderLayout.CENTER); frame.pack();/*from w w w . j a v a2 s . c om*/ frame.setVisible(true); }
From source file:components.TabComponentsDemo.java
public static void main(String[] args) { //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { //Turn off metal's use of bold fonts UIManager.put("swing.boldMetal", Boolean.FALSE); new TabComponentsDemo("TabComponentsDemo").runTest(); }//from www.j a va 2s . c o m }); }
From source file:misc.TrayIconDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {//from w w w.j a va 2s .com UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event-dispatching thread: //adding TrayIcon. SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
From source file:Main.java
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); new Main("Main").runTest(); }
From source file:com.cloudhopper.sxmp.SubmitMain.java
static public void main(String[] args) throws Exception { String url = "http://localhost:9080/api/sxmp/1.0"; // create a submit request SubmitRequest submit = new SubmitRequest(); submit.setAccount(new Account("customer1", "password1")); submit.setDeliveryReport(Boolean.TRUE); MobileAddress sourceAddr = new MobileAddress(); sourceAddr.setAddress(MobileAddress.Type.NETWORK, "40404"); submit.setSourceAddress(sourceAddr); submit.setOperatorId(24);// w w w . j a v a2s .com MobileAddress destAddr = new MobileAddress(); destAddr.setAddress(MobileAddress.Type.INTERNATIONAL, "+14155551212"); submit.setDestinationAddress(destAddr); submit.setText( "Test abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijjabcdefghijjabcdefghijjabcdefghijjabcdefghijjabcdefghijjabcdefghijjabcdefghijbcdefghij", TextEncoding.UTF_8); //submit.setText("Hello World"); // Get file to be posted HttpClient client = new DefaultHttpClient(); client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); client.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, Boolean.FALSE); long totalStart = System.currentTimeMillis(); int count = 1; for (int i = 0; i < count; i++) { long start = System.currentTimeMillis(); // execute request try { HttpPost post = new HttpPost(url); //ByteArrayEntity entity = new ByteArrayEntity(data); StringEntity entity = new StringEntity(SxmpWriter.createString(submit)); entity.setContentType("text/xml; charset=\"iso-8859-1\""); post.setEntity(entity); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String responseBody = client.execute(post, responseHandler); long stop = System.currentTimeMillis(); logger.debug("----------------------------------------"); logger.debug("Response took " + (stop - start) + " ms"); logger.debug(responseBody); logger.debug("----------------------------------------"); } finally { // do nothing } } long totalEnd = System.currentTimeMillis(); logger.debug("Response took " + (totalEnd - totalStart) + " ms for " + count + " requests"); double seconds = ((double) (totalEnd - totalStart)) / 1000; double smspersec = ((double) count) / seconds; logger.debug("SMS / Sec: " + DecimalUtil.toString(smspersec, 2)); }
From source file:com.cloudhopper.sxmp.demo.SubmitMain.java
static public void main(String[] args) throws Exception { String url = "http://127.0.0.1:8080/api/sxmp/1.0"; String phone = "+14155551212"; int operator = 1; if (args.length > 0) url = args[0];// ww w . j a v a2s .c om if (args.length > 1) phone = args[1]; if (args.length > 2) operator = Integer.parseInt(args[2]); // create a submit request SubmitRequest submit = new SubmitRequest(); submit.setAccount(new Account("customer1", "password1")); submit.setDeliveryReport(Boolean.TRUE); MobileAddress sourceAddr = new MobileAddress(); sourceAddr.setAddress(MobileAddress.Type.NETWORK, "40404"); submit.setSourceAddress(sourceAddr); submit.setOperatorId(operator); submit.setPriority(Priority.URGENT); MobileAddress destAddr = new MobileAddress(); destAddr.setAddress(MobileAddress.Type.INTERNATIONAL, phone); submit.setDestinationAddress(destAddr); submit.setText("Hello World"); // Get file to be posted HttpClient client = new DefaultHttpClient(); client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); client.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, Boolean.FALSE); long totalStart = System.currentTimeMillis(); int count = 1; for (int i = 0; i < count; i++) { long start = System.currentTimeMillis(); // execute request try { HttpPost post = new HttpPost(url); //ByteArrayEntity entity = new ByteArrayEntity(data); StringEntity entity = new StringEntity(SxmpWriter.createString(submit)); entity.setContentType("text/xml; charset=\"iso-8859-1\""); post.setEntity(entity); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String responseBody = client.execute(post, responseHandler); long stop = System.currentTimeMillis(); logger.debug("----------------------------------------"); logger.debug("Response took " + (stop - start) + " ms"); logger.debug(responseBody); logger.debug("----------------------------------------"); } finally { // do nothing } } long totalEnd = System.currentTimeMillis(); logger.debug("Response took " + (totalEnd - totalStart) + " ms for " + count + " requests"); double seconds = ((double) (totalEnd - totalStart)) / 1000; double smspersec = ((double) count) / seconds; logger.debug("SMS / Sec: " + DecimalUtil.toString(smspersec, 2)); }
From source file:com.cloudhopper.sxmp.DeliverMain.java
static public void main(String[] args) throws Exception { // create a deliver request DeliverRequest deliver = new DeliverRequest(); deliver.setAccount(new Account("customer1", "password1")); deliver.setOperatorId(2);/*w ww . j a v a 2s . c o m*/ MobileAddress sourceAddr = new MobileAddress(); sourceAddr.setAddress(MobileAddress.Type.INTERNATIONAL, "+13135551212"); deliver.setSourceAddress(sourceAddr); MobileAddress destAddr = new MobileAddress(); destAddr.setAddress(MobileAddress.Type.NETWORK, "55555"); deliver.setDestinationAddress(destAddr); deliver.setText( "This is a new message that I want to send that's a little larger than normal &!#@%20*()$#@!~"); // target url //String url = "http://localhost:9080/api/sxmp/1.0"; //String url = "http://lyn-stratus-001/api/sxmp/1.0"; //String url = "http://localhost:9080/api/sxmp/1.0"; //String strURL = "http://sfd-twtr-gw.cloudhopper.com/api/sxmp/1.0"; String url = "http://lyn-stratus-lab5:9080/api/sxmp/1.0"; // Get file to be posted HttpClient client = new DefaultHttpClient(); client.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); client.getParams().setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, Boolean.FALSE); // convert request into a byte array //byte[] data = SxmpWriter.createByteArray(submit); //logger.debug(StringUtil.toHexString(data)); long totalStart = System.currentTimeMillis(); int count = 5000; for (int i = 0; i < count; i++) { long start = System.currentTimeMillis(); // execute request try { HttpPost post = new HttpPost(url); //ByteArrayEntity entity = new ByteArrayEntity(data); StringEntity entity = new StringEntity(SxmpWriter.createString(deliver)); entity.setContentType("text/xml; charset=\"iso-8859-1\""); post.setEntity(entity); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String responseBody = client.execute(post, responseHandler); long stop = System.currentTimeMillis(); logger.debug("----------------------------------------"); logger.debug("Response took " + (stop - start) + " ms"); logger.debug(responseBody); logger.debug("----------------------------------------"); } finally { // do nothing } } long totalEnd = System.currentTimeMillis(); logger.debug("Response took " + (totalEnd - totalStart) + " ms for " + count + " requests"); double seconds = ((double) (totalEnd - totalStart)) / 1000; double smspersec = ((double) count) / seconds; logger.debug("SMS / Sec: " + DecimalUtil.toString(smspersec, 2)); }
From source file:events.MouseEventDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/* w w w. j a va 2 s.c om*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }