List of usage examples for java.util Enumeration nextElement
E nextElement();
From source file:Main.java
public static void main(String[] args) throws Exception { Properties prop = new Properties(); prop.put("Chapter Count", "200"); prop.put("Tutorial Count", "15"); prop.put("tutorial", "java2s.com"); // assign the property names in a enumaration Enumeration<?> enumeration = prop.propertyNames(); // print the enumaration elements System.out.println(enumeration.nextElement()); System.out.println(enumeration.nextElement()); }
From source file:WordCount.java
public static void main(String args[]) throws IOException { Hashtable map = new Hashtable(); FileReader fr = new FileReader(args[0]); BufferedReader br = new BufferedReader(fr); String line;/*from w w w . j a va 2 s . co m*/ while ((line = br.readLine()) != null) { processLine(line, map); } Enumeration e = map.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); System.out.println(key + " : " + map.get(key)); } }
From source file:Main.java
public static void main(String[] args) throws Exception { String zipname = "data.zip"; ZipFile zipFile = new ZipFile(zipname); Enumeration enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); System.out.println(zipEntry.getCrc()); }// w w w .ja v a 2s .co m }
From source file:Main.java
public static void main(String[] args) throws Exception { String zipname = "data.zip"; ZipFile zipFile = new ZipFile(zipname); Enumeration enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); System.out.println(zipEntry.toString()); }// w w w . j ava2s .c o m }
From source file:Main.java
public static void main(String[] args) throws Exception { ZipFile zipFile = new ZipFile("testfile.zip"); Enumeration zipEntries = zipFile.entries(); while (zipEntries.hasMoreElements()) { System.out.println(((ZipEntry) zipEntries.nextElement()).getName()); }/*from w w w .j a v a2 s .co m*/ }
From source file:Main.java
public static void main(String[] args) throws Exception { String zipname = "data.zip"; ZipFile zipFile = new ZipFile(zipname); Enumeration enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); System.out.println(zipEntry.getMethod() == ZipEntry.STORED); }/*w ww . j a va 2s .c o m*/ }
From source file:Main.java
public static void main(String[] args) throws Exception { String zipname = "data.zip"; ZipFile zipFile = new ZipFile(zipname); Enumeration enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); System.out.println(zipEntry.clone()); }//from w w w . java 2 s . c om }
From source file:Main.java
public static void main(String[] args) throws Exception { // Prepare content for simulating property files String fileContent = "s1=1\n" + "s2=Main\n" + "s3=Fri Jan 31"; InputStream propStream = new StringBufferInputStream(fileContent); PropertyResourceBundle bundle = new PropertyResourceBundle(propStream); // Get resource keys Enumeration keys = bundle.getKeys(); while (keys.hasMoreElements()) { System.out.println("Bundle key: " + keys.nextElement()); }//from w w w . ja v a 2 s. c o m }
From source file:Main.java
public static void main(String[] args) throws Exception { String zipname = "data.zip"; ZipFile zipFile = new ZipFile(zipname); Enumeration enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); System.out.println(zipEntry.hashCode()); }/*from w w w. j a va 2 s. c o m*/ }
From source file:Main.java
public static void main(String[] args) throws Exception { String zipname = "data.zip"; ZipFile zipFile = new ZipFile(zipname); Enumeration enumeration = zipFile.entries(); while (enumeration.hasMoreElements()) { ZipEntry zipEntry = (ZipEntry) enumeration.nextElement(); System.out.println(zipEntry.getName()); }//from w ww . ja v a2 s. c o m }