KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jode > obfuscator > modules > UniqueRenamer


1 /* UniqueRenamer Copyright (C) 1999-2002 Jochen Hoenicke.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; see the file COPYING. If not, write to
15  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16  *
17  * $Id: UniqueRenamer.java.in,v 1.1.2.1 2002/05/28 17:34:17 hoenicke Exp $
18  */

19
20 package jode.obfuscator.modules;
21 import jode.obfuscator.*;
22
23 import java.util.Iterator JavaDoc;
24 import java.lang.UnsupportedOperationException JavaDoc;
25
26 public class UniqueRenamer implements Renamer {
27     static int serialnr = 0;
28     public Iterator JavaDoc generateNames(Identifier ident) {
29     return new Iterator JavaDoc() {
30         public boolean hasNext() {
31         return true;
32         }
33         
34         public Object JavaDoc next() {
35         return "xxx" + serialnr++;
36         }
37         public void remove() {
38         throw new UnsupportedOperationException JavaDoc();
39         }
40     };
41     }
42 }
43
Popular Tags