Skip to content
This repository was archived by the owner on Jun 6, 2022. It is now read-only.

Commit 97c55c3

Browse files
author
sprogcoder
committed
made some functions private
1 parent 4064965 commit 97c55c3

File tree

1 file changed

+24
-18
lines changed
  • java-win-memory-trainer/src/main/java/com/sprogcoder/memory

1 file changed

+24
-18
lines changed

java-win-memory-trainer/src/main/java/com/sprogcoder/memory/JTrainer.java

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public JTrainer(String windowClass, String windowText) throws WindowNotFoundExce
3939
this.pid = getProcessIdFromWindow(windowClass, windowText);
4040
}
4141

42+
/*
43+
* Internal Functions
44+
*/
4245
private HWND findWindow(String lpClassName, String lpWindowName) throws WindowNotFoundException
4346
{
4447
HWND hWnd = JUser32.findWindow(lpClassName, lpWindowName);
@@ -51,33 +54,17 @@ private HWND findWindow(String lpClassName, String lpWindowName) throws WindowNo
5154
return hWnd;
5255
}
5356

54-
public String getLastError()
55-
{
56-
return JKernel32.getLastError();
57-
}
58-
5957
private int getProcessIdFromWindow(String lpClassName, String lpWindowName) throws WindowNotFoundException
6058
{
6159
return getWindowTheadProcessId(findWindow(windowClass, windowText));
6260
}
6361

64-
public int getWindowTheadProcessId(HWND hWnd)
62+
private int getWindowTheadProcessId(HWND hWnd)
6563
{
6664
return JUser32.getWindowThreadProcessId(hWnd);
6765
}
68-
69-
public boolean isProcessAvailable()
70-
{
71-
int hProcess = JKernel32.openProcess(pid);
72-
return (hProcess > 0);
73-
}
74-
75-
public void retryProcess() throws WindowNotFoundException
76-
{
77-
this.pid = getProcessIdFromWindow(windowClass, windowText);
78-
}
7966

80-
public int openProcess(int dwProcessId) throws MemoryException
67+
private int openProcess(int dwProcessId) throws MemoryException
8168
{
8269
int hProcess = JKernel32.openProcess(pid);
8370

@@ -88,7 +75,26 @@ public int openProcess(int dwProcessId) throws MemoryException
8875

8976
return hProcess;
9077
}
78+
79+
/*
80+
* External Functions
81+
*/
82+
public String getLastError()
83+
{
84+
return JKernel32.getLastError();
85+
}
9186

87+
public boolean isProcessAvailable()
88+
{
89+
int hProcess = JKernel32.openProcess(pid);
90+
return (hProcess > 0);
91+
}
92+
93+
public void retryProcess() throws WindowNotFoundException
94+
{
95+
this.pid = getProcessIdFromWindow(windowClass, windowText);
96+
}
97+
9298
public byte[] readProcessMemory(int lpBaseAddress, int nSize) throws MemoryException
9399
{
94100
int hProcess = openProcess(pid);

0 commit comments

Comments
 (0)