public HashNode(DevicePathNode devicePathNode, string hashString, string hashedAtTimeStamp) : this("Hashes/" + hashString) { this.devicePathNode = devicePathNode; this.hashString = hashString; this.hashedAtTimeStamp = hashedAtTimeStamp; }
public void Add(DevicePathNode nd) { mDevicePathNodes.AddIdempotent(nd); }
public TagNode(DevicePathNode devicePathNode, string tagValue) { mTag = tagValue; Add(devicePathNode); }
private static void PopulateTags(DevicePathNode fmi) { //add a random number of existing tags int numberOfExistingToAdd = GetRandomIndex(3); for (int i = 0; i < numberOfExistingToAdd; i++) { if (mTags.Count > 0) { int idx = GetRandomIndex(mTags.Count); fmi.Add(mTags[idx]); } } //generate a random number of new tags to add to shared list int numberOfNewSharedToAdd = GetRandomIndex(4); for (int i = 0; i < numberOfNewSharedToAdd; i++) { String testTag; if (i % 2 == 0) { testTag = getRandomAdjective() + " " + getRandomNoun(); } else { testTag = getRandomNoun(); } TagNode tmi = new TagNode(fmi, testTag); fmi.Add(tmi); mTags.Add(tmi); } //generate a random number of new tags to keep seperate int numberOfNewPrivateToAdd = GetRandomIndex(3); for (int i = 0; i < numberOfNewPrivateToAdd; i++) { String testTag; if (i % 2 == 0) { testTag = getRandomAdjective() + " " + getRandomNoun(); } else { testTag = getRandomNoun(); } TagNode tmi = new TagNode(fmi, testTag); fmi.Add(tmi); } }
private static void PopulateHashes(DevicePathNode fmi) { int numberOfExistingToAdd = GetRandomIndex(2); for (int i = 0; i < numberOfExistingToAdd; i++) { if (mHashes.Count > 0) { int idx = GetRandomIndex(mHashes.Count); fmi.Add(mHashes[idx]); } } //generate a random number of new hashes to add to shared list int numberOfNewSharedToAdd = GetRandomIndex(2); for (int i = 0; i < numberOfNewSharedToAdd; i++) { HashNode hmi = getRandomHashModelItem(fmi); fmi.Add(hmi); mHashes.Add(hmi); } //generate a random number of new hashes to keep seperate int numberOfNewPrivateToAdd = GetRandomIndex(2); for (int i = 0; i < numberOfNewPrivateToAdd; i++) { HashNode hmi = getRandomHashModelItem(fmi); fmi.Add(hmi); } }
private static void PopulateFiles() { int numberToAdd = GetRandomIndex(51); for (int i = 0; i < numberToAdd; i++) { String deviceDesc = WordUtils.CapitalizeFully(getRandomAdjective()) + " " + WordUtils.CapitalizeFully(getRandomNoun()); //String path = // "/NWD/" + getRandomNoun() + "/" + getRandomNoun() + ".test"; string path; if(i % 3 == 0) { path = MockAudioUri(); } else if(i % 2 == 0) { path = MockImageUri(); } else { path = MockTextUri(); } DevicePathNode fmi = new DevicePathNode(deviceDesc, path); PopulateTags(fmi); PopulateHashes(fmi); mDevicePaths.Add(fmi); } }
private static HashNode getRandomHashModelItem(DevicePathNode fmi) { return new HashNode(fmi, getRandomSha1HashString(), getRandomTimeStamp()); }