-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimization improvements
- Loading branch information
Showing
4 changed files
with
278 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import java.util.ArrayList; | ||
|
||
import org.bitcoinj.core.Address; | ||
|
||
public class AddressGroup { | ||
|
||
ArrayList<Address> addressList; | ||
Address[] addressArray; | ||
|
||
boolean isFinalized = false; //Has the arraylist been coverted to an array | ||
|
||
|
||
public AddressGroup() { | ||
addressList = new ArrayList<Address>(); | ||
} | ||
|
||
public void addAddressArray(Address[] thisArray) { | ||
for (int i=0; i < thisArray.length; i++) { | ||
addressList.add(thisArray[i]); | ||
} | ||
} | ||
|
||
public void addAddress(Address thisAddress) { | ||
addressList.add(thisAddress); | ||
} | ||
|
||
public Address[] getAddressArray() { | ||
return addressArray; | ||
} | ||
|
||
public void finalizeGroup() { | ||
|
||
addressArray = new Address[addressList.size()]; | ||
|
||
for (int i = 0; i < addressList.size(); i++) | ||
addressArray[i] = addressList.get(i); | ||
|
||
addressList = null; | ||
|
||
isFinalized = true; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.