Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÀûÓÃjava Api½âÎöXML

import java.io.IOException;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
/**
 * Usage: You can get a instance of Document from a string of xml.
 * This class supply some method to read a document.
 *
 */
public class XMLParser {
 /**
  * Get a instance of Document from a string of xml.
  *
  * @param xmlStr
  * @return Document
  */
 public static Document parse(String xmlStr) {
  if (xmlStr == null) {
   return null;
  }
  StringReader reader = new StringReader(xmlStr);
  InputSource source = new InputSource(reader);
  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  DocumentBuilder builder = null;
  try {
   builder = factory.newDocumentBuilder();
   
  } catch (ParserConfigurationException e) {
   e.printStackTrace();
  }
  if(builder == null){
   return null;
  }
  Document doc = null;
  try {
   doc = builder.parse(source);
  } catch (SAXException e) {
   e.printStackTrace();
  } catch (IOException e) {
   e.printStackTrace();
  }
  return doc;
 }
 
 /**
  * Get Item Value.
  * @param node
  * @return String
  */
 public static String getItemValue(Node node){
  String value = "";
  if(node == null){
   retur


Ïà¹ØÎĵµ£º

JavaÈçºÎ±éÀúMCËùÓÐITEM


Java
鍼뱎˜
MC
ËùÓÐ
ITEM
 
1
¡¢
mc
±éÀú
item
Ô­Àí
      
Mc
±éÀú
item
Óõ½µÄÃüÁîÓÐÈý¸ö£º
stats items
£¬
stats cachedump, get
¡£Í¨¹ý
telnet
³ÌÐò
telnet
µ½
mc
·þÎñÆ÷ÉÏ£¨
telnet ip
µØÖ·
¶Ë¿ÚºÅ£¬Èç
telnet 192.168.0.1 11211
£©£¬ÒÀ´ÎÖ ......

java ÕÒ³ö100ÒÔÄÚµÄËØÊý

 public class FindPrime {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int num = 100;
String s = "100ÒÔÄÚµÄËØÊý£º";
for (int i = 1; i <= num; i++) {
int count = 0;
for (int j = 1; j <= (int) Math.s ......

javaÖеÄforeachÓ÷¨

 import java.util.*;
public class ForeachExample {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Random r = new Random();
int[] x = new int[10];
for (int i = 0; i < x.length; i++) {
x[i] = r.nextInt(100);
}
/ ......

¹ØÓÚ java swing ÖеÄrepaint ºÍ revalidate º¬Òå

   repaint ¶Ô×é¼þ½øÐÐÖØ»æ£¬±ÈÈçÒ»¸öpanel£¬µ±ÄãremoveµôpanelÀïÃæµÄÒ»¸ö×é¼þʱ£¬Äã±ØÐëµ÷ÓÃrepaint·½·¨²ÅÄܶÔpanel½øÐÐÖØ»æ£¬½øÐÐˢУ¬ÄãÏëҪɾ³ýµÄ×é¼þ²ÅÄÜÔÚ½çÃæÉÏÏûʧ¡£
   revalidate ¶Ô×é¼þ½øÐÐÑéÖ¤£¬±ÈÈçÒ»¸öpanel£¬µ±ÄãremoveµôpanelÀïÃæµÄÒ»¸ö×é¼þʱ£¬µ±Äãµ÷ÓÃrevalidate·½·¨ºó£¬panelµÄ²¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ