id
stringlengths
36
36
text
stringlengths
1
1.25M
fe2aefab-e14b-4070-a4c2-77b591cb31fe
@Override protected EntityManager getEntityManager() { return em; }
0966b42d-9a1e-45e7-a19f-589c3cd0c6d9
public OrganizationFacade() { super(Organization.class); }
7ca9eb19-b899-418c-85e4-988498fe8f7d
public AbstractFacade(Class<T> entityClass) { this.entityClass = entityClass; }
76c99975-86a7-4c31-9b89-d0da8859beb5
protected abstract EntityManager getEntityManager();
e3e1647a-bd6a-45cf-99ab-dbfa6ea7c876
public void create(T entity) { getEntityManager().persist(entity); }
2ae951d6-aca9-40c7-bece-47c0225c605b
public void edit(T entity) { getEntityManager().merge(entity); }
2357ea9a-bd56-4c20-9d6f-fbdfdf48c52c
public void remove(T entity) { getEntityManager().remove(getEntityManager().merge(entity)); }
cac12167-11a5-4700-a795-2a7e7eb324f0
public T find(Object id) { return getEntityManager().find(entityClass, id); }
70142295-8c9d-4538-a147-6494c0becc0b
public List<T> findAll() { javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery(); cq.select(cq.from(entityClass)); return getEntityManager().createQuery(cq).getResultList(); }
62713c2c-08a1-4b6c-9447-e10b42efa98c
public List<T> findRange(int[] range) { javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery(); cq.select(cq.from(entityClass)); javax.persistence.Query q = getEntityManager().createQuery(cq); q.setMaxResults(range[1] - range[0]); q.se...
21831c80-2fe0-4800-bbc6-44e537a77358
public int count() { javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery(); javax.persistence.criteria.Root<T> rt = cq.from(entityClass); cq.select(getEntityManager().getCriteriaBuilder().count(rt)); javax.persistence.Query q = getEntityManag...
2b215a2d-4fa1-4adc-b2a3-7286fad89f26
public static int powInt(int base,int expo) { assert base > 0 && expo >= 0; int result = 1; for(;expo>0;expo--) result *= base; return result; }
4b6c78a8-14c9-4d0d-b908-c38b8fc3f2b9
public static int reverseDigit(int size,int base,int number) { assert number <= powInt(base,size); int result = 0; for(;size>0;size--) { result = result*base + number%base; number /= base; } return result; }
d5494fd7-f591-4523-8b73-09f2d2424778
public static int numVarInPattern(int size,int pattern) { int n = 0; for(;size>0;size--,pattern/=3) if(pattern%3 != 2) n++; return n; }
61d3413b-0a34-4a32-b8ca-fd0f51b441a6
protected static void updateLabel(int numVar,int pattern,int prefix,int update) { if(numVar == 0) { numLayer[reverseDigit(totalVar,2,prefix)] += update; return; } if(pattern%3 == 0 || pattern%3 == 2) updateLabel(numVar-1,pattern/3,prefix*2+0,update); if(pattern%3 == 1 || pattern%3 == 2) updateLabel(...
2b951648-b6d0-40c8-8e85-dd17077c9174
protected static boolean groupable(int numVar,int pattern,int prefix) { if(numVar == 0) { switch(kmap[reverseDigit(totalVar,2,prefix)]) { case F: return !isMinterm; case T: return isMinterm; case X: return true; } } switch(pattern%3) { case 0: return groupable(numVar-1,pattern/3,prefix*2+0);...
9b2f4d6b-5cad-49be-959b-12d03828268d
protected static boolean deletable(int numVar,int pattern,int prefix) { if(numVar == 0) { int curPosition = reverseDigit(totalVar,2,prefix); if(kmap[curPosition] == boolx.X) return numLayer[curPosition] > 0; return numLayer[curPosition] > 1; } switch(pattern%3) { case 0: return deletable(numVar-1,...
666a98af-d007-452b-a71b-44d52feb2acd
public static int grade(int totalVar,boolx[] kmap,boolean isMinterm) { assert kmap.length == powInt(2,totalVar); int cost = 0; boolean[] groupAbility = new boolean[powInt(3,totalVar)]; KarnaughMapGrader.totalVar = totalVar; KarnaughMapGrader.kmap = kmap; KarnaughMapGrader.isMinterm = isMinterm; numLayer =...
2947800e-8d30-49d3-9618-257f68e57955
protected int numberOfPermutation(int n, int r) { int result = 1; for (int i = 0; i < r; i++) result *= n - i; return result; }
aa8289e3-88de-4f8c-97d3-a2e19b929f53
public Permutation(int n, int r) { assert 0 < r && r <= n : "cannot find nPr."; this.n = n; this.r = r; this.total = numberOfPermutation(n, r); this.pattern = new int[r]; free = new boolean[n]; reset(); }
6ad82a7d-76c2-4f24-89f4-d80c18c3ca5e
protected void reset() { for (int i = 0; i < r; i++) pattern[i] = i; for (int i = 0; i < n; i++) free[i] = i >= r; }
bb762632-d734-4156-ad68-6a0bf34c3ef6
protected void next() { int p = r - 1; // pointer to current the current index of patten. free[pattern[p]] = true; int i = pattern[p] + 1; while (p < r) { for (; i < n; i++) if (free[i]) break; if (i < n) { pattern[p] = i; free[i] = false; p++; i = 0; } else { free[pattern[...
6a36b94a-96cd-4fef-bb57-fc335bfc99d8
public int log2(int n) { int i; for(i=0;(1<<i)<n;i++); return i; }
fdef36b8-a8a5-4a19-9971-d06fe22b0954
public StateToKarnaughMap(int[][] idealStateDiagram, int argSize,int kmapsSize,int[] h){ // Pre: argSize and idealStateDiagram.length must be multiple of two assert argSize == h.length; for(int i=0;i<idealStateDiagram.length;i++) assert idealStateDiagram[i].length == argSize; this.h =...
7f6dcd0a-1787-4aee-a231-6600f6af8966
public int compareTo(StateToKarnaughMap compState) { return this.score - compState.score; }
9f8261e8-b928-4b2d-aedf-2bc4ad78a1b9
public static void main(String[] args) throws IOException { /*boolx[] kmap = { boolx.F,boolx.F,boolx.T,boolx.F , boolx.T,boolx.T,boolx.T,boolx.F , boolx.F,boolx.T,boolx.T,boolx.T , boolx.F,boolx.T,boolx.F,boolx.F }; Utility.rep4varKmap(kmap); System.out.print...
46adbafb-51a5-4bc7-a26b-de74761d7413
public static void hwcw2UpdateAssignment(int[] assignment,Permutation perm) { assignment[0] = perm.pattern[0]; assignment[1] = perm.pattern[1]; assignment[2] = perm.pattern[2]; assignment[3] = perm.pattern[3]; assignment[4] = perm.pattern[4]; assignment[5] = -1; assignment[6] = perm.pattern[5]; assignme...
17661b10-691f-4a97-a344-fa3b55fd3cce
public static void hwcw2PrintState(StateToKarnaughMap state) { System.out.println(state.score+" "+Arrays.toString(state.isMinterm)); System.out.println(Arrays.toString(state.h)); Utility.rep4varKmap(state.kmaps[0]); Utility.rep4varKmap(state.kmaps[1]); Utility.rep4varKmap(state.kmaps[2]); Utility.p...
b8abd6bf-48ab-4847-844a-bd583b5257fa
public static String loadContigSeq(int id) throws SQLException{ Connection conn = ConnectionManager.getConnection(0); String seq = null; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(" SELECT sequence from ScaffoldSeq where scaffoldId = "+id+";"); while (rs.next()){ seq = rs.get...
36137986-4f6a-4209-b1aa-3a2261f4f59c
private static String loadScaffoldFragment(int scaffoldId, int start,int end) throws SQLException{ Connection conn = ConnectionManager.getConnection(0); String seq = null; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(" SELECT substring(sequence,"+start+","+(end-start)+") FROM"+ ...
f09966f8-1eb8-4bef-b1f9-e8f86aafda4d
public static Sequence loadGeneUpstream(Locus l, int leftCoord) throws SQLException{ DnaPosition pos = l.pos; Scaffold sc = l.sc; // System.out.println(pos.toString()); int scaffoldStartPos; int scaffoldEndPos; if (pos.dir_PLUS) { scaffoldStartPos = pos.begin+leftCoord; scaffoldEndPos = pos.end+1; ...
deb642ff-e070-46f4-8dc6-fee2be4339df
public ContigLoaderThread(int i,COGLoader loader,String dir) { this.loader = loader; this.dir = dir; this.id = i; }
43c01eea-f93a-4e1d-ada6-a2f750700d80
public void run(){ try{ Scaffold scaffold = loader.getNextScaffold(); while(scaffold!=null){ String f = dir+"/"+scaffold.taxonomyId+"_contig"+scaffold.scaffoldId+".fasta"; PrintWriter pw = new PrintWriter(f); String seq = ContigSeqLoader.loadContigSeq(scaffold.scaffoldId); pw.println(">"+scaffol...
dce8809d-782c-49de-a651-003a1930ade0
public COGLoaderThread(int i,COGLoader loader,String dir,String type,int upstream) { this.loader = loader; this.dir = dir; this.id = i; this.type = type; this.upstream=upstream; }
ec1fc333-bdb5-4a02-a9a3-10c905db5809
public void run(){ int strangeStartCount = 0; int erroneusLocusCount = 0; try{ Integer cog = loader.getNextCOG(); while(cog!=null){ ArrayList<Locus> genes = loader.cogs.get(cog); String f = dir+"/"+type+cog+".fasta"; PrintWriter pw = new PrintWriter(f); for (Iterator<Locus> iterator = genes....
0330abc0-ae0f-4dde-9aee-f32efdae806c
public COGLoader(String type) { this.type = type; }
f43b98c7-3813-46db-bd77-ecfb179786f6
private static String getQString(ArrayList<Integer> taxList,String type) throws SQLException{ String q = ""; for (Iterator<Integer> iterator = taxList.iterator(); iterator.hasNext();) { Integer integer = iterator.next(); q+=(","+integer); } q=q.substring(1); String qString = ""; if (type.equal...
e85f1a42-dc5d-4925-8019-08dcdb6f201b
private void loadMembers(ArrayList<Integer>taxList) throws SQLException{ String qString = getQString(taxList, type); if (qString==null) { System.out.println("Unknown type "+type); System.exit(0); } cogs = new Hashtable<Integer,ArrayList<Locus>>(); scaffolds = new Hashtable<Integer,Scaffold>(); taxonom...
c2f899f4-b84e-48b9-b80f-8292709077b3
protected synchronized Integer getNextCOG(){ if (ind_COG<0) { this.COGIterator = cogs.keySet().iterator(); ind_COG = 0; } if (COGIterator.hasNext()) return COGIterator.next(); else return null; }
2bbb95fa-5ff4-4ecc-931e-e7373b60062f
protected synchronized Scaffold getNextScaffold(){ if (ind_contig<0) { this.contigIterator = scaffolds.values().iterator(); ind_contig = 0; } if (contigIterator.hasNext()) return contigIterator.next(); else return null; }
fe2df114-4d41-4b4e-8789-0cbb45400894
public void writeCOGs(int threadNumber, String dir,String type,int upstream){ long time = System.currentTimeMillis(); File f = new File(dir); if (!f.exists()) f.mkdir(); else{ File[] ff = f.listFiles(); for (int i = 0; i < ff.length; i++) { ff[i].delete(); } } COGLoaderThread[] threads = ...
8aa7bc70-c053-45b3-acf6-a3fdf6412f98
public void writeContigs(int threadNumber, String dir){ long time = System.currentTimeMillis(); File f = new File(dir); if (!f.exists()) f.mkdir(); else{ File[] ff = f.listFiles(); for (int i = 0; i < ff.length; i++) { ff[i].delete(); } } ContigLoaderThread[] threads = new ContigLoaderThr...
3fd83044-9b30-4928-bfe9-2268350a9dcb
public static void launch(String f,String type,int upstream,boolean withContig){ System.out.println("Reading taxonomy list.."); ArrayList<Integer> taxList = new ArrayList<Integer>(); try{ BufferedReader br = new BufferedReader(new FileReader(f)); String line = br.readLine(); while (line!=null) { if (...
944c8aec-4397-4084-a1d1-f50e3fa98a1a
public static void main(String[] args) throws FileNotFoundException { /* String f = "genomes_list.txt"; String type = "MOG"; int upstream = 201;*/ String f = args[0]; String type = args[1]; int upstream = Integer.parseInt(args[2]); boolean withContig = false; try{ if (args[3].toLowerCase().equals("wit...
bccbed2b-4d93-414e-94a1-63b4479d0f62
public static String loadAASeq(int id,int version) throws SQLException{ Connection conn = ConnectionManager.getConnection(0); String seq = null; Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(" SELECT sequence from AASeq where locusId = "+id+" and version = "+version+" ;"); while (r...
d6e203c0-fb43-4582-bb28-35760d817888
public static Connection getConnection(int i) { try { if (conn[i] == null || conn[i].isClosed()) { conn[i] = createNewConnection(i); } if (!checkConnection(i)) reconnect(i); return conn[i]; } catch (Exception e) { e.printStackTrace(); return null; } }
e98cab5a-d3e9-43f6-af7a-298223c56bb7
private static Connection createNewConnection(int i) throws Exception { String host = Configuration.getConnHost(i); String port = Configuration.getConnPort(i); String url = "jdbc:mysql://" + host + ":" + port + "/"; String db = Configuration.getConnDB(i); if (db != null) url += db; String usr = Configura...
f40b4747-f695-4675-b34a-c7c015c7046c
private static boolean checkConnection(int i) { if (conn[i] == null) return false; boolean res = false; String testQuery = Configuration.getConnTestQuery(i); try { Statement stmt = conn[i].createStatement(); if (stmt.execute(testQuery)) res = true; stmt.close(); } catch (Exception e) { Syst...
3443553c-125f-4a57-b550-6328d7dc1c99
private static void reconnect(int j) throws Exception { System.out.println("Reconnectiong.."); int i = 0; while (i < RECONNECT_NUMBER) { closeConnection(j); conn[i] = createNewConnection(j); if (checkConnection(j)) break; i++; } if (i == RECONNECT_NUMBER) throw new Exception(); }
b025f60a-b54a-4c78-a039-afdb59f483b8
public static void closeConnection(int i) { try { if ((conn[i] != null) && (!conn[i].isClosed())) conn[i].close(); } catch (Exception e) { e.printStackTrace(); } }
96be47b1-e8d4-45cc-b53c-85db5af34ed7
public static boolean isPropsNull(int i){ return (props[i]==null); }
abd91bc4-e8ab-48da-bc5c-106601d91e98
public static String getConnHost(int i) { Properties prpos = getProps(i); String host = prpos.getProperty(ConnHost); if (host == null) host = "localhost"; return host; }
429f30f6-a2d0-45e1-a88b-cf92382c3605
public static String getConnPort(int i) { Properties prpos = getProps(i); String port = prpos.getProperty(ConnPort); if (port == null) port = "3306"; return port; }
7e2ba421-4293-4ed8-8b5e-4e6c37a05bdf
public static String getMysqlPath(int i) { Properties prpos = getProps(i); String mysql_path = prpos.getProperty(MysqlPath); if (mysql_path == null) mysql_path = "mysql"; return mysql_path; }
2a72aaf3-554a-47ff-8c9b-a2ea022bd9dd
public static String getConnDB(int i) { Properties prpos = getProps(i); return prpos.getProperty(ConnDB); }
300f45dc-6fc4-4bfe-8ccf-ab74473302be
public static String getConnUser(int i) { Properties prpos = getProps(i); return prpos.getProperty(ConnUser); }
eb9c38d8-ff91-47f6-bc06-107db88a0385
public static String getConnPwd(int i) { Properties prpos = getProps(i); return prpos.getProperty(ConnPwd); }
9f6d664a-ea0f-42e8-b082-baa03701057a
public static String getConnTestQuery(int i) { Properties prpos = getProps(i); String testQuery = prpos.getProperty(ConnTestQuery); if (testQuery == null) testQuery = "select 1"; return testQuery; }
70633f80-d6cc-43e7-8762-28f2a5de712c
public static Properties getProps(int i) { if (props[i] == null) { try { props[i] = loadConfigProps(i); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(); } } return props[i]; }
c94ca558-cf3d-41e9-bd1f-a4a64f97910f
public static Properties loadConfigProps(int i) { Properties p = new Properties(); try { Reader fr = new InputStreamReader(Configuration.class .getResourceAsStream(cfg_file_name[i])); p.load(fr); fr.close(); } catch (Exception e) { e.printStackTrace(); System.out.println("Can't read Configurat...
7ffce19f-b525-40b0-aa94-96a9b3c46a28
public DnaPosition(Scaffold scaffold, String strand, int begin, int end) { super(); this.scaffold = scaffold; this.dir_PLUS = strand.equals("+")?true:false; this.begin = begin; this.end = end; }
224dc969-1e11-4524-ba2d-ebb3470c3a47
public String toString(){ return "["+scaffold.toString()+"] "+dir_PLUS+" "+begin+" "+end+" "; }
40296949-fb2a-4964-97ed-66cb2dbc1076
public Locus(int locusId, int version, int cogInfoId,DnaPosition pos,Scaffold sc) { super(); this.locusId = locusId; this.version = version; this.cogInfoId = cogInfoId; this.pos = pos; this.sc = sc; }
553420ae-5608-475a-8a84-23da4f8b83ad
public Scaffold(int scaffoldId, int taxonomyId, int gi, byte isCircular, int length) { super(); this.scaffoldId = scaffoldId; this.taxonomyId = taxonomyId; this.gi = gi; this.isCircular = isCircular; this.length = length; }
39ea2c5f-d381-496b-8a7e-8b3ee1238b83
public String toString(){ return scaffoldId+" "+taxonomyId+" "+gi+" "+isCircular+" "+length; }
1a32b978-d4ed-4c55-beba-d365abfbf095
public SerializerTest() { }
508e153f-f0f5-46f2-b836-a1053a8467b6
@BeforeClass public static void setUpClass() { obj1 = new TestClass(); obj2 = new TestClassWithPrimitiveFields(); obj3 = new TestClassWithReferenceFields(); obj4 = new TestClassWithPrimitiveArrayField(); obj5 = new TestClassWithReferenceArrayField(); }
bdaa5fd8-73e3-4282-9028-aea30967d147
@AfterClass public static void tearDownClass() { }
15e3364d-8cf4-4510-9ff6-a74bad7f8c37
@Before public void setUp() { }
65e050c7-7afd-4c32-9a56-6e3ab29766ab
@After public void tearDown() { }
e3caee60-aaa9-4372-9e7d-df4dd744cb74
public TestClass(){}
49d9549c-c28b-4a95-b0f9-ecf8954e4347
public TestClassWithPrimitiveFields() { a = 6.0; b = 7; c = false; }
edec8f13-8af6-48a7-8b11-c299ddec6653
public TestClassWithReferenceFields() { p = new TestClassWithPrimitiveFields(); q = new TestClassWithPrimitiveFields(); }
03adb26e-eaa2-4fe5-9b4f-14546d677900
public TestClassWithPrimitiveArrayField() { array = new int[]{2, 4, 5}; }
c06c0941-8c87-403b-a8a5-2c27b4f2ec3d
public TestClassWithReferenceArrayField() { array = new TestClassWithPrimitiveFields[] { new TestClassWithPrimitiveFields(), new TestClassWithPrimitiveFields(), }; }
b493b5fa-f6f2-4482-8ddd-0c2a74b701e9
@Test public void testSerialize_throwsNullObjException() { Serializer instance = new Serializer(); Object obj = null; try { instance.serialize(obj); fail("Exception for null object serialization not thrown."); }...
135053ab-45e7-4fde-8c56-3ef22cb70ee2
@Test public void testSerialize_RootElem() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj1); } catch(ObjectToSerializeWasNullException e) { fail("Object to serialize w...
bd5fa6f7-b012-4a4a-86e0-be80b3b2cb58
@Test public void testSerialize_RootElemHasChildren() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj1); } catch(ObjectToSerializeWasNullException e) { fail("Object to ser...
269fc60e-525c-4a7f-a269-1d6e523ea2ff
@Test public void testSerialize_ObjectElemAttributes() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj1); } catch(ObjectToSerializeWasNullException e) { fail("Object to...
90b12e02-a134-4a3b-b4da-1927832c2d55
@Test public void testSerialize_ObjectElemPrimitiveFieldsRecognized() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj2); } catch(ObjectToSerializeWasNullException e) { ...
e298c99c-eabf-4747-b64a-889904c57b5f
@Test public void testSerialize_ObjectElemReferenceFieldsRecognized() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj3); } catch(ObjectToSerializeWasNullException e) { ...
e1a0ed1b-132f-4d3d-99b9-7021e264d260
@Test public void testSerialize_ObjectElemPrimitiveArrayFieldRecognized() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj4); } catch(ObjectToSerializeWasNullException e) { ...
0c70d670-bea5-4240-b4dc-35e55a647bec
@Test public void testSerialize_ObjectElemReferenceArrayFieldRecognized() { Serializer instance = new Serializer(); Document result = null; try { result = instance.serialize(obj5); } catch(ObjectToSerializeWasNullException e) { ...
4bddefa4-46c0-4450-96bf-cb98e8b6036a
@Test public void testSerialize_ObjectElemCollectionReferenceRecognized() { Serializer instance = new Serializer(); ArrayList<Object_PrimitiveFields> list = new ArrayList<Object_PrimitiveFields>(); list.add(new Object_PrimitiveFields(3,5,6)); list.add(new Object_PrimitiveFi...
da1957c8-347c-4338-883f-e1553d0e2cfa
public ObjectToSerializeWasNullException() { super(); }
d62af8c7-ecc5-4369-802f-3863a25d6717
public Serializer() { doc = new Document(); }
5a722c0a-4808-46d1-b7f7-de732ab8d6b9
public Document serialize(Object obj) throws ObjectToSerializeWasNullException { if(obj == null) throw new ObjectToSerializeWasNullException(); // Set root element Element rootElem = new Element("serialized"); doc.setRootElement(rootElem); serializeObject(as...
4b66f466-41c0-4c7d-9676-f84b81f7d571
public Document getDoc() { return doc; }
cd00e877-75b2-4d38-b3d0-578510b1569d
private void serializeObject(long id, Object obj) { Class classObj = obj.getClass(); // Create object element Element objElem = new Element("object"); objElem.setAttribute(new Attribute("class", classObj.getCanonicalName())); objElem.setAttribute(new Attribute("...
e37ae213-e032-4207-a603-f5e6bb18aa9f
private void serializeArray(long id, Object obj) { Class classObj = obj.getClass(); // Create object element Element objElem = new Element("object"); objElem.setAttribute(new Attribute("class", classObj.getName())); objElem.setAttribute(new Attribute("id", "" +...
ba7fbd49-009a-4e01-b544-f53ea29330a5
public long assignIdFor(Object o) { registry.put(nextId, o); return nextId++; }
ebc20f6b-b82b-453a-b2b4-0350481711bd
public Object_JavaCollectionOfReferences () { list = new ArrayList<Object_PrimitiveFields>(); }
331dfe4b-1a95-4281-8023-7125c7b5444b
public Object_JavaCollectionOfReferences (ArrayList<Object_PrimitiveFields> list) { this.list = list; }
a6b29b8f-4c98-4b5a-91d2-947f47b1722f
public void AssignFieldsThroughUserInput() { String userInput = null; System.out.println("Please select values for the fields, or Exit:"); Scanner in = new Scanner(System.in); System.out.println("list:"); int i = 0; while(i < 2) { try ...
e42bd15f-5a5a-4aaa-81a2-54c0a0f9f1a5
public Object_PrimitiveFields() {}
245efa11-4669-41d8-b136-cebaf228c2ad
public Object_PrimitiveFields(int a, int b, int c) { this.a = a; this.b = b; this.c = c; }
79e77016-743e-4897-99d8-74b9ad8ebf10
public void AssignFieldsThroughUserInput() { String userInput = null; System.out.println("Please select values for the fields, or Exit:"); Class c = this.getClass(); Field[] declaredFields = c.getDeclaredFields(); Scanner in = new Scanner(System.in); int...
ad73f6d3-57c5-496b-8584-7be141032f0b
public Server(int port) { try { serverSocket = new ServerSocket(port); serverSocket.setSoTimeout(30000); } catch (IOException e) { System.out.println("Could not open server socket"); } }
517316c4-8215-4c5d-a0dc-0cc70334e0c0
@Override public void run() { Scanner consoleIn = new Scanner(System.in); while(true) { try { System.out.println("Waiting for client on port " + serverSocket.getLocalPort() + "..."); Socket server = serverSocket.accept()...
817134a5-68da-4e6e-9b2d-dddbfe6373d4
public Object_ReferenceArray() { array = new Object_PrimitiveFields[2]; }