// ** This file was generated with DemFGen (vers:4/15/2011) package scg.net; import edu.neu.ccs.demeterf.lib.*; import java.io.*; import edu.neu.ccs.demeterf.lib.*; /** Representation of PasswordFile */ public class PasswordFile{ protected List passwds; /** Construct a(n) PasswordFile Instance */ public PasswordFile(List passwds){ this.passwds = passwds; } /** Is the given object Equal to this PasswordFile? */ public boolean equals(Object o){ if(!(o instanceof PasswordFile))return false; if(o == this)return true; PasswordFile oo = (PasswordFile)o; return (((Object)passwds).equals(oo.passwds)); } /** Parse an instance of PasswordFile from the given String */ public static PasswordFile parse(String inpt) throws scg.net.ParseException{ return new scg.net.TheParser(new java.io.StringReader(inpt)).parse_PasswordFile(); } /** Parse an instance of PasswordFile from the given Stream */ public static PasswordFile parse(java.io.InputStream inpt) throws scg.net.ParseException{ return new scg.net.TheParser(inpt).parse_PasswordFile(); } /** Parse an instance of PasswordFile from the given Reader */ public static PasswordFile parse(java.io.Reader inpt) throws scg.net.ParseException{ return new scg.net.TheParser(inpt).parse_PasswordFile(); } /** Field Class for PasswordFile.passwds */ public static class passwds extends edu.neu.ccs.demeterf.Fields.any{} /** Get a Map of Player-Name / Password-Hash */ public Map getPasswordMap(){ return passwds.fold(new List.Fold>(){ public Map fold(PasswordEntry e, Map m){ return e.addTo(m); } }, Map.create()); } /** Write out the Passwords to a File */ public void write(String file) throws IOException{ PrintStream out = new PrintStream(new FileOutputStream(file)); out.println(this.toString()); out.close(); } /** DGP method from Class Display */ public String display(){ return scg.net.Display.DisplayM(this); } /** DGP method from Class Print */ public String print(){ return scg.net.Print.PrintM(this); } /** DGP method from Class ToStr */ public String toStr(){ return scg.net.ToStr.ToStrM(this); } /** DGP method from Class PrintToString */ public String toString(){ return scg.net.PrintToString.PrintToStringM(this); } /** DGP method from Class HashCode */ public int hashCode(){ return scg.net.HashCode.HashCodeM(this); } /** Setter for field PasswordFile.passwds */ public void setPasswds(List _passwds){ passwds = _passwds; } /** Getter for field PasswordFile.passwds */ public List getPasswds(){ return passwds; } }