query
stringlengths 7
33.1k
| document
stringlengths 7
335k
| metadata
dict | negatives
sequencelengths 3
101
| negative_scores
sequencelengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Adds to the List by treating List as a Set. Thus adds only if not already exists in the List and avoids duplication. See appendToFollowedUsers to append to List. | public void addToFollowedUsers(List<String> followedUsers); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addToFollowedUsers(String followedUsers);",
"public void appendToFollowedUsers(List<String> followedUsers);",
"private void addUsers(List<String> userList, SubscriptionList subscriptionList, SubscriptionEventType eventType) {\n\t\tSubscription subscription = null;\n\t\t\n\t\tfor (Subscription s : subscriptionList.getSubscription()) {\n\t\t\tif (s.getEventType() == eventType) {\n\t\t\t\tsubscription = s;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (subscription != null) {\n\t\t\tfor (String userId : subscription.getUser()) {\n\t\t\t\tif (!userList.contains( userId )) {\n\t\t\t\t\tuserList.add( userId );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void addFollower(Follower follower) {\n follower_list.add(follower);\n }",
"public void addFriendList(FriendList list);",
"public void addFollowings(String following) {\n\tuserFollowings.add(following);\n }",
"@Override\n\t\tpublic void onUserListMemberAddition(User arg0, User arg1, UserList arg2) {\n\t\t\t\n\t\t}",
"@Override\n\tpublic void onUserListMemberAddition(User addedMember, User listOwner, UserList list) {\n\n\t}",
"private void addFriendList(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureFriendListIsMutable();\n friendList_.add(value);\n }",
"public boolean addUsers(List<User> users);",
"public static <T> void addWithoutDuplicates(List<T> addedTo, T toBeAdded) {\n if (!addedTo.contains(toBeAdded))\n addedTo.add(toBeAdded);\n }",
"public void addFollowers(String follower) {\n\tuserFollowers.add(follower);\n }",
"public void addUser(ArrayList<Player> list,String U,String F,String G) {\r\n\t\tboolean flag = true;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile (aa.hasNext()) {\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tif(in.getUserName().equals(U)){\r\n\t\t\t\tSystem.out.println(\"The player already exists.\");\r\n\t\t\t\tflag =false;\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\tif(flag)\r\n\t\t\tlist.add(new NimPlayer(U,F,G,0,0,\"Human\"));\r\n\t\tSystem.out.println(\"\");\r\n\t}",
"public static <T> void addWithoutDuplicates(List<T> addedTo, List<T> toBeAdded) {\n if (addedTo == null | toBeAdded == null)\n return;\n outer:\n for (int i = 0; i < toBeAdded.size(); i++) {\n T item = toBeAdded.get(i);\n for (int j = 0; j < addedTo.size(); j++) {\n if (addedTo.get(j).equals(item))\n continue outer;\n }\n addedTo.add(item);\n }\n }",
"synchronized void crawledList_add(HashSet _crawledList, String url)\n {\n _crawledList.add(url);\n System.out.println(\"Added\"+\"\\t\"+url);\n }",
"public void addFollower(String follower, String following) {\n for (User u : users) {\n System.out.println(\"iterating: \" + u.getName() + \" : \" + following);\n if (u.getName().equals(follower)) {\n for (String f : u.getFollowers()) {\n\n if (f.equals(following)) {\n System.out.println(\"ENDDDDD\");\n return;\n }\n }\n System.out.println(\"adding follower!!!!!!!!\");\n getUser(follower).addFollower(following);\n }\n }\n }",
"private void updateMemberList(Set<ChatRoomUser> chatRoomUserSet,\n boolean removeMember)\n {\n Iterator<ChatRoomUser> it = chatRoomUserSet.iterator();\n\n while (it.hasNext())\n {\n ChatRoomUser user = it.next();\n String uid = user.getScreenname().getFormatted();\n\n // we want to add a member and he/she is not in our member list\n if (!removeMember && !participants.containsKey(uid)\n && !uid.equals(provider.getAccountID().getUserID()))\n {\n OperationSetPersistentPresenceIcqImpl presenceOpSet =\n (OperationSetPersistentPresenceIcqImpl) getParentProvider()\n .getOperationSet(OperationSetPersistentPresence.class);\n\n Contact participant =\n presenceOpSet.getServerStoredContactList()\n .findContactByScreenName(uid);\n\n participants.put(uid, participant);\n\n fireParticipantPresenceEvent(participant,\n AdHocChatRoomParticipantPresenceChangeEvent.CONTACT_JOINED,\n null);\n }\n // we want to remove a member and found him/her in our member list\n if (removeMember && participants.containsKey(uid))\n {\n Contact participant = participants.get(uid);\n\n participants.remove(uid);\n\n fireParticipantPresenceEvent(participant,\n AdHocChatRoomParticipantPresenceChangeEvent.CONTACT_LEFT,\n null);\n }\n }\n }",
"public void setFollowing(ArrayList<Following> followings) {\n following_list = followings;\n }",
"public void follow(int followerId, int followeeId) {\n if (followeeId != followerId) {\n Set<Integer> friendSet = friends.computeIfAbsent(followerId, e -> new HashSet<>());\n friendSet.add(followeeId);\n }\n }",
"public void follow(int followerId, int followeeId) {\n if(!users.containsKey(followerId) && followerId != followeeId){ // If user is not in database\n HashSet<Integer> u_id = new HashSet<>();\n users.put(followerId, u_id);\n }\n users.get(followerId).add(followeeId); // Add the user and the followee to the hashmap\n }",
"private void addWithoutDuplicate(ArrayList<WordDocument> addTo, ArrayList<WordDocument> addFrom) {\n for (WordDocument x : addFrom)\n if (!addTo.contains(x))\n addTo.add(x);\n }",
"@Test\n public void testSetUsersList() {\n System.out.println(\"setUsersList\");\n Set<User> usersList = new HashSet<>();\n usersList.add(new User(\"test1\", \"[email protected]\"));\n sn10.setUsersList(usersList);\n assertEquals(usersList, sn10.getUsersList());\n }",
"@Override\n\tpublic void addEntry(E entry) {\n\n\t\t// Determine if the entry already exists in the list\n\t\tE current = this.getHead();\n\t\twhile (current != null) {\n\t\t\tif (this.isEqual(current, entry)) {\n\t\t\t\t// Already in list\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\n\t\t// Not in list, so add the entry\n\t\tsuper.addEntry(entry);\n\t}",
"@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n FollowingList followingList = (FollowingList) o;\n if (followingList.getId() == null || getId() == null) {\n return false;\n }\n return Objects.equals(getId(), followingList.getId());\n }",
"public void removeFromFollowedUsers(List<String> followedUsers);",
"public boolean add(List<T> e) {\n\t\treturn lists.add(e);\n\t}",
"private void addAllFriendList(\n Iterable<? extends People> values) {\n ensureFriendListIsMutable();\n com.google.protobuf.AbstractMessageLite.addAll(\n values, friendList_);\n }",
"@Override\n\tpublic void onUserListCreation(User listOwner, UserList list) {\n\n\t}",
"@Override\n\tpublic void onUserListUpdate(User listOwner, UserList list) {\n\n\t}",
"@SuppressWarnings(\"unchecked\")\n public static void addIfNotContained(List list, Object object) {\n if (!list.contains(object)) {\n list.add(object);\n }\n }",
"public void follow(int followerId, int followeeId) {\n if (!followMap.containsKey(followerId)) followMap.put(followerId, new HashSet<Integer>());\n followMap.get(followerId).add(followeeId);\n }",
"@Override\n\t\tpublic void onUserListCreation(User arg0, UserList arg1) {\n\t\t\t\n\t\t}",
"@Override\n public boolean add(List<Buyer> buyers) {\n return false;\n }",
"private static void removeExistingFromResults(List<Author> resultList, List<String> existingList) {\n\n // Check that existingList is not null\n if (existingList == null) return;\n\n // Remove items from resultList that are already in the user's friend/follow list\n for (String userId : existingList) {\n for (int i = resultList.size() - 1; i >= 0; i--) {\n Author user = resultList.get(i);\n\n if (user.firebaseId.equals(userId)) {\n resultList.remove(user);\n break;\n }\n }\n }\n }",
"synchronized void toCrawlList_addAll(LinkedHashSet _toCrawlList, ArrayList _links)\n {\n _toCrawlList.addAll(_links);\n }",
"public void insertUserListFromStatusList(List<Status> statusList) {\n\t\tIterator<Status> it = statusList.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tStatus st = it.next();\n\t\t\tUser user = st.getUser();\n\t\t\tInsertUser(user);\n\t\t}\n\t}",
"@Override\n public void appendCache(List<FavoriteEntity> ltEntity)\n {\n for (FavoriteEntity entity : ltEntity)\n {\n addWithCheckExistID(entity);\n }\n }",
"public void follow(final int followerId, final int followeeId) {\n follows.computeIfAbsent(followerId, x -> new HashSet<>()).add(followeeId);\n }",
"@Test\n public void testAddUser_User04() {\n System.out.println(\"addUser\");\n\n User user = new User(\"test\", \"[email protected]\");\n\n Set<User> expResult = new HashSet<>();\n expResult.add(new User(\"nick0\", \"[email protected]\"));\n expResult.add(new User(\"nick1\", \"[email protected]\"));\n expResult.add(new User(\"nick2\", \"[email protected]\"));\n expResult.add(new User(\"nick3\", \"[email protected]\"));\n expResult.add(new User(\"nick4\", \"[email protected]\"));\n expResult.add(new User(\"nick5\", \"[email protected]\"));\n expResult.add(new User(\"nick6\", \"[email protected]\"));\n expResult.add(new User(\"nick7\", \"[email protected]\"));\n expResult.add(new User(\"nick8\", \"[email protected]\"));\n expResult.add(new User(\"nick9\", \"[email protected]\"));\n expResult.add(user);\n\n sn10.addUser(user);\n Set<User> result = sn10.getUsersList();\n assertEquals(expResult, result);\n }",
"public void addFriend() {\n\n /* if (ageOK == true) {\n for (int i = 0; i < listRelationships.size(); i++) {\n if (firstFriend.equalsIgnoreCase(list.get(i).getFirstFriend())) {\n listRelationships.get(i).setFriends(secondFriend);\n System.out.println(listRelationships.get(i));\n System.out.println();\n\n } else if (secondFriend.equalsIgnoreCase(list.get(i).getSecondFriend())) {\n listRelationships.get(i).setFriends(firstFriend);\n System.out.println(listRelationships.get(i));\n System.out.println();\n }\n }\n } */\n }",
"public void appendToFollowedUsers(String followedUsers);",
"@Override\n\t\tpublic void onUserListUpdate(User arg0, UserList arg1) {\n\t\t\t\n\t\t}",
"public void follow(int followerId, int followeeId) {\n if (!followees.containsKey(followerId)) {\n followees.put(followerId, new HashSet<>());\n followees.get(followerId).add(followerId);\n }\n followees.get(followerId).add(followeeId);\n }",
"@Override\n public boolean equals(Object object) {\n if (!(object instanceof Followup)) {\n return false;\n }\n Followup other = (Followup) object;\n if ((this.idfollowup == null && other.idfollowup != null) || (this.idfollowup != null && !this.idfollowup.equals(other.idfollowup))) {\n return false;\n }\n return true;\n }",
"public void addParticipant(String uid) {\n\r\n if (!participants.contains(uid))\r\n participants.add(uid);\r\n }",
"@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tsuper.onActivityResult(requestCode, resultCode, data);\n\t\tif(resultCode==2){\n\t\t\tHashMap<String, Object> map=new HashMap<String, Object>();\n\t\t\tmap.put(\"id\",data.getLongExtra(\"id\", -1));\n\t\t\tmap.put(\"members\", RecordUtil.shareRecordUtil(this).idToName(data.getStringExtra(\"ids\")));\n\t\t\tlist.addFirst(map);\n\t\t\tadapter.notifyDataSetChanged();\n\t\t}\n\t}",
"@Override\n public boolean hasDuplicates() {\n ArrayList<String> itemList = new ArrayList(Arrays.asList(\"\"));\n Node currNode = this.head;\n while(true){\n if(itemList.contains(currNode.getItem())){ // need to edit\n return true;\n }else{\n itemList.add(currNode.getItem());\n }\n if(currNode.getNextNode() == null){\n break;\n }\n currNode = currNode.getNextNode();\n }\n return false;\n }",
"public static void main(String[] args) {\n\n Integer[] integers = new Integer[] {1,2,3,4,5};\n List<Integer>list = new ArrayList<>(Arrays.asList(integers)); // correct one\n System.out.println(\"Converted from Array to List = \" + list);\n\n // this will be a fixed-size list- you can not use add method.\n List<Integer>fixedSizeList = Arrays.asList(integers); // bunu da yapabiliriz ama element ekleme yapamayiz.\n //fixedSizeList.add(6); bunda hata verecek. cunku fixedsize olarak convert ettik. \"unsupported operation exception\" uyarisi verir\n\n\n //Converting list to Array\n Integer[] convertedFromList =list.toArray(new Integer[0]); // sifir yerine herhangi bi sey yazilabilir. ama 0 yazmada fayda var.\n System.out.println(\"Converted from List to Array = \"+ Arrays.toString(convertedFromList));\n\n //Converting an Array to set\n Set<Integer>set = new HashSet<>(Arrays.asList(integers));\n System.out.println(\"Converted from Array to Set = \" + set);\n\n // Converting Set to Array\n Integer[] convertedFromSet = set.toArray(new Integer[0]);\n System.out.println(\"Converted from Set to Array = \" + Arrays.toString(convertedFromSet));\n\n // converting List to Set\n Set<Integer>setFromList = new HashSet<>(list); // bu en cok , ayni value varsa isimize yarar. cunku set'de duplicate yok\n System.out.println(\"Converted list to Set = \" + setFromList);\n\n // Converting Set to List\n List<Integer>listFromSet = new ArrayList<>(setFromList);\n listFromSet.add(9); // en sona ekler\n System.out.println(\"Converted Set to List = \" + listFromSet);\n\n }",
"public void follow(int followerId, int followeeId) {\n\t\t//\n\t\tif (!followees.containsKey(followerId)) {\n\t\t\tfollowees.put(followerId, new HashSet<>());\n\t\t}\n\t\tfollowees.get(followerId).add(followeeId);\n\t}",
"public ArrayList<Follower> getFollower_list(){\n return follower_list;\n }",
"set.addAll(Arrays.asList(a));",
"@Override\n public boolean add(Set<E> e) {\n throw new UnsupportedOperationException(\"Add not supported\");\n }",
"public UserDTOBuilder setFollowers(List<UserDTO> followers) {\n this.followers = followers;\n return this;\n }",
"public void addAll(List<Tweet> list) {\n tweetList.addAll(list);\n notifyDataSetChanged();\n }",
"public void addAll(List<Tweet> list) {\n mTweets.addAll(list);\n notifyDataSetChanged();\n }",
"public void addAll(List<Tweet> list) {\n mTweets.addAll(list);\n notifyDataSetChanged();\n }",
"public void add(User user) {\r\n this.UserList.add(user);\r\n }",
"public static void addList() {\n\t}",
"public static void addFriendsList(String username, FriendsList friends)\r\n\t{\r\n\t\tfriendsLists.put(username, friends);\r\n\t}",
"@Override\n public void add(User member) {\n super.add(member);\n members.add(member);\n }",
"public void follow(int followerId, int followeeId) {\n if (followeeId == followerId) {\n return;\n }\n if (!userId2Followers.containsKey(followeeId)) {\n userId2Followers.put(followeeId, new HashSet<>());\n }\n userId2Followers.get(followeeId).add(followerId);\n\n if (!userId2Followees.containsKey(followerId)) {\n userId2Followees.put(followerId, new HashSet<>());\n }\n\n // 自己关注的人,如果不包含当前操作的用户,就添加到set中,并且修改tweet\n if (!userId2Followees.get(followerId).contains(followeeId)) {\n userId2Followees.get(followerId).add(followeeId);\n if (userId2AllTweets.containsKey(followeeId)) {\n List<Tweet> followeeTweets = userId2AllTweets.get(followeeId);\n for (Tweet followeeTweet : followeeTweets) {\n putFollowerTweet(followerId, followeeTweet);\n }\n }\n }\n }",
"public void addAll(List<NYT> tweetList) {\n nyts.addAll(tweetList);\n notifyDataSetChanged();\n }",
"public List<Person> addPeople(List<Person> personList) {\t\t\n\t\tList<Person> ret = new ArrayList<>();\n\t\t\n\t\tPerson temp = null;\t\t\n\t\tfor(Person p : personList) {\n\t\t\tif(pRepo.existsByPersonLOD(p.getPersonLOD())) {\n\t\t\t\ttemp = pRepo.findByPersonLOD(p.getPersonLOD());\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Enforces default gender\n\t\t\t\tif(p.getGender() == null) {\n\t\t\t\t\tp.setGender('U');\n\t\t\t\t}\n\t\t\t\ttemp = pRepo.save(p);\n\t\t\t}\n\t\t\t//We just want to know if it is in the database\n\t\t\tret.add(temp);\n\t\t}\n\t\t\n\t\treturn ret;\n\t}",
"public void addAI(ArrayList<Player> list,String U,String F,String G) {\r\n\t\tboolean flag = true;\r\n\t\tIterator<Player> aa = list.iterator();\r\n\t\twhile (aa.hasNext()) {\r\n\t\t\tPlayer in = aa.next();\r\n\t\t\tif(in.getUserName().equals(U)){\r\n\t\t\t\tSystem.out.println(\"The player already exists.\");\r\n\t\t\t\tflag =false;\r\n\t\t\t\treturn;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tif(flag)\r\n\t\t\tlist.add(new NimAIPlayer(U,F,G,0,0,\"AI\"));\r\n\t\tSystem.out.println(\"\");\r\n\t}",
"void saveRealtimeListUsers(final RealtimeList realtimeList) {\n deleteRealtimeListUsers(realtimeList.getId());\n\n // Add in all of the entries.\n ejt.batchUpdate(\"insert into realtime_list_users values (?,?,?)\", new BatchPreparedStatementSetter() {\n @Override\n public int getBatchSize() {\n return realtimeList.getRealtimeListUsers().size();\n }\n\n @Override\n public void setValues(PreparedStatement ps, int i) throws SQLException {\n ShareUser wlu = realtimeList.getRealtimeListUsers().get(i);\n ps.setInt(1, realtimeList.getId());\n ps.setInt(2, wlu.getUserId());\n ps.setInt(3, wlu.getAccessType());\n }\n });\n }",
"public void m65918a(List<SearchTrack> list) {\n SpotifyTrackSearchTarget spotifyTrackSearchTarget = (SpotifyTrackSearchTarget) this.f56358a.H();\n if (spotifyTrackSearchTarget != null) {\n this.f56358a.f56363e = true;\n spotifyTrackSearchTarget.addTracks(list);\n this.f56358a.f56361c = this.f56358a.f56361c + 1;\n }\n }",
"public void m65917a(List<SearchTrack> list) {\n SpotifyTrackSearchTarget spotifyTrackSearchTarget = (SpotifyTrackSearchTarget) this.f56357a.H();\n if (spotifyTrackSearchTarget != null) {\n spotifyTrackSearchTarget.addTracks(list);\n }\n }",
"public void setUserList(CopyOnWriteArrayList<User> userList) {\r\n\t\tBootstrap.userList = userList;\r\n\t}",
"List<User> addUsersToShowableList(UserListRequest userListRequest);",
"@Test\n public void testAddUser_Nickname_Email04() {\n System.out.println(\"addUser\");\n String nickname = \"test1\";\n String email = \"[email protected]\";\n\n Set<User> expResult = new HashSet<>();\n expResult.add(new User(\"nick0\", \"[email protected]\"));\n expResult.add(new User(\"nick1\", \"[email protected]\"));\n expResult.add(new User(\"nick2\", \"[email protected]\"));\n expResult.add(new User(\"nick3\", \"[email protected]\"));\n expResult.add(new User(\"nick4\", \"[email protected]\"));\n expResult.add(new User(\"nick5\", \"[email protected]\"));\n expResult.add(new User(\"nick6\", \"[email protected]\"));\n expResult.add(new User(\"nick7\", \"[email protected]\"));\n expResult.add(new User(\"nick8\", \"[email protected]\"));\n expResult.add(new User(\"nick9\", \"[email protected]\"));\n expResult.add(new User(nickname, email));\n\n sn10.addUser(nickname, email);\n Set<User> result = sn10.getUsersList();\n assertEquals(expResult, result);\n }",
"public void addAll(List<Tweet> tweetList) {\n tweets.addAll(tweetList);\n notifyDataSetChanged();\n }",
"public void add(E elem) {\n if (!list.contains(elem))\n list.insertLast(elem);\n }",
"public ContributorTrackingSet(NavigatorContentService aContentService, Object[] elements) {\n for (int i = 0; i < elements.length; i++) super.add(elements[i]);\n contentService = aContentService;\n }",
"private void addFriendList(\n int index, People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureFriendListIsMutable();\n friendList_.add(index, value);\n }",
"public void follow(int followerId, int followeeId) {\n\t\t\tif (!userRelation.containsKey(followerId))\n\t\t\t\tuserRelation.put(followerId, new HashSet<>());\n\t\t\tuserRelation.get(followerId).add(followeeId);\n\t\t}",
"private static final <T> List<T> append(List<T> list, T newElement) {\n List<T> newList = Lists.newArrayListWithCapacity(list.size() + 1);\n newList.addAll(list);\n newList.add(newElement);\n return newList;\n }",
"@Override\n\tpublic boolean doInsertList(List<SysUser> b) throws Exception {\n\t\treturn false;\n\t}",
"public void follow(int followerId, int followeeId) {\n if (followerId == followeeId) return;\n User follower = getOrCreateUser(followerId);\n User followee = getOrCreateUser(followeeId);\n\n if (!follower.following.contains(followee))\n follower.following.add(followee);\n }",
"protected abstract Set<String> _addToSet(String key, Collection<String> str);",
"public synchronized static void toCrawlList_add(ArrayList<String> _toCrawlList,String url)\n\t{\n\n\t\tif(!(arrayList_contain(_toCrawlList,url)) && _toCrawlList.size() < ARRAYLIST_SIZE)\n\t\t\t_toCrawlList.add(url);\n\t}",
"public static <T> List<T> mergeWith(final List<T> extendee, final List<T> list2) {\n for (final T obj : list2) {\n if (!(extendee.contains(obj))) {\n extendee.add(obj);\n }\n }\n return extendee;\n }",
"@Override\r\n\tpublic void insert(FollowUp followup) {\n\t\t\r\n\t}",
"public void add(Preference toAdd) throws DuplicatePreferenceException {\n requireNonNull(toAdd);\n if (contains(toAdd)) {\n throw new DuplicatePreferenceException();\n }\n internalList.add(toAdd);\n\n assert CollectionUtil.elementsAreUnique(internalList);\n }",
"public final void mo69782a(List<SuggestUser> list) {\n Collection collection = list;\n if (!C6307b.m19566a(collection)) {\n StringBuilder sb = new StringBuilder();\n if (list == null) {\n C7573i.m23580a();\n }\n int size = collection.size();\n for (int i = 0; i < size; i++) {\n User user = ((SuggestUser) list.get(i)).user;\n if (user != null) {\n sb.append(user.getUid());\n if (i < list.size() - 1) {\n sb.append(\",\");\n }\n }\n }\n C6907h.m21524a(\"search_for_you_show\", (Map) C22984d.m75611a().mo59973a(\"search_type\", mo69547a()).mo59973a(\"user_list\", sb.toString()).f60753a);\n }\n }",
"private static void addSongsToPlaylists(List<Playlist> playlists, List<AddSong> songsToAdd)\n {\n for(AddSong songToAdd : songsToAdd)\n {\n Playlist playlist = playlists.stream().filter(pl -> songToAdd.getPlaylistId().equals(pl.getId())).findAny().orElse(null);\n if(playlist != null)\n {\n List<String> songs = playlist.getSongIds();\n songs.add(songToAdd.getSongId());\n }\n }\n }",
"public Builder addFriendList(People value) {\n copyOnWrite();\n instance.addFriendList(value);\n return this;\n }",
"public void add(int number) {\n for(int num : list) set.add(num + number);\n list.add(number);\n }",
"void addList(ShoppingList _ShoppingList);",
"private void addFriendList(\n People.Builder builderForValue) {\n ensureFriendListIsMutable();\n friendList_.add(builderForValue.build());\n }",
"private void addAll(User[] users) {\n synchronized (this.base) {\n Stream.of(users).forEach(this::add);\n }\n }",
"public void add(List list) throws PropException {\n if (!contains(list.obtainTitle())) lists.put(list.obtainTitle(), list);\n else throw new PropException(ErrorString.EXISTING_LIST);\n }",
"public void updateList(ArrayList<String> users) {\n System.out.println(\"Updating the list...\");\n listModel.removeAllElements();\n userArrayList = users;\n int index = userArrayList.indexOf(user);\n if(index >= 0) {\n \tuserArrayList.remove(index);\n }\n for(int i=0; i<userArrayList.size(); i++){\n\t\t System.out.println(\"Adding to GUI List: \" + userArrayList.get(i));\n\t\t listModel.addElement(userArrayList.get(i));\n }\n userList.repaint();\n \n if(listModel.size() == 0) {\n \tJOptionPane.showMessageDialog(null,\"There are no other members registered on the server.\");\n\t \tfrmMain.dispatchEvent(new WindowEvent(frmMain, WindowEvent.WINDOW_CLOSING));\n }\n }",
"public void add(List<?> list) {\n list.clear();\n pool.offer(list);\n }",
"public void add(ContentValues values) {\n long startTime = values.getAsLong(DB.FEED.START_TIME);\n long endTime = startTime;\n if (values.containsKey(DB.FEED.DURATION))\n endTime = startTime + values.getAsLong(DB.FEED.DURATION);\n\n int endIndex = findEndIndex(startTime - TIME_MARGIN);\n int startIndex = findStartIndex(endIndex, endTime + TIME_MARGIN);\n\n for (int i = startIndex; i <= endIndex; i++) {\n ContentValues c = currList.get(i);\n if (match(values, c, filterDuplicates)) {\n // Set already contains matching row...skip this\n discarded++;\n return;\n }\n }\n added++;\n addList.add(values); // no match, add this row\n mDB.insert(DB.FEED.TABLE, null, values);\n }",
"public Set<User> sort(List<User> list) {\n TreeSet result = new TreeSet();\n result.addAll(list);\n\n return result;\n }",
"public void addItem(Object item) throws SetException {\n\t\tif (member(item))\n\t\t\tthrow new SetException(\"Item already in set.\");\n\n\t\tlist.add(item);\n\t}",
"public boolean add (Object o) {return addLast(o);}",
"@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof Follower)) {\n return false;\n }\n return id != null && id.equals(((Follower) o).id);\n }",
"public void addAll(List<Activities> list) {\r\n mActivityList.addAll(list);\r\n notifyDataSetChanged();\r\n }",
"@Transactional(propagation = Propagation.REQUIRED)\n\tpublic int addFollowChannels(List<Follow_channels> follow_channels) {\n\t\treturn followChannelsDAO.addFollowChannels(follow_channels);\n\t}"
] | [
"0.6288698",
"0.6103035",
"0.59049034",
"0.58590764",
"0.58510005",
"0.58459604",
"0.5731297",
"0.57069993",
"0.56788397",
"0.56443924",
"0.56068265",
"0.5560373",
"0.55530953",
"0.5527138",
"0.550113",
"0.5498334",
"0.54456526",
"0.54409313",
"0.54259574",
"0.54085934",
"0.53693175",
"0.53445756",
"0.53336954",
"0.53216964",
"0.52841514",
"0.5283642",
"0.5262764",
"0.5252369",
"0.525051",
"0.5232135",
"0.52301466",
"0.51984495",
"0.5192684",
"0.5188922",
"0.5176038",
"0.5173311",
"0.5156856",
"0.5148707",
"0.5127467",
"0.5126004",
"0.5124976",
"0.51207745",
"0.511597",
"0.51096183",
"0.51004463",
"0.50942045",
"0.50718653",
"0.5047999",
"0.5046264",
"0.5039673",
"0.50280935",
"0.50079376",
"0.4998028",
"0.49978495",
"0.49872625",
"0.49872625",
"0.49815547",
"0.49775898",
"0.49760532",
"0.49732232",
"0.49678853",
"0.49674034",
"0.49584082",
"0.4957733",
"0.4952817",
"0.4945469",
"0.49449185",
"0.49397147",
"0.49226943",
"0.4919503",
"0.49172843",
"0.4915917",
"0.48987108",
"0.48964122",
"0.48921037",
"0.48901418",
"0.48874074",
"0.48874062",
"0.48864055",
"0.48831534",
"0.4873561",
"0.4863651",
"0.4860988",
"0.4860945",
"0.48600274",
"0.48543385",
"0.48527727",
"0.48409063",
"0.48259398",
"0.48252296",
"0.4816215",
"0.4813451",
"0.4811991",
"0.48102158",
"0.48007208",
"0.47944573",
"0.47941956",
"0.4793827",
"0.47931594",
"0.4792166"
] | 0.7035341 | 0 |
Removes all occurences of value from the List | public void removeFromFollowedUsers(String followedUsers); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeAllWithValue(v val) {\n\t\tfor (int i = 0; i < buckets.length; i++) {\n\t\t\tNode<k,v> curr = buckets[i];\n\t\t\tNode<k,v> previous = null;\n\t\t\t\n\t\t\twhile (curr != null) {\n\t\t\t\tif (curr.getValue().equals(val)) {\n\t\t\t\t\t\n\t\t\t\t\tif (previous == null) {\n\t\t\t\t\t\tbuckets[i] = curr.getNext(); // if removing first item, set the next as first\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprevious.setNext(curr.getNext()); // else set the previous' next to curr's next\n\t\t\t\t\t}\t\n\t\t\t\t} else {\t\t\t\t\t\t\t// if match wasn't found, set previous to current before moving on\n\t\t\t\t\tprevious = curr;\n\t\t\t\t}\t\n\t\t\t\tcurr = curr.getNext(); \t\t\t\t// move in SLL\n\t\t\t}\t\n\t\t}\n\t}",
"public void removeValue(Object value)\n\t{\n\t\tif (values.contains(value))\n\t\t{\n\t\t\tvalues.remove(value + \"\");\n\t\t}\n\t}",
"void remove(int v){\n if(isEmpty()!=1){\n for(int i=0;i<size;i++){\n if(values[i]==v){\n int j = i;\n while((j+1)!=size){\n values[j] = values[j+1];\n j++;\n\n }\n values[j] = (-1);\n break;\n }\n }\n }\n }",
"@Override\n public void removeAllValues() {\n Map<String, ?> map = preferences.getAll();\n Iterator<String> iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n removeValue(iterator.next());\n }\n }",
"@Override\n public boolean removeByValue(int value) {\n Entry tmp = first;\n for (int i = 0; i < size; i++) {\n if (tmp.value == value) {\n tmp.previous.next = tmp.next;\n tmp.next.previous = tmp.previous;\n size--;\n return true;\n }\n tmp = tmp.next;\n }\n return false;\n }",
"private void removePressed() {\n\t\ts = allMedia.getSelectedValuesList();\n\t\t// now remove all the value that are in the list from the default list model\n\t\tfor(Object o : s){\n\t\t\tif(l.contains(o)){\n\t\t\t\tl.removeElement(o);\n\t\t\t}\n\t\t}\n\t}",
"public void removeDuplication() {\r\n\t\t//checks if the array contains any elements\r\n\t\tif (!isEmpty()) {\t//contains elements\r\n\t\t\t//loop to execute for every element in the array\r\n\t\t\tfor (int i=0;i<size-1;i++) {\r\n\t\t\t\tObject element=list[i];\t//to store value of element in array\r\n\t\t\t\t//loop to execute for every element after the current element in the list\r\n\t\t\t\tfor (int j=i+1;j<size;j++) {\r\n\t\t\t\t\t//checks if there is are 2 elements in the list with the same value\r\n\t\t\t\t\tif (element==list[j]) {\r\n\t\t\t\t\t\tremove(j);\t//calls function to remove that element from array\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\t//contains 0 elements\r\n\t\t\tSystem.out.println(\"List is empty!\");\r\n\t\t}\r\n\t}",
"@Override\n public Collection<V> removeAll( K key ) {\n List<V> result = new ArrayList<V>(currentCountFor(key));\n ValueIterator values = new ValueIterator(key);\n while (values.hasNext()) {\n result.add(values.next());\n values.remove();\n }\n return result;\n }",
"private ArrayList<Equity> getUnwatchedEquities(ArrayList<Equity> list) {\n ArrayList<Equity> temp = new ArrayList<>();\n temp.addAll(list);\n ArrayList<WatchedEquity> watched = controller.getUser().watchedEquities;\n for (Equity e : list) {\n for (WatchedEquity we : watched) {\n if (e.getTickerSymbol().equals(we.getSymbol())) {\n temp.remove(e);\n break;\n }\n }\n }\n return temp;\n }",
"public void remove(int v) {\n Lista iter = new Lista(this);\n if (iter.x != v) {\n while (iter.next.x != v) {\n if (iter.next != null) {\n iter = iter.next;\n }\n }\n }\n if (iter.next.x == v) {\n iter.next = iter.next.next;\n }\n }",
"public static void removeDuplicate(ArrayList<Integer>list) {\n \n //create a temporary arraylist\n ArrayList<Integer> tempList = new ArrayList<>();\n \n //loop thru the list and check if list contains the same integer/number/value as tempList\n for (int i = 0; i < list.size(); i++) {\n if (!tempList.contains(list.get(i))) {\n tempList.add(list.get(i));\n }\n }\n \n //clear the list\n list.clear();\n \n //add all integers/numbers/value from tempList into list\n list.addAll(tempList);\n \n }",
"private void removeLargeValues(ArrayList<Integer> myList)\n {\n // sort list to make removing values easy\n Collections.sort(myList);\n\n while (myList.size() > 1)\n {\n if (myList.get(myList.size() - 1) > 21)\n myList.remove(myList.size() - 1);\n else\n break;\n }\n }",
"protected void resetValues() {\n synchronized (values) {\n values.removeAll(new ArrayList(values));\n }\n }",
"public static void main(String[] args) {\n\n ArrayList<Integer> arrayList=new ArrayList<>();\n\n arrayList.add(1);\n arrayList.add(1);\n arrayList.add(2);\n arrayList.add(5);\n\n\n System.out.println(arrayList);\n System.out.println(arrayList.remove(1));\n System.out.println(arrayList);\n\n }",
"private static ListNode removeElements(ListNode head, int val) {\n ListNode dummy = new ListNode(0);\n dummy.next = head;\n ListNode curr = dummy;\n // Iterate till current.next is null. Keep checking next with value\n while (curr.next != null) {\n // next element is a match so skip pointing to next element.\n if (curr.next.value == val) {\n curr.next = curr.next.next;\n } else {\n curr = curr.next; // else keep moving ahead.\n }\n }\n return dummy.next; \n }",
"public void remove(int num) {\n // find the index of num\n for (int i = 0; i < count; i++) {\n if (list[i] == num) {\n // shift the elements leftward and decrement count\n for (int j = 0; j < count - 1; j++) {\n list[i+j] = list[i+j+1];\n }\n count--;\n return;\n }\n }\n }",
"private void removeFromList(Visit visit){\n\t\tfor (int i=0; i<searchResults.size(); i++) {\n\t\t\tif(searchResults.get(i).getClientRegNo().equals(visit.getClientRegNo())\n\t\t\t\t\t&& searchResults.get(i).getPropertyRegNo().equals(visit.getPropertyRegNo())\n\t\t\t\t\t&& searchResults.get(i).getDate().equals(visit.getDate())){\n\t\t\t\tsearchResults.remove(i);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}",
"public void removeAllElementInsertionMaps()\n {\n list.removeAllElements();\n }",
"@Override\n\tpublic void deleteAll(int pValueToDelete) {\n\t\twhile (find(pValueToDelete) != -1) {\n\t\t\tdelete(pValueToDelete);\n\t\t}\n\n//\t\tif (duplicatesAllowed == false) {\n//\t\t\tdelete(pValueToDelete);\n//\t\t} else {\n//\t\t\tfor (int n = 0; n < pointer; n++) {\n//\t\t\t\tif (values[n] == pValueToDelete) {\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}",
"public void clearListNotIndex(){\n for(int z=0; z<list.length; z++){\n list [z] = 0;\n }\n }",
"public void remove() {\n if (count == 0) {\n return;\n }\n \n Random rand = new Random();\n int index = rand.nextInt(count);\n for (int i = index; i < count - 1; i++) {\n list[i] = list[i+1];\n }\n count--; \n }",
"protected void removeDuplicates() {\n log.trace(\"Removing duplicated\");\n long startTime = System.currentTimeMillis();\n int initial = size();\n E last = null;\n int index = 0;\n while (index < size()) {\n E current = get(index);\n if (last != null && last.equals(current)) {\n if (log.isTraceEnabled()) {\n log.trace(\"Removing duplicate '\" + current + \"'\");\n }\n remove(index);\n } else {\n index++;\n }\n last = current;\n }\n log.debug(String.format(\"Removed %d duplicates from a total of %d values in %dms\",\n initial - size(), initial, System.currentTimeMillis() - startTime));\n }",
"void removeValue(String key);",
"public void removeAll(String c) {\r\n int[] elements = new int[(c.length() / 2) + 1];\r\n if (containsAll(c)) {\r\n for (int i = 0; i < elements.length; i++) {\r\n elements[i] = Integer.parseInt(c.substring(0, c.indexOf(\",\")));\r\n c = c.substring((c.indexOf(\",\") + 1));\r\n remove(elements[i]);\r\n }\r\n } else {\r\n throw new RuntimeException(\"some or all elements dont exist in List.\");\r\n }\r\n }",
"@Override\n\tpublic boolean remove(Object value) {\n\t\tint index = indexOf(value);\n\n\t\tif (index == -1) {\n\t\t\treturn false;\n\t\t}\n\n\t\tremove(index);\n\t\treturn true;\n\t}",
"private Node removeDuplicate() {\n ArrayList<Integer> values = new ArrayList<Integer>();\n int len = this.getlength();\n Node result = this;\n\n if (len == 1) {\n System.out.println(\"only one element can't duplicate\");\n return result;\n } else {\n Node current = result;\n\n for (int i = 0; i < len; i++) {\n if (values.contains(current.value)) {\n result = result.remove(i);\n len = result.getlength();\n i--; // reset the loop back\n current = current.nextNode;\n } else {\n values.add(current.value);\n current = current.nextNode;\n }\n }\n return result;\n }\n }",
"public void removeMatched(String v) {\n\t\t\tElementDPtr p = head;\n\t\t\tSystem.out.println(\" Value 1 \"+ v);\n\t\t\tif (head == null) \n\t\t\t\treturn;\n\t\t\tif (p.getValue().equals(v)) { \n\t\t\t\tSystem.out.println(\" Value 2 \"+ p.getValue());\n\t\t\t\thead = head.getNext(); \n\t\t\t\tif (head == null)\n\t\t\t\t\ttail = null;\n\t\t\t\tlength--;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse { p = head.getNext(); \n\t\t\t System.out.println(\" Value 3 \"+ p.getValue());\n\t\t\t while(p != null) {\n\t\t\t\t if (p.getValue().equals(v)) {\n\t\t\t\t\tSystem.out.println(\" Value \"+ p.getValue()\n\t\t\t\t\t+ p.getPrev().toString() );\n\t\t\t\t\tp.getPrev().setNext(p.getNext());\n\t\t\t\t\tp.getNext().setPrev(p.getPrev());\n\t\t\t\t\t\n\t\t\t\t\tlength--;\n\t\t\t\t\treturn;\n\t\t\t\t } \n\t\t\t\telse p = p.getNext();\n\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n public int remove() {\n isEmptyList();\n int result = first.value;\n first = first.next;\n first.previous = null;\n size--;\n return result;\n }",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"@Override\r\n public void removeFilterValue(String value) {\n }",
"@Override\r\n\tpublic void remove(List<GroupMember> list) {\n\t\tfor(int i = 0;i<list.size();i++)\r\n\t\t\tremove(list.get(i));\r\n\t}",
"public void remove(int key) {\n int index = key % n;\n MapNode node = keys[index];\n for (int i =0; i < node.list.size(); ++i) {\n if (node.list.get(i) == key) {\n node.list.remove(i);\n vals[index].list.remove(i);\n }\n }\n }",
"static List<String> removeDuplicates(List<String> list) {\n // Store unique items in result.\n List<String> result = new ArrayList<String>();\n // Loop over argument list.\n for (String token : list) {\n if (result.indexOf(token) == -1) { \n result.add(token);\n }\n }\n return result;\n }",
"private ArrayList<Integer> remove_duplicates(ArrayList<Integer> l) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n for (int i=0; i< l.size(); i++) {\n if (!(in(l.get(i), res))) {\n res.add(l.get(i));\n }\n }\n return res;\n }",
"private DeleteByValue() {}",
"private DeleteByValue() {}",
"public void removeAll(Object element);",
"public void\t\tremoveAll();",
"@Override\n public void remove(T t) {\n for (int i = 0; i < elementsInArray; i++) {\n if(t.equals(arrayList[i])) {\n arrayList[i] = null;\n elementsInArray--;\n return;\n }\n }\n }",
"@Test\n public void testRemoveAll() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n boolean expectedResult = true;\n boolean result = instance.removeAll(c);\n\n assertEquals(expectedResult, result);\n\n }",
"public void removeAll() {\n this.arrayList = null;\n this.arrayList = new ArrayList<>();\n }",
"public void RemoveValue(int value)\n {\n // Check if the value already exists\n if(_valuesToPut.contains(value))\n {\n _valuesToPut.remove(value);\n }\n }",
"@Test\n public void testRemoveAll_Not_Empty() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(1);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 1;\n assertEquals(expectedResult, instance.size());\n\n }",
"public void removeAllElements();",
"public void remove()\r\n { Exceptions.unmodifiable(\"list\"); }",
"private List<Coordinate> trim(List<Coordinate> list) {\n\n List<Coordinate> temp = new ArrayList<>();\n if (list.size() == 0) {\n return temp;\n }\n temp.add(list.get(0));\n for (int i = 1; i < list.size(); i++) {\n if (list.get(i - 1).equals(list.get(i))) {\n continue;\n }\n temp.add(list.get(i));\n }\n return temp;\n }",
"public void removeAllItems ();",
"public T remove(T value){\n\t return value;\n\t}",
"public boolean remove(int val) {\n if(!map.containsKey(val)) return false;\n int index = map.get(val);\n int size = list.size();\n int tmp = list.get(size-1);\n list.set(size-1, list.get(index));\n list.set(index, tmp);\n list.remove(size-1);\n map.put(tmp, index);\n map.remove(val);\n return true;\n }",
"public void removeWritten(byte[] value) {\n\n writeSetLock.lock();\n \n Set<TimestampValuePair> temp = (HashSet<TimestampValuePair>) writeSet.clone();\n \n for (TimestampValuePair rv : temp) {\n\n if (Arrays.equals(rv.getValue(), value)) writeSet.remove(rv);\n }\n writeSetLock.unlock();\n\n }",
"@Override\n\tpublic boolean remove(Object value) {\n\t\ttry {\n\t\t\tremove(indexOf(value));\n\t\t}catch(IndexOutOfBoundsException e){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"@Test\n public void testRemoveAll_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n boolean expectedResult = true;\n boolean result = instance.removeAll(c);\n\n assertEquals(expectedResult, result);\n\n }",
"public boolean remove(int val) {\r\n\r\n\t\tint pos = get_pos(val);\r\n\t\tif (bucket[pos] != null) {\r\n\t\t\tNode n = bucket[pos].list;\r\n\t\t\tNode p = n;\r\n\t\t\twhile (n != null) {\r\n\t\t\t\tif (n.val == val) {\r\n\t\t\t\t\tif (p == bucket[pos].list) {\r\n\t\t\t\t\t\tbucket[pos].list = n.next;\r\n\t\t\t\t\t\tbucket[pos].size--;\r\n\t\t\t\t\t\tif (bucket[pos].list == null)\r\n\t\t\t\t\t\t\tbucket[pos] = null;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tp.next = n.next;\r\n\t\t\t\t\t\tbucket[pos].size--;\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tp = n;\r\n\t\t\t\tn = n.next;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"public ListNode removeElements(ListNode head, int val) {\n ListNode dummyNode = new ListNode(-1);\n dummyNode.next = head;\n ListNode pre = dummyNode;\n ListNode cur = pre.next;\n while(cur != null){\n if(cur.val == val){\n cur = cur.next;\n pre.next = cur;\n }else{\n pre = pre.next;\n cur = cur.next;\n }\n }\n return dummyNode.next;\n }",
"@Test\n public void testRemoveAll_Not_Empty_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(1);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 1;\n assertEquals(expectedResult, instance.size());\n\n }",
"void removeAllEntries();",
"private void arrayRemove(MyArrayList myArrayList, Results results, int value) {\r\n int old_size = myArrayList.size();\r\n myArrayList.removeValue(value);\r\n int new_size = myArrayList.size();\r\n if(old_size == new_size + 1) {\r\n results.storeNewResult(\"ArrayRemove test case: FAILED\");\r\n }\r\n else {\r\n results.storeNewResult(\"ArrayRemove test case: PASSED\");\r\n }\r\n }",
"void removeAll();",
"void removeAll();",
"public final void remove(@NotNull T value) {\n\t\tObject priorValue;\n\t\tboolean replaced;\n\t\tdo {\n\t\t\tpriorValue = this.value.get();\n\t\t\tObject newValue = remove(priorValue, value);\n\t\t\treplaced = this.value.compareAndSet(priorValue, newValue);\n\t\t} while (!replaced);\n\t}",
"void clear(int list) {\n\t\tint last = getLast(list);\n\t\twhile (last != nullNode()) {\n\t\t\tint n = last;\n\t\t\tlast = getPrev(n);\n\t\t\tfreeNode_(n);\n\t\t}\n\t\tm_lists.setField(list, 0, -1);\n\t\tm_lists.setField(list, 1, -1);\n\t\tsetListSize_(list, 0);\n\t}",
"void clear() {\n\t\tfor (int list = getFirstList(); list != -1;) {\n\t\t\tlist = deleteList(list);\n\t\t}\n\t}",
"public static ArrayList<String> complement(ArrayList<String> universe, ArrayList<String> value) {\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\tfor(String element : universe) {\n\t\t\tif(!value.contains(element)) {\n\t\t\t\tresult.add(element);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public void removeValue(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(VALUE$0, i);\n }\n }",
"public boolean remove(int val) {\n boolean contains = map.containsKey(val);\n if(!contains) return false;\n int pos = map.get(val);\n if (pos < nums.size() - 1) { // if not the last one, then swap the last one with this val\n int last = nums.get(nums.size() - 1); // arraylist get() O(1), basically a value in an array\n nums.set(pos, last); // set the element at \"pos\" position to be last element in the list , set like assign value in an array element\n map.put(last, pos); // put the last element in the list with the pos position\n }\n map.remove(val); // hashmap remove() It is O(1) only when removing the last element by index.\n // O(1); map remove(obj)\n //O(1+k/n) where k is the no. of collision elements\n // added to the same LinkedList (k elements had same hashCode)\n nums.remove(nums.size() - 1);\n return true;\n }",
"public ListNode removeElements(ListNode head, int val) {\n ListNode fakeHead = new ListNode(0);\n fakeHead.next = head;\n head = fakeHead;\n while (head != null && head.next != null)\n {\n if (head.next.val == val)\n head.next = head.next.next;\n else {\n head = head.next;\n }\n }\n return fakeHead.next;\n }",
"public void clear(){\n\n \tlist = new ArrayList();\n\n }",
"@Override\n\tpublic V remove(K key) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// parcurgerea listei de elemente pentru a gasi cheia ceruta si\n\t\t\t// stergerea acesteiu din lista\n\t\t\tif (b.get(h).getEntries().get(i).getKey().equals(key)) {\n\t\t\t\tV x = b.get(h).getEntries().get(i).getValue();\n\t\t\t\tb.get(h).e.remove(i);\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public boolean remove(int val) {\n if(map.containsKey(val)){\n \tif(map.get(val).size() == 1){\n \t\tint last = list.get(list.size()-1);\n \t\tint mvindex = map.get(val).iterator().next();\n \t\tmap.get(last).remove(list.size()-1);\n \t\tmap.get(last).add(mvindex);\n \t\tlist.set(mvindex,list.get(list.size()-1));\n \t\tlist.remove(list.size()-1);\n \t\tmap.remove(val);\n \t}else {\n \t\tint last = list.get(list.size()-1);\n \t\tint mvindex = map.get(val).iterator().next();\n \t\tmap.get(last).remove(list.size()-1);\n \t\tmap.get(last).add(mvindex);\n \t\tlist.set(mvindex, list.get(list.size()-1));\n \t\tlist.remove(list.size()-1);\n \t\tif(last != val)\n \t\t\tmap.get(val).remove(mvindex);\n\t\t\t} \t\n \treturn true;\n }else {\n\t\t\treturn false;\n\t\t}\n }",
"@Test\r\n\tpublic void testRemoveAll() {\r\n\t\tDoubleList sample = new DoubleList(new Munitions(2, 3, \"iron\"));\r\n\t\tsample.add(new Munitions(new Munitions(3, 4, \"iron\")));\r\n\t\tAssert.assertTrue(list.removeAll(sample));\r\n\t\tAssert.assertFalse(list.removeAll(sample));\r\n\t\tAssert.assertEquals(13, list.size());\r\n\t}",
"public void clear() {\n synchronized (LOCK) {\n myValues.clear();\n }\n }",
"public void removeInterpretedBy( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.remove(this.model, this.getResource(), INTERPRETEDBY, value);\r\n\t}",
"private List<String> removeEmptyLines(List<String> list) {\n for (int k1 = 0; k1 < list.size(); ++k1)\n {\n if (list.get(k1).isEmpty()) {\n list.remove(k1);\n }\n }\n return list;\n }",
"public static List<String> noX(List<String> list) {\n\t\treturn list.stream().map(s -> s.replace(\"x\", \"\"))\n\t\t\t\t\t\t\t.collect(Collectors.toList());\n\t}",
"public void removeAllWithKey(k key) {\n\t\t\n\t\tint b = hash(key);\n\t\tNode<k,v> curr = buckets[b];\n\t\tNode<k,v> previous = null;\n\t\t\n\t\twhile (curr != null) {\n\t\t\tif (key.equals(curr.getKey())) { // check if keys match\n\t\t\t\n\t\t\t\tif (previous == null) {\n\t\t\t\t\tbuckets[b] = curr.getNext(); // if removing first item, set the next as first\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tprevious.setNext(curr.getNext()); // else set the previous' next to curr's next\n\t\t\t\t}\t\t\n\t\t\t} else {\n\t\t\t\tprevious = curr; // if match wasn't found, set previous to current before moving on\n\t\t\t}\n\t\t\tcurr = curr.getNext(); // move in SLL\n\t\t}\n\t}",
"void unsetListOfServiceElements();",
"private static <T> Object remove(Object baseValue, T value) {\n\t\tif (baseValue == value || baseValue == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!(baseValue instanceof Object[])) {\n\t\t\t// baseValue is a single element not equal to value\n\t\t\treturn baseValue;\n\t\t}\n\n\t\tObject[] oldArray = (Object[])baseValue;\n\t\tfor (int i = 0; i < oldArray.length; i++) {\n\t\t\tif (oldArray[i] == value) {\n\t\t\t\tif (oldArray.length == 2) {\n\t\t\t\t\treturn oldArray[i == 0 ? 1 : 0];\n\t\t\t\t}\n\n\t\t\t\t// Shift remaining elements and return\n\t\t\t\tfor (int j = i + 1; j < oldArray.length; j++) {\n\t\t\t\t\toldArray[j - 1] = oldArray[j];\n\t\t\t\t}\n\n\t\t\t\treturn Arrays.copyOf(oldArray, oldArray.length - 1);\n\t\t\t}\n\t\t}\n\n\t\treturn baseValue;\n\t}",
"public List<Integer> removeNumber(List<Integer> numbers) {\n List<Integer> result = new ArrayList<>();\n for (int number : numbers) {\n if (number != 7) {\n result.add(number);\n }\n }\n return result;\n }",
"private void clearAll(byte value) {\n for (int i = 0; i < size; i++) {\n data[i] = (byte) (value & 0xff);\n }\n }",
"public static void main(String[] args) {\n\n ArrayList<String> strArray = new ArrayList<>();\n strArray.add(\"man\");\n strArray.add(\"hi\");\n strArray.add(\"yo\");\n strArray.add(\"hi\");\n String strToBeRemoved =\"hi\";\n\n removeAll(strArray, strToBeRemoved);\n\n\n }",
"@Override\n public E deleteMin()\n {\n return list.removeFirst();\n }",
"private void removeEvicted() {\n Map<K,CacheableObject> removeMap = new HashMap<K,CacheableObject>(valueMap.size()/2);\n List<CacheListener<K>> tempListeners = new ArrayList<CacheListener<K>>();\n\n // Retrieve a list of everything that's to be removed\n synchronized(theLock) {\n removeMap.putAll(toEvictMap);\n toEvictMap.clear();\n tempListeners.addAll(listeners);\n }\n\n // Remove the entries one-at-a-time, notifying the listener[s] in the process\n for (Map.Entry<K,CacheableObject> entry : removeMap.entrySet()) {\n synchronized(theLock) {\n currentCacheSize -= entry.getValue().containmentCount;\n valueMap.remove(entry.getKey());\n }\n Thread.yield();\n\n for (CacheListener<K> listener : tempListeners) {\n listener.evictedElement(entry.getKey());\n }\n }\n }",
"@Override\n\tpublic void removeValue(String arg0) {\n\t}",
"public static void main(String[] args) {\r\n\t\t\r\n\tList<Integer> myList = new ArrayList<>();\r\n\tmyList.add(0);\r\n\tmyList.add(1);\r\n\tmyList.add(5);\r\n\tmyList.add(115);\r\n\tmyList.add(100);\r\n\tmyList.add(26);\r\n\tmyList.add(5555);\r\n\tmyList.add(-12);\r\n\t\r\n\tSystem.out.println(myList);\r\n\t\r\n\tfor(int i = 0; i<myList.size(); i++) {\r\n\t\tif(myList.get(i) > 100 || myList.get(i) < 1) {\r\n\t\t\tmyList.remove(i);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\t\r\n\tSystem.out.println(myList);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t}",
"public static void removeEvens(ArrayList<Integer> list)\n {\n /*\n * size method returns the number of elements in the list\n */\n //int size = list.size();//valid way to ge the size\n \n for(int i = 0; i < list.size(); )\n {\n /*\n * get method return the value of the elemtne at the index\n * list get smaller, elements are \"shifted left\"\n */\n int value = list.get(i);\n if( value %2 == 0)\n {\n /*\n * remove method deletes the element at the specified index\n */\n list.remove(i);\n //i--;// if remove move index back one to compensate\n }\n else//only increase i if you don't remove\n {\n i++;\n }\n }\n }",
"public void removeAllItem() {\n orderList.clear();\n }",
"public boolean remove(int val) {\n return list.remove(val);\n }",
"Set<Card> remove();",
"@Override\npublic void removeAll(Collection<Integer> collection) {\n\t\n}",
"public void reduce(List<T> list) {\n\t\tfor(int i = 1; i < list.size(); i++) {\n\t\t\tif(list.get(i) == null || list.get(i-1) == null) continue;\n\t\t\tint hash = list.get(i-1).hashCode();\n\t\t\tif(!rule.containsKey(hash)) continue;\n\t\t\tif(rule.get(hash).contains(list.get(i))) {\n\t\t\t\tlist.remove(i);\ti--;\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.6947017",
"0.6750947",
"0.66021454",
"0.6526514",
"0.64638007",
"0.64427745",
"0.6360537",
"0.61673343",
"0.61351264",
"0.6115447",
"0.6097846",
"0.606517",
"0.60465765",
"0.60458964",
"0.6008555",
"0.5999753",
"0.59915566",
"0.5950291",
"0.5942454",
"0.59411395",
"0.59388345",
"0.59088904",
"0.590399",
"0.5885903",
"0.58834165",
"0.58724225",
"0.58695257",
"0.586607",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.58599985",
"0.5852383",
"0.58486944",
"0.583045",
"0.5826441",
"0.5824425",
"0.5823913",
"0.5823913",
"0.5803889",
"0.57997966",
"0.57955396",
"0.5788623",
"0.5784611",
"0.5774934",
"0.57708824",
"0.57690513",
"0.57688135",
"0.57453823",
"0.57425135",
"0.5737609",
"0.57338476",
"0.5729495",
"0.5718661",
"0.5712207",
"0.57103527",
"0.56978333",
"0.5695428",
"0.56943774",
"0.56850517",
"0.5684148",
"0.5684148",
"0.5681002",
"0.56655794",
"0.5662828",
"0.56558144",
"0.5645435",
"0.5642113",
"0.56401336",
"0.56356096",
"0.56328636",
"0.5630793",
"0.5627128",
"0.56252474",
"0.5612094",
"0.5602405",
"0.55970675",
"0.5595786",
"0.55931664",
"0.5592006",
"0.55886793",
"0.5572317",
"0.55563223",
"0.55554086",
"0.5529794",
"0.5526323",
"0.55232835",
"0.55191946",
"0.55179125",
"0.55168444",
"0.55134463",
"0.55103993",
"0.5510021"
] | 0.0 | -1 |
Removes all occurences of all values from the List | public void removeFromFollowedUsers(List<String> followedUsers); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void removeAllValues() {\n Map<String, ?> map = preferences.getAll();\n Iterator<String> iterator = map.keySet().iterator();\n while (iterator.hasNext()) {\n removeValue(iterator.next());\n }\n }",
"protected void resetValues() {\n synchronized (values) {\n values.removeAll(new ArrayList(values));\n }\n }",
"static List<String> removeDuplicates(List<String> list) {\n // Store unique items in result.\n List<String> result = new ArrayList<String>();\n // Loop over argument list.\n for (String token : list) {\n if (result.indexOf(token) == -1) { \n result.add(token);\n }\n }\n return result;\n }",
"public void removeAllWithValue(v val) {\n\t\tfor (int i = 0; i < buckets.length; i++) {\n\t\t\tNode<k,v> curr = buckets[i];\n\t\t\tNode<k,v> previous = null;\n\t\t\t\n\t\t\twhile (curr != null) {\n\t\t\t\tif (curr.getValue().equals(val)) {\n\t\t\t\t\t\n\t\t\t\t\tif (previous == null) {\n\t\t\t\t\t\tbuckets[i] = curr.getNext(); // if removing first item, set the next as first\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprevious.setNext(curr.getNext()); // else set the previous' next to curr's next\n\t\t\t\t\t}\t\n\t\t\t\t} else {\t\t\t\t\t\t\t// if match wasn't found, set previous to current before moving on\n\t\t\t\t\tprevious = curr;\n\t\t\t\t}\t\n\t\t\t\tcurr = curr.getNext(); \t\t\t\t// move in SLL\n\t\t\t}\t\n\t\t}\n\t}",
"private ArrayList<Equity> getUnwatchedEquities(ArrayList<Equity> list) {\n ArrayList<Equity> temp = new ArrayList<>();\n temp.addAll(list);\n ArrayList<WatchedEquity> watched = controller.getUser().watchedEquities;\n for (Equity e : list) {\n for (WatchedEquity we : watched) {\n if (e.getTickerSymbol().equals(we.getSymbol())) {\n temp.remove(e);\n break;\n }\n }\n }\n return temp;\n }",
"private ArrayList<Integer> remove_duplicates(ArrayList<Integer> l) {\n ArrayList<Integer> res = new ArrayList<Integer>();\n for (int i=0; i< l.size(); i++) {\n if (!(in(l.get(i), res))) {\n res.add(l.get(i));\n }\n }\n return res;\n }",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAll();",
"public void removeAllElementInsertionMaps()\n {\n list.removeAllElements();\n }",
"public static void removeDuplicate(ArrayList<Integer>list) {\n \n //create a temporary arraylist\n ArrayList<Integer> tempList = new ArrayList<>();\n \n //loop thru the list and check if list contains the same integer/number/value as tempList\n for (int i = 0; i < list.size(); i++) {\n if (!tempList.contains(list.get(i))) {\n tempList.add(list.get(i));\n }\n }\n \n //clear the list\n list.clear();\n \n //add all integers/numbers/value from tempList into list\n list.addAll(tempList);\n \n }",
"public void removeDuplication() {\r\n\t\t//checks if the array contains any elements\r\n\t\tif (!isEmpty()) {\t//contains elements\r\n\t\t\t//loop to execute for every element in the array\r\n\t\t\tfor (int i=0;i<size-1;i++) {\r\n\t\t\t\tObject element=list[i];\t//to store value of element in array\r\n\t\t\t\t//loop to execute for every element after the current element in the list\r\n\t\t\t\tfor (int j=i+1;j<size;j++) {\r\n\t\t\t\t\t//checks if there is are 2 elements in the list with the same value\r\n\t\t\t\t\tif (element==list[j]) {\r\n\t\t\t\t\t\tremove(j);\t//calls function to remove that element from array\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\t//contains 0 elements\r\n\t\t\tSystem.out.println(\"List is empty!\");\r\n\t\t}\r\n\t}",
"public void removeAll(String c) {\r\n int[] elements = new int[(c.length() / 2) + 1];\r\n if (containsAll(c)) {\r\n for (int i = 0; i < elements.length; i++) {\r\n elements[i] = Integer.parseInt(c.substring(0, c.indexOf(\",\")));\r\n c = c.substring((c.indexOf(\",\") + 1));\r\n remove(elements[i]);\r\n }\r\n } else {\r\n throw new RuntimeException(\"some or all elements dont exist in List.\");\r\n }\r\n }",
"public void removeAll() {\n this.arrayList = null;\n this.arrayList = new ArrayList<>();\n }",
"@Override\n public Collection<V> removeAll( K key ) {\n List<V> result = new ArrayList<V>(currentCountFor(key));\n ValueIterator values = new ValueIterator(key);\n while (values.hasNext()) {\n result.add(values.next());\n values.remove();\n }\n return result;\n }",
"public void clearListNotIndex(){\n for(int z=0; z<list.length; z++){\n list [z] = 0;\n }\n }",
"protected void removeDuplicates() {\n log.trace(\"Removing duplicated\");\n long startTime = System.currentTimeMillis();\n int initial = size();\n E last = null;\n int index = 0;\n while (index < size()) {\n E current = get(index);\n if (last != null && last.equals(current)) {\n if (log.isTraceEnabled()) {\n log.trace(\"Removing duplicate '\" + current + \"'\");\n }\n remove(index);\n } else {\n index++;\n }\n last = current;\n }\n log.debug(String.format(\"Removed %d duplicates from a total of %d values in %dms\",\n initial - size(), initial, System.currentTimeMillis() - startTime));\n }",
"void clear() {\n\t\tfor (int list = getFirstList(); list != -1;) {\n\t\t\tlist = deleteList(list);\n\t\t}\n\t}",
"public void\t\tremoveAll();",
"private void removeLargeValues(ArrayList<Integer> myList)\n {\n // sort list to make removing values easy\n Collections.sort(myList);\n\n while (myList.size() > 1)\n {\n if (myList.get(myList.size() - 1) > 21)\n myList.remove(myList.size() - 1);\n else\n break;\n }\n }",
"void removeAll();",
"void removeAll();",
"public void delAll(List list);",
"public void removeAllElements();",
"private List<String> removeEmptyLines(List<String> list) {\n for (int k1 = 0; k1 < list.size(); ++k1)\n {\n if (list.get(k1).isEmpty()) {\n list.remove(k1);\n }\n }\n return list;\n }",
"private List<Coordinate> trim(List<Coordinate> list) {\n\n List<Coordinate> temp = new ArrayList<>();\n if (list.size() == 0) {\n return temp;\n }\n temp.add(list.get(0));\n for (int i = 1; i < list.size(); i++) {\n if (list.get(i - 1).equals(list.get(i))) {\n continue;\n }\n temp.add(list.get(i));\n }\n return temp;\n }",
"void removeAllEntries();",
"public void reduce(List<T> list) {\n\t\tfor(int i = 1; i < list.size(); i++) {\n\t\t\tif(list.get(i) == null || list.get(i-1) == null) continue;\n\t\t\tint hash = list.get(i-1).hashCode();\n\t\t\tif(!rule.containsKey(hash)) continue;\n\t\t\tif(rule.get(hash).contains(list.get(i))) {\n\t\t\t\tlist.remove(i);\ti--;\n\t\t\t}\n\t\t}\n\t}",
"private static void clearValues(final ArrayList<Integer[]> arrays)\n {\n arrays.clear();\n\n for (int x = 0; x < NUM_FILTERS; x++)\n {\n final Integer[] array = new Integer[NUM_STATISTICS];\n Arrays.fill(array, 0);\n arrays.add(array);\n }\n }",
"void clear(int list) {\n\t\tint last = getLast(list);\n\t\twhile (last != nullNode()) {\n\t\t\tint n = last;\n\t\t\tlast = getPrev(n);\n\t\t\tfreeNode_(n);\n\t\t}\n\t\tm_lists.setField(list, 0, -1);\n\t\tm_lists.setField(list, 1, -1);\n\t\tsetListSize_(list, 0);\n\t}",
"@Test\n public void testRemoveAll_Not_Empty() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(1);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 1;\n assertEquals(expectedResult, instance.size());\n\n }",
"void remove(int v){\n if(isEmpty()!=1){\n for(int i=0;i<size;i++){\n if(values[i]==v){\n int j = i;\n while((j+1)!=size){\n values[j] = values[j+1];\n j++;\n\n }\n values[j] = (-1);\n break;\n }\n }\n }\n }",
"public static List<String> noX(List<String> list) {\n\t\treturn list.stream().map(s -> s.replace(\"x\", \"\"))\n\t\t\t\t\t\t\t.collect(Collectors.toList());\n\t}",
"public void removeAll() {\n _hash = new Hashtable();\n _first = null;\n _last = null;\n }",
"@Test\n public void testRemoveAll_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n boolean expectedResult = true;\n boolean result = instance.removeAll(c);\n\n assertEquals(expectedResult, result);\n\n }",
"@Test\n public void testRemoveAll_Not_Empty_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(1);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 1;\n assertEquals(expectedResult, instance.size());\n\n }",
"@Test\r\n\tpublic void testRemoveAll() {\r\n\t\tDoubleList sample = new DoubleList(new Munitions(2, 3, \"iron\"));\r\n\t\tsample.add(new Munitions(new Munitions(3, 4, \"iron\")));\r\n\t\tAssert.assertTrue(list.removeAll(sample));\r\n\t\tAssert.assertFalse(list.removeAll(sample));\r\n\t\tAssert.assertEquals(13, list.size());\r\n\t}",
"@Test\n public void testRemoveAll() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n boolean expectedResult = true;\n boolean result = instance.removeAll(c);\n\n assertEquals(expectedResult, result);\n\n }",
"private void removeEmptyTokens(ArrayList<String> tokens) {\n Iterator<String> it = tokens.iterator();\n while (it.hasNext()) {\n if (it.next().equals(\"\")) {\n it.remove();\n }\n }\n }",
"public void removeAll(Object element);",
"public void clear() {\n duplicates.clear();\n }",
"public void clear() {\n synchronized (LOCK) {\n myValues.clear();\n }\n }",
"public void removeAllItems ();",
"private void removePressed() {\n\t\ts = allMedia.getSelectedValuesList();\n\t\t// now remove all the value that are in the list from the default list model\n\t\tfor(Object o : s){\n\t\t\tif(l.contains(o)){\n\t\t\t\tl.removeElement(o);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void clear() {\n for (E e : this) {\n remove(e);\n }\n }",
"public void removeAll() {\n\t\tsynchronized (mNpcs) {\n\t\t\tmNpcs = Collections.synchronizedList(new ArrayList<Npc>());\n\t\t\tmDemonCount = 0;\n\t\t\tmHumanCount = 0;\n\t\t}\n\t}",
"@Test\n public void testList(){\n ArrayList<Integer> integers = Lists.newArrayList(1, 2, 3, 4);\n ArrayList<Integer> integers2 = Lists.newArrayList(1, 2, 3, 4, 5);\n// integers2.removeAll(integers);\n// System.out.println(integers2);\n integers2.retainAll(integers);\n System.out.println(integers2);\n }",
"void unsetListOfServiceElements();",
"abstract public void removeAll();",
"private List<MutateOperation> removeAll() {\n return removeDescendantsAndFilter(rootResourceName);\n }",
"public void clear() {\n values.clear();\n }",
"private void removeFromList(Visit visit){\n\t\tfor (int i=0; i<searchResults.size(); i++) {\n\t\t\tif(searchResults.get(i).getClientRegNo().equals(visit.getClientRegNo())\n\t\t\t\t\t&& searchResults.get(i).getPropertyRegNo().equals(visit.getPropertyRegNo())\n\t\t\t\t\t&& searchResults.get(i).getDate().equals(visit.getDate())){\n\t\t\t\tsearchResults.remove(i);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}",
"@Override\r\n\tpublic void remove(List<GroupMember> list) {\n\t\tfor(int i = 0;i<list.size();i++)\r\n\t\t\tremove(list.get(i));\r\n\t}",
"public static void collapseDuplicates( ArrayList<Integer> L ) { \n\tfor (int i = 1; i < L.size();) {\n\t if (L.get(i).equals(L.get(i - 1))) {\n\t\tL.remove(i - 1);\n\t } else {\n\t\ti++;\n\t }\n\t}\n }",
"@Override\npublic void removeAll(Collection<Integer> collection) {\n\t\n}",
"public static void removeEvens(ArrayList<Integer> list)\n {\n /*\n * size method returns the number of elements in the list\n */\n //int size = list.size();//valid way to ge the size\n \n for(int i = 0; i < list.size(); )\n {\n /*\n * get method return the value of the elemtne at the index\n * list get smaller, elements are \"shifted left\"\n */\n int value = list.get(i);\n if( value %2 == 0)\n {\n /*\n * remove method deletes the element at the specified index\n */\n list.remove(i);\n //i--;// if remove move index back one to compensate\n }\n else//only increase i if you don't remove\n {\n i++;\n }\n }\n }",
"private void clearAll( )\n {\n for( Vertex v : vertexMap.values( ) )\n v.reset( );\n }",
"public void removeAllEntries() {\n }",
"public void clear() {\n \tIterator<E> iterateSet = this.iterator();\n \t\n \twhile(iterateSet.hasNext()) {\n \t\t// iterate through and remove all elements\n \t\titerateSet.next();\n \t\titerateSet.remove();\n \t}\n }",
"public static <T> List<T> eliminateDuplicates(final List<T> list) {\n return list.stream().distinct().collect(Collectors.toList());\n }",
"public void clear(){\n\n \tlist = new ArrayList();\n\n }",
"private Node removeDuplicate() {\n ArrayList<Integer> values = new ArrayList<Integer>();\n int len = this.getlength();\n Node result = this;\n\n if (len == 1) {\n System.out.println(\"only one element can't duplicate\");\n return result;\n } else {\n Node current = result;\n\n for (int i = 0; i < len; i++) {\n if (values.contains(current.value)) {\n result = result.remove(i);\n len = result.getlength();\n i--; // reset the loop back\n current = current.nextNode;\n } else {\n values.add(current.value);\n current = current.nextNode;\n }\n }\n return result;\n }\n }",
"public void removeAll(ArrayList<Integer> ruleNrs){\n\t\tList<Rule> toRemove = new ArrayList<Rule>();\n\t\tfor(int i=0;i<ruleNrs.size();i++){\n\t\t\ttoRemove.add(rules.get(ruleNrs.get(i) - 1));\n\t\t}\n\t\tremoveAll(toRemove);\n\t}",
"@Override\n\tpublic void deleteAll(int pValueToDelete) {\n\t\twhile (find(pValueToDelete) != -1) {\n\t\t\tdelete(pValueToDelete);\n\t\t}\n\n//\t\tif (duplicatesAllowed == false) {\n//\t\t\tdelete(pValueToDelete);\n//\t\t} else {\n//\t\t\tfor (int n = 0; n < pointer; n++) {\n//\t\t\t\tif (values[n] == pValueToDelete) {\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t}",
"void unsetMultiple();",
"public void clear() {\n list = new Object[MIN_CAPACITY];\n n = 0;\n }",
"@Test\r\n public void removeAll() throws Exception {\r\n\r\n TreeSet<Integer> check = new TreeSet<>();\r\n check.addAll(sInt);\r\n ArrayList<Integer> l = new ArrayList<>();\r\n l.add(4);\r\n l.add(2);\r\n check.removeAll(l);\r\n assertFalse(check.containsAll(l));\r\n assertFalse(check.contains(2));\r\n assertFalse(check.contains(4));\r\n assertTrue(check.contains(1));\r\n assertTrue(check.contains(3));\r\n assertTrue(check.contains(5));\r\n }",
"@Test\n public void testRemoveAll_Size() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 0;\n assertEquals(expectedResult, instance.size());\n\n }",
"@Test\n public void testRemoveAll_Size_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n instance.add(3);\n instance.add(2);\n\n Collection c = Arrays.asList(2, 3);\n instance.removeAll(c);\n\n int expectedResult = 0;\n assertEquals(expectedResult, instance.size());\n\n }",
"public void removeDuplitcate(List<Integer> a)\n\t{\n\t\tif(a==null ||a.size()==0 ) return ;\n\t\t\n\t\tHashMap<Integer, Integer> hm = new HashMap<Integer, Integer>();\n\t\t\n\t\tfor(int i=a.size()-1;i>=0;i--)\n\t\t{\n\t\t\tif(hm.containsKey(a.get(i)))\n\t\t\t{\n\t\t\t\ta.remove(i);\n\t\t\t}\n\t\t\telse hm.put(a.get(i), 1);\n\t\t}\n\t}",
"public void remove() {\n if (count == 0) {\n return;\n }\n \n Random rand = new Random();\n int index = rand.nextInt(count);\n for (int i = index; i < count - 1; i++) {\n list[i] = list[i+1];\n }\n count--; \n }",
"public List<VaccineDetails> removeDuplicates(final List<VaccineDetails> list)\n {\n\n Set<VaccineDetails> carSet = new HashSet<VaccineDetails>();\n for (VaccineDetails car : list) {\n carSet.add(car);\n }\n List<VaccineDetails> withoutDuplicates = new ArrayList<VaccineDetails>(carSet);\n\n return withoutDuplicates;\n }",
"public void removeAllElements() {\n for (int i = 0; i < OLast; i++) O[i] = null;\n ON = OLast = 0;\n Gap = -1;\n }",
"@Override\n\tpublic void clear() {\n\t\t\n\t\tsuperset.removeRange(lower, upper, fromInclusive, toInclusive);\n\t\t\n\t\t//Alternative direct implementation:\n\t\t//while (pollFirst() != null) {\n\t\t//}\n\t\t\n\t}",
"public void removeAll(String s) {\n for (int i = 0; i < size; i++) {\n if (elements[i] == s) {\n elements[i] = null;\n }\n }\n }",
"private List<AxiomTreeNode> reduceNodeList(List<AxiomTreeNode> list, int remove) {\n\n List<AxiomTreeNode> reduced = new ArrayList<AxiomTreeNode>(list);\n\n reduced.remove(remove);\n\n return reduced;\n }",
"public static void removeDuplicatesWithoutBuffer(LinkedList list)\n\t{\n\t\t//**Needs only two pointers**//\n\t\tNode current = list.getHead();\n\t\twhile(current != null && current.getNext() != null)\n\t\t{\n\t\t\tNode temp = current;\n\t\t\twhile(temp.getNext() != null)\n\t\t\t{\n\t\t\t\tif(current.getData() == temp.getNext().getData())\n\t\t\t\t{\n\t\t\t\t\ttemp.setNext(temp.getNext());\n\t\t\t\t\ttemp.setNext(temp.getNext().getNext());;\n\t\t\t\t} \n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttemp = temp.getNext();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrent = current.getNext();\n\t\t}\n\t}",
"public void clear()\n {\n int llSize = ll.getSize();\n for(int i=0; i<llSize; i++){\n ll.remove(0);\n }\n }",
"public void removeAll() {\n start = null;\n _size = 0;\n }",
"private void clean() {\n //use iterator\n Iterator<Long> it = nodes.keySet().iterator();\n while (it.hasNext()) {\n Long node = it.next();\n if (nodes.get(node).adjs.isEmpty()) {\n it.remove();\n }\n }\n }",
"public void removeAll()\n {\n this.front = null;\n this.rear = null;\n }",
"private static void removeCurrentColors(){\n\t\tIterator<ArrayList<Peg>> itr = possibleCombinations.iterator();\n\t\twhile(itr.hasNext()){\n\t\t\tArrayList <Peg> victim=itr.next();\n\t\t\tfor(int i=0; i<aiGuess.size(); i++){\n\t\t\t\t\n\t\t\t\tif(victim.contains(aiGuess.get(i))){\n\t\t\t\t\titr.remove();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public List<Integer> removeNumber(List<Integer> numbers) {\n List<Integer> result = new ArrayList<>();\n for (int number : numbers) {\n if (number != 7) {\n result.add(number);\n }\n }\n return result;\n }",
"public static void main(String[] args) {\n\n ArrayList<Integer> arrayList=new ArrayList<>();\n\n arrayList.add(1);\n arrayList.add(1);\n arrayList.add(2);\n arrayList.add(5);\n\n\n System.out.println(arrayList);\n System.out.println(arrayList.remove(1));\n System.out.println(arrayList);\n\n }",
"public static void clearList(ArrayList<Student> sList){\n\t\tsList.clear();\n\t}",
"void unsetUnordered();",
"public void clearConcertList(){\n concertList.clear();\n }",
"@Override\n public void clear() {\n for (LinkedList<Entry<K,V>> list : table) {\n list = null;\n }\n }",
"private void clearLists(){\r\n\t\tfor(int i=0; i<potentialFriends.length; i++){\r\n\t\t\tpotentialFriends[i] = null;\r\n\t\t}\r\n\t\tfor(int i=0; i<mutualNum.length; i++){\r\n\t\t\tmutualNum[i] = -1;\r\n\t\t}\r\n\t}",
"public void clearAll();",
"public void clearAll();",
"@Override\n public void Clear() {\n for (int i = 0; i < array.size(); i++) {\n array.remove(i);\n\n }//Fin del for\n }"
] | [
"0.6639631",
"0.6507789",
"0.63582087",
"0.6356254",
"0.63504463",
"0.6336836",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6314781",
"0.6300363",
"0.62967914",
"0.6266169",
"0.6252558",
"0.6244538",
"0.6217716",
"0.6198025",
"0.6197544",
"0.6173073",
"0.61092085",
"0.61025745",
"0.61019784",
"0.61019784",
"0.61015314",
"0.60805917",
"0.6063905",
"0.6047287",
"0.6028718",
"0.6028135",
"0.6002352",
"0.5971931",
"0.5954388",
"0.5932308",
"0.5923547",
"0.59098345",
"0.59001064",
"0.589608",
"0.5889608",
"0.5888936",
"0.58605033",
"0.58550555",
"0.584127",
"0.5818456",
"0.58144575",
"0.5808223",
"0.5794559",
"0.5777957",
"0.57716954",
"0.57693475",
"0.57658416",
"0.5762956",
"0.5750961",
"0.5750635",
"0.57457113",
"0.5738768",
"0.57284164",
"0.57199854",
"0.5715491",
"0.56949204",
"0.5684455",
"0.56822056",
"0.56546754",
"0.5652842",
"0.565025",
"0.5646175",
"0.5643076",
"0.56419814",
"0.5639403",
"0.5637593",
"0.56344193",
"0.56241447",
"0.56238705",
"0.5616291",
"0.56121695",
"0.5609997",
"0.5608377",
"0.56047875",
"0.560089",
"0.55992925",
"0.5597926",
"0.5589928",
"0.55871147",
"0.5586741",
"0.5584221",
"0.5566814",
"0.5555628",
"0.55523896",
"0.55409855",
"0.55318445",
"0.55316854",
"0.55248374",
"0.55248374",
"0.5521337"
] | 0.0 | -1 |
Finds the winning player's score. | public int winningPlayerScore(LinkedList<Integer> player1Cards, LinkedList<Integer> player2Cards){
while (!player1Cards.isEmpty() && !player2Cards.isEmpty()){
int player1Move = player1Cards.poll();
int player2Move = player2Cards.poll();
if (player1Move > player2Move){
player1Cards.add(player1Move);
player1Cards.add(player2Move);
}
else {
player2Cards.add(player2Move);
player2Cards.add(player1Move);
}
}
if (player1Cards.isEmpty())
return countWinnerScore(player2Cards);
else
return countWinnerScore(player1Cards);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int whoWin(){\r\n int winner = -1;\r\n \r\n int highest = 0;\r\n \r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(getPlayerPoints(player) > highest){\r\n highest = getPlayerPoints(player);\r\n winner = player.getID();\r\n }\r\n \r\n }\r\n \r\n return winner;\r\n }",
"public static int getPlayerScore()\r\n\t{\r\n\t\treturn playerScore;\r\n\t}",
"public int getPlayerScore();",
"private Score getScore(Player player) {\n Game game = Dogfight.instance.getGame(player);\n\n if (game != null) {\n Team team = game.getPlayerRegistry().getTeam(player);\n\n if (team != null) {\n return game.getScoreRegistry().getScore(team);\n }\n }\n\n return null; //No game found\n }",
"public static Player whoWonGame() {\r\n\t\tint highest = Main.winScoreNumb;\r\n\t\tPlayer winner = null;\r\n\t\t\r\n\t\t//Three handed play.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\twinner = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\twinner = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\twinner = Main.playerThree;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Four handed play with no teams.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\twinner = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\twinner = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\twinner = Main.playerThree;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player4Score) >= highest) {\r\n\t\t\t\thighest = Utils.stringToInt(Main.player4Score);\r\n\t\t\t\twinner = Main.playerFour;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn winner;\r\n\t}",
"public int winner() {\n if(humanPlayerHits == 17) {\n return 1;\n }\n if(computerPlayerHits == 17){\n return 2;\n }\n return 0;\n }",
"public int getPlayerScore(){\n\t\treturn playerScore;\n\t}",
"public int getScore(){\n\t\treturn playerScore;\n\t}",
"private TeamId findWinningTeam(){\n if (state.score().totalPoints(TeamId.TEAM_1)>=Jass.WINNING_POINTS) {\n return TeamId.TEAM_1;\n }\n else {\n return TeamId.TEAM_2;\n }\n }",
"@Override\n public int getScore(String username) throws RemoteException {\n Player p = getPlayer(username);\n return p != null ? p.getScore() : -1;\n }",
"public static Player whoLostGame() {\r\n\t\tint lowest = Main.loseScoreNumb;\r\n\t\tPlayer loser = null;\r\n\t\t\r\n\t\t\r\n\t\t//Three handed play.\r\n\t\tif (Main.isThreeHanded){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\tloser = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\tloser = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\tloser = Main.playerThree;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Four handed play with no teams.\r\n\t\tif (Main.isFourHandedSingle){\r\n\t\t\tif (Utils.stringToInt(Main.player1Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player1Score);\r\n\t\t\t\tloser = Main.playerOne;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player2Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player2Score);\r\n\t\t\t\tloser = Main.playerTwo;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player3Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player3Score);\r\n\t\t\t\tloser = Main.playerThree;\r\n\t\t\t}\r\n\t\t\tif (Utils.stringToInt(Main.player4Score) <= lowest) {\r\n\t\t\t\tlowest = Utils.stringToInt(Main.player4Score);\r\n\t\t\t\tloser = Main.playerFour;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn loser;\r\n\t}",
"public int getScore(String nickname) {\n\t\treturn scoreboard.get(nickname);\n\t}",
"public int winningPlayerScore(LinkedList<Integer> player1Cards, LinkedList<Integer> player2Cards){\n if (recursiveCombat(player1Cards, player2Cards) == 1)\n return countWinnerScore(player1Cards);\n else\n return countWinnerScore(player2Cards);\n }",
"public int getPlayerScore(int index) {\n\t\treturn allplayers.get(index).getScore();\n\t}",
"public int getOpponentScore(){\n return this.oppoScore;\n }",
"@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }",
"public ScoreValues getScore(int player) {\n switch (player) {\n case PLAYER_A:\n return scoreA;\n case PLAYER_B:\n return scoreB;\n }\n return -1;\n }",
"public int getWinner()\n {\n //Loops to get the winner\n for(int i = 0; i < NUM_PLAYERS; i++){\n if(isPlayerWinner(i)) return i; //This player is a winner\n }\n return -1; //no one is a winner so far\n }",
"public static double getChampionMatchResult(String matchDetails, String accountID, double wins) {\n try {\r\n JSONObject searchResultsObj = new JSONObject(matchDetails);\r\n JSONArray searchResultsItems = searchResultsObj.getJSONArray(\"participantIdentities\");\r\n\r\n for (int i = 0; i < searchResultsItems.length(); i++) {\r\n JSONObject resultItem = searchResultsItems.getJSONObject(i);\r\n\r\n if (resultItem.getJSONObject(\"player\").getString(\"accountId\").equals(accountID)) {\r\n int participantId = resultItem.getInt(\"participantId\"); //store the user's id\r\n\r\n JSONArray teams = searchResultsObj.getJSONArray(\"teams\"); //fetch array of game results\r\n\r\n if (teams.getJSONObject(0).getString(\"win\").equals(\"Win\") && participantId < 5) { //check for user as blue team winning\r\n wins++; //the user won, increment to keep track of how many wins total\r\n }\r\n else if (teams.getJSONObject(0).getString(\"win\").equals(\"Fail\") && participantId > 5) { //check for user as red team winning\r\n wins++; //the user won, increment to keep track of how many wins total\r\n }\r\n else {\r\n //do nothing, the user lost this game\r\n }\r\n break; //break, the user has been found\r\n }\r\n }\r\n return wins;\r\n } catch (JSONException e) {\r\n System.out.println(\"JSON CHAMPION MATCH RESULT EXCEPTION: \" + e);\r\n return -1;\r\n }\r\n }",
"public int getScore() {\n return getStat(score);\n }",
"public int getScore(String playerName) {\n\t\treturn this.getMancala(playerName).getStones() + this.getStonesInPits(playerName);\n\t}",
"private Scorestreak getScorestreak(Player player) {\n Game game = Dogfight.instance.getGame(player);\n\n if (game != null) {\n return game.getScoreRegistry().getScorestreak(player);\n }\n\n return null; //No game found\n }",
"@Override\n\tprotected int calculateScore() {\n\t\treturn Math.abs(playerScore[0] - playerScore[1]);\n\t}",
"public int wins(String team) {\n return 0;\n }",
"public void score(){\r\n\t\tint playerLocation = player.getLocationX();\r\n\t\tint obstacleX = obstacle.getLocationX();\r\n\t\tint obstacleY = obstacle.getLocationY();\r\n\r\n\r\n\t\tstr =\"\" + countCoins;\r\n\r\n\t\t//if you hit a coin, the number of points goes up by one.\r\n\t\tif(obstacleY == 280 && obstacleX==300 && playerLocation == 250){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\t\tif(obstacleY== 450 && obstacleX==300 && playerLocation ==450){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\r\n\t\t//if you hit the green monster, you lose one point.\r\n\t\tif((obstacleX-50) == 250 && (obstacleY-240) == 250 && playerLocation ==250){\r\n\t\t\tcountCoins--;\r\n\t\t}\r\n\r\n\t\t//if you hit the blue monster, you lose 3 points.\r\n\t\tif((obstacleX+180) == 480 && (obstacleY+180) == 250 && playerLocation ==450){\r\n\t\t\tcountCoins-=3;\r\n\t\t}\r\n\t}",
"public static Player getWinnerIfPresent(Game game) {\r\n\r\n Map<Player,Integer> scoreMap = new HashMap<>();\r\n\r\n for (Player player : game.getPlayers()) {\r\n int numFrames = player.getFrames().size();\r\n if (numFrames == 10\r\n && player.getFrames().get(numFrames -1).getWasScored()) {\r\n scoreMap.put(player,player.getFrames().get(numFrames -1).getScore());\r\n }\r\n\r\n }\r\n\r\n //set the winner\r\n Optional<Map.Entry<Player, Integer>> entry = scoreMap.entrySet().stream().max(Map.Entry.comparingByValue());\r\n if (entry.isPresent()) {\r\n entry.get().getKey().setWinner(true);\r\n game.setOver(true);\r\n return entry.get().getKey();\r\n }\r\n\r\n return null;\r\n }",
"public static double playerScore(Player player, State state) {\n\t\tdouble playerScore = 0;\n\t\tfor(int row = 0; row < state.getGrid().length; row++) {\n\t\t\tfor(int col = 0; col < state.getGrid()[row].length; col++) {\n\t\t\t\tif(state.getGrid()[row][col] == player.getPiece()) {\n\t\t\t\t\tplayerScore += score(player.getPiece(), state, row, col);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn playerScore;\n\t}",
"private int getGlobalRanking() {\n\t\tint globalRanking = 0;\n\t\ttry{\n\t\t\t//Retrieve list of all players and order them by global score\n\t\t\tArrayList<Player> allPlayers = dc.getAllPlayerObjects();\n\t\t\tCollections.sort(allPlayers, new Comparator<Player>(){\n\t\t\t\t\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(Player p1, Player p2) {\n\t\t\t\t\treturn p2.getGlobalScore() - p1.getGlobalScore();\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\n\t\t\t//Search for the user in the ordered list\n\t\t\tglobalRanking = allPlayers.indexOf(dc.getCurrentPlayer()) +1;\n\n\t\t} catch(DatabaseException e) {\n\t\t\tactivity.showNegativeDialog(\"Error\", e.prettyPrint(), \"OK\");\n\t\t}\n\t\treturn globalRanking;\n\t}",
"static int calculateScore(Card[] winnings) {\n int score = 0;\n for (Card card : winnings)\n if (card != null)\n score++;\n else\n break;\n return score;\n }",
"private long opponent_winning_position() {\r\n return compute_winning_position(bitboard ^ mask, mask);\r\n }",
"public int evaluateWinner() {\n int winner = -1; //-1 house, 0 tie, 1 player\n boolean playerBlackjack = false;\n\n //Player got winnable score\n if (playerScore <= 21) {\n\n //Dealer got a winnable score\n if (dealerScore <= 21) {\n\n //Dealer got blackjack\n if (dealerScore == 21) {\n //Player also got blackjack, tie\n if (playerScore == 21) {\n winner = 0;\n }\n //Player did not have blackjack, loses\n else {\n winner = -1;\n }\n }\n //Player got blackjack, but dealer did not\n else if (playerScore == 21) {\n playerBlackjack = true;\n winner = 1;\n }\n //Tie\n else if (dealerScore == playerScore) {\n winner = 0;\n }\n //Player scored higher than dealer, but did not get blackjack\n else if (playerScore > dealerScore) {\n winner = 1;\n }\n }\n //Dealer went over 21\n else {\n //If player got blackjack\n if (playerScore == 21) {\n playerBlackjack = true;\n }\n\n winner = 1;\n }\n }\n\n //House won\n if (winner == -1) {\n if (playerCash <= 0)\n restartGame();\n else\n return winner;\n }\n //Tie\n else if (winner == 0) {\n playerCash += playerBet;\n return winner;\n }\n //Player won\n else {\n if (playerBlackjack) {\n //Player won, give back original bet AND blackjack earnings\n playerCash += (playerBet + (playerBet * 1.5));\n } else {\n //Player won, give back bet AND earnings\n playerCash += (playerBet + playerBet);\n }\n\n return winner;\n }\n\n return winner;\n }",
"public int wins(String team) {\n return getTeamByName(team).wins;\r\n }",
"public int winner() {\n if (player1Wins())\n return 1;\n if (player2Wins())\n return 2;\n return -1; // No one has won\n }",
"int score(Player player)\n\t{\n\t\treturn IntStream.range(0, state.size())\n\t\t\t.map(i -> state.get(i) == player.getId() ? (int) Math.pow(2, i) : 0)\n\t\t\t.reduce(0, (a, b) -> a + b);\n\t}",
"public int score(){\r\n\t\t//to be implemented: should return game score \r\n\t\tfor(int i=0; i<10; i++)\r\n\t\t{\r\n\t\t\tscore= frames.get(i).score();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn score + bonusGame;\r\n\t}",
"public static int getScore()\n {\n return score;\n }",
"public int getScoreTeamOne() throws ByeMatchException\r\n\t{\r\n\t\tif (isByeMatch)\r\n\t\t{\r\n\t\t\tthrow new ByeMatchException();\r\n\t\t}\r\n\t\treturn score1;\r\n\t}",
"@Override\n public int getWinner()\n {\n return currentPlayer;\n }",
"public int score() {\n ArrayList<Integer> scores = possibleScores();\n int maxUnder = Integer.MIN_VALUE;\n int minOver = Integer.MAX_VALUE;\n for (int score : scores) {\n if (score > 21 && score < minOver) {\n minOver = score;\n } else if (score <= 21 && score > maxUnder) {\n maxUnder = score;\n }\n }\n return maxUnder == Integer.MIN_VALUE ? minOver : maxUnder;\n }",
"public static int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"public static int getScore()\n\t{\n\t\treturn score;\n\t}",
"public PlayerNumber winner() {\n\t\tif (someoneQuit) {\n\t\t\treturn onePlayerLeft;\n\t\t}\n\t\tif (winningPlayer == Game.FIRST_PLAYER) {\n\t\t\treturn Game.FIRST_PLAYER;\n\t\t}\n\t\tif (winningPlayer == Game.SECOND_PLAYER) {\n\t\t\treturn Game.SECOND_PLAYER;\n\t\t}\n\t\tif (movesLeft() > 0) {\n\t\t\treturn Game.GAME_NOT_OVER;\n\t\t}\n\t\treturn Game.DRAW;\n\t}",
"public int getBestScore() {\n\t\tInteger score = this.hand.countValue().lower(22);\n\t\tif(score!=null) {\n\t\t\treturn score;\n\t\t}\n\t\telse {\n\t\t\treturn this.hand.countValue().higher(21);\n\t\t}\n\t}",
"public int getScore() {\n\t\tint darkDisks = 0;\r\n\t\tint lightDisks = 0;\r\n\r\n\t\tfor(Character c : board){\r\n\t\t\tif(c == '1'){\r\n\t\t\t\tdarkDisks++;\r\n\t\t\t}\r\n\t\t\telse if(c == '2'){\r\n\t\t\t\tlightDisks++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//If dark wins\r\n\t\tif(darkDisks > lightDisks){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\t//If light wins\r\n\t\telse if(darkDisks < lightDisks){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t//For a tie\r\n\t\telse if(darkDisks == lightDisks){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t//Return 0 on a tie\r\n\t\treturn 0;\r\n\t}",
"Float getScore();",
"public int wins(String team) {\n return wins[findTeamIndex(team)];\n }",
"public int getScore()\n\t{\n\t\tif (containsAce() && score < 11)\n\t\t\treturn score + 10;\n\t\t\t\n\t\treturn score;\n\t}",
"public int getUserWonNumber() {\n\t\tint result = -1;\n\t\ttry {\n\t\t\tthis.rs = smt.executeQuery(\"SELECT count(id) FROM tp.gamerecord WHERE winner = (SELECT id FROM tp.player WHERE isAI = false)\");\n\t\t\tif(this.rs.next()) {\n\t\t\t\tresult = rs.getInt(1);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Query is Failed!\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}",
"public Player roundWinner() {\n\t\tfor(Player player : gamePlayers){\n\t\t\tEvaluator eval = new Evaluator(player, communityCards);\n\t\t\t\n\t\t\tplayer.setHandRank(eval.evaluate());\n\t\t\tplayersByHandRank.add(player);\n\t\t}\n\t\t\n\t\t//lambdas are magic. Sorts players from lowest to highest rank starting with the lowest at the first\n\t\t//index, and the highest at the last.\n\t\tCollections.sort(playersByHandRank, (p1, p2) -> p1.getHandRank().compareTo(p2.getHandRank()));\n\t\t\n\t\t//TODO: Needs to evaluate high card in case of two or more players have the same high hand rank.\n\t\t//the evaluate method in Evaluator sets high card == to the highest card in a pairSet, flush, or straight,\n\t\t//but needs to be able to add it in the event HIGH_CARD is the highest hand a player has.\n\n\t\treturn playersByHandRank.get(playersByHandRank.size() -1);\n\t}",
"int getScore();",
"public int getPoints(){\n\t\t//add the player socres(including monster killing, powerUp points and winning points\n\t\tint points = this.player.getScore() + 200*this.player.getHealth();\n\t\t\n\t\t//since the better the less time used, we use 600 seconds to minus the total seconds being used\n\t\t//and add it to the points\n\t\t//600 seconds is 10 minutes, which is definity long enough\n\t\t//if exceeds 10 minutes, we will subtract total score\n\t\tif(this.player.win()){\t//only if the player wins will we calculate the time\n\t\t\tpoints += (int)(3600 - (this.time / 1000000000));\n\t\t}\n\t\t\n\t\tthis.totalLabel.setText(String.valueOf(points));\t//set the value of the JLabel\n\t\t\n\t\treturn points;\n\t\t\n\t}",
"public PlayerController calculateWinner()\n {\n // This function will find the winner based on the move that is made by player\n // Here we are checking only the two players who are leading the match\n PlayerController player1 = this.playerControllerList.poll();\n PlayerController player2 = this.playerControllerList.poll();\n this.playerControllerList.add(player1);\n this.playerControllerList.add(player2);\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS && player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n else if(this.gameController.isBoardEmpty() == true)\n {\n if(player1.getPoints() >= player2.getPoints()+GameConfiguration.MINIMUM_DIFF_POINTS || player1.getPoints() >= GameConfiguration.MINIMUM_POINTS_REQUIRED)\n {\n return player1;\n }\n }\n return null;\n }",
"float getScore();",
"float getScore();",
"public int scoreSpec(){\n List<Player> players = state.getPlayers();\n int currentBonusScore = 0;\n int otherBonus = 0;\n for(int i = 0; i < players.size(); i++){\n if( i == state.getCurrentPlayerId()){\n currentBonusScore += bonusScore(players.get(i));\n }\n else{\n otherBonus += bonusScore(players.get(i));\n }\n }\n return currentBonusScore-otherBonus;\n }",
"public PlayerNumber whoseTurn() {\n\t\tif (isGameOver()) {\n\t\t\treturn Game.GAME_OVER;\n\t\t}\n\t\treturn nextPlayer;\n\t}",
"public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n p.setScore(p.getScore() - (10*diff));\n }\n if(p.getTricksWon() == p.getBid()){\n p.setScore(p.getScore() + 20);\n }\n }\n }",
"public void getScores(){\n String p1 = \"Player 1 has \" + Integer.toString(player1.getWins());\n String p2 = \"Player 2 has \" + Integer.toString(player2.getWins());\n String winner = \"tie\";\n if(player1.getWins()>player2.getWins()){\n winner = player1.getName() + \" wins!!!!\";\n }\n else if(player2.getWins()>player1.getWins()){\n winner = player2.getName() + \" Wins!!!\";\n }\n JOptionPane.showMessageDialog(null, (p1 + \"\\n\" + p2 + \"\\n\" + winner));\n }",
"private int determineWinning(GamePlayerInterface player, GamePlayerInterface dealer)\n {\n \n int playerValue = player.getTotalCardsValue();\n int dealerValue = dealer.getTotalCardsValue();\n int result = 0;\n \n if(dealerValue > playerValue)\n {\n \t view.print(\"Dealer Wins\");\n \t view.printLine();\n \t result = 1;\n }\n \n else if(dealerValue < playerValue)\n {\n \t view.print(\"Player Wins\");\n \t view.printLine();\n \t result = 2;\n }\n \n else{\n \t view.print(\"Match Draw!\");\n \t view.printLine();\n }\n \n return result;\n }",
"public Player getWinner() {\n \tif (!isOver())\n \t\treturn null;\n \tif (player1.getScore() > player2.getScore())\n \t\treturn player1;\n \tif (player2.getScore() > player1.getScore())\n \t\treturn player2;\n \treturn null;\n }",
"public int currentHighscore() { \r\n \tFileReader readFile = null;\r\n \tBufferedReader reader = null;\r\n \ttry\r\n \t{\r\n \t\treadFile = new FileReader(\"src/p4_group_8_repo/scores.dat\");\r\n \t\treader = new BufferedReader(readFile);\r\n \t\treturn Integer.parseInt(reader.readLine());\r\n \t}\r\n \tcatch (Exception e)\r\n \t{\r\n \t\treturn 0;\r\n \t}\r\n \tfinally\r\n \t{\r\n \t\ttry {\r\n \t\t\tif (reader != null)\r\n\t\t\t\treader.close();\r\n\t\t\t} catch (IOException e) {\r\n\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n \t}\r\n }",
"public Player checkForWinner() {\n if (playersInGame.size() == 1) {\n Player winner = playersInGame.get(0);\n\n // --- DEBUG LOG ---\n // The winner of the game\n Logger.log(\"WINNING PLAYER:\", winner.toString());\n\n return winner;\n } else {\n return null;\n }\n }",
"long getScore();",
"long getScore();",
"long getScore();",
"long getScore();",
"public Player lookForWinner(){\n\t\tfor(int i = 0; i < this.players.size(); i++){\n\t\t\tif(this.players.get(i).numCards() == 0)\n\t\t\t\treturn this.players.get(i);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public int getPlayerScore(){\n return this.playerScore;\n }",
"public Player<T> findWinner(){\n\tPlayer<T> highPlayer = this.currentPlayer;\n\tPlayer<T> tempPlayer = this.currentPlayer;\n\tfor (int i = 0; i < getNumPlayers(); i++) {\n\t\tif (tempPlayer.getPoints() > highPlayer.getPoints()) {\n\t\t\thighPlayer = getCurrentPlayer();\n\t\t}\n\t\ttempPlayer = tempPlayer.getNext();\n\t}\n\treturn tempPlayer;\n}",
"@Override\n\tpublic int getPlayerOneScore() {\n\t\treturn super.getPlayerOneScore();\n\t}",
"public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}",
"public int getCurrentScore() {\n return currentScore;\n }",
"public int getWinner() {return winner();}",
"@Override\n public void updateScore(int winner)\n {\n if (winner == 0)\n {\n playerOneScore++;\n }\n else\n {\n playerTwoScore++;\n }\n }",
"public int wins(String team) {\n validate(team);\n int t = st.get(team);\n return matTeam[t][1];\n }",
"public int getWinner() {\n for (int i = 0; i < nrOfPlayers(); i++) {\n if (players.get(i).isFinished()) {\n\n // PLAYERLISTENER : Trigger playerEvent for player that WON\n for (PlayerListener listener : playerListeners) {\n PlayerEvent event = new PlayerEvent(this, players.get(i).getColour(), PlayerEvent.WON);\n listener.playerStateChanged(event);\n }\n return i;\n }\n }\n return -1;\n }",
"private String calculateScore(DiceModel Player1, DiceModel Player2) {\n\t\tint p1d1 = Player1.getDie1();\n\t\tint p1d2 = Player1.getDie2();\n\t\tint p1d3 = Player1.getDie3();\n\t\t\n\t\tint p2d1 = Player2.getDie1();\n\t\tint p2d2 = Player2.getDie2();\n\t\tint p2d3 = Player2.getDie3();\n\t\t\n\t\tint p1P = Player1.getPoints();\n\t\tint p2P = Player2.getPoints();\n\t\n\t\t// impParts stands for the 'important parts' used when calculating pairs (the pair)\n\t\tint impPartsP1;\n\t\tint impPartsP2;\n\t\t\n\t\t// for when the sum is needed\n\t\tint sumP1 = (p1d1 + p1d2 + p1d3);\n\t\tint sumP2 = (p2d1 + p2d2 + p2d3);\n\t\t\n\t\t// ranks are the first step in determining who won\n\t\tint rankP1 = getRank(Player1);\n\t\tint rankP2 = getRank(Player2);\n\n\t\t// now that ranks have been gotten, calculate winner\n\t\t// if P1 had higher rank, he wins. the end.\n\t\tif (rankP1 > rankP2) {\n\t\t\twinner = \"Player1\";\n\t\t} else if (rankP2 > rankP1) { // if player2 has higher rank\n\t\t\twinner = \"Player2\";\n\t\t} else if (rankP1 == rankP2) { // if ranks are same\n\t\t\tif (rankP1 == 4) {\t\t\t// if player 1 rolled 421\n\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else {\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t}\n\t\t\t\twinner = \"Player1\";\n\t\t\t} else if (rankP1 == 3) { // if they are triples;\n\t\t\t\tif (sumP1 >= sumP2) { // highest wins\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else if (sumP2 > sumP1) {\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t} else {\n\t\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (rankP1 == 2) { // if they are doubles\n\t\t\t\tif (p1d1 == p1d2) {\n\t\t\t\t\timpPartsP1 = p1d1; // set the important part to the pair\n\t\t\t\t} else {\n\t\t\t\t\timpPartsP1 = p1d3;\n\t\t\t\t}\n\t\t\t\tif (p2d1 == p2d2) { // do it for player 2 also\n\t\t\t\t\timpPartsP2 = p2d1;\n\t\t\t\t} else {\n\t\t\t\t\timpPartsP2 = p2d3;\n\t\t\t\t}\n\t\t\t\tif (impPartsP1 > impPartsP2) { //if player1 pair is better\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else if (impPartsP2 > impPartsP1) { // or p2's > p1's\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t} else if (impPartsP1 == impPartsP2) { // if same pair\n\t\t\t\t\tif (sumP1 >= sumP2) {\t\t\t\t// add them up\n\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t} else if (sumP2 > sumP1) {\n\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tif (sumP1 >= sumP2) { // if no pairs or better, take sums\n\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t} else if (sumP2 > sumP1){\n\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t} else {\n\t\t\t\t\tif (winner.equals(\"Player1\")) {\n\t\t\t\t\t\twinner = \"Player1\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twinner = \"Player2\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} \t\n\t\t\n\t\tif (winner.equals(\"Player1\")) {\n\t\t\tplayer1.setPoints(p1P + 1);\n\t\t} else {\n\t\t\tplayer2.setPoints(p2P + 1);\n\t\t}\n\t\treturn winner;\n\t}",
"public int getRoundScore() {\n return score;\n }",
"int score();",
"int score();",
"public int getWinner(Shape shapeRandomPlayer){\n\t\tint winner = -1;\n\t\ttry{\n\t\t\tswitch(shapeRandomPlayer){\n\t\t\tcase SCISSOR:\n\t\t\t\twinner = DEFAULT_PLAYER_INT;\n\t\t\t\tbreak;\n\t\t\tcase PAPER:\n\t\t\t\twinner = RANDOM_PLAYER_INT;\n\t\t\t\tbreak;\n\t\t\tcase ROCK:\n\t\t\t\twinner = DRAW_INT;\n\t\t\t\tbreak;\n\t\t }\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tthrow new RuntimeException(\"Shape not valid\");\n\t\t}\n\t\treturn winner;\n\t}",
"public int getPointsAgainst() {\n int pointsAgainst = 0;\n for (Game g : gameList) {\n pointsAgainst += g.getOtherTeamScore(this);\n }\n return pointsAgainst;\n }",
"public Player getWinner();",
"public double findScore(String name) throws RemoteException {\r\n double score = -1;\r\n try {\r\n // Set the specified name in the prepared statement\r\n pstmt.setString(1, name);\r\n\r\n // Execute the prepared statement\r\n ResultSet rs = pstmt.executeQuery();\r\n\r\n // Retrieve the score\r\n if (rs.next()) {\r\n if (rs.getBoolean(3))\r\n score = rs.getDouble(2);\r\n }\r\n }\r\n catch (SQLException ex) {\r\n System.out.println(ex);\r\n }\r\n\r\n System.out.println(name + \"\\'s score is \" + score);\r\n return score;\r\n }",
"public int wins(String team) {\n validateTeam(team);\n return w[teamsMap.get(team)];\n }",
"public Integer getGameScore() {\n return gameScore;\n }",
"public int getHeuristicScore() {\n \tCell cell=curMap.getCell(nodePos[0], nodePos[1]);\r\n \tint cost=cell.getCost();\r\n \tint[] goal=curMap.getTerminal();\r\n \t//System.out.println(cost);\r\n \tint heuristic=Math.abs(nodePos[0] - goal[0]) + Math.abs(nodePos[1] - goal[1]);\r\n \treturn heuristic + cost;\r\n }",
"private void whoIsTheWinner() {\n\t\t// at first we say let the number for winner and the maximal score be 0.\n\t\tint winnerName = 0;\n\t\tint maxScore = 0;\n\t\t// then, for each player, we check if his score is more than maximal\n\t\t// score, and if it is we let that score to be our new maximal score and\n\t\t// we generate the player number by it and we let that player number to\n\t\t// be the winner, in other way maximal scores doen't change.\n\t\tfor (int i = 1; i <= nPlayers; i++) {\n\t\t\tif (totalScore[i] > maxScore) {\n\t\t\t\tmaxScore = totalScore[i];\n\t\t\t\twinnerName = i - 1;\n\t\t\t}\n\t\t}\n\t\t// finally, program displays on screen who is the winner,and what score\n\t\t// he/she/it got.\n\t\tdisplay.printMessage(\"Congratulations, \" + playerNames[winnerName]\n\t\t\t\t+ \", you're the winner with a total score of \" + maxScore + \"!\");\n\t}",
"public int getScore(String nickname) throws NoSuchElementException {\n if (nickname == null) throw new NoSuchElementException(\"The nickname is not valid!\");\n User user = this.onlineUsers.get(nickname);\n if (user != null) {\n return user.getScore();\n }\n throw new NoSuchElementException(\"The user is not currently online\");\n }",
"@Override\n public int getWinner() {\n //TODO Implement this method\n return -1;\n }",
"public int getScore() {\n return currentScore;\n }",
"public void updatePlayerScore()\n\t{\n\t\tthis.score = (int)(getBalance() - 500) - (getNumberOfLoans()*500); \n\t}",
"public int score() {\n return score;\n }",
"public static int getScore(){\n return score;\n }",
"public int getWhoseTurn() {\n if (gameStatus == null || gameStatus.getActivePlayer() == null) return -1;\n if (gameStatus.getActivePlayer().equals(gameStatus.getPlayerOne())) return 1;\n if (gameStatus.getActivePlayer().equals(gameStatus.getPlayerTwo())) return 2;\n return -2;\n }",
"public int getScore()\n {\n return currentScore;\n }",
"public int getWinner() {\n return winner;\n }",
"public int getScorePlayer2() {\n\t\treturn this.scorePlayer2;\n\t}",
"public int getPointsFor() {\n int pointsFor = 0;\n for (Game g : gameList) {\n pointsFor += g.getTeamScore(this);\n }\n return pointsFor;\n }",
"public Integer getWinner() {\n if (isWinner(PLAYER_X)) {\n return (int) PLAYER_X;\n } else if (isWinner(PLAYER_O)) {\n return (int) PLAYER_O;\n } else if (getFreeFields().isEmpty()) {\n return 0;\n } else {\n return null;\n }\n }",
"public int winningPlayerIndex(int[][] board, Move lastMove) {\n int m = board.length;\n int n = board[0].length;\n\n\n int player = lastMove.playerIndex;\n int curRow = lastMove.row;\n int curCol = lastMove.col;\n\n\n int start = Math.max(0, curCol - 3);\n for (int i = start; i + 3 < n; i++) {\n if (board[curRow][i] == player && board[curRow][i + 1] == player\n && board[curRow][i + 2] == player && board[curRow][i + 3] == player) {\n return player;\n }\n }\n\n int startRow = Math.max(0, curRow - 3);\n for (int i = start; i + 3 < m; i++) {\n if (board[i][curCol] == player && board[i + 1][curCol] == player\n && board[i + 2][curCol] == player && board[i + 3][curCol] == player) {\n return player;\n }\n }\n\n int count = 0;\n int x = curRow;\n int y = curCol;\n while (x >= 0 && y >= 0) {\n if (board[x][y] == player) {\n count++;\n x--;\n y--;\n if (count >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n x = curRow + 1;\n y = curCol + 1;\n while (x < m && y < n) {\n if (board[x][y] == player) {\n count++;\n x++;\n y++;\n if (count >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n int count1 = 0;\n int x1 = curRow;\n int y1 = curCol;\n while (x1 < m && y1 >= 0) {\n if (board[x1][y1] == player) {\n count1++;\n x1++;\n y1--;\n if (count1 >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n x1 = curRow - 1;\n y1 = curCol + 1;\n while (x1 >= 0 && y1 < n) {\n if (board[x1][y1] == player) {\n count1++;\n x1--;\n y1++;\n if (count1 >= 4) {\n return player;\n }\n } else {\n break;\n }\n }\n\n\n\n// //horizontal\n// for (int i = 0; i < m; i++) {\n// for (int j = 0; j + 3 < n; j++) {\n// if (board[i][j] == player && board[i][j + 1] == player && board[i][j + 2] == player && board[i][j + 3] == player) {\n// return player;\n// }\n// }\n// }\n\n// //vertical\n// for (int i = 0; i + 3 < m; i++) {\n// for (int j = 0; j < n; j++) {\n// if (board[i][j] == player && board[i + 1][j] == player && board[i + 2][j] == player && board[i + 3][j] == player) {\n// return player;\n// }\n// }\n// }\n\n// //diagonal from upper left to lower right\n// for (int i = 3; i < m; i++) {\n// for (int j = 3; j < n; j++) {\n// if (board[i][j] == player && board[i - 1][j - 1] == player && board[i - 2][j - 2] == player && board[i - 3][j - 3] == player) {\n// return player;\n// }\n// }\n// }\n\n// //diagnoal from lower left to upper right\n// for (int i = 3; i < m; i++) {\n// for (int j = 0; j + 3 < n; j++) {\n// if (board[i][j] == player && board[i - 1][j + 1] == player && board[i - 2][j + 2] == player && board[i - 3][j + 3] == player) {\n// return player;\n// }\n// }\n// }\n\n return -1;\n }"
] | [
"0.7590163",
"0.74833477",
"0.73805994",
"0.72841465",
"0.71532655",
"0.71014184",
"0.7094649",
"0.7010742",
"0.6957401",
"0.6955533",
"0.69344205",
"0.6917168",
"0.686574",
"0.6833793",
"0.68293333",
"0.6827398",
"0.6819881",
"0.67935544",
"0.67649555",
"0.6761504",
"0.6743442",
"0.6735077",
"0.6717408",
"0.67014486",
"0.6701158",
"0.6695242",
"0.6690981",
"0.668605",
"0.6655197",
"0.6648876",
"0.6640743",
"0.66264236",
"0.66171795",
"0.66131663",
"0.6611619",
"0.6602256",
"0.6602064",
"0.6597678",
"0.65944666",
"0.6586108",
"0.6577226",
"0.6559939",
"0.6553647",
"0.65378374",
"0.6520273",
"0.65111566",
"0.6510332",
"0.64973795",
"0.6490608",
"0.6476972",
"0.6452091",
"0.6446311",
"0.64445907",
"0.64445907",
"0.6442474",
"0.64424044",
"0.64399934",
"0.6434967",
"0.6427613",
"0.6425858",
"0.64246523",
"0.6421394",
"0.64170194",
"0.64170194",
"0.64170194",
"0.64170194",
"0.64136016",
"0.6402071",
"0.6401617",
"0.6386056",
"0.63786846",
"0.63773775",
"0.6364716",
"0.63632375",
"0.635177",
"0.63487965",
"0.6343293",
"0.6334113",
"0.6330933",
"0.6330933",
"0.63273907",
"0.63136715",
"0.6304245",
"0.62939763",
"0.62896913",
"0.62846124",
"0.627478",
"0.626995",
"0.6268743",
"0.6266266",
"0.626428",
"0.62551427",
"0.6253669",
"0.62497526",
"0.6243792",
"0.6241988",
"0.6240572",
"0.6239616",
"0.62363803",
"0.6234103",
"0.62308234"
] | 0.0 | -1 |
Counts the winner's score. | private int countWinnerScore(LinkedList<Integer> cards){
int size = cards.size();
return IntStream.range(0, size)
.map(i -> cards.get(i) * (size - i))
.sum();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void updateScore(int winner)\n {\n if (winner == 0)\n {\n playerOneScore++;\n }\n else\n {\n playerTwoScore++;\n }\n }",
"int getScoresCount();",
"static int calculateScore(Card[] winnings) {\n int score = 0;\n for (Card card : winnings)\n if (card != null)\n score++;\n else\n break;\n return score;\n }",
"public void score(){\r\n\t\tint playerLocation = player.getLocationX();\r\n\t\tint obstacleX = obstacle.getLocationX();\r\n\t\tint obstacleY = obstacle.getLocationY();\r\n\r\n\r\n\t\tstr =\"\" + countCoins;\r\n\r\n\t\t//if you hit a coin, the number of points goes up by one.\r\n\t\tif(obstacleY == 280 && obstacleX==300 && playerLocation == 250){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\t\tif(obstacleY== 450 && obstacleX==300 && playerLocation ==450){\r\n\t\t\tcountCoins++;\r\n\t\t}\r\n\r\n\t\t//if you hit the green monster, you lose one point.\r\n\t\tif((obstacleX-50) == 250 && (obstacleY-240) == 250 && playerLocation ==250){\r\n\t\t\tcountCoins--;\r\n\t\t}\r\n\r\n\t\t//if you hit the blue monster, you lose 3 points.\r\n\t\tif((obstacleX+180) == 480 && (obstacleY+180) == 250 && playerLocation ==450){\r\n\t\t\tcountCoins-=3;\r\n\t\t}\r\n\t}",
"public int winner() {\n if(humanPlayerHits == 17) {\n return 1;\n }\n if(computerPlayerHits == 17){\n return 2;\n }\n return 0;\n }",
"public void countScore(int score)\n {\n scoreCounter.add(score);\n }",
"public int getTotalOfwins() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfWins()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfWins();\n }",
"public int wins(String team) {\n return 0;\n }",
"public void scoring(){\n for (int i=0; i< players.size(); i++){\n Player p = players.get(i);\n p.setScore(10*p.getTricksWon());\n if(p.getTricksWon() < p.getBid() || p.getTricksWon() > p.getBid()){\n int diff = Math.abs(p.getTricksWon() - p.getBid());\n p.setScore(p.getScore() - (10*diff));\n }\n if(p.getTricksWon() == p.getBid()){\n p.setScore(p.getScore() + 20);\n }\n }\n }",
"public String countScore() {\n String str =\"\";\n System.out.println(\"Game has ended\");\n int playerOneCount = 0;\n int playerTwoCount = 0;\n System.out.println(\"this is size of computer board\" + player2.playerTwoDomino.size());\n System.out.println(\"this is size of boneyard \" + allElements.size());\n System.out.println(\"this is size of human board \" + human1.playerOneDomino.size());\n System.out.println(\"this is size of game board \" + gameBoard.size());\n for (int i = 0; i < human1.playerOneDomino.size(); i++) {\n playerOneCount = playerOneCount + human1.playerOneDomino.get(i).getX() + human1.playerOneDomino.get(i).getX();\n }\n for (int j = 0; j < player2.playerTwoDomino.size(); j++) {\n playerTwoCount = playerTwoCount + player2.playerTwoDomino.get(j).getX() + player2.playerTwoDomino.get(j).getY();\n }\n\n if (playerOneCount < playerTwoCount) {\n str = \"Winner is Human by \" + (playerTwoCount - playerOneCount) + \" points\";\n\n\n } else {\n str = \"Winner is Computer by \" + (playerOneCount - playerTwoCount) + \" points\";\n\n }\n\n return str;\n }",
"public void calculateScores()\r\n {\r\n for(int i = 0; i < gameBoard.getBoardRows(); i++)\r\n for(int j = 0; j < gameBoard.getBoardCols(); j++)\r\n {\r\n if(gameBoard.tilePlayer(i,j) == 0)\r\n currentRedScore = currentRedScore + gameBoard.tileScore(i,j);\r\n if(gameBoard.tilePlayer(i,j) == 1)\r\n currentBlueScore = currentBlueScore + gameBoard.tileScore(i,j);\r\n }\r\n }",
"public int totalScore() {\n return 0;\n }",
"void computeResult() {\n // Get the winner (null if draw).\n roundWinner = compareTopCards();\n\n\n if (roundWinner == null) {\n logger.log(\"Round winner: Draw\");\n logger.log(divider);\n // Increment statistic.\n numDraws++;\n\n } else {\n logger.log(\"Round winner: \" + roundWinner.getName());\n\t logger.log(divider);\n this.gameWinner = roundWinner;\n if (roundWinner.getIsHuman()) {\n // Increment statistic.\n humanWonRounds++;\n }\n }\n\n setGameState(GameState.ROUND_RESULT_COMPUTED);\n }",
"public int score(){\r\n\t\t//to be implemented: should return game score \r\n\t\tfor(int i=0; i<10; i++)\r\n\t\t{\r\n\t\t\tscore= frames.get(i).score();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn score + bonusGame;\r\n\t}",
"public int winner() {\n if (player1Wins())\n return 1;\n if (player2Wins())\n return 2;\n return -1; // No one has won\n }",
"public int getScoresCount() {\n return scores_.size();\n }",
"public static void incrementScore() {\n\t\tscore++;\n\t}",
"public int getTotalScore() {\r\n return totalScore;\r\n }",
"public int getScore() {\n\t\tint darkDisks = 0;\r\n\t\tint lightDisks = 0;\r\n\r\n\t\tfor(Character c : board){\r\n\t\t\tif(c == '1'){\r\n\t\t\t\tdarkDisks++;\r\n\t\t\t}\r\n\t\t\telse if(c == '2'){\r\n\t\t\t\tlightDisks++;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//If dark wins\r\n\t\tif(darkDisks > lightDisks){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\t//If light wins\r\n\t\telse if(darkDisks < lightDisks){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\t//For a tie\r\n\t\telse if(darkDisks == lightDisks){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t//Return 0 on a tie\r\n\t\treturn 0;\r\n\t}",
"public int totalGames() {\n return wins + losses + draws;\n }",
"public int getWins() {\n return wins;\n }",
"public void updateScore(){\r\n if (this.isArtist || winners.contains(this)) {\r\n this.score += pointsGainedLastRound;\r\n }\r\n pointsGainedLastRound = 0;\r\n placeLastRound = 0;\r\n }",
"public int getWins() {\n return wins;\n }",
"private int computeScore() {\n int score = 0;\n for (int i = 0; i < MainActivity.DEFAULT_SIZE; i++) {\n TextView answerView = (TextView) findViewById(MainActivity.NAME_VIEWS[i]);\n String answer = answerView.getText().toString();\n String solution = getQuizCountries().get(i).getName();\n if (answer.equals(solution)) {\n score++;\n }\n }\n return score;\n }",
"public void winner() {\n\t\tList<String> authors = new ArrayList<String>(scores_authors.keySet());\n\t\tCollections.sort(authors, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_authors.get(o1).compareTo(scores_authors.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des auteurs :\");\n\t\tfor(String a :authors) {\n\t\t\tSystem.out.println(a.substring(0,5)+\" : \"+scores_authors.get(a));\n\t\t}\n\t\t\n\t\tList<String> politicians = new ArrayList<String>(scores_politicians.keySet());\n\t\tCollections.sort(politicians, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\treturn scores_politicians.get(o1).compareTo(scores_politicians.get(o2));\n\t\t\t}\n\t\t});\n\t\tSystem.out.println(\"Score des politiciens :\");\n\t\tfor(String p :politicians) {\n\t\t\tSystem.out.println(p.substring(0,5)+\" : \"+scores_politicians.get(p));\n\t\t}\n\t}",
"@Override\n\tpublic int findCounts(Score score) {\n\t\treturn scoreDao.findCounts(score);\n\t}",
"public int getPlayerScore();",
"public int getScoresCount() {\n if (scoresBuilder_ == null) {\n return scores_.size();\n } else {\n return scoresBuilder_.getCount();\n }\n }",
"public int wins(String team) {\n return getTeamByName(team).wins;\r\n }",
"public static int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"public static int getScore()\n\t{\n\t\treturn score;\n\t}",
"public int scoreSpec(){\n List<Player> players = state.getPlayers();\n int currentBonusScore = 0;\n int otherBonus = 0;\n for(int i = 0; i < players.size(); i++){\n if( i == state.getCurrentPlayerId()){\n currentBonusScore += bonusScore(players.get(i));\n }\n else{\n otherBonus += bonusScore(players.get(i));\n }\n }\n return currentBonusScore-otherBonus;\n }",
"int score();",
"int score();",
"private int calculateScore(){\n int score = 0;\n for(Card card : hand){\n score += card.getScore();\n }\n return score;\n }",
"public int score() {\n int sum = 0;\n for (Candidate c : chosen) {\n sum += c.score(compatibilityScoreSet);\n }\n return sum;\n }",
"public int getScore() {\n int totalScore = 0;\n for (Frame current : frames) {\n totalScore += current.getScore();\n }\n return totalScore;\n }",
"public void CalculatePointsFromEachPlayerToWinner(Player winner) {\n\n\t\tfor (int i = 0; i < players.size(); i++) { \n\t\t\tif (players.get(i).getName() != winner.getName()) {\n\t\t\t\tfor (int j = 0; j < players.get(i).getPlayersHand().size(); j++) {\n\t\t\t\t\twinner.setPlayerScore(players.get(i).getPlayersHand().get(j).getValue() + winner.getPlayerScore());\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\t\tif (winner.getPlayerScore() > 500) {\n\t\t\t//End of game. Implement this later\n\t\t}\n\t}",
"private int scoreCounter(int result) {\n result +=1;\n return result;\n }",
"public int getWinner() {return winner();}",
"int getScore();",
"public int score() {\n return score;\n }",
"public static int getScore()\n {\n return score;\n }",
"public int getOpponentScore(){\n return this.oppoScore;\n }",
"private void DeclareWinner(){\n\t\tTextView tvStatus = (TextView) findViewById(R.id.tvStatus);\n\t\tTextView tvP1Score = (TextView) findViewById(R.id.tvP1Score);\n\t\tTextView tvP2SCore = (TextView) findViewById(R.id.tvP2Score);\n\t\tTextView tvTieScore = (TextView) findViewById(R.id.tvTieScore);\n\t\tswitch(winner){\n\t\t\tcase CAT:\n\t\t\t\ttieScore = tieScore + 1;\n\t\t\t\ttvStatus.setText(\"Tie Cat Wins!\");\n\t\t\t\ttvTieScore.setText(String.valueOf(tieScore));\n\t\t\t\tbreak;\n\t\t\tcase P1_WINNER:\n\t\t\t\tp1Score = p1Score + 1;\n\t\t\t\ttvStatus.setText(\"Player 1 Wins!\");\n\t\t\t\ttvP1Score.setText(String.valueOf(p1Score));\n\t\t\t\tbreak;\n\t\t\tcase P2_WINNER:\n\t\t\t\tp2Score = p2Score + 1;\n\t\t\t\ttvStatus.setText(\"Player 2 Wins!\");\n\t\t\t\ttvP2SCore.setText(String.valueOf(p2Score));\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public int getTotalScore() {\n\t\tLoadingDatabaseTotalScore();\n\t\treturn totalScore;\n\t}",
"public int getScore(String nickname) {\n\t\treturn scoreboard.get(nickname);\n\t}",
"public int addWinningGame() {\n\t\tgamesWon++;\n\t\treturn gamesWon;\n\t}",
"public int getWinner() {\n return winner;\n }",
"public int winningPlayerScore(LinkedList<Integer> player1Cards, LinkedList<Integer> player2Cards){\n if (recursiveCombat(player1Cards, player2Cards) == 1)\n return countWinnerScore(player1Cards);\n else\n return countWinnerScore(player2Cards);\n }",
"public int whoWin(){\r\n int winner = -1;\r\n \r\n int highest = 0;\r\n \r\n for(Player player : discWorld.getPlayer_HASH().values()){\r\n if(getPlayerPoints(player) > highest){\r\n highest = getPlayerPoints(player);\r\n winner = player.getID();\r\n }\r\n \r\n }\r\n \r\n return winner;\r\n }",
"public int moveScore(long move) {\r\n return popcount(compute_winning_position(bitboard | move, mask));\r\n }",
"public int getNumWins() {\n\t\treturn this.numWins;\n\t}",
"public int playerCount()\r\n\t{\r\n\t\tint count = 0;\r\n\t\tfor(Player player: this.players)\r\n\t\t{\r\n\t\t\tif(player != null)\r\n\t\t\t{\r\n\t\t\t\t++count;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public int getScore(){\n\t\treturn playerScore;\n\t}",
"public void calculateScore() {\n\n turnScore();\n\n if (turn == 1) {\n p1.setScore(p1.getScore() - turnScore);\n\n } else if (turn == 2) {\n p2.setScore(p2.getScore() - turnScore);\n\n }\n\n\n }",
"public static int getPlayerScore()\r\n\t{\r\n\t\treturn playerScore;\r\n\t}",
"@Override\n public int getScore() {\n return totalScore;\n }",
"public int getRoundScore() {\n return score;\n }",
"int getWins() {return _wins;}",
"public void tellPlayerResult(int winner) {\n\t}",
"public void getScores(){\n String p1 = \"Player 1 has \" + Integer.toString(player1.getWins());\n String p2 = \"Player 2 has \" + Integer.toString(player2.getWins());\n String winner = \"tie\";\n if(player1.getWins()>player2.getWins()){\n winner = player1.getName() + \" wins!!!!\";\n }\n else if(player2.getWins()>player1.getWins()){\n winner = player2.getName() + \" Wins!!!\";\n }\n JOptionPane.showMessageDialog(null, (p1 + \"\\n\" + p2 + \"\\n\" + winner));\n }",
"private void scoreCounter(int playerName, int category, int score) {\n\t\t// firstly it will update the category score.\n\t\tdisplay.updateScorecard(category, playerName, score);\n\t\t// if the category is lower than upper score it means that player chose\n\t\t// one to six, and we calculate than the upper score.\n\t\tif (category < UPPER_SCORE) {\n\t\t\tupperScore[playerName] += score;\n\t\t\tdisplay.updateScorecard(UPPER_SCORE, playerName,\n\t\t\t\t\tupperScore[playerName]);\n\t\t\t// if the category is more than upper score it means that player\n\t\t\t// chose and we calculate than the lower score.\n\t\t} else if (category > UPPER_SCORE) {\n\t\t\tlowerScore[playerName] += score;\n\t\t\tdisplay.updateScorecard(LOWER_SCORE, playerName,\n\t\t\t\t\tlowerScore[playerName]);\n\t\t}\n\t\t// here we calculate total score by summing upper and lower scores.\n\t\ttotalScore[playerName] = upperScore[playerName]\n\t\t\t\t+ lowerScore[playerName];\n\t\t// if upper score is more than 63 it means player got the bonus.\n\t\tif (upperScore[playerName] >= 63) {\n\t\t\tdisplay.updateScorecard(UPPER_BONUS, playerName, 63);\n\t\t\t// we plus that bonus to total score.\n\t\t\ttotalScore[playerName] += 63;\n\t\t} else {\n\t\t\t// if upper score is lower than 63 it means player didn't get bonus,\n\t\t\t// and it means that bonus=0.\n\t\t\tdisplay.updateScorecard(UPPER_BONUS, playerName, 0);\n\t\t}\n\t\t// and finally we display total score.\n\t\tdisplay.updateScorecard(TOTAL, playerName, totalScore[playerName]);\n\t}",
"public int getTotalScore(){\r\n return totalScore;\r\n }",
"public int getScore() {\n return getStat(score);\n }",
"public int getNumPlayed()\n\t{\n\t\treturn numPlayed;\n\t}",
"@Override\n\tprotected int calculateScore() {\n\t\treturn Math.abs(playerScore[0] - playerScore[1]);\n\t}",
"int getCount(Side player) {\n return player == BLACK ? _countBlack : _countWhite;\n }",
"public void setWins() {\r\n this.wins++;\r\n }",
"public void updatescore() {\n scorelabel.setText(\"\" + score + \" points\");\n if (100 - score <= 10) win();\n }",
"public int getPlayerScore(){\n\t\treturn playerScore;\n\t}",
"public int getScore() {\r\n\t\tint sum = 0;\r\n\t\tint value;\r\n\t\tint aces = 0;\r\n\t\t\r\n\t\t// Gets card values from hand\r\n\t\tfor (int i = 0; i < cards; i++) {\r\n\t\t\tvalue = this.Hand.get(i).cardValue();\r\n\t\t\tsum = sum + value;\r\n\t\t\tif (value == 11) {\r\n\t\t\t\taces++;\r\n\t\t\t}\r\n\t\t\tvalue = 0;\r\n\t\t}\r\n\t\t\r\n\t\twhile (aces > 0 && sum > 21) {\r\n\t\t\tsum = sum - 10;\r\n\t\t\taces--;\r\n\t\t}\r\n\t\t\r\n\t\treturn sum;\r\n\t}",
"public int incrementNumberWins()\n\t{\n\t\treturn myNumberWins++;\n\t}",
"public int getScore(Grid grid) {\n Integer[] allValues = {0, 0, 0, 0, 0, 0};\n for (int idx_x = 0; idx_x < Grid.COLUMNS; idx_x++) {\n for (int idx_y = 0; idx_y < Grid.ROWS; idx_y++) {\n if (!grid.isCellEmpty(idx_x, idx_y)) {\n Dice currDie = grid.getDie(idx_x, idx_y);\n allValues[currDie.getValue()-1] += 1;\n }\n }\n }\n return Collections.min(Arrays.asList(allValues)) * this.objValue;\n }",
"public int getTotalScore(){\n return totalScore;\n }",
"public int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"public int getScore()\r\n\t{\r\n\t\treturn score;\r\n\t}",
"private void whoIsTheWinner() {\n\t\t// at first we say let the number for winner and the maximal score be 0.\n\t\tint winnerName = 0;\n\t\tint maxScore = 0;\n\t\t// then, for each player, we check if his score is more than maximal\n\t\t// score, and if it is we let that score to be our new maximal score and\n\t\t// we generate the player number by it and we let that player number to\n\t\t// be the winner, in other way maximal scores doen't change.\n\t\tfor (int i = 1; i <= nPlayers; i++) {\n\t\t\tif (totalScore[i] > maxScore) {\n\t\t\t\tmaxScore = totalScore[i];\n\t\t\t\twinnerName = i - 1;\n\t\t\t}\n\t\t}\n\t\t// finally, program displays on screen who is the winner,and what score\n\t\t// he/she/it got.\n\t\tdisplay.printMessage(\"Congratulations, \" + playerNames[winnerName]\n\t\t\t\t+ \", you're the winner with a total score of \" + maxScore + \"!\");\n\t}",
"public void scoringTrick(){\n wizardRule();\n winner.tricksWon++;\n winner = new Player();\n }",
"public static void score() {\n\t\tSystem.out.println(\"SCORE: \");\n\t\tSystem.out.println(player1 + \": \" + score1);\n\t\tSystem.out.println(player2 + \": \" + score2);\n\t}",
"public int getScore(){\r\n\t\treturn score;\r\n\t}",
"public int getScore(){\r\n\t\treturn score;\r\n\t}",
"public int score()\n {\n if (this.score != Integer.MIN_VALUE)\n return this.score;\n\n this.score = 0;\n if (!this.safe)\n return 0;\n\n // End game bonus\n int bonus = this.d.size() * Math.max(0, (this.L - 3 * this.b.shots)) * 3;\n this.score = (this.d.size() * 100) + ((this.NE - this.e.size()) * 10) + (this.e.size() == 0 ? bonus : 0);\n\n // value:\n return this.score;\n }",
"public int getHighscoreCount() {\r\n\t\t//TODO\r\n\t\treturn -1;\r\n\t}",
"public int calculScore(Deck deck)\n {\n return 0;\n }",
"public String winner() {\r\n\t\tif(player1.isDone() || player2.isDone()) {\r\n\t\t\tint count1 = player1.winningsCount();\r\n\t\t\tint count2 = player2.winningsCount();\r\n\t\t\tif(count1 > count2) {\r\n\t\t\t\treturn \"Player 1 wins, \" + count1 + \" to \" + count2 + \"!\";\r\n\t\t\t}else if(count2 > count1) {\r\n\t\t\t\treturn \"Player 2 wins, \" + count2 + \" to \" + count1 + \"!\";\r\n\t\t\t}else {\r\n\t\t\t\treturn \"The Game ends in a tie!\";\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}",
"public int getScore() {\r\n\t\treturn deck.getScore() + extraVictory;\r\n\t}",
"public void countPoints() {\n points = 0;\n checkAnswerOne();\n checkAnswerTwo();\n checkAnswerThree();\n checkAnswerFour();\n checkAnswerFive();\n checkAnswerSix();\n checkAnswerSeven();\n checkAnswerEight();\n checkAnswerNine();\n checkAnswerTen();\n }",
"int score(OfcHandMatrix matrix);",
"public int getF_Wins() {\n return f_wins;\n }",
"public int getScore() {\n return currentScore;\n }",
"public int getScore(){\n\t\treturn this.score;\n\t}",
"public int getScore(){\n\t\treturn this.score;\n\t}",
"public int diffScore() {\n\t\treturn getWin() - getLose();\n\t}",
"long getScore();",
"long getScore();",
"long getScore();",
"long getScore();",
"public int getScore(){\n\t\treturn score;\n\t}"
] | [
"0.76205844",
"0.7286716",
"0.7267946",
"0.71182096",
"0.70023614",
"0.6947394",
"0.6808398",
"0.68029803",
"0.67905205",
"0.67491496",
"0.672956",
"0.6716588",
"0.67119265",
"0.6695638",
"0.66560704",
"0.6649394",
"0.66332376",
"0.6598745",
"0.65980625",
"0.65963686",
"0.6566447",
"0.6548162",
"0.65471584",
"0.65292305",
"0.6503236",
"0.648919",
"0.6488786",
"0.64327884",
"0.64304304",
"0.6419084",
"0.6418779",
"0.64157736",
"0.64145046",
"0.64145046",
"0.64143944",
"0.6411898",
"0.6409056",
"0.6403168",
"0.6373964",
"0.63534284",
"0.6349541",
"0.6349469",
"0.634167",
"0.63415706",
"0.6339447",
"0.6332547",
"0.6320819",
"0.63196766",
"0.63089025",
"0.6305081",
"0.63017297",
"0.62954134",
"0.6294963",
"0.6294665",
"0.62912333",
"0.6290824",
"0.6290703",
"0.6283999",
"0.62830424",
"0.62773424",
"0.6276725",
"0.62534165",
"0.6249937",
"0.624684",
"0.6245204",
"0.6245008",
"0.62210757",
"0.62195086",
"0.6217657",
"0.6216173",
"0.6211861",
"0.62002164",
"0.619845",
"0.6188322",
"0.61870587",
"0.6175929",
"0.6175929",
"0.61718583",
"0.61679536",
"0.61465424",
"0.61454904",
"0.61454904",
"0.6138444",
"0.61336875",
"0.61265534",
"0.6114627",
"0.6112491",
"0.61016846",
"0.61009765",
"0.6100958",
"0.6099358",
"0.6098683",
"0.6098683",
"0.60938025",
"0.6091544",
"0.6091544",
"0.6091544",
"0.6091544",
"0.60863996"
] | 0.6651363 | 16 |
If the request is a Set it is forwarded to all the servers and finally the response sent back to the client | private void sendSetRequest() {
numOfSets++;
type = "0";
numOfRecipients = servers.size();
for(ServerHandler s : servers) {
s.send(this, input);
}
sendTime = System.nanoTime();
workerTime = sendTime - pollTime;
for(ServerHandler s : servers) {
String ricevuto = s.receive();
replies.add(ricevuto);
}
receiveTime = System.nanoTime();
processingTime = receiveTime - sendTime;
for(String reply : replies) {
if(!("STORED".equals(reply))) {
unproperRequests.add(reply);
sendBack(currentJob.getClient(), reply);
replies.clear();
return;
}
}
sendBack(currentJob.getClient(), "STORED");
replies.clear();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"private void getMall(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}",
"private void processRequest(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) {\n\r\n\t}",
"public ServerResponse<T> sendRequest()\n {\n return this.sendRequestWithMultiHeaders(Collections.emptyMap());\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"private void doServers(final HttpRequest httpRequest, final HttpResponse response) {\r\n\r\n final List<Server> servers = ServerService.getInstance().getAll();\r\n if (servers == null || servers.isEmpty()) {\r\n return;\r\n }\r\n\r\n // We should have a dedicated mapper for this\r\n final ServerListEntity serverListEntity = XMLUtils.convertServers(servers);\r\n try {\r\n final JAXBContext jaxbContext = JAXBContext.newInstance(ServerListEntity.class);\r\n final Marshaller marshaller = jaxbContext.createMarshaller();\r\n marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);\r\n marshaller.setProperty(\"com.sun.xml.bind.characterEscapeHandler\", new XmlCharacterHandler());\r\n marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);\r\n\r\n final StringWriter stringWriter = new StringWriter();\r\n stringWriter.append(\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\");\r\n final PrintWriter printWriter = new PrintWriter(stringWriter);\r\n marshaller.marshal(serverListEntity, printWriter);\r\n response.appendContent(stringWriter.toString());\r\n response.setMimeType(\"text/xml\");\r\n }\r\n catch (final JAXBException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355562000000\"; //--multi-dist\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multi\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"multidist\");\r\n\t\t\t\t//multiCounter.printResponse(req, \"multidist\");\r\n\t\t\t\t//use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"multidist\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"private void buscarLista(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"private void forwardResponse(XmppServletResponse response, IQRequest originalRequest) {\n\t\t\n\t\tJID from = originalRequest.getTo();\n\t\tJID to = originalRequest.getFrom();\t\t\n\t\ttry {\n\t\t\tIQRequest request = null;\n\t\t\tList<Element> elements = response.getElements();\n\t\t\tif (elements != null && elements.size() > 0) {\n\t\t\t\trequest = getXmppFactory().createIQ(from,to,response.getType(), elements.toArray(new Element[]{}));\n\t\t\t} else {\n\t\t\t\trequest = getXmppFactory().createIQ(from, to, response.getType());\n\t\t\t}\n\t\t\trequest.setID(originalRequest.getId());\n\t\t\trequest.send();\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// In the event of an error, continue dispatching to all remaining JIDs\n\t\t\tlog.error(e.getMessage(),e);\n\t\t}\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\r\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t this.request = request;\r\n\t}",
"@Override\r\n public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {\n chain.doFilter(request, response);\r\n\r\n if (request instanceof HttpServletRequest) {\r\n localRequest.set((HttpServletRequest) request);\r\n }\r\n\r\n try {\r\n chain.doFilter(request, response);\r\n }\r\n finally {\r\n localRequest.remove();\r\n }\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException, ParseException {\n\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n String method = request.getMethod().toLowerCase();\n System.out.println(\"method = \" + method);\n boolean doOutput = false;\n if (\"post\".equals(method) || \"put\".equals(method) || \"delete\".equals(method) || \"trace\".equals(method)) {\n try (ServletInputStream r = request.getInputStream()) {\n byte buff[] = new byte[300000];\n int cant;\n while ((cant = r.read(buff)) != -1) {\n baos.write(buff, 0, cant);\n }\n baos.flush();\n baos.close();\n }\n doOutput = true;\n }\n String host = request.getParameter(\"host\");\n Utils.getInstance().getManagers(host);\n String port = request.getParameter(\"port\");\n String urlS = URLDecoder.decode(request.getParameter(\"url\"), \"US-ASCII\");\n System.out.println(\"url = \" + urlS);\n System.out.println(\"query = \" + request.getQueryString());\n URL url = new URL(urlS);\n //la base del sitio pedido\n String base = url.getProtocol() + \"://\" + url.getHost() + (url.getPort() != -1 ? \":\" + url.getPort() : \"\");\n\n //la url que representa a el host donde esta montada esta app\n String thishost = \"http://\" + request.getLocalName() + \":\" + request.getLocalPort() + \"/\";\n System.out.println(\"thishost = \" + thishost);\n// System.out.println(\"request server name = \" + request.getServerName());\n// boolean debug = false;\n// if (host != null) {\n//// debug = true;\n// thishost = \"http://ostest.tt:8080/\";\n// } else {\n// thishost = \"http://test-truetest.rhcloud.com/\";\n// }\n\n HttpURLConnection openConnection;\n if (host == null) {\n openConnection = (HttpURLConnection) url.openConnection();\n } else {\n Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, Integer.parseInt(port))); // or whatever your proxy is\n openConnection = (HttpURLConnection) url.openConnection(proxy);\n }\n openConnection.setConnectTimeout(0);\n openConnection.setReadTimeout(0);\n openConnection.setRequestMethod(request.getMethod());\n //por si acaso no cambia automatico cuando cambio el metodo\n\n Enumeration<String> headerNames = request.getHeaderNames();\n while (headerNames.hasMoreElements()) {\n String headerName = headerNames.nextElement();\n Enumeration<String> headers = request.getHeaders(headerName);\n while (headers.hasMoreElements()) {\n String headerValue = headers.nextElement();\n if (headerName != null && !\"accept-encoding\".equals(headerName.toLowerCase())) {\n openConnection.addRequestProperty(headerName, headerValue);\n }\n }\n }\n openConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.102 Safari/537.36\");\n// openConnection.connect();\n if (doOutput) {\n openConnection.setDoOutput(true);\n try (OutputStream out = openConnection.getOutputStream()) {\n out.write(baos.toByteArray());\n out.flush();\n }\n }\n boolean nis = false;\n InputStream inputStream = null;\n try {\n inputStream = openConnection.getInputStream();\n } catch (IOException e) {\n nis = true;\n }\n String contentType = openConnection.getContentType();\n System.out.println(\"contentType basico = \" + contentType);\n// String guessContentTypeFromName = HttpURLConnection.guessContentTypeFromName(urlS);\n ContentType ct = null;\n if (contentType != null) {\n ct = new ContentType(contentType);\n }\n //usod de jsoup para modificar la pag para que todas las url se dirijan a este servidor\n Document parse = null;//\n if (ct != null && ct.match(\"text/html\") && !nis) {\n String charset = ct.getParameter(\"charset\");\n System.out.println(\"charset = \" + charset);\n parse = Jsoup.parse(inputStream, charset, urlS);\n parse.outputSettings().escapeMode(EscapeMode.xhtml);\n String arrayURLAtt[] = new String[]{\"src\", \"data\", \"cite\"};\n for (String attr : arrayURLAtt) {\n Elements linksatt = parse.select(\"[\" + attr + \"]\");\n for (Element link : linksatt) {\n link.attr(attr, link.attr(\"abs:\" + attr));\n }\n }\n //para mandar los post y get de los formularios a travez de este proxy html\n //FIXME poner iframe\n String attr[] = new String[]{\"action\", \"href\", \"src\"};\n for (String att : attr) {\n String select;\n switch (att) {\n case \"href\":\n select = \"a[\" + att + \"],link[\" + att + \"]\";\n break;\n case \"src\":\n select = \"iframe[\" + att + \"],script[\" + att + \"]\";\n break;\n default:\n select = \"[\" + att + \"]\";\n break;\n }\n Elements links = parse.select(select);\n for (Element link : links) {\n String abs = link.attr(\"abs:\" + att);\n if (host == null) {\n String finalUrl = thishost + \"?url=\" + URLEncoder.encode(abs, \"US-ASCII\") + \"&d=true\";\n link.attr(att, finalUrl);\n } else {\n link.attr(att, thishost + \"?url=\" + URLEncoder.encode(abs, \"US-ASCII\") + \"&host=\" + host + \"&port=\" + port);\n }\n }\n }\n }\n\n Map<String, List<String>> headerFields = openConnection.getHeaderFields();\n for (Map.Entry<String, List<String>> entry : headerFields.entrySet()) {\n String header = entry.getKey();\n// System.out.println(\"header = \" + header);\n List<String> list = entry.getValue();\n for (String headerValue : list) {\n if (header != null) {\n// System.out.println(\"header = \" + header);\n if (\"location\".equals(header.toLowerCase()) || \"referer\".equals(header.toLowerCase())) {\n if (host == null) {\n headerValue = \"http://ostest.tt:8081/?url=\" + headerValue + \"&d=true\";\n } else {\n headerValue = \"http://test-truetest.rhcloud.com/?url=\" + headerValue + \"&host=\" + host + \"&port=\" + port;\n }\n }\n if (\"host\".equals(header.toLowerCase())) {\n headerValue = url.getHost() + \":\" + (url.getPort() != -1 ? url.getPort() : url.getDefaultPort());\n }\n if (!\"content-length\".equals(header.toLowerCase())) {\n headerValue = url.getHost() + \":\" + (url.getPort() != -1 ? url.getPort() : url.getDefaultPort());\n }\n// System.out.println(\"headerValue = \" + headerValue);\n if (!\"content-length\".equals(header.toLowerCase()) && !\"content-encoding\".equals(header.toLowerCase())) {\n response.addHeader(header, headerValue);\n }\n }\n }\n }\n\n// response.setStatus(openConnection.getResponseCode());\n// System.out.println(\"content = \" + openConnection.getContentType());\n response.setContentType(openConnection.getContentType());\n if (parse != null) {\n try (PrintWriter writer = response.getWriter()) {\n StringBuilder builder = new StringBuilder(parse.outerHtml());\n String cabecera = \"<head>\";\n int indexOf = builder.indexOf(cabecera);\n if (indexOf != -1) {\n String scripText = \"<script id=\\\"prox\\\" >(function(open) {\\n\"\n + \" XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {\\n\"\n + \" open.call(this, method, '\" + thishost + \"?url=\" + base + \"'+encodeURIComponent(url)+'\" + (host == null ? \"&d=true\" : \"&host=\" + host + \"&port=\" + port) + \"', true, user, pass);\\n\"\n + \" };\\n\"\n + \" })(XMLHttpRequest.prototype.open);\"\n + \"\"\n + \"window.location.origin='\" + base + \"'</script>\";\n builder.insert(indexOf + cabecera.length(), scripText);\n }\n writer.print(builder);\n writer.flush();\n }\n } else {\n try (OutputStream out = response.getOutputStream(); BufferedInputStream in = new BufferedInputStream((openConnection.getInputStream()))) {\n byte buff[] = new byte[300000];\n int cant;\n while ((cant = in.read(buff)) != -1) {\n out.write(buff, 0, cant);\n }\n out.flush();\n }\n }\n }",
"public Response sendRequest(Request request) {\n return null;\n }",
"protected abstract void processRequest( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException;",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"application/json\");\n try (PrintWriter out = response.getWriter()) {\n JSONArray jArr = new JSONArray();\n ArrayList<Queue> queueList = QueueDAO.getQueue();\n for(Queue q : queueList){\n JSONObject queue = new JSONObject();\n queue.put(\"patientID\", q.getPatientID());\n queue.put(\"visitID\", q.getVisitID());\n queue.put(\"timestamp\", q.getTimestamp());\n queue.put(\"status\", q.getStatus());\n queue.put(\"name\", q.getName());\n jArr.add(queue);\n }\n out.println(jArr.toString());\n response.setStatus(HttpServletResponse.SC_OK);\n }\n }",
"@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}",
"@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}",
"@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}",
"public void handle_request(Request request){\n currentRequest.add(request);\n System.out.println(\"[Worker\"+String.valueOf(id)+\"] Received request of client \"+String.valueOf(request.getId()));\n }",
"@Override\r\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\r\n\t}",
"@Override\n\tpublic void setServletRequest(HttpServletRequest arg0) {\n\t\t\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\n { \n ResponseType rt = ResponseType.Success;\n Exception caughtException = null;\n try\n {\n // Check the settings have been loaded\n Settings settings;\n if((settings = PALS_SettingsListener.getSettings()) == null)\n throw new SettingsException(SettingsException.Type.FailedToLoad, null);\n // Build request\n // -- Fetch session identifier\n String sessid = getCookie(request, SESSION_COOKIE_NAME);\n // -- Build relative url of request\n String relUrl = (String)request.getAttribute(PALS_RequestsFilter.REQUEST_ATTRIBUTE_NAME_ORIGINALURL);\n // -- Prepare remote request wrapper\n RemoteRequest dataRequest = new RemoteRequest(sessid, relUrl, request.getRemoteAddr());\n // -- Add request fields\n for(Map.Entry<String,String[]> param : request.getParameterMap().entrySet())\n dataRequest.setFields(param.getKey(), param.getValue());\n // -- Add request files (and possibly fields)\n if(ServletFileUpload.isMultipartContent(request))\n {\n ServletFileUpload uploads = new ServletFileUpload();\n try\n {\n FileItemIterator itFile = uploads.getItemIterator(request);\n // Iterate each upload item\n File file;\n FileItemStream fis;\n FileOutputStream fos;\n InputStream is;\n long size;\n int bytesRead;\n byte[] data;\n while(itFile.hasNext())\n {\n fis = itFile.next();\n is = fis.openStream();\n if(!fis.isFormField() && fis.getName() != null && fis.getName().length() > 0)\n {\n file = new File(\n Storage.getPath_tempWebFile(settings.getStr(\"storage/path\"), request.getRemoteAddr())\n ).getCanonicalFile();\n // Write data to disk\n size = 0;\n fos = new FileOutputStream(file);\n data = new byte[1024];\n while((bytesRead = is.read(data)) != -1)\n {\n fos.write(data, 0, bytesRead);\n size += bytesRead;\n }\n fos.flush();\n fos.close();\n // Add to request\n dataRequest.setFile(fis.getFieldName(), new UploadedFile(fis.getName(), fis.getContentType(), size, file.getName()));\n }\n else\n {\n // Not a file - a field...\n dataRequest.setAddFields(fis.getFieldName(), Streams.asString(is));\n }\n }\n }\n catch(FileUploadException ex)\n {\n System.err.println(\"Failed to receive upload from user '\" + request.getRemoteAddr() + \"' ~ \" + ex.getMessage());\n }\n }\n\n // Communicate to node using RMI\n // -- Fetch host\n RMI_Host rmiHost = PALS_SettingsListener.fetchHost(); \n // -- Setup the socket and connect\n SSL_Factory sfact = PALS_SettingsListener.getRMISockFactory();\n Registry r;\n if(sfact != null)\n r = LocateRegistry.getRegistry(rmiHost.getHost(), rmiHost.getPort(), sfact);\n else\n r = LocateRegistry.getRegistry(rmiHost.getHost(), rmiHost.getPort());\n // -- Bind to our version of the interface\n RMI_Interface ri = (RMI_Interface)r.lookup(RMI_Interface.class.getName());\n RemoteResponse dataResponse = ri.handleWebRequest(dataRequest);\n \n // Handle response\n // -- Transfer header data\n if(dataResponse.isHeadersAvailable())\n {\n for(Map.Entry<String,String> kv : dataResponse.getHeaders().entrySet())\n response.setHeader(kv.getKey(), kv.getValue());\n }\n // -- Update the session ID cookie\n Cookie cookieSess = new Cookie(SESSION_COOKIE_NAME, dataResponse.getSessionID());\n cookieSess.setPath(\"/\");\n cookieSess.setMaxAge(dataResponse.isSessionPrivate() ? 3600 : 600);\n response.addCookie(cookieSess);\n // -- Check for redirect\n String redirect = dataResponse.getRedirectUrl();\n if(redirect != null)\n {\n if(!redirect.startsWith(\"/\"))\n redirect = \"/\" + redirect;\n response.sendRedirect(request.getContextPath() + redirect);\n }\n else\n {\n // -- Handle response type\n response.setContentType(dataResponse.getResponseType());\n // -- Set response code\n response.setStatus(dataResponse.getResponseCode());\n // -- Handle response data\n {\n byte[] buffer = dataResponse.getBuffer();\n if(buffer != null && buffer.length != 0)\n {\n ServletOutputStream sos = response.getOutputStream();\n sos.write(buffer);\n sos.flush();\n }\n else\n rt = ResponseType.Error_NoOutput;\n }\n }\n // Note: nothing else can be sent now; thus do not set any\n // cookies or headers at this point.\n \n // Destroy any temp files\n String tempFolder = Storage.getPath_tempWeb(settings.getStr(\"storage/path\"));\n File file;\n for(UploadedFile uf : dataRequest.getFiles())\n {\n file = new File(tempFolder + \"/\" + uf.getTempName());\n if(file.exists() && file.isFile())\n file.delete();\n }\n }\n catch(RemoteException ex)\n {\n System.err.println(\"RMI RemoteException ~ \" + ex.getMessage() + \"!\");\n rt = ResponseType.Error_RMI;\n caughtException = ex;\n }\n catch(NotBoundException ex)\n {\n System.err.println(\"RMI NotBoundException ~ \" + ex.getMessage() + \"!\");\n rt = ResponseType.Error_RMI;\n caughtException = ex;\n }\n catch(SettingsException ex)\n {\n System.err.println(\"Settings exception ~ \" + ex.getMessage() + \"!\");\n rt = ResponseType.Error_Settings;\n caughtException = ex;\n }\n // Check if we have handled the response correctly, else output a message to the user\n if(rt == ResponseType.Success)\n return;\n // An error has occurred...\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter pw = response.getWriter();\n pw.println(\"<!DOCTYPE html><html><head><title>PALS - Communication Issue</title></head><body>\");\n pw.println(\"<h1>Error</h1>\");\n // Output humam message\n switch(rt)\n {\n case Error_RMI:\n pw.println(\"<p>Communication issue, please try again...</p>\");\n pw.println(\"<h2>Network Administrators</h2>\");\n pw.println(\"<p>The system is unable to communicate with the node process, check it is running!</p>\");\n break;\n case Error_NoOutput:\n pw.println(\"<p>Communication issue, please try again...</p>\");\n pw.println(\"<h2>Network Administrators</h2>\");\n pw.println(\"<p>No data for the web-page was returned from the node; check templates and plugins are loading correctly.</p>\");\n break;\n case Error_Settings:\n pw.println(\"<p>Error occurred reading settings...</p>\");\n pw.println(\"<h2>Network Administrators</h2>\");\n pw.println(\"<p>Ensure the file at WEB-INF/web.config as been correctly configured.</p>\");\n break;\n }\n // Output debug information\n if(caughtException != null && PALS_SettingsListener.getSettings().getBool(\"debug\", false))\n {\n pw.println(\"<h2>Debug Data</h2>\");\n pw.println(\"<p>\");\n caughtException.printStackTrace(pw);\n pw.println(\"</p>\");\n }\n // Dispose and end\n pw.println(\"</body></html>\");\n pw.flush();\n pw.close();\n }",
"@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request=request;\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/html;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n Connection connection = (Connection) request.getAttribute(\"connection\");\n AuthorService authorService = new AuthorServiceImpl();\n Map<String, String> authors = authorService.getAuthors(connection);\n request.setAttribute(\"authors\", authors);\n RequestDispatcher requestDispatcher = request.getRequestDispatcher(\"book.jsp\");\n requestDispatcher.forward(request, response);\n out.close();\n }",
"public void sendGetRequest() {\r\n\t\tString[] requests = this.input.substring(4, this.input.length()).split(\" \"); \r\n\t\t\r\n\t\tif(requests.length <= 1 || !(MyMiddleware.readSharded)){\r\n\t\t\tnumOfRecipients = 1;\r\n\t\t\trecipient = servers.get(loadBalance());\r\n\r\n\t\t\trecipient.send(this, input);\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\t\r\n\t\t\tif(requests.length <= 1) {\r\n\t\t\t\tnumOfGets++;\r\n\t\t\t\ttype= \"10\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumOfMultiGets++;\r\n\t\t\t\ttype = requests.length+\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString reply = recipient.receive();\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\t\r\n\t\t\tint hit = 0;\r\n\t\t\thit += reply.split(\"VALUE\").length - 1;\r\n\t\t\tmiss += requests.length-hit;\r\n\r\n\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsendBack(currentJob.getClient(), reply);\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnumOfMultiGets++;\r\n\t\t\ttype = requests.length+\"\";\r\n\t\t\tnumOfRecipients = servers.size();\r\n\t\t\trequestsPerServer = requests.length / servers.size();\r\n\t\t\tremainingRequests = requests.length % servers.size() ;\r\n\t\t\t\r\n\t\t\t//The worker thread sends a number of requests to each server equal to requestsPerServer \r\n\t\t\t//and at most requestsPerServer + remainingRequests\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < servers.size(); i++) {\r\n\t\t\t\tmessage = requestType;\r\n\t\t\t\tfor(int j = 0; j < requestsPerServer; j++){\r\n\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\tmessage += requests[requestsPerServer*i+j];\r\n\t\t\t\t\tif(i < remainingRequests) {\r\n\t\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\t\tmessage += requests[requests.length - remainingRequests + i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tservers.get(i).send(this, message);\r\n\t\t\t}\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\tint hit = 0;\r\n\t\t\tfor(ServerHandler s : servers) {\r\n\t\t\t\tString ricevuto = s.receive();\r\n\t\t\t\thit += ricevuto.split(\"VALUE\").length - 1;\r\n\t\t\t\treplies.add(ricevuto);\r\n\t\t\t}\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\r\n\t\t\tmiss += requests.length-hit;\r\n\t\t\t\r\n\t\t\tfinalReply = \"\";\r\n\t\t\tfor(String reply : replies) {\r\n\t\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\t\treplies.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treply = reply.substring(0, reply.length() - 3);\r\n\t\t\t\t\tfinalReply += reply;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalReply += \"END\";\r\n\t\t\tsendBack(currentJob.getClient(), finalReply);\r\n\t\t\treplies.clear();\r\n\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n public void setServletRequest(HttpServletRequest arg0) {\n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String name = request.getParameter(GenericConstants.COMPONENT_PNAME);\n \n RealTimeSUStateHelper suRTHelper = new RealTimeSUStateHelper(name);\n String responseData = suRTHelper.getServiceUnitsState();\n response.setStatus(HttpServletResponse.SC_OK);\n response.setHeader(RealTimeStatisticServlet.CONTENT_TYPE_HEADER, \n RealTimeStatisticServlet.CONTENT_TYPE_VALUE);\n response.setHeader(RealTimeStatisticServlet.CACHE_CONTROL_HEADER, \n RealTimeStatisticServlet.CACHE_CONTROL_VALUE);\n \n // Write out the message on the response stream\n OutputStream outputStream = response.getOutputStream();\n try {\n outputStream.write(responseData.getBytes());\n } catch (IOException e2) {\n }\n outputStream.flush();\n \n }",
"Mono<ServerResponse> reset(ServerRequest request);",
"@Override\n\tpublic void service(ServletRequest req, ServletResponse res)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"protected void onMEVPostsRequest( HttpServletRequest req, HttpServletResponse resp ) throws Exception {\r\n\tHttpSession session = req.getSession( false );\r\n\tif (session == null) { // that means that it is the first request\r\n\t session = req.getSession();\r\n\t synchronized( session ) {\r\n\t\tsession.setAttribute(\"MEV_SESSION\", new SessionState() );\r\n\t\tMEVRequestAcceptStrategy strategy = new MEVRequestAcceptStrategy( m_properties );\r\n\t\tstrategy.acceptMEVRequest( req, resp );\r\n\t }\r\n\t} else {\r\n\t SessionState si = (SessionState)session.getAttribute(\"MEV_SESSION\");\r\n\t MEVRequestAcceptStrategy2 strategy = new MEVRequestAcceptStrategy2( si );\r\n\t strategy.acceptMEVRequest( req, resp );\r\n\t}\r\n }",
"@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355620946302\"; //--separate-comp\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multicomp\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"sep_comp\");\r\n\t\t\t\t\r\n\t\t\t\t//multiCounter.printResponse(req, \"sep_comp\");\r\n\t\t\t\t// use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"sep_comp\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}",
"public void setRequest(Map<String, Object> request)\r\n\t{\n\t\tthis.request = request;\r\n\t}",
"void setRequest(Request req);",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Routes( { @Route( method = Method.ANY, path = \":?path=(.*)\", binding = BindingType.raw ) } )\n public void handle( final HttpServerRequest request )\n {\n ResponseUtils.setStatus( ApplicationStatus.OK, request );\n\n request.pause();\n String path = request.params()\n .get( PathParam.path.key() );\n\n if ( path != null && ( path.length() < 1 || path.equals( \"/\" ) ) )\n {\n path = null;\n }\n\n VertXWebdavRequest req = null;\n final VertXWebdavResponse response = new VertXWebdavResponse( request.response() );\n\n try\n {\n String contextPath = masterRouter.getPrefix();\n if ( contextPath == null )\n {\n contextPath = \"\";\n }\n\n req = new VertXWebdavRequest( request, contextPath, \"/mavdav\", path, null );\n\n service.service( req, response );\n\n }\n catch ( WebdavException | IOException e )\n {\n logger.error( String.format( \"Failed to service mavdav request: %s\", e.getMessage() ), e );\n formatResponse( e, request );\n }\n finally\n {\n IOUtils.closeQuietly( req );\n IOUtils.closeQuietly( response );\n\n try\n {\n request.response()\n .end();\n }\n catch ( final IllegalStateException e )\n {\n }\n }\n }",
"public void handleRequest(Request req) {\n\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n try {\r\n response.setContentType(CONTENT_TYPE);\r\n String[] menuChoices = request.getParameterValues(MENU_CHOICES);\r\n // OrderCalculator o = new OrderCalculator(menuChoices); \r\n OrderService o = new OrderService(menuChoices);\r\n ArrayList<MenuItem> itemsOrdered = o.getItemsOrdered();\r\n double subTotal = o.getSubTotal();\r\n double total = o.getTotal();\r\n\r\n\r\n request.setAttribute(ITEMS_ORDERED, itemsOrdered);\r\n request.setAttribute(SUB_TOTAL, subTotal);\r\n request.setAttribute(TOTAL, total);\r\n\r\n\r\n } catch (DataAccessException ex) {\r\n \r\n }\r\n\r\n RequestDispatcher view =\r\n request.getRequestDispatcher(DESTINATION_URL);\r\n view.forward(request, response);\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n getServletContext().log(\"Processing a request : \" + request.getServletPath());\n \n try {\n ModelAndView mav = this.handler.handle(request, response, true);\n \n // use a view resolver.\n// response.getWriter().print(controllerResponse);\n // flush here ?\n// response.flushBuffer();\n// 2801752\n } catch (Exception ex) {\n getServletContext().log(\"Exception : \", ex);\n if(!response.isCommitted()) {\n response.sendError(500, ex.getMessage());\n }\n }\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n \r\n }",
"Mono<ServerResponse> indexManagement(ServerRequest request);",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n HttpSession session = request.getSession();\r\n\r\n boolean adminSession;\r\n try {\r\n adminSession = (Boolean) session.getAttribute(\"mainAdminSession\");\r\n } catch (Exception e) {\r\n LOGGER.log(Level.INFO, \"Main admin session is null\");\r\n LOGGER.log(Level.INFO, \"Requesting dispatch to forward to: index.jsp\");\r\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);\r\n return;\r\n }\r\n\r\n if (adminSession == false) {\r\n try {\r\n adminSession = (Boolean) session.getAttribute(\"subAdminSession\");\r\n } catch (Exception e) {\r\n LOGGER.log(Level.INFO, \"Sub admin session is null\");\r\n LOGGER.log(Level.INFO, \"Requesting dispatch to forward to: index.jsp\");\r\n request.getRequestDispatcher(\"index.jsp\").forward(request, response);\r\n return;\r\n }\r\n }\r\n\r\n //Check session type\r\n LOGGER.log(Level.INFO, \"Checking session type\");\r\n if (adminSession == false) {\r\n //Admin session not established\r\n LOGGER.log(Level.INFO, \"Admin session not established hence not responding to the request\");\r\n\r\n String path = (String) session.getAttribute(\"home\");\r\n LOGGER.log(Level.INFO, \"Path is: {0}\", path);\r\n String destination = \"/WEB-INF/views\" + path + \".jsp\";\r\n try {\r\n LOGGER.log(Level.INFO, \"Dispatching request to: {0}\", destination);\r\n request.getRequestDispatcher(destination).forward(request, response);\r\n } catch (ServletException | IOException e) {\r\n LOGGER.log(Level.INFO, \"Request dispatch failed\");\r\n }\r\n\r\n } else if (adminSession == true) {\r\n //Admin session established\r\n LOGGER.log(Level.INFO, \"Admin session established hence responding to the request\");\r\n\r\n String path = request.getServletPath();\r\n String destination;\r\n Map<RatingTypeDetail, List<RatingDetails>> ratingTypeAndValuesMap = new HashMap<>();\r\n\r\n switch (path) {\r\n case \"/addRating\":\r\n\r\n //Read in details for the rating\r\n LOGGER.log(Level.INFO, \"Reading in details for the rating\");\r\n rating = new RatingDetails();\r\n rating.setActive(true);\r\n rating.setRatingType(RatingTypeDetail.getRatingType(Short.parseShort(request.getParameter(\"ratingType\"))));\r\n if (rating.getRatingType().equals(RatingTypeDetail.PERCENTAGE)) {\r\n rating.setRating(request.getParameter(\"ratingValue\") + \"%\");\r\n } else {\r\n rating.setRating(request.getParameter(\"ratingValue\"));\r\n }\r\n\r\n //Send the details to the entity manager for recording in the database\r\n LOGGER.log(Level.INFO, \"Sending the details to the entity manager for recording in the database\");\r\n try {\r\n ratingService.addRating(rating);\r\n } catch (InvalidArgumentException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(e.getCode()));\r\n LOGGER.log(Level.INFO, bundle.getString(e.getCode()));\r\n }\r\n\r\n //Retrieve the new list of rating records from the database\r\n LOGGER.log(Level.INFO, \"Retrieving the new list of rating records from the database\");\r\n try {\r\n ratingTypeAndValuesMap = ratingService.retrieveRatings();\r\n } catch (InvalidStateException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(e.getCode()));\r\n LOGGER.log(Level.INFO, bundle.getString(e.getCode()));\r\n }\r\n\r\n //Avail the ratings session\r\n LOGGER.log(Level.INFO, \"Availing the ratings in session\");\r\n session.setAttribute(\"ratingTypeAndValuesMap\", ratingTypeAndValuesMap);\r\n\r\n //Display the new list of rating records\r\n generateTableBody(ratingTypeAndValuesMap, session, response);\r\n return;\r\n\r\n case \"/editRating\":\r\n\r\n //Read in details for the rating\r\n LOGGER.log(Level.INFO, \"Reading in details for the rating\");\r\n rating = new RatingDetails();\r\n rating.setActive(true);\r\n rating.setId(Short.parseShort(request.getParameter(\"ratingId\")));\r\n rating.setRatingType(RatingTypeDetail.getRatingType(Short.parseShort(request.getParameter(\"ratingType\"))));\r\n if (rating.getRatingType().equals(RatingTypeDetail.PERCENTAGE)) {\r\n rating.setRating(request.getParameter(\"ratingValue\") + \"%\");\r\n } else {\r\n rating.setRating(request.getParameter(\"ratingValue\"));\r\n }\r\n\r\n //Send the details to the entity manager for recording in the database\r\n LOGGER.log(Level.INFO, \"Sending the details to the entity manager for record update in the database\");\r\n try {\r\n ratingService.editRating(rating);\r\n } catch (InvalidArgumentException | InvalidStateException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(e.getCode()));\r\n LOGGER.log(Level.INFO, bundle.getString(e.getCode()));\r\n }\r\n\r\n //Retrieve the new list of rating records from the database\r\n LOGGER.log(Level.INFO, \"Retrieving the new list of rating records from the database\");\r\n try {\r\n ratingTypeAndValuesMap = ratingService.retrieveRatings();\r\n } catch (InvalidStateException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(e.getCode()));\r\n LOGGER.log(Level.INFO, bundle.getString(e.getCode()));\r\n }\r\n\r\n //Display the new list of rating records\r\n generateTableBody(ratingTypeAndValuesMap, session, response);\r\n return;\r\n\r\n case \"/removeRating\":\r\n\r\n //Send the details to the entity manager for record removal from the database\r\n LOGGER.log(Level.INFO, \"Sending the details to the entity manager for record removal from the database\");\r\n try {\r\n ratingService.removeRating(Short.parseShort(request.getParameter(\"ratingId\")));\r\n } catch (InvalidArgumentException | InvalidStateException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(e.getCode()));\r\n LOGGER.log(Level.INFO, bundle.getString(e.getCode()));\r\n }\r\n\r\n //Retrieve the new list of rating records from the database\r\n LOGGER.log(Level.INFO, \"Retrieving the new list of rating records from the database\");\r\n try {\r\n ratingTypeAndValuesMap = ratingService.retrieveRatings();\r\n } catch (InvalidStateException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(e.getCode()));\r\n LOGGER.log(Level.INFO, bundle.getString(e.getCode()));\r\n }\r\n\r\n //Display the new list of rating records\r\n generateTableBody(ratingTypeAndValuesMap, session, response);\r\n\r\n return;\r\n }\r\n destination = \"WEB-INF/views\" + path + \".jsp\";\r\n try {\r\n LOGGER.log(Level.INFO, \"Dispatching request to: {0}\", destination);\r\n request.getRequestDispatcher(destination).forward(request, response);\r\n } catch (ServletException | IOException e) {\r\n response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n response.getWriter().write(bundle.getString(\"redirection_failed\"));\r\n LOGGER.log(Level.INFO, bundle.getString(\"redirection_failed\"), e);\r\n }\r\n }\r\n }",
"ResponseDTO performServerActions();",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n {\r\n String idTemp = request.getParameter(\"id\");\r\n int id = Integer.parseInt(idTemp);\r\n request.setAttribute(\"obterCliente\", DAO.obterCliente(id));\r\n RequestDispatcher rd = request.getRequestDispatcher(\"EditarCliente.jsp\");\r\n try {\r\n rd.forward(request, response);\r\n } catch (ServletException | IOException ex) {\r\n Logger.getLogger(EditarCliente.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"private void changeRequest(InstanceRequest request) {\r\n\t\t\r\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n request.setCharacterEncoding(\"UTF-8\");\n response.setHeader(\"Cache-Control\", \"no-cache\");\n response.setContentType(\"text;charset=UTF-8\");\n Locale locale = request.getLocale();\n String action = request.getParameter(\"action\");\n User user = Server.getSession(request);\n\n if (User.isValid(user)) {\n if (action == null) {\n //redirect to somewhere\n } else if (action.equals(\"friend\")) {\n String requestedUserId = request.getParameter(\"id\");\n String groupNames = request.getParameter(\"groups\");\n String requestMessage = request.getParameter(\"message\");\n String[] requiredFields = {requestedUserId, groupNames};\n if (!Util.areEmpty(requiredFields)) {\n if (friendAlreadyAdded(user, requestedUserId)) {\n String message = I18n.getString(locale, \"request.AlreadyCompleted\");\n response.getWriter().write(\"fail;\".concat(message));\n } else {\n Group.process(\n user,\n groupNames, new Query());\n Request friendRequest = new Request(\n Request.FRIENDSHIP,\n user.getId(),\n requestedUserId, requestMessage, groupNames);\n if (friendRequest.isDuplicate(new Query())) {\n String message = I18n.getString(locale, \"request.isDuplicate\");\n response.getWriter().write(\"fail;\".concat(message));\n } else {\n DAO dao = new Query();\n dao.open();\n try {\n dao.set(friendRequest);\n dao.commit();\n String message = I18n.getString(locale, \"request.success\");\n response.getWriter().write(\"success;\".concat(message));\n } catch (Exception e) {\n dao.rollBack();\n } finally {\n dao.closeSession();\n }\n }\n }\n } else {\n response.getWriter().write(HttpServletResponse.SC_NO_CONTENT);\n }\n } else if (action.equals(\"acceptFriend\")) {\n String requestId = request.getParameter(\"requestId\");\n String groupCSV = request.getParameter(\"groups\");\n String[] requiredFields = {requestId, groupCSV};\n\n if (!Util.areEmpty(requiredFields)) {\n DAO dao = new Query();\n dao.open();\n try {\n Request friendRequest = (Request) dao.get(\n Request.class,\n requestId);\n if (friendRequest != null) {\n if (user.getId() == friendRequest.getToId()) {\n if (friendRequest.getType().equals(Request.FRIENDSHIP)) {\n if (friendAlreadyAdded(user, friendRequest)) {\n String message = I18n.getString(locale, \"request.AlreadyCompleted\");\n response.getWriter().write(\"fail;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n dao.commit();\n } else {\n User sender = (User) friendRequest.getFrom();\n for (String groupNameFrom : friendRequest.getGroupNamesArray()) {\n if (isValid(groupNameFrom)) {\n GroupMembership membershipFrom = new GroupMembership(\n user,\n Group.get(sender, groupNameFrom, new Query()));\n dao.set(membershipFrom);\n }\n }\n String[] groupNamesTo = groupCSV.split(\";\");\n for (String groupNameTo : groupNamesTo) {\n if (isValid(groupNameTo)) {\n GroupMembership membershipTo = new GroupMembership(\n sender,\n Group.get(user, groupNameTo, new Query()));\n dao.set(membershipTo);\n }\n }\n String message = I18n.getString(locale, \"request.accepted\");\n response.getWriter().write(\"success;\".concat(message).concat(\" \".concat(sender.getName())) + \";\".concat(friendRequest.getIdString()));\n dao.delete(friendRequest);\n dao.commit();\n }\n } else {\n Server.failed(response, locale);\n }\n }\n } else {\n Server.failed(response, locale);\n }\n } catch (Exception e) {\n //e.printStackTrace();\n dao.rollBack();\n } finally {\n dao.closeSession();\n }\n } else {\n response.getWriter().write(HttpServletResponse.SC_NO_CONTENT);\n }\n } else if (action.equals(\"rejectFriend\")) {\n String requestId = request.getParameter(\"requestId\");\n if (requestId != null) {\n DAO dao = new Query();\n dao.open();\n try {\n Request friendRequest = (Request) dao.get(Request.class, requestId);\n if (friendRequest != null) {\n if (friendRequest.getToId() == user.getId()) {\n if (friendRequest.getType().equals(Request.FRIENDSHIP)) {\n String message = I18n.getString(locale, \"request.Rejected\");\n response.getWriter().write(\"success;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n dao.delete(friendRequest);\n return;\n }\n }\n }\n String message = I18n.getString(locale, \"request.fail\");\n response.getWriter().write(\"fail;\".concat(message) + \";\".concat(friendRequest.getIdString()));\n } catch (Exception e) {\n //e.printStackTrace();\n } finally {\n dao.close();\n }\n }\n } else if (action.equals(\"unfriend\")) {\n String friendName = request.getParameter(\"id\");\n if (user.unfriend(friendName, new Query())) {\n String message = I18n.getString(locale, \"request.Unfriend\");\n response.getWriter().write(\"success;\".concat(message));\n } else {\n Server.failed(response, locale);\n }\n } else {\n Server.failed(response, locale);\n }\n } else {\n Util.redirectToLogin(request, response);\n }\n }",
"@Override\n\tpublic List<Map<String,String>> dispatchRequest(Map<String, String[]> request) {\n\n\t\t// ********* LOGGING ********* \n\t\tSystem.out.println(\"reached DispatchRequest\");\n\t\tSystem.out.println(\"Request Keys : \");\n\t\tSystem.out.println(request.keySet());\n\t\t// ********* LOGGING ********* \n\n\n\t\tString classPrefix = request.get(\"requestID\")[0]; \n\n\t\t// ********* LOGGING ********* \n\t\tSystem.out.println(\"class name : \"+PACKAGE_NAME+classPrefix+CLASS_SUFFIX);\n\t\t// ********* LOGGING ********* \n\n\t\t// obtain class reference\t\t\n\t\tiManagementRequestHandlerObject = (IManagementRequestHandler) \n\t\t\t\tiReflectionManagerObject.getClass(PACKAGE_NAME+classPrefix+CLASS_SUFFIX);\n\n\t\t// ********* LOGGING *********\n\t\tSystem.out.println(\"object reference : \"+ iManagementRequestHandlerObject);\n\t\t// ********* LOGGING *********\n\n\t\t// Delegate the request to the appropriate class.\n\t\treturn (iManagementRequestHandlerObject.handleManagementRequest(request));\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response); \n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n\tpublic void processRequest(RequestEvent requestEvent) {\n\t\t requestEvent.getServerTransaction();\n\t\tSystem.out.println(\"Sending ------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"[]:\"+requestEvent.toString());\n\t}",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException, UnsupportedEncodingException, ParseException {\n response.setContentType(\"text/html;charset=UTF-8\");\n\n HttpSession session = request.getSession(true);\n WebUser user = (WebUser) session.getAttribute(\"loggedInUser\");\n String token = user.getToken();\n int staffId = user.getStaffId();\n ArrayList<String> errorMessages = new ArrayList<String>();\n\n SettingDAO sDAO = new SettingDAO();\n ArrayList<Setting> settings = sDAO.retrieveAllSettings(staffId, token);\n\n for (Setting s : settings) {\n int settingId = s.getId();\n String value = request.getParameter(settingId + \"\");\n String errMsg = \"\";\n Validation validation = new Validation();\n String isNum = validation.isValidNumber(value);\n if (isNum == null) {\n int valueInt = Integer.parseInt(value);\n errMsg = sDAO.editSetting(staffId, token, settingId, value);\n } else {\n String category = s.getCategory();\n String name = s.getName();\n if (name.equals(category)) {\n errMsg = \"(\" + s.getCategory() + \") \" + isNum;\n } else {\n errMsg = \"(\" + s.getCategory() + \": \" + s.getName() + \") \" + isNum;\n }\n }\n \n if (errMsg.length() != 0) {\n errorMessages.add(errMsg);\n }\n }\n\n if (errorMessages.size() == 0) {\n session.setAttribute(\"success\", \"Settings Updated!\");\n// RequestDispatcher view = request.getRequestDispatcher(\"ManageService.jsp\");\n// view.forward(request, response);\n response.sendRedirect(\"Admin_Settings.jsp\");\n } else {\n session.setAttribute(\"fail\", errorMessages);\n// RequestDispatcher view = request.getRequestDispatcher(\"ManageService.jsp\");\n// view.forward(request, response);\n response.sendRedirect(\"Admin_Settings.jsp\");\n }\n }",
"Response filterResponse(Response currentResponse, HttpExchange exchange);",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException \r\n {\r\n response.setContentType(\"text/html;charset=UTF-8\");\r\n try (PrintWriter out = response.getWriter()) \r\n {\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\");\r\n out.println(\"<title>Servlet JoinGroupServlet</title>\"); \r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n out.println(\"<h1>Servlet JoinGroupServlet at \" + request.getContextPath() + \"</h1>\");\r\n out.println(\"</body>\");\r\n out.println(\"</html>\");\r\n }\r\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n request.setCharacterEncoding(\"UTF-8\");\n Redirect rd = new Redirect();\n ManageSession_Parameter manageSession_Parameter = new ManageSession_Parameter(request);\n boolean session = manageSessions_actions.checkSession(manageSession_Parameter);\n Hilo_Parameter hiloParameter = new Hilo_Parameter(request);\n\n if (!session) { //si no hay sesión\n\n rd.redirect(request, response, \"/Boot\");\n\n } else { //si hay alguna sesión \n \n Usuario usuario = manageSessions_actions.getUser(manageSession_Parameter); \n asistir_actions.insertAsistir(hiloParameter, usuario);\n rd.redirect(request, response, \"ListaEventosServlet?idCiudad=\"+hiloParameter.getIdCiudad()+\"&idHilo=\"+hiloParameter.getIdHilo());\n \n }\n \n }",
"@Override\r\n\tpublic void handle(String target, HttpServletRequest request, HttpServletResponse response, boolean[] isHandled) {\n\t\t\r\n\t}",
"@Override\n public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {\n }",
"private void processRequest(String targetID, HttpServerRequest req) throws Exception {\n\t\tString result = retrieveDetails(targetID);\n\t\tif(result != null)\n\t\t\treq.response().end(result);\t\n\t\telse\n\t\t\treq.response().end(\"No resopnse received\");\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String statsDefName = request.getParameter(\"stats_def\");\n \n try {\n List<ResourcePOJO> resources;\n if (statsDefName == null || \"\".equals(statsDefName)) {\n // if no layer is given in http parameters, find all stats data\n resources = manager.searchStatsDataByStatsDef(null);\n } else {\n // otherwise find all stats with the given statsDef attribute\n resources = manager.searchStatsDataByStatsDef(statsDefName);\n //request.setAttribute(\"statsDef\", statsDefName);\n }\n request.setAttribute(\"resources\", resources);\n \n //Retrieve stats data and store them in a Map \n Map<Long, ResourcePOJO> statsDefMap = new HashMap<Long, ResourcePOJO>();\n ResourcePOJO statsDef = manager.searchResourceByName(statsDefName, CategoryPOJO.STATSDEF);\n request.setAttribute(\"statsDef\", statsDef);\n \n RequestDispatcher rd = request.getRequestDispatcher(\"stats-data-list.jsp\");\n rd.forward(request, response);\n } catch (JAXBException ex) {\n throw new ServletException(ex);\n }\n }",
"protected synchronized void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain;charset=UTF-8\");\n String remoteHost = request.getRemoteHost();\n String localhost = request.getLocalName();\n String localIP = request.getLocalAddr();\n\n\n PrintWriter out = response.getWriter();\n try {\n out.println(\"healthy=true\");\n out.println(\"ip=\" + localIP);\n out.println(\"host=\" + localhost);\n out.println(\"client=\" + remoteHost);\n if (lastHeathCheck != null) {\n out.println(\"lastCheck=\" + sdf.format(lastHeathCheck));\n out.println(\"lastCheckClient=\" + lastCheckClient);\n }\n\n } finally {\n if (!\"true\".equals(request.getParameter(\"nolog\"))) {\n lastHeathCheck = new Date();\n lastCheckClient = remoteHost;\n }\n out.close();\n }\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }"
] | [
"0.58440787",
"0.5732952",
"0.5673409",
"0.5663667",
"0.56360644",
"0.56325",
"0.56188935",
"0.5615135",
"0.55872834",
"0.5568843",
"0.5567273",
"0.5567273",
"0.5564698",
"0.55475676",
"0.551116",
"0.55021966",
"0.55021966",
"0.54968405",
"0.5485822",
"0.5485822",
"0.547184",
"0.5448319",
"0.5424212",
"0.5400385",
"0.5388077",
"0.5387076",
"0.5347074",
"0.5345527",
"0.53445786",
"0.53445786",
"0.53445786",
"0.53423935",
"0.53324157",
"0.53239816",
"0.53084123",
"0.5307869",
"0.5306687",
"0.5301249",
"0.52978176",
"0.5291302",
"0.5289996",
"0.5288036",
"0.528642",
"0.5285104",
"0.52817",
"0.5273517",
"0.5263248",
"0.52602285",
"0.5255982",
"0.5255982",
"0.52533245",
"0.52528906",
"0.5250687",
"0.5250612",
"0.52440983",
"0.5234802",
"0.5227679",
"0.5220903",
"0.5217458",
"0.5209989",
"0.5203021",
"0.52021116",
"0.5193714",
"0.51932746",
"0.5192132",
"0.518862",
"0.51867044",
"0.51840186",
"0.5176488",
"0.51730305",
"0.5171652",
"0.51714385",
"0.51700646",
"0.51696855",
"0.5167312",
"0.5163038",
"0.5162858",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159723",
"0.5159109",
"0.5158564",
"0.51575476",
"0.51575476",
"0.51575476",
"0.51575476"
] | 0.6588897 | 0 |
In case of a get request or multiget with no sharding, the message is sent only to one server while in case of multiget with sharding the request is split into multiple parts and forwarded to the servers. Lastly, the response is sent back to the client. | public void sendGetRequest() {
String[] requests = this.input.substring(4, this.input.length()).split(" ");
if(requests.length <= 1 || !(MyMiddleware.readSharded)){
numOfRecipients = 1;
recipient = servers.get(loadBalance());
recipient.send(this, input);
sendTime = System.nanoTime();
workerTime = sendTime - pollTime;
if(requests.length <= 1) {
numOfGets++;
type= "10";
}
else {
numOfMultiGets++;
type = requests.length+"";
}
String reply = recipient.receive();
receiveTime = System.nanoTime();
processingTime = receiveTime - sendTime;
int hit = 0;
hit += reply.split("VALUE").length - 1;
miss += requests.length-hit;
if(!(reply.endsWith("END"))) {
unproperRequests.add(reply);
sendBack(currentJob.getClient(), reply);
return;
}
sendBack(currentJob.getClient(), reply);
}
else {
numOfMultiGets++;
type = requests.length+"";
numOfRecipients = servers.size();
requestsPerServer = requests.length / servers.size();
remainingRequests = requests.length % servers.size() ;
//The worker thread sends a number of requests to each server equal to requestsPerServer
//and at most requestsPerServer + remainingRequests
for(int i = 0; i < servers.size(); i++) {
message = requestType;
for(int j = 0; j < requestsPerServer; j++){
message += " ";
message += requests[requestsPerServer*i+j];
if(i < remainingRequests) {
message += " ";
message += requests[requests.length - remainingRequests + i];
}
}
servers.get(i).send(this, message);
}
sendTime = System.nanoTime();
workerTime = sendTime - pollTime;
int hit = 0;
for(ServerHandler s : servers) {
String ricevuto = s.receive();
hit += ricevuto.split("VALUE").length - 1;
replies.add(ricevuto);
}
receiveTime = System.nanoTime();
processingTime = receiveTime - sendTime;
miss += requests.length-hit;
finalReply = "";
for(String reply : replies) {
if(!(reply.endsWith("END"))) {
unproperRequests.add(reply);
sendBack(currentJob.getClient(), reply);
replies.clear();
return;
}
else {
reply = reply.substring(0, reply.length() - 3);
finalReply += reply;
}
}
finalReply += "END";
sendBack(currentJob.getClient(), finalReply);
replies.clear();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public synchronized MRPublisherResponse sendBatchWithResponse() {\n if (fPending.isEmpty()) {\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST));\n pubResponse.setResponseMessage(\"No Messages to send\");\n return pubResponse;\n }\n\n final long nowMs = Clock.now();\n\n host = this.fHostSelector.selectBaseHost();\n\n final String httpUrl = MRConstants.makeUrl(host, fTopic, props.getProperty(DmaapClientConst.PROTOCOL),\n props.getProperty(DmaapClientConst.PARTITION));\n OutputStream os = null;\n try (ByteArrayOutputStream baseStream = new ByteArrayOutputStream()) {\n os = baseStream;\n final String propsContentType = props.getProperty(DmaapClientConst.CONTENT_TYPE);\n if (propsContentType.equalsIgnoreCase(MRFormat.JSON.toString())) {\n JSONArray jsonArray = parseJSON();\n os.write(jsonArray.toString().getBytes());\n } else if (propsContentType.equalsIgnoreCase(CONTENT_TYPE_TEXT)) {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n } else if (propsContentType.equalsIgnoreCase(MRFormat.CAMBRIA.toString())\n || (propsContentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString()))) {\n if (propsContentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString())) {\n os = new GZIPOutputStream(baseStream);\n }\n for (TimestampedMessage m : fPending) {\n os.write((\"\" + m.fPartition.length()).getBytes());\n os.write('.');\n os.write((\"\" + m.fMsg.length()).getBytes());\n os.write('.');\n os.write(m.fPartition.getBytes());\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n\n }\n }\n\n final long startMs = Clock.now();\n if (ProtocolType.DME2.getValue().equalsIgnoreCase(protocolFlag)) {\n\n try {\n configureDME2();\n\n this.wait(5);\n\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), url + subContextPath, nowMs - fPending.peek().timestamp);\n }\n sender.setPayload(os.toString());\n\n String dmeResponse = sender.sendAndWait(5000L);\n\n pubResponse = createMRPublisherResponse(dmeResponse, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n final String logLine = String.valueOf((Clock.now() - startMs)) + dmeResponse.toString();\n getLog().info(logLine);\n fPending.clear();\n\n } catch (DME2Exception x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(x.getErrorCode());\n pubResponse.setResponseMessage(x.getErrorMessage());\n } catch (URISyntaxException x) {\n\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST));\n pubResponse.setResponseMessage(x.getMessage());\n } catch (InterruptedException e) {\n throw e;\n } catch (Exception x) {\n\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(x.getMessage());\n logger.error(\"exception: \", x);\n\n }\n\n return pubResponse;\n }\n\n if (ProtocolType.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpUrl, nowMs - fPending.peek().timestamp);\n }\n final String result = postAuthwithResponse(httpUrl, baseStream.toByteArray(), contentType, authKey,\n authDate, username, password, protocolFlag);\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n\n pubResponse = createMRPublisherResponse(result, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n\n logTime(startMs, result);\n fPending.clear();\n return pubResponse;\n }\n\n if (ProtocolType.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpUrl, nowMs - fPending.peek().timestamp);\n }\n final String result = postWithResponse(httpUrl, baseStream.toByteArray(), contentType, username,\n password, protocolFlag);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n pubResponse = createMRPublisherResponse(result, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n\n final String logLine = String.valueOf((Clock.now() - startMs));\n getLog().info(logLine);\n fPending.clear();\n return pubResponse;\n }\n\n if (ProtocolType.HTTPNOAUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpUrl, nowMs - fPending.peek().timestamp);\n }\n final String result = postNoAuthWithResponse(httpUrl, baseStream.toByteArray(), contentType);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n pubResponse = createMRPublisherResponse(result, pubResponse);\n\n if (Integer.parseInt(pubResponse.getResponseCode()) < 200\n || Integer.parseInt(pubResponse.getResponseCode()) > 299) {\n\n return pubResponse;\n }\n\n final String logLine = String.valueOf((Clock.now() - startMs));\n getLog().info(logLine);\n fPending.clear();\n return pubResponse;\n }\n } catch (IllegalArgumentException | HttpException x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_BAD_REQUEST));\n pubResponse.setResponseMessage(x.getMessage());\n\n } catch (IOException x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(x.getMessage());\n } catch (InterruptedException e) {\n getLog().warn(\"Interrupted!\", e);\n // Restore interrupted state...\n Thread.currentThread().interrupt();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(x.getMessage());\n\n } finally {\n if (!fPending.isEmpty()) {\n getLog().warn(\"Send failed, \" + fPending.size() + \" message to send.\");\n pubResponse.setPendingMsgs(fPending.size());\n }\n if (os != null) {\n try {\n os.close();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n pubResponse.setResponseCode(String.valueOf(HttpStatus.SC_INTERNAL_SERVER_ERROR));\n pubResponse.setResponseMessage(\"Error in closing Output Stream\");\n }\n }\n }\n\n return pubResponse;\n }",
"public ServerResponse<T> sendRequest()\n {\n return this.sendRequestWithMultiHeaders(Collections.emptyMap());\n }",
"private void sendSetRequest() {\r\n\t\tnumOfSets++;\r\n\t\ttype = \"0\";\r\n\t\tnumOfRecipients = servers.size();\r\n\t\tfor(ServerHandler s : servers) {\r\n\t\t\ts.send(this, input);\r\n\t\t}\r\n\t\tsendTime = System.nanoTime();\r\n\r\n\t\tworkerTime = sendTime - pollTime;\r\n\t\t\r\n\t\tfor(ServerHandler s : servers) {\r\n\t\t\tString ricevuto = s.receive();\r\n\t\t\treplies.add(ricevuto);\r\n\t\t}\r\n\t\treceiveTime = System.nanoTime();\r\n\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\r\n\t\t\r\n\t\tfor(String reply : replies) {\r\n\t\t\tif(!(\"STORED\".equals(reply))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treplies.clear();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tsendBack(currentJob.getClient(), \"STORED\");\r\n\t\treplies.clear();\r\n\t\t\r\n\t}",
"@Override\n\tpublic void consume(Message message) {\n\t\tif (!AMQ_CONTENT_TYPE_JSON_GET.equals(message.getStringProperty(AMQ_CONTENT_TYPE)))\n\t\t\treturn;\n\n\t\tJson node = Util.readBodyBuffer(message.toCore());\n\t\tString correlation = message.getStringProperty(Config.AMQ_CORR_ID);\n\t\tString destination = message.getStringProperty(Config.AMQ_REPLY_Q);\n\n\t\t// deal with diff format\n\t\tif (node.has(CONTEXT) && (node.has(GET))) {\n\t\t\tif (logger.isDebugEnabled())\n\t\t\t\tlogger.debug(\"GET msg: {}\", node.toString());\n\t\t\tString ctx = node.at(CONTEXT).asString();\n\t\t\tString jwtToken = null;\n\t\t\tif (node.has(SignalKConstants.TOKEN) && !node.at(SignalKConstants.TOKEN).isNull()) {\n\t\t\t\tjwtToken = node.at(SignalKConstants.TOKEN).asString();\n\t\t\t}\n\t\t\tString root = StringUtils.substringBefore(ctx, dot);\n\t\t\troot = Util.sanitizeRoot(root);\n\n\t\t\t// limit to explicit series\n\t\t\tif (!vessels.equals(root) && !CONFIG.equals(root) && !sources.equals(root) && !resources.equals(root)\n\t\t\t\t\t&& !aircraft.equals(root) && !sar.equals(root) && !aton.equals(root) && !ALL.equals(root)) {\n\t\t\t\ttry {\n\t\t\t\t\tsendReply(destination, FORMAT_FULL, correlation, Json.object(), jwtToken);\n\t\t\t\t\treturn;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlogger.error(e, e);\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tString qUuid = StringUtils.substringAfter(ctx, dot);\n\t\t\tif (StringUtils.isBlank(qUuid))\n\t\t\t\tqUuid = \"*\";\n\t\t\tArrayList<String> fullPaths = new ArrayList<>();\n\n\t\t\ttry {\n\t\t\t\tNavigableMap<String, Json> map = new ConcurrentSkipListMap<>();\n\t\t\t\tfor (Json p : node.at(GET).asJsonList()) {\n\n\t\t\t\t\tString path = p.at(PATH).asString();\n\t\t\t\t\tString time = p.has(\"time\") ? p.at(\"time\").asString() : null;\n\t\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\t\tlogger.debug(\"GET time : {}={}\", time,\n\t\t\t\t\t\t\t\tStringUtils.isNotBlank(time) ? Util.getMillisFromIsoTime(time) : null);\n\t\t\t\t\tpath = Util.sanitizePath(path);\n\t\t\t\t\tfullPaths.add(Util.sanitizeRoot(ctx + dot + path));\n\n\t\t\t\t\tMap<String, String> queryMap = new HashMap<>();\n\t\t\t\t\tif (StringUtils.isNotBlank(path))\n\t\t\t\t\t\tqueryMap.put(skey, Util.regexPath(path).toString());\n\t\t\t\t\tif (StringUtils.isNotBlank(qUuid))\n\t\t\t\t\t\tqueryMap.put(\"uuid\", Util.regexPath(qUuid).toString());\n\t\t\t\t\tswitch (root) {\n\t\t\t\t\tcase CONFIG:\n\t\t\t\t\t\tinflux.loadConfig(map, queryMap);\n\t\t\t\t\t\tif (map.size() == 0 && queryMap.size() == 0) {\n\t\t\t\t\t\t\t// send defaults\n\t\t\t\t\t\t\tConfig.setDefaults(map);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase resources:\n\t\t\t\t\t\tinflux.loadResources(map, queryMap);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase sources:\n\t\t\t\t\t\tinflux.loadSources(map, queryMap);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase vessels:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, vessels, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, vessels, queryMap);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase aircraft:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, aircraft, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, aircraft, queryMap);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase sar:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, sar, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, sar, queryMap);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase aton:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, aton, queryMap, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, aton, queryMap);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ALL:\n\t\t\t\t\t\tif (StringUtils.isNotBlank(time)) {\n\t\t\t\t\t\t\tinflux.loadDataSnapshot(map, vessels, null, time);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinflux.loadData(map, vessels, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// loadAllDataFromInflux(map,aircraft);\n\t\t\t\t\t\t// loadAllDataFromInflux(map,sar);\n\t\t\t\t\t\t// loadAllDataFromInflux(map,aton);\n\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(\"GET token: {}, map : {}\", jwtToken, map);\n\n\t\t\t\t// security filter here\n\t\t\t\tSecurityUtils.trimMap(map, message.getStringProperty(Config.AMQ_USER_ROLES));\n\n\t\t\t\tJson json = SignalkMapConvertor.mapToFull(map);\n\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(\"GET json : {}\", json);\n\n\t\t\t\tString fullPath = StringUtils.getCommonPrefix(fullPaths.toArray(new String[] {}));\n\t\t\t\t// fullPath=StringUtils.remove(fullPath,\".*\");\n\t\t\t\t// fullPath=StringUtils.removeEnd(fullPath,\".\");\n\n\t\t\t\t// for REST we only send back the sub-node, so find it\n\t\t\t\tif (logger.isDebugEnabled())\n\t\t\t\t\tlogger.debug(\"GET node : {}\", fullPath);\n\n\t\t\t\tif (StringUtils.isNotBlank(fullPath) && !root.startsWith(CONFIG) && !root.startsWith(ALL))\n\t\t\t\t\tjson = Util.findNodeMatch(json, fullPath);\n\n\t\t\t\tsendReply(destination, FORMAT_FULL, correlation, json, jwtToken);\n\n\t\t\t} catch (Exception e) {\n\t\t\t\tlogger.error(e, e);\n\n\t\t\t}\n\n\t\t}\n\t\treturn;\n\t}",
"@Override\n public Redis send(Request request, Handler<AsyncResult<Response>> handler) {\n final RequestImpl req = (RequestImpl) request;\n final Command cmd = req.command();\n\n if (cmd.isMovable()) {\n // in cluster mode we currently do not handle movable keys commands\n try {\n handler.handle(Future.failedFuture(\"RedisClusterClient does not handle movable keys commands, use non cluster client on the right node.\"));\n } catch (RuntimeException e) {\n onException.handle(e);\n }\n return this;\n }\n\n if (cmd.isKeyless()) {\n // it doesn't matter which node to use\n send(selectClient(-1, cmd.isReadOnly()), options, RETRIES, req, handler);\n return this;\n }\n\n final List<byte[]> args = req.getArgs();\n\n if (cmd.isMultiKey()) {\n int currentSlot = -1;\n\n // args exclude the command which is an arg in the commands response\n int start = cmd.getFirstKey() - 1;\n int end = cmd.getLastKey();\n if (end > 0) {\n end--;\n }\n if (end < 0) {\n end = args.size() + (end + 1);\n }\n int step = cmd.getInterval();\n\n for (int i = start; i < end; i += step) {\n int slot = ZModem.generate(args.get(i));\n if (currentSlot == -1) {\n currentSlot = slot;\n continue;\n }\n if (currentSlot != slot) {\n\n if (!REDUCERS.containsKey(cmd)) {\n // we can't continue as we don't know how to reduce this\n try {\n handler.handle(Future.failedFuture(\"No Reducer available for: \" + cmd));\n } catch (RuntimeException e) {\n onException.handle(e);\n }\n return this;\n }\n\n final Map<Integer, Request> requests = splitRequest(cmd, args, start, end, step);\n final List<Future> responses = new ArrayList<>(requests.size());\n\n for (Map.Entry<Integer, Request> kv : requests.entrySet()) {\n final Future<Response> f = Future.future();\n send(selectClient(kv.getKey(), cmd.isReadOnly()), options, RETRIES, kv.getValue(), f);\n responses.add(f);\n }\n\n CompositeFuture.all(responses).setHandler(composite -> {\n if (composite.failed()) {\n // means if one of the operations failed, then we can fail the handler\n try {\n handler.handle(Future.failedFuture(composite.cause()));\n } catch (RuntimeException e) {\n onException.handle(e);\n }\n } else {\n try {\n handler.handle(Future.succeededFuture(REDUCERS.get(cmd).apply(composite.result().list())));\n } catch (RuntimeException e) {\n onException.handle(e);\n }\n }\n });\n\n return this;\n }\n }\n\n // all keys are on the same slot!\n send(selectClient(currentSlot, cmd.isReadOnly()), options, RETRIES, req, handler);\n return this;\n }\n\n // last option the command is single key\n int start = cmd.getFirstKey() - 1;\n send(selectClient(ZModem.generate(args.get(start)), cmd.isReadOnly()), options, RETRIES, req, handler);\n return this;\n }",
"private void dispatchRequests(RoutingContext context) {\n int initialOffset = 5; // length of `/api/`\n // Run with circuit breaker in order to deal with failure\n circuitBreaker.execute(future -> {\n getAllEndpoints().setHandler(ar -> {\n if (ar.succeeded()) {\n List<Record> recordList = ar.result();\n // Get relative path and retrieve prefix to dispatch client\n String path = context.request().uri();\n if (path.length() <= initialOffset) {\n notFound(context);\n future.complete();\n return;\n }\n\n String prefix = (path.substring(initialOffset).split(\"/\"))[0];\n String newPath = path.substring(initialOffset + prefix.length());\n\n // Get one relevant HTTP client, may not exist\n Optional<Record> client = recordList.stream()\n .filter(record -> record.getMetadata().getString(\"api.name\") != null)\n .filter(record -> record.getMetadata().getString(\"api.name\").equals(prefix))\n .findAny(); // simple load balance\n\n if (client.isPresent()) {\n doDispatch(context, newPath, discovery.getReference(client.get()).get(), future);\n } else {\n notFound(context);\n future.complete();\n }\n } else {\n future.fail(ar.cause());\n }\n });\n }).setHandler(ar -> {\n if (ar.failed()) {\n badGateway(ar.cause(), context);\n }\n });\n }",
"public Message process(Message m) throws ActionProcessingException {\n\t\t\r\n\t\t\r\n\t\t String responseMsg = (String) m.getBody().get(Body.DEFAULT_LOCATION);\r\n\t\t m.getBody().add(\"MsgToClient\",responseMsg);\r\n\t\t \r\n\t\t return m;\r\n\r\n\t}",
"void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }",
"private void sendToNodes(Sm.RetrieveChunkResponse chunkResponse, ArrayList<Sm.StorageNode> toSend) {\n\n System.out.println(\"Nodes to send to: \" + toSend);\n\n if (toSend.size() != 0) {\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n PatrolMessagePipeline pipeline = new PatrolMessagePipeline();\n Bootstrap bootstrap = new Bootstrap()\n .group(workerGroup)\n .channel(NioSocketChannel.class)\n .option(ChannelOption.SO_KEEPALIVE, true)\n .handler(pipeline);\n\n// for (Sm.StorageNode node: toSend) {\n\n //create StoreChunkRequest\n Sm.StoreChunk chunk = Sm.StoreChunk.newBuilder()\n .setFileName(chunkResponse.getFilename())\n .setChunkId(chunkResponse.getChunkId())\n .setChunkSize(chunkResponse.getChunkSize())\n .setData(chunkResponse.getData())\n .setChunkName(chunkResponse.getChunkName())\n .build();\n\n Sm.StorageNodes nodes = Sm.StorageNodes.newBuilder()\n .addAllNodeList(toSend)\n .build();\n\n Sm.StorageNode primary = toSend.get(0);\n System.out.println(\"Primary: \" + primary.getIp());\n System.out.println(\"Primary: \" + primary.getPort());\n\n //Connect to the first replica\n ChannelFuture cf = bootstrap.connect(primary.getIp(), primary.getPort());\n cf.syncUninterruptibly();\n\n //Prepare Request & Wrap\n Sm.StoreChunkRequest request = Sm.StoreChunkRequest.newBuilder()\n .setChunk(chunk)\n .setNodes(nodes)\n .build();\n\n Sm.StorageMessageWrapper msgWrapper = Sm.StorageMessageWrapper.newBuilder()\n .setScRequest(request)\n .build();\n\n //Send\n Channel chan = cf.channel();\n PatrolInboundHandler handler = chan.pipeline().get(PatrolInboundHandler.class);\n Sm.StorageMessageWrapper response = handler.request(msgWrapper);\n\n if (response.getScResponse().getSuccess()) {\n System.out.println(\"StoreChunk successful?: \" + response.getScResponse().getSuccess());\n Controller.getInstance().updateReplicasAndChunkNames(toSend, chunk.getChunkName());\n }\n\n workerGroup.shutdownGracefully();\n }\n }",
"@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355562000000\"; //--multi-dist\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multi\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"multidist\");\r\n\t\t\t\t//multiCounter.printResponse(req, \"multidist\");\r\n\t\t\t\t//use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"multidist\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}",
"@Override\r\n\tprotected byte[] handleSpecificRequest(String request) {\r\n\t\tif (!Utils.isEmpty(request)) {\r\n\t\t\tlogger.info(\"$$$$$$$$$$$$Message received at Tracking Server:\" + request);\r\n\t\t\tif (request.startsWith(NODE_REQUEST_TO_SERVER.FILE_LIST.name())) {\r\n\t\t\t\thandleFileUpdateMessage(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FIND.name())) {\r\n\t\t\t\tString peers = handleFindFileRequest(request);\r\n\t\t\t\treturn Utils.stringToByte((Utils.isEmpty(peers) ? SharedConstants.COMMAND_FAILED\r\n\t\t\t\t\t\t: SharedConstants.COMMAND_SUCCESS) + SharedConstants.COMMAND_PARAM_SEPARATOR + peers);\r\n\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FAILED_PEERS.name())) {\r\n\t\t\t\thandleFailedPeerRequest(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Utils.stringToByte(SharedConstants.INVALID_COMMAND);\r\n\r\n\t}",
"@Override\r\n\t\t\tpublic void handle(final HttpServerRequest req) {\n\t\t\t\tString startTime = \"1355620946302\"; //--separate-comp\r\n\t\t\t\tIterator<EventInfo> iter = \r\n\t\t\t\t\t\tdataService.events()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(EventInfo.class).iterator();\r\n\t\t\t\tEventCounter multiCounter = new EventCounter(\"/multicomp\");\r\n\t\t\t\tint processed = 0;\r\n\t\t\t\twhile (iter.hasNext() && processed < limit) {\r\n\t\t\t\t\tEventInfo event = iter.next();\r\n\t\t\t\t\tmultiCounter.countEvent(event);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treq.response.setChunked(true);\r\n\t\t\t\tmultiCounter.printDistance(req, \"sep_comp\");\r\n\t\t\t\t\r\n\t\t\t\t//multiCounter.printResponse(req, \"sep_comp\");\r\n\t\t\t\t// use response time data\r\n\t\t\t\tIterator<ResponseInfo> respIter = \r\n\t\t\t\t\t\tdataService.response()\r\n\t\t\t\t\t\t\t.find(\"{timestamp:{$gt:\"+startTime+\"}}\")\r\n\t\t\t\t\t\t\t.sort(\"{timestamp:1}\")\r\n\t\t\t\t\t\t\t.as(ResponseInfo.class).iterator();\r\n\t\t\t\tResponseCounter responseCounter = new ResponseCounter();\r\n\t\t\t\tprocessed = 0;\r\n\t\t\t\twhile (respIter.hasNext() && processed < limit) {\r\n\t\t\t\t\tResponseInfo resp = respIter.next();\r\n\t\t\t\t\tresponseCounter.count(resp);\r\n\t\t\t\t\tprocessed++;\r\n\t\t\t\t}\r\n\t\t\t\tresponseCounter.printResponse(req, \"sep_comp\");\r\n\r\n\t\t\t\treq.response.end();\r\n\t\t\t}",
"protected abstract boolean sendNextRequests();",
"Mono<ServerResponse> indexManagement(ServerRequest request);",
"protected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException\r\n\t{\r\n\t\t/**\r\n\t\t * Note: the \"resp\" is the only destination for an incoming requests\r\n\t\t */\r\n\t\tfinal long clientChannelID = Long.valueOf(req.getHeader(\"channelID\"));\r\n\t\t//final String clientID = req.getProtocol() + req.getRemoteAddr() + clientChannelID;\r\n\t\t\r\n\t\tSmartObjectInputStream input = new SmartObjectInputStream(req.getInputStream());\r\n\r\n\t\tLong xid = 0L;\r\n\t\tfinal WaitingCallback blocking = new WaitingCallback();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tchannelEndpoint.updateDeserializingThread(Thread.currentThread(),\r\n\t\t\t\t\ttrue);\r\n\t\t\tfinal CommMessage msg = CommMessage.parse(input);\r\n\t\t\txid = msg.getXID();\r\n\r\n\t\t\tsynchronized (callbacks)\r\n\t\t\t{\r\n\t\t\t\tcallbacks.put(xid + clientChannelID, blocking);\r\n\t\t\t}\r\n\t\t\tmsg.setXID(xid + clientChannelID); //update ID for preventing naming conflict\r\n\t\t\t\r\n\t\t\tchannelEndpoint.getChannelFacade().receivedMessage(this, msg);\r\n\t\t}\r\n\t\tcatch (final IOException ioe)\r\n\t\t{\r\n\t\t\tchannelEndpoint.getChannelFacade().receivedMessage(this, null);\r\n\t\t}\r\n\t\tcatch (final Throwable t)\r\n\t\t{\r\n\t\t\tt.printStackTrace();\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tchannelEndpoint.updateDeserializingThread(Thread.currentThread(),\r\n\t\t\t\t\tfalse);\r\n\t\t}\r\n\r\n\t\tCommMessage responseMsg = null;\r\n\r\n\t\t// wait for the reply\r\n\t\tsynchronized (blocking)\r\n\t\t{\r\n\t\t\tfinal long timeout = System.currentTimeMillis()\r\n\t\t\t\t\t+ CommConstants.TIMEOUT;\r\n\t\t\tresponseMsg = blocking.getResult();\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\twhile (responseMsg == null && System.currentTimeMillis() < timeout)\r\n\t\t\t\t{\r\n\t\t\t\t\tblocking.wait(CommConstants.TIMEOUT);\r\n\t\t\t\t\tresponseMsg = blocking.getResult();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (InterruptedException ie)\r\n\t\t\t{\r\n\t\t\t\tthrow new RemoteCommException(\r\n\t\t\t\t\t\t\"Interrupted while waiting for callback\", ie);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (responseMsg != null)\r\n\t\t{\r\n\t\t\tresponseMsg.setXID(responseMsg.getXID() - clientChannelID);//reset ID\r\n\t\t\tresp.setContentType(\"multipart/x-dpartner\");\r\n\t\t\tSmartObjectOutputStream output = new SmartObjectOutputStream(resp.getOutputStream());\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tchannelEndpoint.updateSerializing(Thread.currentThread(), true);\r\n\t\t\t\tresponseMsg.send(output);\r\n\t\t\t\tresp.flushBuffer();\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\tthrow e;\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tchannelEndpoint.updateSerializing(Thread.currentThread(), false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RemoteCommException(\r\n\t\t\t\t\t\"Method Invocation failed, timeout exceeded.\");\r\n\t\t}\r\n\t}",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"private void handleClient() {\n\t\t//Socket link = null;\n\t\tRequestRecord reqRec = new RequestRecord();\n\t\tResponder respondR = new Responder();\n\t\t\n\t\ttry {\n\t\t\t// STEP 1 : accepting client request in client socket\n\t\t\t//link = servSock.accept(); //-----> already done in *ThreadExecutor*\n\t\t\t\n\t\t\t// STEP 2 : creating i/o stream for socket\n\t\t\tScanner input = new Scanner(link.getInputStream());\n\t\t\tdo{\n\t\t\t\t//PrintWriter output = new PrintWriter(link.getOutputStream(),true);\n\t\t\t\t//DataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\t\t\tint numMsg = 0;\n\t\t\t\tString msg = input.nextLine();\n\t\t\t\t\n\t\t\t\t//to write all requests to a File\n\t\t\t\tFileOutputStream reqFile = new FileOutputStream(\"reqFile.txt\");\n\t\t\t\tDataOutputStream dat = new DataOutputStream(reqFile);\n\t\t\t\t\n\t\t\t\t// STEP 4 : listening iteratively till close string send\n\t\t\t\twhile(msg.length()>0){\n\t\t\t\t\tnumMsg++;\n\t\t\t\t\tdat.writeChars(msg + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"\\nNew Message Received\");\n\t\t\t\t\tif(reqRec.setRecord(msg)==false)\n\t\t\t\t\t\tSystem.out.println(\"\\n-----\\nMsg#\"+numMsg+\": \"+msg+\":Error with Request Header Parsing\\n-----\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Msg#\" + numMsg + \": \" + msg);\n\t\t\t\t\tmsg = input.nextLine();\n\t\t\t\t};\n\t\t\t\tdat.writeChars(\"\\n-*-*-*-*-*-*-*-*-*-*-*-*-*-\\n\\n\");\n\t\t\t\tdat.close();\n\t\t\t\treqFile.close();\n\t\t\t\tSystem.out.println(\"---newEST : \" + reqRec.getResource());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n==========Send HTTP Response for Get Request of\\n\"+reqRec.getResource()+\"\\n***********\\n\");\n\t\t\t\tif(respondR.sendHTTPResponseGET(reqRec.getResource(), link)==true)//RES, ds)==true)\n\t\t\t\t\tSystem.out.println(\"-----------Resource Read\");\n\t\t\t\tSystem.out.println(\"Total Messages Transferred: \" + numMsg);\n\t\t\t\t//link.close();\n\t\t\t\tif(reqRec.getConnection().equalsIgnoreCase(\"Keep-Alive\")==true && respondR.isResourceExisting(reqRec.getResource())==true)\n\t\t\t\t\tlink.setKeepAlive(true);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}while(true);\n\t\t\tSystem.out.print(\"Request Link Over as Connection: \" + reqRec.getConnection());\n\t\t} catch (IOException e) {\n\t\t\tif(link.isClosed())\n\t\t\t\tSystem.out.print(\"\\n\\nCritical(report it to developer):: link closed at exception\\n\\n\");\n\t\t\tSystem.out.println(\"Error in listening.\\n {Error may be here or with RespondR}\\nTraceString: \");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// STEP 5 : closing the connection\n\t\t\tSystem.out.println(\"\\nClosing Connection\\n\");\n\t\t\ttry {\t\t\t\t\n\t\t\t\tlink.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to disconnect.\\nTraceString: \");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}/*ends :: try...catch...finally*/\n\t\t\n\t}",
"private Object proxyGet (Request request, Response response) {\n\n final long startTimeMsec = System.currentTimeMillis();\n\n final String bundleId = request.params(\"bundleId\");\n final String workerVersion = request.params(\"workerVersion\");\n\n WorkerCategory workerCategory = new WorkerCategory(bundleId, workerVersion);\n String address = broker.getWorkerAddress(workerCategory);\n if (address == null) {\n Bundle bundle = null;\n // There are no workers that can handle this request. Request one and ask the UI to retry later.\n final String accessGroup = request.attribute(\"accessGroup\");\n final String userEmail = request.attribute(\"email\");\n WorkerTags workerTags = new WorkerTags(accessGroup, userEmail, \"anyProjectId\", bundle.regionId);\n broker.createOnDemandWorkerInCategory(workerCategory, workerTags);\n response.status(HttpStatus.ACCEPTED_202);\n response.header(\"Retry-After\", \"30\");\n response.body(\"Starting worker.\");\n return response;\n } else {\n // Workers exist in this category, clear out any record that we're waiting for one to start up.\n // FIXME the tracking of which workers are starting up should really be encapsulated using a \"start up if needed\" method.\n broker.recentlyRequestedWorkers.remove(workerCategory);\n }\n\n String workerUrl = \"http://\" + address + \":7080/single\"; // TODO remove hard-coded port number.\n LOG.info(\"Re-issuing HTTP request from UI to worker at {}\", workerUrl);\n\n\n HttpClient httpClient = HttpClient.newBuilder().build();\n HttpRequest httpRequest = HttpRequest.newBuilder()\n .GET()\n .uri(URI.create(workerUrl))\n .header(\"Accept-Encoding\", \"gzip\") // TODO Explore: is this unzipping and re-zipping the result from the worker?\n .build();\n try {\n response.status(0);\n // content-type response.header();\n return httpClient.send(httpRequest, HttpResponse.BodyHandlers.ofInputStream());\n } catch (Exception exception) {\n response.status(HttpStatus.BAD_GATEWAY_502);\n response.body(ExceptionUtils.stackTraceString(exception));\n return response;\n } finally {\n\n }\n }",
"public ServerResponse<T> sendRequestWithMultiHeaders(Map<String, String[]> httpHeaders)\n {\n HttpUriRequest request = getHttpUriRequest();\n request.setHeader(HttpHeader.CONTENT_TYPE_HEADER, HttpHeader.SCIM_CONTENT_TYPE);\n addHeaderToRequest(scimHttpClient.getScimClientConfig().getHttpHeaders(), httpHeaders, request);\n if (scimHttpClient.getScimClientConfig().getBasicAuth() != null)\n {\n request.setHeader(HttpHeader.AUTHORIZATION,\n scimHttpClient.getScimClientConfig().getBasicAuth().getAuthorizationHeaderValue());\n }\n HttpResponse response = scimHttpClient.sendRequest(request);\n return toResponse(response);\n }",
"@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {\n\t\t\n\t\t// This is all debugging...\n\t\tif (msg instanceof HttpResponse) {\n\t\t\tHttpResponse response = (HttpResponse) msg;\n\n\t\t\tlogger.debug(\"STATUS: \" + response.status());\n\t\t\tlogger.debug(\"VERSION: \" + response.protocolVersion());\n\n\t\t\tif (!response.headers().isEmpty()) {\n\t\t\t\tfor (CharSequence name : response.headers().names()) {\n\t\t\t\t\tfor (CharSequence value : response.headers().getAll(name)) {\n\t\t\t\t\t\tlogger.debug(\"HEADER: \" + name + \" = \" + value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (HttpUtil.isTransferEncodingChunked(response)) {\n\t\t\t\tlogger.debug(\"CHUNKED CONTENT {\");\n\t\t\t} else {\n\t\t\t\tlogger.debug(\"CONTENT {\");\n\t\t\t}\n\t\t}\n\t\t\n\t\t// This is where the work happens. This handler gets called MULTIPLE times.\n\t\tif (msg instanceof HttpContent) {\n\t\t\t// The data from the server\n\t\t\tHttpContent content = (HttpContent) msg;\n\n\t\t\t// Gather all the chunks.\n\t\t\tif (null == chunks) {\n\t\t\t\tlogger.debug(\"Chunks initialized.\");\n\t\t\t\tchunks = copiedBuffer(content.content());\n\t\t\t} else {\n\t\t\t\tlogger.debug(\"Adding chunks\");\n\t\t\t\tchunks = copiedBuffer(chunks, content.content());\n\t\t\t}\n\n\t\t\tlogger.debug(content.content().toString(CharsetUtil.UTF_8));\n\n\t\t\tif (content instanceof LastHttpContent) {\n\t\t\t\tlogger.debug(\"} END OF CONTENT\");\n\t\t\t\tlogger.debug(\"Subscriber in handler: {}\", this.subscriber);\n\t\t\t\tlogger.debug(\"Chunks: {}\", this.chunks);\n\t\t\t\tsubscriber.onNext(chunks.toString(CharsetUtil.UTF_8));\n\t\t\t\tctx.close();\n\t\t\t}\n\t\t}\n\t}",
"ResponseDTO performServerActions();",
"Map<String, Object> send();",
"public static void doClientMessageSend() {\n\t\tfinal String correlationId = \"ABC123\";\n\t\tMessage toSend = new Message(\"query message to server\", correlationId);\n\n\t\tMessagingSystemInfo messagingSystemInfo = oneAgentSDK.createMessagingSystemInfo(\"myCreativeMessagingSystem\",\n\t\t\t\t\"theOnlyQueue\", MessageDestinationType.QUEUE, ChannelType.TCP_IP, \"localhost:4711\");\n\n\t\t// sending the request:\n\t\t{\n\t\t\tOutgoingMessageTracer outgoingMessageTracer = oneAgentSDK.traceOutgoingMessage(messagingSystemInfo);\n\t\t\toutgoingMessageTracer.start();\n\t\t\ttry {\n\t\t\t\t// transport the Dynatrace tag along with the message to allow the outgoing message tracer to be linked\n\t\t\t\t// with the message processing tracer on the receiving side\n\t\t\t\ttoSend.setHeaderField(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME, outgoingMessageTracer.getDynatraceStringTag());\n\t\t\t\ttheQueue.send(toSend);\n\t\t\t\toutgoingMessageTracer.setVendorMessageId(toSend.getMessageId()); // optional payload\n\t\t\t\toutgoingMessageTracer.setCorrelationId(toSend.correlationId);\n\t\t\t} catch (Exception e) {\n\t\t\t\toutgoingMessageTracer.error(e.getMessage());\n\t\t\t} finally {\n\t\t\t\toutgoingMessageTracer.end();\n\t\t\t}\n\t\t}\n\n\t\t// waiting for server response message:\n\t\t{\n\t\t\tIncomingMessageReceiveTracer receivingMessageTracer = oneAgentSDK.traceIncomingMessageReceive(messagingSystemInfo);\n\t\t\treceivingMessageTracer.start();\n\t\t\ttry {\n\t\t\t\tMessage answer = theQueue.receive(correlationId);\n\t\t\t\t\n\t\t\t\tIncomingMessageProcessTracer processMessageTracer = oneAgentSDK.traceIncomingMessageProcess(messagingSystemInfo);\n\t\t\t\t// retrieve Dynatrace tag created using the outgoing message tracer to link both sides together\n\t\t\t\tprocessMessageTracer.setDynatraceStringTag(answer.getHeaderField(OneAgentSDK.DYNATRACE_MESSAGE_PROPERTYNAME));\n\t\t\t\tprocessMessageTracer.setVendorMessageId(answer.msgId);\n\t\t\t\tprocessMessageTracer.setCorrelationId(answer.correlationId);\n\t\t\t\tprocessMessageTracer.start();\n\t\t\t\ttry {\n\t\t\t\t\t// handle answer message in sync way ...\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tprocessMessageTracer.error(e.getMessage());\n\t\t\t\t} finally {\n\t\t\t\t\tprocessMessageTracer.end();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\treceivingMessageTracer.error(e.getMessage());\n\t\t\t} finally {\n\t\t\t\treceivingMessageTracer.end();\n\t\t\t}\n\t\t}\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) \n\tthrows ServletException, IOException {\n\t\ttry {\n\t\t\tServletContext context = getServletContext();\n\t\t\tHttpSession session = request.getSession();\n\t\t\tDBConnection connection = (DBConnection) context.getAttribute(\"DBConnection\");\n\t\t\tInteger messageID = Integer.parseInt( request.getParameter(\"messageID\") );\n\t\t\tInteger fromUserID = Integer.parseInt( request.getParameter(\"fromUserID\") );\n\t\t\tInteger requestUserID = ( (User) session.getAttribute(\"user\") ).getUserID();\n\t\t\t\n\t\t\tif (fromUserID != requestUserID) { // reading a message only applies to recipients\n\t\t\t\tconnection.readMessage(messageID);\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception ignored) {}\n\t}",
"public void sendRequest(byte[] request) {\n // send request\n try {\n //get file id and chunk number\n String[] req = new String(request).split(\" \",5);\n String fileID = req[3] , chunkNo = req[4];\n\n //create socket\n MulticastSocket socket = new MulticastSocket(this.mcastPort);\n\n socket.setTimeToLive(1);\n socket.joinGroup(InetAddress.getByName(mscastAdress));\n\n int time = new Random().nextInt(400);\n socket.setSoTimeout(time); //max time it will listen to\n\n //listen for x time\n long oldTime = System.currentTimeMillis();\n byte[] b = new byte[65000];\n\n DatagramPacket receive = new DatagramPacket(b,b.length);\n while(System.currentTimeMillis()-oldTime < time){\n\n try {\n socket.receive(receive);\n }catch (IOException e)\n {\n System.out.println(\"\\nReached time out - no one has sent PUTCHUNK!\");\n break;\n }\n\n String[] ms = new String(receive.getData()).split(\" \",6);\n\n if(ms[1]==\"PUTCHUNK\" && ms[3]==fileID && ms[4]==chunkNo){\n System.out.println(\"Someone already sent it!\");\n socket.close();\n return;//exit\n }\n }\n\n //sending request\n DatagramPacket replyPacket = new DatagramPacket(request, request.length, InetAddress.getByName(mscastAdress), mcastPort);\n socket.send(replyPacket);\n\n System.out.println(\"In PUTCHUNK - Sent packet, no one has sent it\");\n socket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"private static void sendGets(HttpClient httpClient) {\n HttpTextResponse httpResponse = httpClient.get(\"/hello/mom\");\n puts(httpResponse);\n\n\n /* Send one param get. */\n httpResponse = httpClient.getWith1Param(\"/hello/singleParam\", \"hi\", \"mom\");\n puts(\"single param\", httpResponse);\n\n\n /* Send two param get. */\n httpResponse = httpClient.getWith2Params(\"/hello/twoParams\",\n \"hi\", \"mom\", \"hello\", \"dad\");\n puts(\"two params\", httpResponse);\n\n\n /* Send two param get. */\n httpResponse = httpClient.getWith3Params(\"/hello/3params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\");\n puts(\"three params\", httpResponse);\n\n\n /* Send four param get. */\n httpResponse = httpClient.getWith4Params(\"/hello/4params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\");\n puts(\"4 params\", httpResponse);\n\n /* Send five param get. */\n httpResponse = httpClient.getWith5Params(\"/hello/5params\",\n \"hi\", \"mom\",\n \"hello\", \"dad\",\n \"greetings\", \"kids\",\n \"yo\", \"pets\",\n \"hola\", \"neighbors\");\n puts(\"5 params\", httpResponse);\n\n\n /* Send six params with get. */\n\n final HttpRequest httpRequest = httpRequestBuilder().addParam(\"hi\", \"mom\")\n .addParam(\"hello\", \"dad\")\n .addParam(\"greetings\", \"kids\")\n .addParam(\"yo\", \"pets\")\n .addParam(\"hola\", \"pets\")\n .addParam(\"salutations\", \"all\").build();\n\n httpResponse = httpClient.sendRequestAndWait(httpRequest);\n puts(\"6 params\", httpResponse);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsync(\"/hi/async\", (code, contentType, body) -> puts(\"Async text with lambda\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith1Param(\"/hi/async\", \"hi\", \"mom\", (code, contentType, body) -> puts(\"Async text with lambda 1 param\\n\", body));\n\n Sys.sleep(100);\n\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith2Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n (code, contentType, body) -> puts(\"Async text with lambda 2 params\\n\", body));\n\n Sys.sleep(100);\n\n\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith3Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n (code, contentType, body) -> puts(\"Async text with lambda 3 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith4Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n (code, contentType, body) -> puts(\"Async text with lambda 4 params\\n\", body));\n\n Sys.sleep(100);\n\n\n /* Using Async support with lambda. */\n httpClient.getAsyncWith5Params(\"/hi/async\",\n \"p1\", \"v1\",\n \"p2\", \"v2\",\n \"p3\", \"v3\",\n \"p4\", \"v4\",\n \"p5\", \"v5\",\n (code, contentType, body) -> puts(\"Async text with lambda 5 params\\n\", body));\n\n Sys.sleep(100);\n }",
"@Override\n protected void decode(ChannelHandlerContext ctx, HttpObject msg, List<Object> out) throws Exception {\n if (continueResponse && msg instanceof LastHttpContent) {\n // Release the last empty content associated with the 100-Continue response\n release(msg);\n return;\n }\n\n if (msg instanceof HttpResponse && CONTINUE.equals(((HttpResponse) msg).status())) {\n continueResponse = true;\n ctx.fireChannelRead(msg);\n return;\n }\n\n continueResponse = false;\n super.decode(ctx, msg, out);\n }",
"@Override\n public void onResponse(String response) {\n System.out.print(\"respuesta Server\"+response);\n responseRequest(sync_id);\n /*if (sync_id != 0) {\n responseRequest(sync_id);\n } else {\n background_response = \"ID Sync null\";\n restartRequest(background_response);\n }*/\n }",
"@Override\n\tpublic void run(){\n\t\tSystem.out.println(\"run\");\n\t\ttry {\n\t\t\tString firstLine = inFromClient.readLine();\n\t\t\tSystem.out.println(\"Received: \" + firstLine);\n\n\t\t\tboolean badRequest = false;\n\t\t\tString[] array = firstLine.split(\" \");\n\t\t\tString HTTPcommand = array[0];\n\t\t\tString URI = array[1];\n\t\t\tString HTTPversion = array[2];\n\t\t\tString path = \"\";\n\t\t\t\n\t\t\tint indexSlash = URI.lastIndexOf(\"/\");\n\t\t\tSystem.out.println(indexSlash);\n\t\t\tpath = URI.substring(indexSlash+1, URI.length());\n\n\t\t\t\n\t\t\tString secondLine = inFromClient.readLine();\n\t\t\tif (!HTTPversion.equals(\"HTTP/1.1\")) {\n\t\t\t\tbadRequest = true;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif (badRequest) {\n\t\t\t\tout.println(\"HTTP/1.1 400 Bad Request\");\n\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\tout.flush();\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tswitch(HTTPcommand){\n\t\t\t\tcase \"HEAD\": Head.head(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"GET\": Get.get(clientSocket, inFromClient, out, path);\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"PUT\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPut.put(inFromClient, path);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase \"POST\": {\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t\tString Line3 = inFromClient.readLine();\n\t\t\t\t\tString Line4 = inFromClient.readLine();\n\t\t\t\t\tString Line5 = inFromClient.readLine();\n\t\t\t\t\tPost.post(inFromClient, path);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault: {\n\t\t\t\t\tout.println(\"HTTP/1.1 501 Not Implemented\");\n\t\t\t\t\tout.println('\\r' + '\\n' + '\\r' + '\\n');\n\t\t\t\t\tout.flush();\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\n\t\t//run();\n\n\t\t//inFromClient.close();\n\t\t//serverSocket.close();\n\t}",
"Single<WebClientServiceRequest> whenSent();",
"Single<WebClientServiceRequest> whenSent();",
"private void processRequestMessage(ServerSessionFactory factory, JsonObject requestJsonObject,\n final ResponseSender responseSender, String transportId) throws IOException {\n\n final Request<JsonElement> request = JsonUtils.fromJsonRequest(requestJsonObject,\n JsonElement.class);\n\n switch (request.getMethod()) {\n case METHOD_CONNECT:\n\n log.debug(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processReconnectMessage(factory, request, responseSender, transportId);\n break;\n case METHOD_PING:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processPingMessage(factory, request, responseSender, transportId);\n break;\n\n case METHOD_CLOSE:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processCloseMessage(factory, request, responseSender, transportId);\n\n break;\n default:\n\n final ServerSession session = getOrCreateSession(factory, transportId, request);\n\n log.debug(\"{} Req-> {} [jsonRpcSessionId={}, transportId={}]\", label, request,\n session.getSessionId(), transportId);\n\n // TODO, Take out this an put in Http specific handler. The main\n // reason is to wait for request before responding to the client.\n // And for no contaminate the ProtocolManager.\n if (request.getMethod().equals(Request.POLL_METHOD_NAME)) {\n\n Type collectionType = new TypeToken<List<Response<JsonElement>>>() {\n }.getType();\n\n List<Response<JsonElement>> responseList = JsonUtils.fromJson(request.getParams(),\n collectionType);\n\n for (Response<JsonElement> response : responseList) {\n session.handleResponse(response);\n }\n\n // Wait for some time if there is a request from server to\n // client\n\n // TODO Allow send empty responses. Now you have to send at\n // least an\n // empty string\n responseSender.sendResponse(new Response<Object>(request.getId(), Collections.emptyList()));\n\n } else {\n session.processRequest(new Runnable() {\n @Override\n public void run() {\n handlerManager.handleRequest(session, request, responseSender);\n }\n });\n }\n break;\n }\n\n }",
"@Override\n @SuppressWarnings(\"unchecked\")\n public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise) {\n // We still have a request in-flight so we need to reschedule it in order to not let it trip on each others\n // toes.\n if (currentRequest != null) {\n RetryOrchestrator.maybeRetry(endpointContext, (Request<? extends Response>) msg, RetryReason.NOT_PIPELINED_REQUEST_IN_FLIGHT);\n if (endpoint != null) {\n endpoint.decrementOutstandingRequests();\n }\n return;\n }\n\n if (msg instanceof NonChunkedHttpRequest) {\n try {\n currentRequest = (NonChunkedHttpRequest<Response>) msg;\n FullHttpRequest encoded = ((NonChunkedHttpRequest<Response>) msg).encode();\n encoded.headers().set(HttpHeaderNames.HOST, remoteHost);\n encoded.headers().set(HttpHeaderNames.USER_AGENT, endpointContext.environment().userAgent().formattedLong());\n dispatchTimingStart = System.nanoTime();\n if (currentRequest.requestSpan() != null) {\n RequestTracer tracer = endpointContext.environment().requestTracer();\n currentDispatchSpan = tracer.requestSpan(TracingIdentifiers.SPAN_DISPATCH, currentRequest.requestSpan());\n\n if (!CbTracing.isInternalTracer(tracer)) {\n setCommonDispatchSpanAttributes(\n currentDispatchSpan,\n ctx.channel().attr(ChannelAttributes.CHANNEL_ID_KEY).get(),\n ioContext.localHostname(),\n ioContext.localPort(),\n endpoint.remoteHostname(),\n endpoint.remotePort(),\n currentRequest.operationId()\n );\n }\n }\n ctx.write(encoded, promise);\n } catch (Throwable t) {\n currentRequest.response().completeExceptionally(t);\n if (endpoint != null) {\n endpoint.decrementOutstandingRequests();\n }\n }\n } else {\n if (endpoint != null) {\n endpoint.decrementOutstandingRequests();\n }\n eventBus.publish(new InvalidRequestDetectedEvent(ioContext, serviceType, msg));\n ctx.channel().close().addListener(f -> eventBus.publish(new ChannelClosedProactivelyEvent(\n ioContext,\n ChannelClosedProactivelyEvent.Reason.INVALID_REQUEST_DETECTED)\n ));\n }\n }",
"@SuppressWarnings(\"unchecked\")\n @Override\n public void onReceive(Request request) throws Throwable {\n Util.initializeContext(request, TelemetryEnvKey.USER);\n // set request id fto thread loacl...\n ExecutionContext.setRequestId(request.getRequestId());\n\n Response response = new Response();\n if (request.getOperation().equalsIgnoreCase(ActorOperations.ADD_CONTENT.getValue())) {\n Util.DbInfo dbInfo = Util.dbInfoMap.get(JsonKey.LEARNER_CONTENT_DB);\n Util.DbInfo batchdbInfo = Util.dbInfoMap.get(JsonKey.COURSE_BATCH_DB);\n // objects of telemetry event...\n Map<String, Object> targetObject = null;\n List<Map<String, Object>> correlatedObject = null;\n\n String userId = (String) request.getRequest().get(JsonKey.USER_ID);\n List<Map<String, Object>> requestedcontentList =\n (List<Map<String, Object>>) request.getRequest().get(JsonKey.CONTENTS);\n CopyOnWriteArrayList<Map<String, Object>> contentList =\n new CopyOnWriteArrayList<>(requestedcontentList);\n request.getRequest().put(JsonKey.CONTENTS, contentList);\n // map to hold the status of requested state of contents\n Map<String, Integer> contentStatusHolder = new HashMap<>();\n\n if (!(contentList.isEmpty())) {\n for (Map<String, Object> map : contentList) {\n // replace the course id (equivalent to Ekstep content id) with One way hashing\n // of\n // userId#courseId , bcoz in cassndra we are saving course id as userId#courseId\n\n String batchId = (String) map.get(JsonKey.BATCH_ID);\n boolean flag = true;\n\n // code to validate the whether request for valid batch range(start and end\n // date)\n if (!(StringUtils.isBlank(batchId))) {\n Response batchResponse =\n cassandraOperation.getRecordById(\n batchdbInfo.getKeySpace(), batchdbInfo.getTableName(), batchId);\n List<Map<String, Object>> batches =\n (List<Map<String, Object>>) batchResponse.getResult().get(JsonKey.RESPONSE);\n if (batches.isEmpty()) {\n flag = false;\n } else {\n Map<String, Object> batchInfo = batches.get(0);\n flag = validateBatchRange(batchInfo);\n }\n\n if (!flag) {\n response\n .getResult()\n .put((String) map.get(JsonKey.CONTENT_ID), \"BATCH NOT STARTED OR BATCH CLOSED\");\n contentList.remove(map);\n continue;\n }\n }\n map.putIfAbsent(JsonKey.COURSE_ID, JsonKey.NOT_AVAILABLE);\n preOperation(map, userId, contentStatusHolder);\n map.put(JsonKey.USER_ID, userId);\n map.put(JsonKey.DATE_TIME, new Timestamp(new Date().getTime()));\n\n try {\n ProjectLogger.log(\n \"LearnerStateUpdateActor:onReceive: map \" + map, LoggerEnum.INFO.name());\n cassandraOperation.upsertRecord(dbInfo.getKeySpace(), dbInfo.getTableName(), map);\n response.getResult().put((String) map.get(JsonKey.CONTENT_ID), JsonKey.SUCCESS);\n // create telemetry for user for each content ...\n targetObject =\n TelemetryUtil.generateTargetObject(\n (String) map.get(JsonKey.BATCH_ID), JsonKey.BATCH, JsonKey.CREATE, null);\n // since this event will generate multiple times so nedd to recreate correlated\n // objects every time ...\n correlatedObject = new ArrayList<>();\n TelemetryUtil.generateCorrelatedObject(\n (String) map.get(JsonKey.CONTENT_ID), JsonKey.CONTENT, null, correlatedObject);\n TelemetryUtil.generateCorrelatedObject(\n (String) map.get(JsonKey.COURSE_ID), JsonKey.COURSE, null, correlatedObject);\n TelemetryUtil.generateCorrelatedObject(\n (String) map.get(JsonKey.BATCH_ID), JsonKey.BATCH, null, correlatedObject);\n Map<String, String> rollUp = new HashMap<>();\n rollUp.put(\"l1\", (String) map.get(JsonKey.COURSE_ID));\n rollUp.put(\"l2\", (String) map.get(JsonKey.CONTENT_ID));\n TelemetryUtil.addTargetObjectRollUp(rollUp, targetObject);\n TelemetryUtil.telemetryProcessingCall(\n request.getRequest(), targetObject, correlatedObject);\n } catch (Exception ex) {\n response.getResult().put((String) map.get(JsonKey.CONTENT_ID), JsonKey.FAILED);\n contentList.remove(map);\n }\n }\n }\n sender().tell(response, self());\n // call to update the corresponding course\n ProjectLogger.log(\"Calling background job to update learner state\");\n request.getRequest().put(CONTENT_STATE_INFO, contentStatusHolder);\n request.setOperation(ActorOperations.UPDATE_LEARNER_STATE.getValue());\n tellToAnother(request);\n } else {\n onReceiveUnsupportedOperation(request.getOperation());\n }\n }",
"@Override\n public Flux<Response> statefulChannel(Publisher<Request> messages, ByteBuf metadata) {\n Flux.from(messages).limitRate(8).subscribe(processor::onNext);\n return responseFlux;\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n Long multicastId = new Long(req.getParameter(\"multicastKey\"));\n boolean success = mSender.sendMessage(multicastId);\n if (success) {\n taskDone(resp, multicastId);\n } else {\n retryTask(resp);\n }\n }",
"public void processRequest(StunMessageEvent evt)\n {\n if(messageSequence.isEmpty())\n return;\n Object obj = messageSequence.remove(0);\n\n if( !(obj instanceof Response) )\n return;\n\n Response res = (Response)obj;\n\n try\n {\n stunStack.sendResponse(evt.getMessage().getTransactionID(),\n res, serverAddress, evt.getRemoteAddress());\n }\n catch (Exception ex)\n {\n logger.log(Level.WARNING, \"failed to send a response\", ex);\n }\n\n }",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"public interface Router {\n\n interface Message {\n /**\n * The reply-to header\n *\n * @return the reply-to header\n */\n default String replyTo() {\n return (String) metadata().get(\"reply-to\");\n }\n\n /**\n * The host header\n *\n * @return the host header\n */\n default String host() {\n return (String) metadata().get(\"x-host\");\n }\n\n /**\n * Get the name of the reply queue to send the message to\n *\n * @return the reply queue\n */\n default String replyQueue() {\n return (String) metadata().get(\"x-reply-queue\");\n }\n\n\n /**\n * The uri header\n *\n * @return the uri header\n */\n default String uri() {\n\n return (String) metadata().get(\"x-uri\");\n }\n\n /**\n * The scheme header\n *\n * @return the scheme header\n */\n default String scheme() {\n return (String) metadata().get(\"x-scheme\");\n }\n\n /**\n * The method header\n *\n * @return the method header\n */\n default String method() {\n String m = (String) metadata().get(\"x-method\");\n if (null == m) {\n m = \"get\";\n }\n return m.toLowerCase();\n }\n\n /**\n * Get the port... may be String, Number, or null\n *\n * @return get the port\n */\n default Object port() {\n return metadata().get(\"server-port\");\n }\n\n /**\n * get the protocol for the request\n *\n * @return\n */\n default String protocol() {\n return (String) metadata().get(\"x-server-protocol\");\n }\n\n /**\n * Get the uri args for the request\n *\n * @return the uri args for the request\n */\n default String args() {\n return (String) metadata().get(\"x-uri-args\");\n }\n\n /**\n * The content-type header\n *\n * @return the content-type header\n */\n default String contentType() {\n return (String) metadata().get(\"content-type\");\n }\n\n /**\n * The remote address of the client\n *\n * @return remote address\n */\n default String remoteAddr() {\n return (String) metadata().get(\"x-remote-addr\");\n }\n\n /**\n * The\n *\n * @return\n */\n Map<String, Object> metadata();\n\n Object body();\n\n byte[] rawBody();\n\n MessageBroker.ReceivedMessage underlyingMessage();\n }\n\n /**\n * Convert the message from the more generic one from the MessageBroker into\n * something that can be routed\n *\n * @param message\n * @return\n */\n default Message brokerMessageToRouterMessage(MessageBroker.ReceivedMessage message) {\n return new Message() {\n\n @Override\n public Map<String, Object> metadata() {\n return message.metadata();\n }\n\n @Override\n public Object body() {\n return message.body();\n }\n\n @Override\n public byte[] rawBody() {\n return message.rawBody();\n }\n\n @Override\n public MessageBroker.ReceivedMessage underlyingMessage() {\n return message;\n }\n };\n }\n\n /**\n * Route the message. This may cause the message to be queued to the next handler (Runner)\n * or route it to the handler Func.\n *\n * @param message the Message to route\n * @return the result of the Message application or void if this Router forwards the message\n */\n Object routeMessage(Message message) throws IOException;\n\n\n /**\n * Release any resources that the Router has... for example, any database pool connections\n */\n void endLife();\n\n /**\n * Get the host that this Router is listening for\n *\n * @return the name of the host. May be null\n */\n String host();\n\n /**\n * Get the base path for this Router\n *\n * @return the base path for the router\n */\n String basePath();\n\n /**\n * Return the name of the queue that is associated with the host/path combination\n *\n * @return the name of the queue associated with the host/path combination\n */\n String nameOfListenQueue();\n\n /**\n * Get the swagger for this Router\n *\n * @return the Swagger information for the router\n */\n Map<String, Object> swagger();\n\n}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\tString uid1=request.getParameter(\"uid1\");\n\t\t\tString uid2=request.getParameter(\"uid2\");\n\t\t\tString uidentity=request.getParameter(\"uidentity\");\n\t\t\t\n\t\t\tSystem.out.println(\"message:\"+uid2);\n\t\t\t\n\t\t\tif(uidentity.charAt(0)=='2')\n\t\t\t{\n\t\t\t\tString order=request.getParameter(\"order\");\n\t\t\t\tif(order==\"0\")\n\t\t\t\t{\n\t\t\t\tmessage m=new message();\n\t\t\t\tm.setMuid1(uid1);\n\t\t\t\tm.setMuid2(uid2);\n\t\t\t\tm.setMtext(\"邀请评价\");\n\t\t\t\tm.setMsituation('0');\n\t\t\t\ttry {\n\t\t\t\t\tnew messageDAO().addMessage(m);\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmessage m=new message();\n\t\t\t\t\tm.setMuid1(uid1);\n\t\t\t\t\tm.setMuid2(uid2);\n\t\t\t\t\tm.setMtext(\"申请项目\");\n\t\t\t\t\tm.setMsituation('0');\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnew messageDAO().addMessage(m);\n\t\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmessage m=new message();\n\t\t\t\tm.setMuid1(uid1);\n\t\t\t\tm.setMuid2(uid2);\n\t\t\t\tm.setMtext(\"邀请加入\");\n\t\t\t\tm.setMsituation('0');\n\t\t\t\ttry {\n\t\t\t\t\tnew messageDAO().addMessage(m);\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t}",
"public void processReq(){\n //Using auto cloable for reader ;)\n try( BufferedReader reader = new BufferedReader(new InputStreamReader(clientSock.getInputStream()))){\n String mess = reader.readLine();\n String returnMess = getData(mess);\n\n PrintWriter writer = new PrintWriter(clientSock.getOutputStream());\n writer.println(returnMess);\n writer.flush();\n\n //Close sockets\n clientSock.close();\n sock.close();\n } catch (IOException e) {\n System.err.println(\"ERROR: Problem while opening / close a stream\");\n }\n }",
"private void getMall(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}",
"@Test\n void testRequestInterleaving() throws Exception {\n final BlockerSync sync = new BlockerSync();\n testHandler.handlerBody =\n id -> {\n if (id == 1) {\n try {\n sync.block();\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n }\n }\n return CompletableFuture.completedFuture(new TestResponse(id.toString()));\n };\n\n // send first request and wait until the handler blocks\n final CompletableFuture<TestResponse> response1 =\n sendRequestToTestHandler(new TestRequest(1));\n sync.awaitBlocker();\n\n // send second request and verify response\n final CompletableFuture<TestResponse> response2 =\n sendRequestToTestHandler(new TestRequest(2));\n assertThat(response2.get().getStatus()).isEqualTo(\"2\");\n\n // wake up blocked handler\n sync.releaseBlocker();\n\n // verify response to first request\n assertThat(response1.get().getStatus()).isEqualTo(\"1\");\n }",
"long sendRequestToClient(long client, byte[] content, int prio) throws IOException, MlmqException;",
"@Override\n\tpublic void channelRead(ChannelHandlerContext ctx, Object msg)\n\t\t\tthrows Exception {\n\t\thandleRequestWithsingleThread(ctx, msg);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tint id = -1;\n\t\ttry {\n\t\t\tid = Integer.parseInt(request.getParameter(\"id\"));\n\t\t} catch (Exception e) {\n\t\t}\n\t\tList<String> messages = ChatServerConnector.getMessage(id);\n\t\tString message = \"\";\n\t\tif (messages != null) {\n\t\t\tmessage = messages.stream().map((msg) -> msg + \"\\n\").reduce(message, String::concat);\n\t\t} else {\n\t\t\t//TODO håndtere fejl\n\t\t}\n\t\tresponse.setContentType(\"text/plain;charset=UTF-8\");\n\t\ttry (PrintWriter out = response.getWriter()) {\n\t\t\tout.print(message);\n\t\t}\n\t}",
"private void doRequest() {\n\n try {\n JsonObject request = new JsonObject()\n .put(\"action\", Math.random() < 0.5 ? \"w\" : \"r\")\n .put(\"timeOfRequest\", System.currentTimeMillis());\n\n if (request.getString(\"action\") == \"w\") {\n request.put(\"data\", new JsonObject()\n .put(\"key\", \"value\")\n );\n logger.debug(\"requesting write: \" + request.toString());\n eb.send(\"storage-write-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n } else {\n Random random = new Random();\n List<String> keys = new ArrayList<String>(map.keySet());\n String randomKey = keys.get(random.nextInt(keys.size()));\n request.put(\"id\", randomKey);\n logger.debug(\"waiting for read: \" + request.toString());\n eb.send(\"storage-read-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n }\n } catch (Exception e) {\n logger.warn(\"Error\");\n makeRequest();\n }\n\n }",
"public void sentRecieve() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException {\n InetAddress host = InetAddress.getLocalHost();\r\n Socket socket = null;\r\n ObjectOutputStream output = null;\r\n ObjectInputStream input = null;\r\n \r\n LinkedList client = new LinkedList();\r\n client.add(\"Elifas\");\r\n client.add(\"Andrew\");\r\n client.add(\"Claudia\");\r\n client.add(\"Ester\");\r\n client.add(\"Emilie\");\r\n \r\n for (int i = 0; i < client.size(); i++) {\r\n int size = client.size();\r\n //establishing socket connection to a server\r\n socket = new Socket(host.getHostName(), 2535);\r\n //write to the socket using ObjectOutputStream\r\n output = new ObjectOutputStream(socket.getOutputStream());\r\n System.out.println(client.get(i)+\" sending request to the server\");\r\n if (size > 5) {\r\n output.writeObject(\"exit\");\r\n }\r\n else{\r\n output.writeObject(\" \"+ client.get(i));\r\n }\r\n //reading the server response\r\n input = new ObjectInputStream(socket.getInputStream());\r\n String message = (String) input.readObject();\r\n System.out.println(\"Response: \"+message);\r\n \r\n //close resources\r\n input.close();\r\n output.close();\r\n Thread.sleep(2000);\r\n }\r\n }",
"public abstract void handleServerSide(T message, EntityPlayer player);",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\ttry {\n\t\t\tprocessRequest(request, response);\n\t\t} catch (NamingException ex) {\n\t\t\tLogger.getLogger(u_SendMessage.class.getName()).log(Level.SEVERE, null, ex);\n\t\t} catch (SQLException ex) {\n\t\t\tLogger.getLogger(u_SendMessage.class.getName()).log(Level.SEVERE, null, ex);\n\t\t}\n\t}",
"public synchronized boolean continueOperation(boolean sendEmpty, boolean inStream)\n throws IOException {\n\n if (isGet) {\n if ((inStream) && (!isDone)) {\n // to deal with inputstream in get operation\n parent.sendRequest(0x83, null, replyHeaders, privateInput);\n /*\n * Determine if that was not the last packet in the operation\n */\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n\n return true;\n\n } else if ((!inStream) && (!isDone)) {\n // to deal with outputstream in get operation\n\n if (privateInput == null) {\n privateInput = new PrivateInputStream(this);\n }\n sendRequest(0x03);\n return true;\n\n } else if (isDone) {\n return false;\n }\n\n } else {\n if ((!inStream) && (!isDone)) {\n // to deal with outputstream in put operation\n if (replyHeaders.responseCode == -1) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n }\n sendRequest(0x02);\n return true;\n } else if ((inStream) && (!isDone)) {\n // How to deal with inputstream in put operation ?\n return false;\n\n } else if (isDone) {\n return false;\n }\n\n }\n return false;\n }",
"@Override\n protected void process(List<String> chunks) {\n\n logger.debug(LOG_TAG + \".process()\");\n\n logger.info(chunks.get(chunks.size() - 1));\n\n if (newConnection) {\n // save email address for distributing communication message\n emailAddress = chunks.get(chunks.size() - 1);\n // send email address and remote address to server\n server.newConnection(chunks.get(chunks.size() - 1),\n socket.getRemoteSocketAddress().toString());\n\n // send 'welcome' message to client\n sendMessage(\"@welcome\");\n\n newConnection = false;\n\n return;\n }\n\n if (chunks.get(chunks.size() - 1).equals(\"@disconnect\")) {\n // send message to server\n server.removeConnection(clientId);\n\n // send 'goodbye' message to client\n sendMessage(\"@goodbye\");\n\n newConnection = true;\n\n return;\n }\n\n // communication message from client, distribute message\n // to all clients\n server.distributeMessage(emailAddress + \">\" + chunks.get(chunks.size() - 1));\n\n }",
"public StringBuilder sendMessage(String msg) throws IOException {\n out.println(msg);\n String resp = \"\";\n StringBuilder stringBuilder = new StringBuilder();\n if(msg.length() >3 && msg.substring(0,3).equals(\"GET\")) {\n while (true) {\n String newLine;\n newLine = in.readLine();\n\n if (newLine.equals(\"~~~END~~~\")) {\n return stringBuilder;\n }\n else{stringBuilder.append(newLine);\n stringBuilder.append(System.getProperty(\"line.separator\"));\n }\n }\n }\n else {\n stringBuilder.append(in.readLine());\n\n\n }\n return stringBuilder;\n\n }",
"private void doDispatch(RoutingContext context, String path, HttpClient client, Future<Object> cbFuture) {\n HttpClientRequest toReq = client\n .request(context.request().method(), path, response -> {\n response.bodyHandler(body -> {\n if (response.statusCode() >= 500) { // api endpoint server error, circuit breaker should fail\n cbFuture.fail(response.statusCode() + \": \" + body.toString());\n } else {\n HttpServerResponse toRsp = context.response()\n .setStatusCode(response.statusCode());\n response.headers().forEach(header -> {\n toRsp.putHeader(header.getKey(), header.getValue());\n });\n // send response\n toRsp.end(body);\n cbFuture.complete();\n }\n ServiceDiscovery.releaseServiceObject(discovery, client);\n });\n });\n // set headers\n context.request().headers().forEach(header -> {\n toReq.putHeader(header.getKey(), header.getValue());\n });\n if (context.user() != null) {\n toReq.putHeader(\"user-principal\", context.user().principal().encode());\n }\n // send request\n if (context.getBody() == null) {\n toReq.end();\n } else {\n toReq.end(context.getBody());\n }\n }",
"private void processNextMessage(ByteBuf buf) throws IgniteClientException {\n var unpacker = new ClientMessageUnpacker(buf);\n\n if (protocolCtx == null) {\n // Process handshake.\n pendingReqs.remove(-1L).complete(unpacker);\n return;\n }\n\n var type = unpacker.unpackInt();\n\n if (type != ServerMessageType.RESPONSE)\n throw new IgniteClientException(\"Unexpected message type: \" + type);\n\n Long resId = unpacker.unpackLong();\n\n int status = unpacker.unpackInt();\n\n ClientRequestFuture pendingReq = pendingReqs.remove(resId);\n\n if (pendingReq == null)\n throw new IgniteClientException(String.format(\"Unexpected response ID [%s]\", resId));\n\n if (status == 0) {\n pendingReq.complete(unpacker);\n } else {\n var errMsg = unpacker.unpackString();\n var err = new IgniteClientException(errMsg, status);\n pendingReq.completeExceptionally(err);\n }\n }",
"@Override\n public Single<StreamingHttpResponse> handle(HttpServiceContext ctx,\n StreamingHttpRequest request,\n StreamingHttpResponseFactory responseFactory) {\n request.context().put(CLIENT_CTX, request.headers().get(header(CLIENT_CTX)));\n request.context().put(CLIENT_FILTER_OUT_CTX, request.headers().get(header(CLIENT_FILTER_OUT_CTX)));\n // Set server-side values:\n request.context().put(SERVER_FILTER_IN_CTX, value(SERVER_FILTER_IN_CTX));\n request.context().put(SERVER_FILTER_IN_TRAILER_CTX, value(SERVER_FILTER_IN_TRAILER_CTX));\n return delegate().handle(ctx, request, responseFactory).map(response -> {\n HttpHeaders headers = response.headers();\n // Take the first two values from context:\n headers.set(header(SERVER_FILTER_IN_CTX),\n requireNonNull(response.context().get(SERVER_FILTER_IN_CTX)));\n headers.set(header(SERVER_CTX), requireNonNull(response.context().get(SERVER_CTX)));\n // Set the last value explicitly:\n assertThat(response.context().containsKey(SERVER_FILTER_OUT_CTX), is(false));\n headers.set(header(SERVER_FILTER_OUT_CTX), value(SERVER_FILTER_OUT_CTX));\n\n // For Trailers-Only response put everything into headers:\n if (headers.contains(GRPC_STATUS)) {\n setTrailers(response.context(), headers);\n return response;\n }\n return response.transform(new StatelessTrailersTransformer<Buffer>() {\n @Override\n protected HttpHeaders payloadComplete(HttpHeaders trailers) {\n setTrailers(response.context(), trailers);\n return trailers;\n }\n });\n });\n }",
"@Override\n public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {\n if (msg instanceof HttpResponse) {\n //clear the buffer.\n _responseBodyBuf.clear();\n //\n HttpResponse response = (HttpResponse) msg;\n //get HTTP Response code.\n this._hcr._responseStatus = response.getStatus();\n //\n //print header.\n Set<String> headers = response.headers().names();\n for (Iterator<String> keyIter = headers.iterator(); keyIter.hasNext();) {\n String keyName = keyIter.next();\n //System.out.println(keyName + \":\" + response.headers().get(keyName));\n this._hcr._responseHeaderMap.put(keyName, response.headers().get(keyName));\n }\n }\n //content or lastContent\n if (msg instanceof HttpContent) {\n HttpContent content = (HttpContent) msg;\n _responseBodyBuf.writeBytes(content.content());\n //if is last content fire done.\n if (content instanceof LastHttpContent) {\n try {\n fireDone(_responseBodyBuf.toString(this._hcr._responseBodyCharset));\n } finally {\n ctx.close();\n releaseResource();\n }\n }\n }\n }",
"private String requesttosend() throws IOException {\n\t\tsender.sendMsg(Constants.REQSEND);\r\n\t\t//等待接收的返回状态\r\n\t\treturn sender.getMsg();\r\n\t}",
"protected Message<Response>\n run(final String query, final Message<Request> m) throws Exception {\n final String p = HTTP.predicate(query);\n if (null == p || \".\".equals(p)) { // introspection or when block\n if (\"OPTIONS\".equals(m.head.method)) {\n return new Message<Response>(\n Response.options(\"TRACE\",\"OPTIONS\",\"GET\",\"HEAD\"), null);\n }\n if (!(\"GET\".equals(m.head.method) || \"HEAD\".equals(m.head.method))){\n return new Message<Response>(\n Response.notAllowed(\"TRACE\",\"OPTIONS\",\"GET\",\"HEAD\"), null);\n }\n Object value;\n try {\n // AUDIT: call to untrusted application code\n value = Eventual.ref(exports.reference(query)).call();\n } catch (final NullPointerException e) {\n return serialize(m.head.method, \"404\", \"not yet\",\n Server.ephemeral, new Rejected<Object>(e));\n } catch (final Exception e) {\n value = new Rejected<Object>(e);\n }\n if (null == p && !HTTP.isPBC(value)) {\n value = describe(value.getClass());\n }\n final Response failed = m.head.allow(\"\\\"\\\"\");\n if (null != failed) { return new Message<Response>(failed, null); }\n return serialize(m.head.method, \"200\", \"OK\", Server.forever, value);\n } // member access\n \n // determine the target object\n final Object target;\n try {\n final Promise<?> subject = Eventual.ref(exports.reference(query));\n // to preserve message order, only access members on a fulfilled ref\n if (!Fulfilled.isInstance(subject)) { throw new Exception(); }\n // AUDIT: call to untrusted application code\n target = subject.call();\n } catch (final Exception e) {\n return serialize(m.head.method, \"404\", \"never\", Server.forever,\n new Rejected<Object>(e));\n } \n if (HTTP.isPBC(target)) {\n // prevent access to local implementation details\n return new Message<Response>(Response.gone(), null);\n }\n \n // determine the type of accessed member\n final Method lambda = HTTP.dispatch(target, p);\n if (null == lambda) { // no such member\n if (\"OPTIONS\".equals(m.head.method)) {\n return new Message<Response>(\n Response.options(\"TRACE\", \"OPTIONS\"), null);\n }\n return new Message<Response>(\n Response.notAllowed(\"TRACE\", \"OPTIONS\"), null);\n }\n \n if (null != HTTP.property(lambda)) { // property access\n if (\"OPTIONS\".equals(m.head.method)) {\n return new Message<Response>(\n Response.options(\"TRACE\",\"OPTIONS\",\"GET\",\"HEAD\"), null);\n }\n if (!(\"GET\".equals(m.head.method) || \"HEAD\".equals(m.head.method))){\n return new Message<Response>(\n Response.notAllowed(\"TRACE\",\"OPTIONS\",\"GET\",\"HEAD\"), null);\n }\n Object value;\n try {\n // AUDIT: call to untrusted application code\n final Object r = Reflection.invoke(bubble(lambda), target);\n value = Fulfilled.isInstance(r) ? ((Promise<?>)r).call() : r;\n } catch (final Exception e) {\n value = new Rejected<Object>(e);\n }\n final boolean constant = \"getClass\".equals(lambda.getName());\n final int maxAge = constant ? Server.forever : Server.ephemeral; \n final String etag = constant ? null : exports.getTransactionTag();\n final Response failed = m.head.allow(etag);\n if (null != failed) { return new Message<Response>(failed, null); }\n Message<Response> r =\n serialize(m.head.method, \"200\", \"OK\", maxAge, value);\n if (null != etag) {\n r = new Message<Response>(r.head.with(\"ETag\", etag), r.body);\n }\n return r;\n }\n \n if (\"OPTIONS\".equals(m.head.method)) { // method invocation\n return new Message<Response>(\n Response.options(\"TRACE\", \"OPTIONS\", \"POST\"), null);\n }\n if (!\"POST\".equals(m.head.method)) {\n return new Message<Response>(\n Response.notAllowed(\"TRACE\", \"OPTIONS\", \"POST\"), null);\n }\n final Response failed = m.head.allow(null);\n if (null != failed) { return new Message<Response>(failed, null); }\n final Object value=exports.execute(query, lambda, new Promise<Object>(){\n public Object\n call() throws Exception {\n /*\n * SECURITY CLAIM: deserialize inside the once block to ensure\n * application code cannot detect request replay by causing\n * failed deserialization\n */ \n final ConstArray<?> argv;\n try {\n argv = deserialize(m,\n ConstArray.array(lambda.getGenericParameterTypes()));\n } catch (final BadSyntax e) {\n /*\n * strip out the parsing information to avoid leaking\n * information to the application layer\n */ \n throw (Exception)e.getCause();\n }\n \n // AUDIT: call to untrusted application code\n final Object r = Reflection.invoke(bubble(lambda), target,\n argv.toArray(new Object[argv.length()]));\n return Fulfilled.isInstance(r) ? ((Promise<?>)r).call() : r;\n }\n });\n return serialize(m.head.method, \"200\", \"OK\", Server.ephemeral, value);\n }",
"public void process()\n {\n ClientRequest clientRequest = threadPool.remove();\n\n if (clientRequest == null)\n {\n return;\n }\n\n\n // Do the work\n // Create new Client\n ServiceLogger.LOGGER.info(\"Building client...\");\n Client client = ClientBuilder.newClient();\n client.register(JacksonFeature.class);\n\n // Get uri\n ServiceLogger.LOGGER.info(\"Getting URI...\");\n String URI = clientRequest.getURI();\n\n ServiceLogger.LOGGER.info(\"Getting endpoint...\");\n String endpointPath = clientRequest.getEndpoint();\n\n // Create WebTarget\n ServiceLogger.LOGGER.info(\"Building WebTarget...\");\n WebTarget webTarget = client.target(URI).path(endpointPath);\n\n // Send the request and save it to a Response\n ServiceLogger.LOGGER.info(\"Sending request...\");\n Response response = null;\n if (clientRequest.getHttpMethodType() == Constants.getRequest)\n {\n // Create InvocationBuilder\n ServiceLogger.LOGGER.info(\"Starting invocation builder...\");\n Map<String, Object> queryMap = clientRequest.getQueryParams();\n String pathParam = clientRequest.getPathParam();\n\n if (pathParam != null)\n {\n webTarget = webTarget.path(pathParam);\n }\n\n if (queryMap != null)\n {\n ServiceLogger.LOGGER.info(\"QUERY MAP NOT NULL.\");\n for (Map.Entry<String, Object> entry : queryMap.entrySet())\n {\n webTarget = webTarget.queryParam(entry.getKey(), entry.getValue());\n }\n }\n ServiceLogger.LOGGER.info(\"WEBTARGET: \" + webTarget.toString());\n\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n\n ServiceLogger.LOGGER.info(\"Got a GET request.\");\n response = invocationBuilder\n .header(\"email\", clientRequest.getEmail())\n .header(\"sessionID\", clientRequest.getSessionID())\n .header(\"transactionID\", clientRequest.getTransactionID())\n .get();\n }\n else if (clientRequest.getHttpMethodType() == Constants.postRequest)\n {\n // Create InvocationBuilder\n ServiceLogger.LOGGER.info(\"Starting invocation builder...\");\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n Map<String, Object> queryMap = clientRequest.getQueryParams();\n\n if (queryMap != null)\n {\n ServiceLogger.LOGGER.info(\"QUERY MAP NOT NULL.\");\n for (Map.Entry<String, Object> entry : queryMap.entrySet())\n {\n webTarget = webTarget.queryParam(entry.getKey(), entry.getValue());\n }\n }\n ServiceLogger.LOGGER.info(\"WEBTARGET: \" + webTarget.toString());\n\n ServiceLogger.LOGGER.info(\"Got a POST request.\");\n response = invocationBuilder\n .header(\"email\", clientRequest.getEmail())\n .header(\"sessionID\", clientRequest.getSessionID())\n .header(\"transactionID\", clientRequest.getTransactionID())\n .post(Entity.entity(clientRequest.getRequest(), MediaType.APPLICATION_JSON));\n }\n else if (clientRequest.getHttpMethodType() == Constants.deleteRequest)\n {\n String pathParam = clientRequest.getPathParam();\n if (pathParam != null)\n {\n webTarget = webTarget.path(pathParam);\n }\n Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);\n\n ServiceLogger.LOGGER.info(\"Got a DELETE request.\");\n response = invocationBuilder\n .header(\"email\", clientRequest.getEmail())\n .header(\"sessionID\", clientRequest.getSessionID())\n .header(\"transactionID\", clientRequest.getTransactionID())\n .delete();\n }\n else\n {\n ServiceLogger.LOGGER.warning(ANSI_YELLOW + \"Request was not sent successfully\");\n }\n ServiceLogger.LOGGER.info(ANSI_GREEN + \"Sent!\" + ANSI_RESET);\n\n // Check status code of request\n String jsonText = \"\";\n int httpstatus = response.getStatus();\n\n jsonText = response.readEntity(String.class);\n\n // Add response to database\n String email = clientRequest.getEmail();\n String sessionID = clientRequest.getSessionID();\n ResponseDatabase.insertResponseIntoDB(clientRequest.getTransactionID(), jsonText, email, sessionID, httpstatus);\n\n }",
"@Override\n public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {\n String body = (String) msg;\n System.out.println(body);\n System.out.println(\"第\"+ ++count + \"次收到服务器回应\");\n }",
"protected abstract void transfer(UUID[] players, String server, IntConsumer response);",
"@POST\n @Path(\"server/receiver\")\n @Counted(\"quarkus_wsserver_handle_message_rest_counter\")\n @Timed(\"quarkus_wsserver_handle_message_rest\")\n public void receive(@Valid MessageExchange mmx) {\n LOGGER.warnf(\"(%s) Message [%s] received for [%s]\", getClass().getSimpleName(), mmx.message, mmx.client.getSmartClientKey());\n if (datagridUsage) {\n datagrid.store(mmx.client.user.name, mmx.client.id, mmx.message);\n } else {\n wsServer.send(mmx.client.getSmartClientKey(), mmx.message);\n }\n }",
"protected HttpResponse doReceiveResponse(final HttpRequest request, final HttpClientConnection conn,\n final HttpContext context)\n throws HttpException, IOException\n {\n// log.debug(\"EspMeshHttpRequestExecutor::doReceiveResponse()\");\n if (request == null)\n {\n throw new IllegalArgumentException(\"HTTP request may not be null\");\n }\n if (conn == null)\n {\n throw new IllegalArgumentException(\"HTTP connection may not be null\");\n }\n if (context == null)\n {\n throw new IllegalArgumentException(\"HTTP context may not be null\");\n }\n \n HttpResponse response = null;\n int statuscode = 0;\n \n // check whether the request is instantly, instantly request don't wait the response\n boolean isInstantly = request.getParams().isParameterTrue(EspHttpRequest.ESP_INSTANTLY);\n if (isInstantly)\n {\n ProtocolVersion version = new ProtocolVersion(\"HTTP\", 1, 1);\n StatusLine statusline = new BasicStatusLine(version, 200, \"OK\");\n // let the connection used only once to check whether the device is available\n context.setAttribute(\"timeout\", 1);\n response = ResponseFactory.newHttpResponse(statusline, context);\n Header contentLengthHeader = new BasicHeader(HTTP.CONTENT_LEN, \"0\");\n response.addHeader(contentLengthHeader);\n }\n else\n {\n if (!request.getRequestLine().getMethod().equals(EspHttpRequest.METHOD_COMMAND))\n {\n while (response == null || statuscode < HttpStatus.SC_OK)\n {\n \n response = conn.receiveResponseHeader();\n if (canResponseHaveBody(request, response))\n {\n conn.receiveResponseEntity(response);\n }\n statuscode = response.getStatusLine().getStatusCode();\n \n } // while intermediate response\n }\n else\n {\n ProtocolVersion version = new ProtocolVersion(\"HTTP\", 1, 1);\n StatusLine statusline = new BasicStatusLine(version, 200, \"OK\");\n response = ResponseFactory.newHttpResponse(statusline, context);\n // copy request headers\n // Header[] requestHeaders = request.getAllHeaders();\n // for (Header requestHeader : requestHeaders) {\n // System.out.println(\"requestHeader:\" + requestHeader);\n // response.addHeader(requestHeader);\n // }\n \n Header[] contentLengthHeader = request.getHeaders(HTTP.CONTENT_LEN);\n if (contentLengthHeader == null || contentLengthHeader.length != 1)\n {\n throw new IllegalArgumentException(\"contentLengthHeader == null || contentLengthHeader.length != 1\");\n }\n // at the moment, mesh command request and response len is the same\n response.addHeader(contentLengthHeader[0]);\n \n conn.receiveResponseEntity(response);\n }\n }\n \n // for device won't reply \"Connection: Keep-Alive\" by default, add the header by manual\n if (response != null && response.getFirstHeader(HTTP.CONN_DIRECTIVE) == null)\n {\n response.addHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_KEEP_ALIVE);\n }\n \n return response;\n \n }",
"private void sendReceiveRes(){\n\t}",
"public Message handleRequest(Message request){\n\n Message error = new Message(Message.GENERIC_ERROR);\n\n switch (request.getId()){\n\n case Message.LOGIN:\n return handleLogin(request);\n case Message.CREATE_DOCUMENT:\n return handleCreate(request);\n case Message.REMOVE_INVITE:\n controlServer.removeInvite(request.getUserName(),request.getDocumentName());\n return request;\n case Message.PORTIONS:\n System.out.println(\"HANDLER pre-handle: \" +request.getDocumentName());\n request.setSectionNumbers(controlServer.getPortions(request.getDocumentName()));\n return request;\n case Message.ADMINS:\n Message response = new Message(Message.ADMINS);\n response.setStringVector(new Vector<>(controlServer.getAdmins(request.getDocumentName())));\n return response;\n case Message.USERS:\n request.setStringVector(controlServer.getUserNames());\n return request;\n case Message.INVITATION:\n controlServer.addAdmin(request.getDocumentName(),request.getReceiver());\n controlServer.addInvite(request.getReceiver(),request.getDocumentName());\n request.setId(Message.INVITE_SENT);\n return request;\n case Message.GET_INVITES:\n String owner = request.getUserName();\n request.setStringVector(controlServer.getUserData(owner).getInvites());\n return request;\n case Message.GET_USERDATA:\n return handleGetUserData(request);\n case Message.LOCK:\n if(!controlServer.lock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.LOCK_NOK);\n else\n request.setId(Message.LOCK_OK);\n return request;\n case Message.UNLOCK:\n if(controlServer.unlock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.UNLOCK_OK);\n return request;\n case Message.EDIT:\n String DocumentName = request.getDocumentName();\n int SectionNumbers = request.getSectionNumbers();\n request.setText(controlServer.getSection(DocumentName,SectionNumbers));\n return request;\n case Message.END_EDIT:\n controlServer.editDoc(request.getDocumentName(),request.getSectionNumbers(),request.getText());\n return request;\n case Message.PRINT:\n request.setText(controlServer.getDocumentString(request.getDocumentName()));\n return request;\n case Message.SHOW:\n String text = controlServer.getSection(request.getDocumentName(),request.getSectionNumbers());\n request.setText(text);\n return request;\n default:\n controlServer.showMessage(\"unknown request\");\n break;\n }return error;\n }",
"public void sendResponse(ChannelHandlerContext ctx, CorfuMsg inMsg, CorfuMsg outMsg) {\n outMsg.copyBaseFields(inMsg);\n ctx.writeAndFlush(outMsg);\n log.trace(\"Sent response: {}\", outMsg);\n }",
"@Override\r\n\tpublic void handleRequest(){\r\n\r\n\t\ttry {\r\n\t\t\t_inFromClient = new ObjectInputStream(_socket.getInputStream());\r\n\t\t\t_outToClient = new ObjectOutputStream(_socket.getOutputStream());\r\n\t\t _humanQuery = (String) _inFromClient.readObject();\r\n\t\t _outToClient.writeObject(manageCommunication());\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}",
"private synchronized boolean sendBatch() {\n if (fPending.isEmpty()) {\n return true;\n }\n\n final long nowMs = Clock.now();\n\n if (this.fHostSelector != null) {\n host = this.fHostSelector.selectBaseHost();\n }\n\n final String httpurl = MRConstants.makeUrl(host, fTopic, props.getProperty(DmaapClientConst.PROTOCOL),\n props.getProperty(DmaapClientConst.PARTITION));\n\n try {\n\n final ByteArrayOutputStream baseStream = new ByteArrayOutputStream();\n OutputStream os = baseStream;\n final String contentType = props.getProperty(DmaapClientConst.CONTENT_TYPE);\n if (contentType.equalsIgnoreCase(MRFormat.JSON.toString())) {\n JSONArray jsonArray = parseJSON();\n os.write(jsonArray.toString().getBytes());\n os.close();\n\n } else if (contentType.equalsIgnoreCase(CONTENT_TYPE_TEXT)) {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA.toString())\n || (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString()))) {\n if (contentType.equalsIgnoreCase(MRFormat.CAMBRIA_ZIP.toString())) {\n os = new GZIPOutputStream(baseStream);\n }\n for (TimestampedMessage m : fPending) {\n\n os.write((\"\" + m.fPartition.length()).getBytes());\n os.write('.');\n os.write((\"\" + m.fMsg.length()).getBytes());\n os.write('.');\n os.write(m.fPartition.getBytes());\n os.write(m.fMsg.getBytes());\n os.write('\\n');\n }\n os.close();\n } else {\n for (TimestampedMessage m : fPending) {\n os.write(m.fMsg.getBytes());\n\n }\n os.close();\n }\n\n final long startMs = Clock.now();\n if (ProtocolType.DME2.getValue().equalsIgnoreCase(protocolFlag)) {\n\n configureDME2();\n\n this.wait(5);\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), url + subContextPath, nowMs - fPending.peek().timestamp);\n }\n sender.setPayload(os.toString());\n String dmeResponse = sender.sendAndWait(5000L);\n\n logTime(startMs, dmeResponse);\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AUTH_KEY.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result =\n postAuth(new PostAuthDataObject().setPath(httpurl).setData(baseStream.toByteArray())\n .setContentType(contentType).setAuthKey(authKey).setAuthDate(authDate)\n .setUsername(username).setPassword(password).setProtocolFlag(protocolFlag));\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.AAF_AUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = post(httpurl, baseStream.toByteArray(), contentType, username, password,\n protocolFlag);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n\n if (ProtocolType.HTTPNOAUTH.getValue().equalsIgnoreCase(protocolFlag)) {\n if (fPending.peek() != null) {\n logSendMessage(fPending.size(), httpurl, nowMs - fPending.peek().timestamp);\n }\n final JSONObject result = postNoAuth(httpurl, baseStream.toByteArray(), contentType);\n\n // Here we are checking for error response. If HTTP status\n // code is not within the http success response code\n // then we consider this as error and return false\n if (result.getInt(JSON_STATUS) < 200 || result.getInt(JSON_STATUS) > 299) {\n return false;\n }\n logTime(startMs, result.toString());\n fPending.clear();\n return true;\n }\n } catch (InterruptedException e) {\n getLog().warn(\"Interrupted!\", e);\n // Restore interrupted state...\n Thread.currentThread().interrupt();\n } catch (Exception x) {\n getLog().warn(x.getMessage(), x);\n }\n return false;\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException {\n //parsing request parameters in order to match operation to implement\n\n this.serverManager.execute(request, response);\n }",
"public void run() {\n\t\ttry {\n\t\t\t// Get input and output streams to talk to the client\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(csocket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(csocket.getOutputStream());\n\t\t\t/*\n\t\t\t * read the input lines from client and perform respective action based on the\n\t\t\t * request\n\t\t\t */\n\t\t\tString line;\n\t\t\twhile ((line = in.readLine()) != null) {\n\t\t\t\t// return if all the lines are read\n\t\t\t\tif (line.length() == 0)\n\t\t\t\t\tbreak;\n\t\t\t\telse if (line.contains(\"GET\") && line.contains(\"/index.html\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * get the respective file requested by the client i.e index.html\n\t\t\t\t\t */\n\t\t\t\t\tFile file = new File(WEB_ROOT, \"/index.html\");\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(\"Content-length: \" + file.length());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t\tout.write(FileUtils.readFileToString(file, \"UTF-8\"), 0, ((int) file.length()));\n\t\t\t\t} else if (line.contains(\"PUT\")) {\n\t\t\t\t\t/*\n\t\t\t\t\t * put the respective file at a location on local\n\t\t\t\t\t */\n\t\t\t\t\tString[] split = line.split(\" \");\n\t\t\t\t\tFile source = new File(split[1]);\n\t\t\t\t\tFile dest = new File(WEB_ROOT, \"clientFile.html\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// copy the file to local storage\n\t\t\t\t\t\tFileUtils.copyFile(source, dest);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t// send HTTP Headers\n\t\t\t\t\tout.println(\"HTTP/1.1 200 OK\");\n\t\t\t\t\tout.println(\"Date: \" + new Date());\n\t\t\t\t\tout.println(); // blank line between headers and content\n\t\t\t\t\tout.flush(); // flush character output stream buffer\n\t\t\t\t} else {\n\t\t\t\t\tout.print(line + \"\\r\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// closing the input and output streams\n\t\t\tout.close(); // Flush and close the output stream\n\t\t\tin.close(); // Close the input stream\n\t\t\tcsocket.close(); // Close the socket itself\n\t\t} // If anything goes wrong, print an error message\n\t\tcatch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t\tSystem.err.println(\"Usage: java HttpMirror <port>\");\n\t\t}\n\t}",
"@Override\n\t\t\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\t\t\tthrows ServletException, IOException {\n\t\t\t\tString method = req.getParameter(\"method\");\n\t\t\t\tif (method != null){\n\t\t\t\t\tif (method.equals(\"show\")){\n\t\t\t\t\t\tint pageNo = 1;\n\t\t\t\t\t\tint pageSize = 6;\n\t\t\t\t\t\tString key = req.getParameter(\"destination\");\n\t\t\t\t\t\tif (key == null || key.equals(\"null\")) key = \"\";\n\t\t\t\t\t\tMap parameters = new HashMap();\n\t\t\t\t\t\tparameters.put(\"destination\", key);\n\t\t\t\t\t\treq.setAttribute(\"destination\", key);\n\t\t\t\t\t\tif (req.getParameter(\"pageNo\") != null){\n\t\t\t\t\t\t\tpageNo = Integer.parseInt(req.getParameter(\"pageNo\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (req.getParameter(\"pageSize\") != null){\n\t\t\t\t\t\t\tpageSize = Integer.parseInt(req.getParameter(\"pageSize\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treq.setAttribute(\"sp\", md.showMessageService(pageNo, pageSize, parameters));\n\t\t\t\t\t\treq.getRequestDispatcher(\"showMessage.jsp\").forward(req, resp);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}",
"static void serverHandlerImpl(InputStream inputStream,\n OutputStream outputStream,\n URI uri,\n SendResponseHeadersFunction sendResponseHeadersFunction)\n throws IOException\n {\n try (InputStream is = inputStream;\n OutputStream os = outputStream) {\n readAllBytes(is);\n\n String magicQuery = uri.getQuery();\n if (magicQuery != null) {\n int bodyIndex = Integer.valueOf(magicQuery);\n String body = BODIES[bodyIndex];\n byte[] bytes = body.getBytes(UTF_8);\n sendResponseHeadersFunction.apply(200, bytes.length);\n int offset = 0;\n // Deliberately attempt to reply with several relatively\n // small data frames ( each write corresponds to its own\n // data frame ). Additionally, yield, to encourage other\n // handlers to execute, therefore increasing the likelihood\n // of multiple different-stream related frames in the\n // client's read buffer.\n while (offset < bytes.length) {\n int length = Math.min(bytes.length - offset, 64);\n os.write(bytes, offset, length);\n os.flush();\n offset += length;\n Thread.yield();\n }\n } else {\n sendResponseHeadersFunction.apply(200, 1);\n os.write('A');\n }\n }\n }",
"protected void logging(Message message) throws Fault {\n\t\tif (message.containsKey(LoggingMessage.ID_KEY)) {\n return;\n }\n String id = (String)message.getExchange().get(LoggingMessage.ID_KEY);\n if (id == null) {\n id = LoggingMessage.nextId();\n message.getExchange().put(LoggingMessage.ID_KEY, id);\n }\n message.put(LoggingMessage.ID_KEY, id);\n final LoggingMessage buffer \n = new LoggingMessage(\"Inbound Message\\n--------------------------\", id);\n\n Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE);\n if (responseCode != null) {\n buffer.getResponseCode().append(responseCode);\n }\n\n String encoding = (String)message.get(Message.ENCODING);\n\n if (encoding != null) {\n buffer.getEncoding().append(encoding);\n }\n String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);\n if (httpMethod != null) {\n buffer.getHttpMethod().append(httpMethod);\n }\n String ct = (String)message.get(Message.CONTENT_TYPE);\n if (ct != null) {\n buffer.getContentType().append(ct);\n }\n Object headers = message.get(Message.PROTOCOL_HEADERS);\n\n if (headers != null) {\n buffer.getHeader().append(headers);\n }\n String uri = (String)message.get(Message.REQUEST_URL);\n if (uri != null) {\n buffer.getAddress().append(uri);\n String query = (String)message.get(Message.QUERY_STRING);\n if (query != null) {\n buffer.getAddress().append(\"?\").append(query);\n }\n }\n \n if (!isShowBinaryContent() && isBinaryContent(ct)) {\n buffer.getMessage().append(BINARY_CONTENT_MESSAGE).append('\\n');\n log.handle(RequestLogController.getInstance().getRequestLogLevel(), \n \t\tbuffer.toString());\n return;\n }\n \n InputStream is = message.getContent(InputStream.class);\n if (is != null) {\n CachedOutputStream bos = new CachedOutputStream();\n if (threshold > 0) {\n bos.setThreshold(threshold);\n }\n try {\n // use the appropriate input stream and restore it later\n InputStream bis = is instanceof DelegatingInputStream \n ? ((DelegatingInputStream)is).getInputStream() : is;\n \n IOUtils.copyAndCloseInput(bis, bos);\n bos.flush();\n bis = bos.getInputStream();\n \n // restore the delegating input stream or the input stream\n if (is instanceof DelegatingInputStream) {\n ((DelegatingInputStream)is).setInputStream(bis);\n } else {\n message.setContent(InputStream.class, bis);\n }\n\n if (bos.getTempFile() != null) {\n //large thing on disk...\n buffer.getMessage().append(\"\\nMessage (saved to tmp file):\\n\");\n buffer.getMessage().append(\"Filename: \" + bos.getTempFile().getAbsolutePath() + \"\\n\");\n }\n if (bos.size() > limit) {\n buffer.getMessage().append(\"(message truncated to \" + limit + \" bytes)\\n\");\n }\n writePayload(buffer.getPayload(), bos, encoding, ct); \n \n bos.close();\n } catch (Exception e) {\n throw new Fault(e);\n }\n }\n log.handle(RequestLogController.getInstance().getRequestLogLevel(), \n \t\tbuffer.toString());\n\t}",
"void reply(Server server);",
"@Test\n public void testStoreSaleMultiple() {\n String responseMsg = target.path(\"service/message\").queryParam(\"messageType\", \"0\").queryParam(\"productType\", \"ELMA\").queryParam(\"value\", \"2.0\").request().get(String.class);\n responseMsg = target.path(\"service/message\").queryParam(\"messageType\", \"1\").queryParam(\"productType\", \"ELMA\").queryParam(\"value\", \"2.0\").queryParam(\"ocurrence\", \"2\").request().get(String.class);\n assertEquals(\"SUCCESS\", responseMsg);\n }",
"private synchronized void startProcessing() throws IOException {\n\n if (privateInput == null) {\n privateInput = new PrivateInputStream(this);\n }\n boolean more = true;\n\n if (isGet) {\n if (!isDone) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x03);\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x83, null, replyHeaders, privateInput);\n }\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n }\n } else {\n\n if (!isDone) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x02);\n\n }\n }\n\n if (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x82, null, replyHeaders, privateInput);\n }\n\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n }\n }",
"public synchronized void handle(PBFTRequest r){\n \n Object lpid = getLocalServerID();\n\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \", at time \" + getClockValue() + \", received \" + r);\n\n StatedPBFTRequestMessage loggedRequest = getRequestInfo().getStatedRequest(r);\n \n /* if the request has not been logged anymore and it's a old request, so it was garbage by checkpoint procedure then I must send a null reply */\n if(loggedRequest == null && getRequestInfo().isOld(r)){\n IProcess client = new BaseProcess(r.getClientID());\n PBFTReply reply = new PBFTReply(r, null, lpid, getCurrentViewNumber());\n emit(reply, client);\n return;\n \n }\n \n try{\n /*if the request is new and hasn't added yet then it'll be added */\n if(loggedRequest == null){\n /* I received a new request so a must log it */\n loggedRequest = getRequestInfo().add(getRequestDigest(r), r, RequestState.WAITING);\n loggedRequest.setRequestReceiveTime(getClockValue());\n }\n\n /* if I have a entry in request log but I don't have the request then I must update my request log. */\n if(loggedRequest.getRequest() == null) loggedRequest.setRequest(r);\n \n /*if the request was served the I'll re-send the related reply if it has been logged yet.*/\n if(loggedRequest.getState().equals(RequestState.SERVED)){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" has already served \" + r);\n\n /* retransmite the reply when the request was already served */\n PBFTReply reply = getRequestInfo().getReply(r);\n IProcess client = new BaseProcess(r.getClientID());\n emit(reply, client);\n return;\n }\n \n /* If I'm changing then I'll do nothing more .*/\n if(changing()) return;\n\n PBFTPrePrepare pp = getPrePreparebackupInfo().get(getCurrentViewNumber(), getCurrentPrimaryID(), loggedRequest.getDigest());\n\n if(pp != null && !isPrimary()){\n /* For each digest in backuped pre-prepare, I haven't all request then it'll be discarded. */\n DigestList digests = new DigestList();\n for(String digest : pp.getDigests()){\n if(!getRequestInfo().hasRequest(digest)){\n digests.add(digest);\n }\n }\n \n if(digests.isEmpty()){\n handle(pp);\n getPrePreparebackupInfo().rem(pp);\n return;\n } \n }\n\n boolean committed = loggedRequest.getState().equals( RequestState.COMMITTED );\n \n// /* if my request was commit and it hasn't been served yet I must check the stated of the request */\n if(committed){\n tryExecuteRequests();\n return;\n }\n \n /* performs the batch procedure if the server is the primary replica. */\n if(isPrimary()){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" (primary) is executing the batch procedure for \" + r + \".\");\n batch();\n }else{\n /* schedules a timeout for the arriving of the pre-prepare message if the server is a secundary replica. */\n scheduleViewChange();\n }//end if is primary\n \n }catch(Exception e){\n e.printStackTrace();\n }\n }",
"ChatWithServer.Req getChatWithServerReq();",
"@Override\n\tprotected void channelRead0(ChannelHandlerContext ctx, RpcRequest msg) throws Exception {\n\t\tRpcResponse response = new RpcResponse();\n\t\tresponse.setRequestId(msg.getRequestId());\n\t\ttry {\n\t\t\tObject result = handle(msg);\n\t\t\tresponse.setResult(result);\n\t\t} catch (Throwable t) {\n\t\t\tLOGGER.debug(\"handle ocurred error ==> {}\", t);\n\t\t\tresponse.setError(t);\n\t\t}\n\t\tctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);//写完然后关闭channel\n\t}",
"public static void sendCoordinatorMsg() {\n int numberOfRequestsNotSent = 0;\n for ( int key : ServerState.getInstance().getServers().keySet() ) {\n if ( key != ServerState.getInstance().getSelfID() ){\n Server destServer = ServerState.getInstance().getServers().get(key);\n\n try {\n MessageTransfer.sendServer(\n ServerMessage.getCoordinator( String.valueOf(ServerState.getInstance().getSelfID()) ),\n destServer\n );\n System.out.println(\"INFO : Sent leader ID to s\"+destServer.getServerID());\n }\n catch(Exception e) {\n numberOfRequestsNotSent += 1;\n System.out.println(\"WARN : Server s\"+destServer.getServerID()+\n \" has failed, it will not receive the leader\");\n }\n }\n }\n if( numberOfRequestsNotSent == ServerState.getInstance().getServers().size()-1 ) {\n // add self clients and chat rooms to leader state\n List<String> selfClients = ServerState.getInstance().getClientIdList();\n List<List<String>> selfRooms = ServerState.getInstance().getChatRoomList();\n\n for( String clientID : selfClients ) {\n LeaderState.getInstance().addClientLeaderUpdate( clientID );\n }\n\n for( List<String> chatRoom : selfRooms ) {\n LeaderState.getInstance().addApprovedRoom( chatRoom.get( 0 ),\n chatRoom.get( 1 ), Integer.parseInt(chatRoom.get( 2 )) );\n }\n\n leaderUpdateComplete = true;\n }\n }",
"Mono<ServerResponse> indexing(ServerRequest request);",
"public void streamClosed(boolean inStream) throws IOException {\n if (!isGet) {\n if ((!inStream) && (!isDone)) {\n // to deal with outputstream in put operation\n\n boolean more = true;\n\n if ((privateOutput != null) && (privateOutput.size() <= 0)) {\n byte[] headerArray = OBEXHelper.createHeader(requestHeaders, false);\n if (headerArray.length <= 0)\n more = false;\n }\n // If have not sent any data so send all now\n if (replyHeaders.responseCode == -1) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n }\n\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x02);\n }\n\n /*\n * According to the IrOBEX specification, after the final put, you\n * only have a single reply to send. so we don't need the while\n * loop.\n */\n while (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n\n sendRequest(0x82);\n }\n isDone = true;\n } else if ((inStream) && (isDone)) {\n // how to deal with input stream in put stream ?\n isDone = true;\n }\n } else {\n isValidateConnected = false;\n if ((inStream) && (!isDone)) {\n\n // to deal with inputstream in get operation\n // Have not sent any data so send it all now\n\n if (replyHeaders.responseCode == -1) {\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n }\n\n while (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n if (!sendRequest(0x83)) {\n break;\n }\n }\n while (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE) {\n parent.sendRequest(0x83, null, replyHeaders, privateInput);\n }\n isDone = true;\n } else if ((!inStream) && (!isDone)) {\n // to deal with outputstream in get operation\n // part of the data may have been sent in continueOperation.\n\n boolean more = true;\n\n if ((privateOutput != null) && (privateOutput.size() <= 0)) {\n byte[] headerArray = OBEXHelper.createHeader(requestHeaders, false);\n if (headerArray.length <= 0)\n more = false;\n }\n\n if (privateInput == null) {\n privateInput = new PrivateInputStream(this);\n }\n if ((privateOutput != null) && (privateOutput.size() <= 0))\n more = false;\n\n replyHeaders.responseCode = OBEXConstants.OBEX_HTTP_CONTINUE;\n while ((more) && (replyHeaders.responseCode == OBEXConstants.OBEX_HTTP_CONTINUE)) {\n more = sendRequest(0x03);\n }\n sendRequest(0x83);\n // parent.sendRequest(0x83, null, replyHeaders, privateInput);\n if (replyHeaders.responseCode != OBEXConstants.OBEX_HTTP_CONTINUE) {\n isDone = true;\n }\n\n }\n }\n }",
"@Override\n\tpublic void send(SendRequest req) {\n\t\tSystem.out.println(req);\n\t\t// send in s1.onentry\n\t\tif (\"This is some content!\".equals(req.getContent())) {\n\t\t\treturnEvent(new Event(\"received1\"));\n\t\t\treturn;\n\t\t}\n\t\t// send in s2.onentry\n\t\tif (req.getParams().containsKey(\"foo\")\n\t\t\t\t&& \"bar\".equals(req.getParams().get(\"foo\").get(0).getAtom())) {\n\t\t\treturnEvent(new Event(\"received2\"));\n\t\t\treturn;\n\t\t}\n\t\t// send in s3\n\t\tif (req.getXML().length() > 0) {\n\t\t\ttry {\n\t\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory\n\t\t\t\t\t\t.newInstance();\n\t\t\t\tDocument doc = factory.newDocumentBuilder().parse(\n\t\t\t\t\t\tnew InputSource(new StringReader(req.getXML())));\n\t\t\t\tSystem.out.println(\"Root element :\"\n\t\t\t\t\t\t+ doc.getDocumentElement().getNodeName());\n\t\t\t\tif (\"this\".equals(doc.getDocumentElement().getNodeName())) {\n\t\t\t\t\treturnEvent(new Event(\"received3\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (ParserConfigurationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (SAXException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}",
"protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }",
"private boolean read (SocketChannel chan, SelectionKey key) {\n HttpTransaction msg;\n boolean res;\n try {\n InputStream is = new BufferedInputStream (new NioInputStream (chan));\n String requestline = readLine (is);\n MessageHeader mhead = new MessageHeader (is);\n String clen = mhead.findValue (\"Content-Length\");\n String trferenc = mhead.findValue (\"Transfer-Encoding\");\n String data = null;\n if (trferenc != null && trferenc.equals (\"chunked\"))\n data = new String (readChunkedData (is));\n else if (clen != null)\n data = new String (readNormalData (is, Integer.parseInt (clen)));\n String[] req = requestline.split (\" \");\n if (req.length < 2) {\n /* invalid request line */\n return false;\n }\n String cmd = req[0];\n URI uri = null;\n try {\n uri = new URI (req[1]);\n msg = new HttpTransaction (this, cmd, uri, mhead, data, null, key);\n cb.request (msg);\n } catch (URISyntaxException e) {\n System.err.println (\"Invalid URI: \" + e);\n msg = new HttpTransaction (this, cmd, null, null, null, null, key);\n msg.sendResponse (501, \"Whatever\");\n }\n res = false;\n } catch (IOException e) {\n res = true;\n }\n return res;\n }",
"@SuppressWarnings(\"unchecked\")\n\t@GET\n @Path(\"get/{hash}\")\n @Produces(\"application/json\")\n public Response getIt(@PathParam(\"hash\") String curHash) {\n \t\n \tJSONObject resp = new JSONObject();\n \t\n \tOnlineStatus on = OnlineStatus.getInstance(); \n \t\n \t// Find SA\n \tint saID = SADAO.hashToId(curHash);\n \t\n \tif (saID == 0) {\n \t\tresp.put(\"Error\", \"Hash not in database\");\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n \t\n \t//if SA is set for exit\n \tif(on.isForExit(curHash)){\n \t\tresp.put(\"Signal\" , \"Kill\");\n \t\ton.exited(curHash);\n \t\t\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n \t\n \t// Update SAs Online Status\n \ton.update(curHash);\n \t\n \t// Find jobs for SA\n \tLinkedList<Job> jobsToSendToSa = JobDAO.getAllSAJobs(saID);\n \t\n \tif(jobsToSendToSa.size() > 0){\n \t\tSystem.out.println(\"Sending to SA \"+curHash+\" the following job(s) :\");\n \t}\n \tfor (Job j : jobsToSendToSa) {\n \t\tj.print();\n \t}\n \t\n \t// Create JSON and Sent\n \tObjectMapper mapper = new ObjectMapper();\n \t\n \ttry{\n \t\t\n \t\tString jsonInString = mapper.writeValueAsString(jobsToSendToSa);\n \t\t\n \t\treturn Response.status(200).entity(jsonInString).build();\n \t\n \t}catch (JsonProcessingException ex){\n \t\t\n \t\tSystem.out.println(ex.getMessage());\n \t\t\n \t\tresp.put(\"Error\", ex.getMessage());\n \t\treturn Response.status(200).entity(resp.toJSONString()).build();\n \t}\n }",
"void sendChunkRequest(int chunkX, int chunkY);",
"@Override\n\tpublic void receiveRequest() {\n\n\t}",
"public Response send() {\n setupAndConnect();\n setRequestMethod();\n setRequestBody();\n setRequestHeaders();\n writeRequestBody();\n getResponse();\n connection.disconnect();\n return response;\n }",
"@Override\n\tpublic void sendResponse() {\n\t\t\n\t}",
"netty.framework.messages.TestMessage.TestRequest getRequest();",
"private void processRequest(String targetID, HttpServerRequest req) throws Exception {\n\t\tString result = retrieveDetails(targetID);\n\t\tif(result != null)\n\t\t\treq.response().end(result);\t\n\t\telse\n\t\t\treq.response().end(\"No resopnse received\");\n\t}",
"public void handle_request(Request request){\n currentRequest.add(request);\n System.out.println(\"[Worker\"+String.valueOf(id)+\"] Received request of client \"+String.valueOf(request.getId()));\n }",
"public void usersUserIdMessagesDeliveredGet (String userId, final Response.Listener<InlineResponse2002> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesDeliveredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesDeliveredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/delivered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2002) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2002.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public void run() {\n req.response().end(\"0\"); // Default response = 0\n }",
"@Override\r\n\tprotected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {\r\n//\t\tnettyChache = Redis.use(\"rediscache\");\r\n\t\tJSONObject resultJson = JSON.parseObject(msg.toString());\r\n\t\tNyMsgType type = NyMsgType.valueOf(resultJson.getString(\"type\"));\r\n\t\tString clientId = resultJson.getString(\"clientid\");\r\n\t\tString data = resultJson.getString(\"data\");\r\n\t\tNyMessage message = new NyMessage();\r\n\t\tmessage.setClientId(clientId);\r\n\t\t// 先判断有没有登录\r\n\t\tif (NyMsgType.LOGIN.equals(type)) {\r\n\t\t\t// 首次登录,添加到当前的map保存\r\n\t\t\tSystem.out.println(\"进来登录\\t将当前的客户添加到队列\\t\" + clientId + \"(Channel) ctx.channel():\" + (Channel) ctx.channel());\r\n\t\t\tNyCurrentChannelMap.add(clientId, (Channel) ctx.channel());\r\n\t\t\tmessage.setType(NyMsgType.SEND);\r\n\t\t\tmessage.setData(\"{\\\"message\\\":\\\"success\\\"}\");\r\n\t\t\tctx.channel().writeAndFlush(message.toString());\r\n\t\t} else {\r\n\t\t\t// 不是登录,判断用户是否存在当前的map\r\n\t\t\tif (NyCurrentChannelMap.get(clientId) == null) {\r\n\t\t\t\t// 发送重新登录信息\r\n\t\t\t\tmessage = new NyMessage(NyMsgType.LOGIN);\r\n\t\t\t\tmessage.setClientId(clientId);\r\n\t\t\t\tctx.channel().writeAndFlush(message.toString());\r\n\t\t\t} else {\r\n\t\t\t\tswitch (type) {\r\n\t\t\t\tcase PING:\r\n\t\t\t\t\tSystem.out.println(\"==========心跳处理==========\");\r\n\t\t\t\t\t// message.setType(NyMsgType.PING);\r\n\t\t\t\t\t// ctx.channel().writeAndFlush(message.toString());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase SEND:\r\n\t\t\t\t\tSystem.out.println(\"发送消息,给指定人clientId发。。。。\");\r\n\t\t\t\t\t// NySendCommand command=new NySendCommand(clientId,\r\n\t\t\t\t\t// \"你瞅啥,瞅你咋地!\");\r\n\t\t\t\t\t// command.send();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase RESPONCE:\r\n\t\t\t\t\t// 返回的消息体\r\n\t\t\t\t\tSystem.out.println(\"-----响应---\" + msg);\r\n\t\t\t\t\tString messageid = resultJson.getString(\"messageid\");\r\n\t\t\t\t\tSystem.out.println(\"messageid=\" + messageid);\r\n\t\t\t\t\t// 保存\r\n\t\t\t\t\tString txtB = \"\";\r\n\t\t\t\t\tJSONArray jsonArray = resultJson.getJSONArray(\"data\");\r\n\t\t\t\t\tfor (int i = 0; i < jsonArray.size(); i++) {\r\n\t\t\t\t\t\tJSONObject temp = jsonArray.getJSONObject(i);\r\n\t\t\t\t\t\ttxtB = temp.getString(\"txtByte\");\r\n\t\t\t\t\t}\r\n\r\n//\t\t\t\t\tGenerateTxt(messageid, txtB);\r\n\t\t\t\t\tmessage.setData(\"{\\\"message\\\":\\\"success\\\"}\");\r\n\t\t\t\t\tmessage.setType(NyMsgType.NO_TARGET);\r\n\t\t\t\t\tctx.channel().writeAndFlush(message.toString());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"ManagedEndpoint next();",
"protected abstract void sendMessage(UUID[] players, String[] messages, IntConsumer response);"
] | [
"0.5735244",
"0.56612563",
"0.5537455",
"0.5431977",
"0.54246646",
"0.54198784",
"0.5354361",
"0.5335621",
"0.5296982",
"0.5266819",
"0.5237736",
"0.5228639",
"0.5203264",
"0.5192412",
"0.51825917",
"0.5163583",
"0.5150771",
"0.5143727",
"0.5129788",
"0.51255345",
"0.5103304",
"0.50984627",
"0.50883526",
"0.50768566",
"0.50745404",
"0.506565",
"0.50626516",
"0.50567716",
"0.5047824",
"0.50360376",
"0.50360376",
"0.50234056",
"0.49918845",
"0.49832827",
"0.4983012",
"0.49815434",
"0.4980214",
"0.4973515",
"0.4973515",
"0.49660733",
"0.49651262",
"0.49634537",
"0.49582076",
"0.49572262",
"0.49509367",
"0.4945262",
"0.4921146",
"0.49181122",
"0.49148864",
"0.49129522",
"0.49117225",
"0.49090236",
"0.49070087",
"0.49024063",
"0.48979023",
"0.48961836",
"0.48915341",
"0.48717657",
"0.48699674",
"0.48654145",
"0.48647165",
"0.4860898",
"0.4852278",
"0.48454273",
"0.48439074",
"0.4838528",
"0.483773",
"0.48245624",
"0.4816911",
"0.48149392",
"0.48136476",
"0.48123768",
"0.48104003",
"0.48098925",
"0.48049855",
"0.48040664",
"0.48017776",
"0.47959936",
"0.47935537",
"0.4793424",
"0.47904277",
"0.47902203",
"0.4779337",
"0.47789577",
"0.4772282",
"0.47709534",
"0.4768881",
"0.47663984",
"0.47647825",
"0.47604588",
"0.4759095",
"0.47561842",
"0.47528118",
"0.47486052",
"0.47423837",
"0.4729984",
"0.47293904",
"0.4725404",
"0.47241178",
"0.4724012"
] | 0.65785855 | 0 |
This is where the message is sent back to the client that made that request | public void sendBack(SelectionKey key, String message) {
socketChannel = (SocketChannel) key.channel();
message += "\r\n";
buffer = CharBuffer.wrap(message);
while (buffer.hasRemaining()) {
try {
socketChannel.write(Charset.defaultCharset().encode(buffer));
} catch (IOException e) {
e.printStackTrace();
}
}
Long x = System.nanoTime();
serviceTime = x - pollTime;
responseTime = x - currentJob.queueEntranceTime;
timeInSystem = x - currentJob.timeOfArrival;
times.add(myNumber + "\t" + type + "\t" + queueTime + "\t" + workerTime +"\t" + processingTime +"\t" + serviceTime +"\t" + responseTime +"\t" + timeInSystem );
numOfRequests.incrementAndGet();
myNumOfRequests++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void sendResponse() {\n\t\t\n\t}",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\n\tpublic void sendResponse() {\n\n\t}",
"private String requesttosend() throws IOException {\n\t\tsender.sendMsg(Constants.REQSEND);\r\n\t\t//等待接收的返回状态\r\n\t\treturn sender.getMsg();\r\n\t}",
"public void send() {\n try {\n String message = _gson.toJson(this);\n byte[] bytes = message.getBytes(\"UTF-8\");\n int length = bytes.length;\n\n _out.writeInt(length);\n _out.write(bytes);\n \n } catch (IOException ex) {\n Logger.getLogger(ResponseMessage.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public Message process(Message m) throws ActionProcessingException {\n\t\t\r\n\t\t\r\n\t\t String responseMsg = (String) m.getBody().get(Body.DEFAULT_LOCATION);\r\n\t\t m.getBody().add(\"MsgToClient\",responseMsg);\r\n\t\t \r\n\t\t return m;\r\n\r\n\t}",
"@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}",
"private void sendReceiveRes(){\n\t}",
"public String getRequestMessage()\r\n/* 34: */ {\r\n/* 35:26 */ return this.requestMessage;\r\n/* 36: */ }",
"void messageSent();",
"@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n }",
"@Override\n\tpublic void receiveRequest() {\n\n\t}",
"void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }",
"@Override\n\tpublic String back_request() {\n\t\treturn null;\n\t}",
"public void responseSent(DesktopCtrl desktopCtrl, String channel, String reqId, Object resInfo);",
"@Override\n\tpublic String viewmessage_request() {\n\t\treturn null;\n\t}",
"public String response() {\n\t\treturn message;\n\t}",
"public void messageResp(int respId) {\n\r\n\t}",
"@Override\n\tpublic void processRequest(RequestEvent requestEvent) {\n\t\t requestEvent.getServerTransaction();\n\t\tSystem.out.println(\"Sending ------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"[]:\"+requestEvent.toString());\n\t}",
"@Override\r\n\tprotected void processRespond() throws SGSException {\n\r\n\t}",
"public void sendResponse(ChannelHandlerContext ctx, CorfuMsg inMsg, CorfuMsg outMsg) {\n outMsg.copyBaseFields(inMsg);\n ctx.writeAndFlush(outMsg);\n log.trace(\"Sent response: {}\", outMsg);\n }",
"void responseSent( C conn ) ;",
"@Override\n public void handleMessage(Message message) {}",
"public String receiveResponse()\n\t{\n\t\t\n\t}",
"private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}",
"@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n public void handleClientRequest(User sender, ISFSObject params) {\n }",
"public void request() {\n }",
"public ObjectOutputStream returnMessage()\n {\n return outToClient;\n }",
"private void clientResponse(String msg) {\n JSONObject j = new JSONObject();\n j.put(\"statuscode\", 200);\n j.put(\"sequence\", ++sequence);\n j.put(\"response\", new JSONArray().add(msg));\n output.println(j);\n output.flush();\n }",
"protected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException\r\n\t{\r\n\t\t/**\r\n\t\t * Note: the \"resp\" is the only destination for an incoming requests\r\n\t\t */\r\n\t\tfinal long clientChannelID = Long.valueOf(req.getHeader(\"channelID\"));\r\n\t\t//final String clientID = req.getProtocol() + req.getRemoteAddr() + clientChannelID;\r\n\t\t\r\n\t\tSmartObjectInputStream input = new SmartObjectInputStream(req.getInputStream());\r\n\r\n\t\tLong xid = 0L;\r\n\t\tfinal WaitingCallback blocking = new WaitingCallback();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tchannelEndpoint.updateDeserializingThread(Thread.currentThread(),\r\n\t\t\t\t\ttrue);\r\n\t\t\tfinal CommMessage msg = CommMessage.parse(input);\r\n\t\t\txid = msg.getXID();\r\n\r\n\t\t\tsynchronized (callbacks)\r\n\t\t\t{\r\n\t\t\t\tcallbacks.put(xid + clientChannelID, blocking);\r\n\t\t\t}\r\n\t\t\tmsg.setXID(xid + clientChannelID); //update ID for preventing naming conflict\r\n\t\t\t\r\n\t\t\tchannelEndpoint.getChannelFacade().receivedMessage(this, msg);\r\n\t\t}\r\n\t\tcatch (final IOException ioe)\r\n\t\t{\r\n\t\t\tchannelEndpoint.getChannelFacade().receivedMessage(this, null);\r\n\t\t}\r\n\t\tcatch (final Throwable t)\r\n\t\t{\r\n\t\t\tt.printStackTrace();\r\n\t\t}\r\n\t\tfinally\r\n\t\t{\r\n\t\t\tchannelEndpoint.updateDeserializingThread(Thread.currentThread(),\r\n\t\t\t\t\tfalse);\r\n\t\t}\r\n\r\n\t\tCommMessage responseMsg = null;\r\n\r\n\t\t// wait for the reply\r\n\t\tsynchronized (blocking)\r\n\t\t{\r\n\t\t\tfinal long timeout = System.currentTimeMillis()\r\n\t\t\t\t\t+ CommConstants.TIMEOUT;\r\n\t\t\tresponseMsg = blocking.getResult();\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\twhile (responseMsg == null && System.currentTimeMillis() < timeout)\r\n\t\t\t\t{\r\n\t\t\t\t\tblocking.wait(CommConstants.TIMEOUT);\r\n\t\t\t\t\tresponseMsg = blocking.getResult();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch (InterruptedException ie)\r\n\t\t\t{\r\n\t\t\t\tthrow new RemoteCommException(\r\n\t\t\t\t\t\t\"Interrupted while waiting for callback\", ie);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (responseMsg != null)\r\n\t\t{\r\n\t\t\tresponseMsg.setXID(responseMsg.getXID() - clientChannelID);//reset ID\r\n\t\t\tresp.setContentType(\"multipart/x-dpartner\");\r\n\t\t\tSmartObjectOutputStream output = new SmartObjectOutputStream(resp.getOutputStream());\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tchannelEndpoint.updateSerializing(Thread.currentThread(), true);\r\n\t\t\t\tresponseMsg.send(output);\r\n\t\t\t\tresp.flushBuffer();\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\tthrow e;\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tchannelEndpoint.updateSerializing(Thread.currentThread(), false);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new RemoteCommException(\r\n\t\t\t\t\t\"Method Invocation failed, timeout exceeded.\");\r\n\t\t}\r\n\t}",
"private void finishRequest(String message, Request baseRequest, HttpServletResponse response) throws IOException {\n ByteArrayISO8859Writer writer = new ByteArrayISO8859Writer(1500);\n writer.write(message);\n writer.flush();\n\n response.setContentLength(writer.size());\n\n OutputStream outputStream = response.getOutputStream();\n writer.writeTo(outputStream);\n\n outputStream.close();\n writer.close();\n baseRequest.getConnection().getEndPoint().close();\n }",
"public void send() {\n\t}",
"public void processRequest(StunMessageEvent evt)\n {\n if(messageSequence.isEmpty())\n return;\n Object obj = messageSequence.remove(0);\n\n if( !(obj instanceof Response) )\n return;\n\n Response res = (Response)obj;\n\n try\n {\n stunStack.sendResponse(evt.getMessage().getTransactionID(),\n res, serverAddress, evt.getRemoteAddress());\n }\n catch (Exception ex)\n {\n logger.log(Level.WARNING, \"failed to send a response\", ex);\n }\n\n }",
"protected void logging(Message message) throws Fault {\n\t\tif (message.containsKey(LoggingMessage.ID_KEY)) {\n return;\n }\n String id = (String)message.getExchange().get(LoggingMessage.ID_KEY);\n if (id == null) {\n id = LoggingMessage.nextId();\n message.getExchange().put(LoggingMessage.ID_KEY, id);\n }\n message.put(LoggingMessage.ID_KEY, id);\n final LoggingMessage buffer \n = new LoggingMessage(\"Inbound Message\\n--------------------------\", id);\n\n Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE);\n if (responseCode != null) {\n buffer.getResponseCode().append(responseCode);\n }\n\n String encoding = (String)message.get(Message.ENCODING);\n\n if (encoding != null) {\n buffer.getEncoding().append(encoding);\n }\n String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);\n if (httpMethod != null) {\n buffer.getHttpMethod().append(httpMethod);\n }\n String ct = (String)message.get(Message.CONTENT_TYPE);\n if (ct != null) {\n buffer.getContentType().append(ct);\n }\n Object headers = message.get(Message.PROTOCOL_HEADERS);\n\n if (headers != null) {\n buffer.getHeader().append(headers);\n }\n String uri = (String)message.get(Message.REQUEST_URL);\n if (uri != null) {\n buffer.getAddress().append(uri);\n String query = (String)message.get(Message.QUERY_STRING);\n if (query != null) {\n buffer.getAddress().append(\"?\").append(query);\n }\n }\n \n if (!isShowBinaryContent() && isBinaryContent(ct)) {\n buffer.getMessage().append(BINARY_CONTENT_MESSAGE).append('\\n');\n log.handle(RequestLogController.getInstance().getRequestLogLevel(), \n \t\tbuffer.toString());\n return;\n }\n \n InputStream is = message.getContent(InputStream.class);\n if (is != null) {\n CachedOutputStream bos = new CachedOutputStream();\n if (threshold > 0) {\n bos.setThreshold(threshold);\n }\n try {\n // use the appropriate input stream and restore it later\n InputStream bis = is instanceof DelegatingInputStream \n ? ((DelegatingInputStream)is).getInputStream() : is;\n \n IOUtils.copyAndCloseInput(bis, bos);\n bos.flush();\n bis = bos.getInputStream();\n \n // restore the delegating input stream or the input stream\n if (is instanceof DelegatingInputStream) {\n ((DelegatingInputStream)is).setInputStream(bis);\n } else {\n message.setContent(InputStream.class, bis);\n }\n\n if (bos.getTempFile() != null) {\n //large thing on disk...\n buffer.getMessage().append(\"\\nMessage (saved to tmp file):\\n\");\n buffer.getMessage().append(\"Filename: \" + bos.getTempFile().getAbsolutePath() + \"\\n\");\n }\n if (bos.size() > limit) {\n buffer.getMessage().append(\"(message truncated to \" + limit + \" bytes)\\n\");\n }\n writePayload(buffer.getPayload(), bos, encoding, ct); \n \n bos.close();\n } catch (Exception e) {\n throw new Fault(e);\n }\n }\n log.handle(RequestLogController.getInstance().getRequestLogLevel(), \n \t\tbuffer.toString());\n\t}",
"private void send(HttpServletResponse response, int status, String message) throws IOException {\n\t\tresponse.setStatus(status);\n\t\tresponse.getOutputStream().println(message);\n\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\tpublic void sendMessage() {\n\t\t\n\t}",
"@Override\n\tpublic void requestHandle(IPlayer player, IMessage message) {\n\t\t\n\t}",
"public void sendRequest() {\r\n\t\t\r\n\t\tclient.join(this, isHost, gameCode, playerName, playerNumber);\r\n\t\t\r\n\t}",
"public void sendRemainData();",
"@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}",
"@Override\n public void onResponse(String response) {\n System.out.println(\"Recieved Response: \" + response);\n }",
"private void returnToSender(ClientMessage m) {\n\n if (m.returnToSender) {\n // should never happen!\n // System.out.println(\"**** Returning to sender says EEK\");\n return;\n }\n\n // System.out.println(\"**** Returning to sender says her I go!\");\n m.returnToSender = true;\n forward(m, true);\n }",
"@Override\n\t\t\tprotected void deliverResponse(String response) {\n\n\t\t\t}",
"@Override\r\n public void handleMessage(Message msg) {\n }",
"private synchronized void onRequest(ObjectMessage message) {\n try {\n Serializable request = message.getObject(); //serializer.requestFromString(message.getText());\n activeRequests.put(request, message);\n requestListener.receivedRequest(request);\n } catch (JMSException ex) {\n Logger.getLogger(AsynchronousReplier.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }",
"private void forwardRequest(String recordId, String body) {\n\t\tSystem.out.println(\"recordId : \"+recordId + \" body : \"+body);\n\n\t}",
"@Override\n\tpublic void visit(Request r) {\n\t\tif (!ph.getPeerChoked()) {\n\t\t\tSystem.out.println(\"requete rećue\");\n\t\t\tbyte[] body = r.getBody();\n\t\t\tbyte[] indexB = new byte[4], beginB = new byte[4], lengthB = new byte[4];\n\t\t\tTorrent torrent = ph.getTorrent();\n\t\t\tint index = 0, begin = 0, length = 0;\n\n\t\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\t\tindex = byteArrayToInt(indexB);\n\n\t\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\t\tbegin = byteArrayToInt(beginB);\n\n\t\t\tlengthB = Arrays.copyOfRange(body, 8, body.length);\n\t\t\tlength = byteArrayToInt(lengthB);\n\n\t\t\tPiece piece = torrent.getPieces().get(index);\n\t\t\tif (index <= torrent.getPieces().size()) {\n\t\t\t\tbyte[] block = new byte[length];\n\t\t\t\tbyte[] pieceByte = piece.getData();\n\t\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t\tblock[i] = pieceByte[begin + i];\n\t\t\t\t}\n\t\t\t\tsb = new SendBlock(index, begin, block);\n\t\t\t\tthis.ph.addMessageQueue(sb);\n\t\t\t\tSystem.out.println(\"sendBlock envoyé\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Index trop grand\");\n\t\t\t}\n\t\t}\n\t}",
"public String processMsg(RequestObject reqObj);",
"void requestReceived( C conn ) ;",
"Map<String, Object> send();",
"private void writeMessage(Message message) throws IOException {\n Message.Command temp = message.getCommand();\n if (temp != Message.Command.GET_RESERVED && temp != Message.Command.GET_AVAILABLE) {\n connectionLoggerService.add(\"Bank : \" + message.toString());\n }\n objectOutputStream.reset();\n objectOutputStream.writeObject(message);\n }",
"@Override\n protected void encode(ChannelHandlerContext channelHandlerContext, RequestMessage msg, ByteBuf out) throws Exception {\n byte[] bytes = REQUEST_MESSAGE_CODEC.encode(msg);\n out.writeBytes(REQUEST_HEADER);\n out.writeBytes(Integer.toString(bytes.length).getBytes(StandardCharsets.US_ASCII));\n out.writeBytes(CRLF);\n out.writeBytes(bytes);\n }",
"@Override\n\tpublic void handleResponse() {\n\t\t\n\t}",
"public String getResponseMessage();",
"public void handle_request(Request request){\n currentRequest.add(request);\n System.out.println(\"[Worker\"+String.valueOf(id)+\"] Received request of client \"+String.valueOf(request.getId()));\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tresult = HttpRequestUtil.sendGet(serverUrl + \"services/tmp_notice_detail\", \"id=\" + id, (OilApplication)getApplication());\n\t\t\ttry {\n\t\t\t\tJSONObject json = new JSONObject(result);\n\t\t\t\tif(json.getInt(\"status\") == 200) {\n\t\t\t\t\tgetHandler.sendMessage(getHandler.obtainMessage());\n\t\t\t\t}\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}",
"private void sendMsg()\n {\n try {\n spauldingApp.println(\"AckRequest.sendMsg() - sending request to nodeID= \" + node.getNodeID() + \" ...\");\n this.nbrTransmits++;\n //spauldingApp.eventLogger.writeMsgSentPing(fetchReqMsg);\n spauldingApp.getMoteIF().send(node.getNodeID(), requestMsg);\n } catch (Exception e) {\n spauldingApp.println(\"ERROR: Can't send message: \" + e);\n e.printStackTrace();\n }\n }",
"@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tint id = -1;\n\t\ttry {\n\t\t\tid = Integer.parseInt(request.getParameter(\"id\"));\n\t\t} catch (Exception e) {\n\t\t}\n\n\t\tChatServerConnector.sentMessage(request.getParameter(\"message\"), id);\n\t}",
"public void run() {\n req.response().end(\"0\"); // Default response = 0\n }",
"@Override\n public void sendResponse(final Response response) {\n\n }",
"public String getResponseMessage() { return responseMessage; }",
"public String concludeRequest() {\n\t\treturn \"Already received a request\";\n\t}",
"public void sendMessage(String message) {\n\t\tSystem.out.println(\"DEBUG : response sent by server = \" + message);\n\t\tprinter.println(message);\n\t}",
"@Override\r\n\tpublic void handleRequest(){\r\n\r\n\t\ttry {\r\n\t\t\t_inFromClient = new ObjectInputStream(_socket.getInputStream());\r\n\t\t\t_outToClient = new ObjectOutputStream(_socket.getOutputStream());\r\n\t\t _humanQuery = (String) _inFromClient.readObject();\r\n\t\t _outToClient.writeObject(manageCommunication());\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t}",
"public void serverSideOk();",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n Long multicastId = new Long(req.getParameter(\"multicastKey\"));\n boolean success = mSender.sendMessage(multicastId);\n if (success) {\n taskDone(resp, multicastId);\n } else {\n retryTask(resp);\n }\n }",
"public String message()\n {\n return rawResponse.message();\n }",
"protected void reply_ok() throws java.io.IOException {\n byte[] ok = PushCacheProtocol.instance().okPacket();\n _socket.getOutputStream().write(ok, 0, ok.length);\n }",
"@Override\n\t\t\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\t\t\tthrows ServletException, IOException {\n\t\t\t\tString method = req.getParameter(\"method\");\n\t\t\t\tif (method != null){\n\t\t\t\t\tif (method.equals(\"show\")){\n\t\t\t\t\t\tint pageNo = 1;\n\t\t\t\t\t\tint pageSize = 6;\n\t\t\t\t\t\tString key = req.getParameter(\"destination\");\n\t\t\t\t\t\tif (key == null || key.equals(\"null\")) key = \"\";\n\t\t\t\t\t\tMap parameters = new HashMap();\n\t\t\t\t\t\tparameters.put(\"destination\", key);\n\t\t\t\t\t\treq.setAttribute(\"destination\", key);\n\t\t\t\t\t\tif (req.getParameter(\"pageNo\") != null){\n\t\t\t\t\t\t\tpageNo = Integer.parseInt(req.getParameter(\"pageNo\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (req.getParameter(\"pageSize\") != null){\n\t\t\t\t\t\t\tpageSize = Integer.parseInt(req.getParameter(\"pageSize\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treq.setAttribute(\"sp\", md.showMessageService(pageNo, pageSize, parameters));\n\t\t\t\t\t\treq.getRequestDispatcher(\"showMessage.jsp\").forward(req, resp);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}",
"public void sendToWard(){\r\n\t\t//here is some code that we do not have access to\r\n\t}",
"public void handleMessageEvent(StunMessageEvent e) {\n delegate.processRequest(e);\n }",
"public void handleMessage(Message message) {\r\n\r\n\t try { \r\n\t \t//only authenticate if you are trying to write to the db... \r\n\t \tHttpServletRequest req = (HttpServletRequest) message.get(\"HTTP.REQUEST\");\r\n\t \tString method = req.getMethod();\r\n\t \t\r\n\t \tif (method!=HttpMethod.GET && method!=HttpMethod.OPTIONS && method!=HttpMethod.HEAD){\r\n \t \r\n\t\t \tAuthorizationPolicy policy = apiUserService.getCurrentAuthPolicy();\r\n\t\t \tString accessKey = policy.getUserName();\r\n\t\t \tString secret = policy.getPassword();\r\n\t\t \r\n\t\t\t\tif (accessKey==null || accessKey.length()==0\r\n\t\t\t\t\t\t|| secret==null || secret.length()==0)\t{\r\n\t\t\t \tthrow new RMapTransformApiException(ErrorCode.ER_NO_USER_TOKEN_PROVIDED);\r\n\t\t\t\t}\t\t\r\n\t\t\t\r\n\t\t\t\tapiUserService.validateKey(accessKey, secret);\r\n\t \t}\r\n\t \t\r\n\t } catch (RMapTransformApiException ex){ \r\n\t \t//generate a response to intercept default message\r\n\t \tRMapTransformApiExceptionHandler exceptionhandler = new RMapTransformApiExceptionHandler();\r\n\t \tResponse response = exceptionhandler.toResponse(ex);\r\n\t \tmessage.getExchange().put(Response.class, response); \t\r\n\t }\r\n\t\t\r\n }",
"Request back();",
"public void handleMessageFromClient(Object msg) {\n\n }",
"@Override\n\tpublic void send() {\n\t\tSystem.out.println(\"this is send\");\n\t}",
"@Override\n\tpublic String createMsg_request() {\n\t\treturn null;\n\t}",
"public void processReq(){\n //Using auto cloable for reader ;)\n try( BufferedReader reader = new BufferedReader(new InputStreamReader(clientSock.getInputStream()))){\n String mess = reader.readLine();\n String returnMess = getData(mess);\n\n PrintWriter writer = new PrintWriter(clientSock.getOutputStream());\n writer.println(returnMess);\n writer.flush();\n\n //Close sockets\n clientSock.close();\n sock.close();\n } catch (IOException e) {\n System.err.println(\"ERROR: Problem while opening / close a stream\");\n }\n }",
"public synchronized void handle(PBFTRequest r){\n \n Object lpid = getLocalServerID();\n\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \", at time \" + getClockValue() + \", received \" + r);\n\n StatedPBFTRequestMessage loggedRequest = getRequestInfo().getStatedRequest(r);\n \n /* if the request has not been logged anymore and it's a old request, so it was garbage by checkpoint procedure then I must send a null reply */\n if(loggedRequest == null && getRequestInfo().isOld(r)){\n IProcess client = new BaseProcess(r.getClientID());\n PBFTReply reply = new PBFTReply(r, null, lpid, getCurrentViewNumber());\n emit(reply, client);\n return;\n \n }\n \n try{\n /*if the request is new and hasn't added yet then it'll be added */\n if(loggedRequest == null){\n /* I received a new request so a must log it */\n loggedRequest = getRequestInfo().add(getRequestDigest(r), r, RequestState.WAITING);\n loggedRequest.setRequestReceiveTime(getClockValue());\n }\n\n /* if I have a entry in request log but I don't have the request then I must update my request log. */\n if(loggedRequest.getRequest() == null) loggedRequest.setRequest(r);\n \n /*if the request was served the I'll re-send the related reply if it has been logged yet.*/\n if(loggedRequest.getState().equals(RequestState.SERVED)){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" has already served \" + r);\n\n /* retransmite the reply when the request was already served */\n PBFTReply reply = getRequestInfo().getReply(r);\n IProcess client = new BaseProcess(r.getClientID());\n emit(reply, client);\n return;\n }\n \n /* If I'm changing then I'll do nothing more .*/\n if(changing()) return;\n\n PBFTPrePrepare pp = getPrePreparebackupInfo().get(getCurrentViewNumber(), getCurrentPrimaryID(), loggedRequest.getDigest());\n\n if(pp != null && !isPrimary()){\n /* For each digest in backuped pre-prepare, I haven't all request then it'll be discarded. */\n DigestList digests = new DigestList();\n for(String digest : pp.getDigests()){\n if(!getRequestInfo().hasRequest(digest)){\n digests.add(digest);\n }\n }\n \n if(digests.isEmpty()){\n handle(pp);\n getPrePreparebackupInfo().rem(pp);\n return;\n } \n }\n\n boolean committed = loggedRequest.getState().equals( RequestState.COMMITTED );\n \n// /* if my request was commit and it hasn't been served yet I must check the stated of the request */\n if(committed){\n tryExecuteRequests();\n return;\n }\n \n /* performs the batch procedure if the server is the primary replica. */\n if(isPrimary()){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" (primary) is executing the batch procedure for \" + r + \".\");\n batch();\n }else{\n /* schedules a timeout for the arriving of the pre-prepare message if the server is a secundary replica. */\n scheduleViewChange();\n }//end if is primary\n \n }catch(Exception e){\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) {\n\n\t\tString message = request.getParameter(\"message\");\n\t\tString nickname = request.getParameter(\"nickname\");\n\t\t\n\t\tDao2 dao = new Dao2();\n\t\t\n\t\tUserDto dto = dao.usInfo(nickname);\n\t\t\n\t\tint userseq = dto.getUserseq();\n\t\tint myseq = Integer.parseInt(request.getParameter(\"myseq\"));\n\t\t\n\t\t//System.out.println(myseq);\n\t\tdao.SendMessage(myseq, userseq, message);\n\t\n\t\t\n\t}",
"public void messageSent(Message m) {\n\t\t\r\n\t}",
"public ObjectNode getLoggableMessage(HttpServletRequest httpServletRequest, HttpServletResponse response) {\n\t\tObjectMapper mapper = new ObjectMapper();\n\n\t\tObjectNode ecs = mapper.createObjectNode();\n\n\t\t// client\n\t\t// client.address can contain comma separated list of IP\n\t\t// client.ip should contain the FIRST IP Address in that comma separated list\n\t\tObjectNode client = mapper.createObjectNode();\n\t\tString clientAddress = getClientIpAddress(httpServletRequest);\n\t\tclient.put(\"address\", clientAddress);\n\t\tclient.put(\"ip\", clientAddress.split(\",\")[0].trim());\n\n\t\t// client.user\n\t\tUser user = (User) httpServletRequest.getAttribute(String.valueOf(User.class));\n\t\tif (user != null) {\n\t\t\tObjectNode userNode = mapper.createObjectNode();\n\t\t\tuserNode.put(\"email\", user.getEmail());\n\t\t\tuserNode.put(\"id\", user.getId().toString());\n\t\t\tuserNode.put(\"name\", user.getUsername());\n\t\t\tuserNode.set(\"roles\", mapper.valueToTree(user.getRoles()));\n\t\t\tclient.set(\"user\", userNode);\n\t\t}\n\n\t\tecs.set(\"client\", client);\n\n\t\t// url\n\t\tString uri = httpServletRequest.getRequestURI();\n\t\tString fullURL = httpServletRequest.getRequestURL().toString();\n\n\t\t// if this is a forwarded Error Request, we'll have to rebuild the full URL\n\t\tif (httpServletRequest.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI) != null) {\n\t\t\turi = (String) httpServletRequest.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);\n\t\t\ttry {\n\t\t\t\tURL rebuiltURL = new URL(httpServletRequest.getRequestURL().toString());\n\t\t\t\tString host = rebuiltURL.getHost();\n\t\t\t\tString userInfo = rebuiltURL.getUserInfo();\n\t\t\t\tString scheme = rebuiltURL.getProtocol();\n\t\t\t\tint port = rebuiltURL.getPort();\n\t\t\t\tString query = (String) httpServletRequest.getAttribute(RequestDispatcher.FORWARD_QUERY_STRING);\n\t\t\t\tURI rebuiltURI = new URI(scheme, userInfo, host, port, uri, query, null);\n\t\t\t\tfullURL = rebuiltURI.toString();\n\t\t\t}\n\t\t\tcatch (MalformedURLException | URISyntaxException ignored) {\n\n\t\t\t}\n\t\t}\n\t\tObjectNode url = mapper.createObjectNode();\n\t\turl.put(\"path\", uri);\n\t\turl.put(\"full\", fullURL);\n\n\t\t// parse the full URL to fill out the other bits\n\t\ttry {\n\t\t\tURL parsedURL = new URL(fullURL);\n\t\t\turl.put(\"scheme\", parsedURL.getProtocol());\n\t\t\turl.put(\"port\", parsedURL.getPort());\n\t\t}\n\t\tcatch (MalformedURLException ignored) {\n\n\t\t}\n\n\t\tif (httpServletRequest.getQueryString() != null) {\n\t\t\turl.put(\"query\", httpServletRequest.getQueryString());\n\t\t}\n\n\t\tecs.set(\"url\", url);\n\n\t\t// http\n\t\tObjectNode http = mapper.createObjectNode();\n\n\t\t// http.request\n\t\tObjectNode httpRequest = mapper.createObjectNode();\n\t\thttpRequest.put(\"method\", httpServletRequest.getMethod());\n\t\tString referrer = httpServletRequest.getHeader(\"referrer\");\n\t\tif (referrer != null) {\n\t\t\thttpRequest.put(\"referrer\", referrer);\n\t\t}\n\t\thttp.set(\"request\", httpRequest);\n\n\t\t// http.response\n\t\tObjectNode httpResponse = mapper.createObjectNode();\n\t\thttpResponse.put(\"status_code\", String.valueOf(response.getStatus()));\n\t\thttp.set(\"response\", httpResponse);\n\n\t\tecs.set(\"http\", http);\n\n\t\t// useragent\n\t\tObjectNode userAgent = mapper.createObjectNode();\n\t\tuserAgent.put(\"original\", httpServletRequest.getHeader(\"User-Agent\"));\n\t\tecs.set(\"user_agent\", userAgent);\n\n\t\t// service\n\t\tObjectNode service = mapper.createObjectNode();\n\t\tservice.put(\"type\", \"igsn\");\n\t\tservice.put(\"name\", \"igsn-registry\");\n\t\tservice.put(\"kind\", \"event\");\n\t\tecs.set(\"service\", service);\n\n\t\t// custom metadata_registry fields\n\t\tObjectNode metadataRegistry = mapper.createObjectNode();\n\t\tRequest request = (Request) httpServletRequest.getAttribute(String.valueOf(Request.class));\n\t\tif (request != null) {\n\t\t\tmetadataRegistry.set(\"request\", mapper.valueToTree(request));\n\t\t}\n\t\tecs.set(\"metadata_registry\", metadataRegistry);\n\n\t\t// event\n\t\tObjectNode event = mapper.createObjectNode();\n\t\tevent.put(\"category\", \"web\");\n\t\tevent.put(\"action\", determineEventAction(httpServletRequest));\n\t\tString outcome = (response.getStatus() < 200 || response.getStatus() > 299) ? \"failure\" : \"success\";\n\t\tevent.put(\"outcome\", outcome);\n\t\tecs.set(\"event\", event);\n\n\t\t// message\n\t\tString defaultMessage = String.format(\"%s %s %s\", httpServletRequest.getMethod(), uri, response.getStatus());\n\t\tString exceptionMessage = (String) httpServletRequest.getAttribute(ExceptionMessage);\n\t\tecs.put(\"message\",\n\t\t\t\texceptionMessage != null && !exceptionMessage.trim().equals(\"\") ? exceptionMessage : defaultMessage);\n\n\t\treturn ecs;\n\t}",
"public String getClientMessage() {\n return message;\n }",
"@Override\n\t\tpublic void action() {\n\t\t\tMessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.REQUEST); \n\t\t\tACLMessage msg = receive(mt);\n\t\t\tif(msg != null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tContentElement ce = null;\n\t\t\t\t\tSystem.out.println(msg.getContent()); //print out the message content in SL\n\n\t\t\t\t\t// Let JADE convert from String to Java objects\n\t\t\t\t\t// Output will be a ContentElement\n\t\t\t\t\tce = getContentManager().extractContent(msg);\n\t\t\t\t\tSystem.out.println(ce);\n\t\t\t\t\tif(ce instanceof Action) {\n\t\t\t\t\t\tConcept action = ((Action)ce).getAction();\n\t\t\t\t\t\tif (action instanceof SupplierOrder) {\n\t\t\t\t\t\t\tSupplierOrder order = (SupplierOrder)action;\n\t\t\t\t\t\t\t//CustomerOrder cust = order.getItem();\n\t\t\t\t\t\t\t//OrderQuantity = order.getQuantity();\n\t\t\t\t\t\t\tif(!order.isFinishOrder()) {\n\t\t\t\t\t\t\tSystem.out.println(\"exp test: \" + order.getQuantity());\n\t\t\t\t\t\t\trecievedOrders.add(order);}\n\t\t\t\t\t\t\telse {orderReciever = true;}\n\t\t\t\t\t\t\t//Item it = order.getItem();\n\t\t\t\t\t\t\t// Extract the CD name and print it to demonstrate use of the ontology\n\t\t\t\t\t\t\t//if(it instanceof CD){\n\t\t\t\t\t\t\t\t//CD cd = (CD)it;\n\t\t\t\t\t\t\t\t//check if seller has it in stock\n\t\t\t\t\t\t\t\t//if(itemsForSale.containsKey(cd.getSerialNumber())) {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Selling CD \" + cd.getName());\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t//else {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"You tried to order something out of stock!!!! Check first!\");\n\t\t\t\t\t\t\t\t//}\n\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t//deal with bool set here\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcatch (CodecException ce) {\n\t\t\t\t\tce.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcatch (OntologyException oe) {\n\t\t\t\t\toe.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tblock();\n\t\t\t}\n\t\t}",
"void sendRequest(String message);",
"@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}",
"public Message getResponseData();",
"public String requestMessage() {\n return this.requestMessage;\n }",
"@Override\n public void onReceivedResponse(WebSocketResponseMessage responseMessage) {\n System.err.println(\"[JVDBG] Got response with status \" + responseMessage.getStatus()+\n \" and requestId = \"+responseMessage.getRequestId());\n long id = responseMessage.getRequestId();\n if (pending.containsKey(id)) {\n Consumer f = pending.get(id);\n f.accept(responseMessage);\n pending.remove(id);\n }\n System.err.println(\"Message = \" + responseMessage);\n if (responseMessage.getBody().isPresent()) {\n System.err.println(\"[JVDBG] Got response body: \" + new String(responseMessage.getBody().get()));\n }\n }",
"@Override\n\tpublic void OnRequest() {\n\t\t\n\t}",
"void sendResponseMessage(HttpResponse response) throws IOException;",
"@Override\r\n\t\t\t\t\tpublic void onResponse(HttpResponse resp) {\n\t\t\t\t\t\tLog.i(\"HttpPost\", \"Success\");\r\n\r\n\t\t\t\t\t}",
"@Override\n\tpublic void sendPacket() {\n\t\t\n\t\tStringBuilder theURL = new StringBuilder();\n\t\t\n\t\ttheURL.append(core.modelCore.targetURL);\n\t\ttheURL.append(\"michael/updateevent.php?\");\n\t\ttheURL.append(\"page=\" + \"eleven\" +\"&\"); //page = \"three\"&\n\t\ttheURL.append(\"name=\" + core.modelCore.selectedEvent.eventName +\"&\");\n\t\ttheURL.append(\"answer=\" + yesBox.isChecked() +\"&\");\n\t\ttheURL.append(\"user=\" + core.modelCore.username);\n\t\t\n\t\tSystem.out.println( theURL.toString() );\n\t\t\n\t\tLogic_PHP.getResponseFromURL(core, theURL.toString());\n\t}",
"@Override\n public void action() {\n ACLMessage acl = receive();\n if (acl != null) {\n if (acl.getPerformative() == ACLMessage.REQUEST) {\n try {\n ContentElement elemento = myAgent.getContentManager().extractContent(acl);\n if (elemento instanceof PublicarServicio) {\n PublicarServicio publicar = (PublicarServicio) elemento;\n Servicio servicio = publicar.getServicio();\n jadeContainer.iniciarChat(servicio.getTipo(), servicio.getDescripcion());\n //myAgent.addBehaviour(new IniciarChatBehaviour(myAgent, servicio.getTipo(), servicio.getDescripcion()));\n } else if (elemento instanceof EnviarMensaje) {\n EnviarMensaje enviar = (EnviarMensaje) elemento;\n Mensaje mensaje = enviar.getMensaje();\n jadeContainer.enviarMensajeChatJXTA(mensaje.getRemitente(), mensaje.getMensaje());\n }\n } catch (CodecException ex) {\n System.out.println(\"CodecException: \" + ex.getMessage());\n } catch (UngroundedException ex) {\n System.out.println(\"UngroundedException: \" + ex.getMessage());\n } catch (OntologyException ex) {\n System.out.println(\"OntologyException: \" + ex.getMessage());\n }\n }\n } else {\n block();\n }\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tList<TopicEvent> list = board.getNewMessages();\r\n\t\t// Send message to GUI\r\n\t\tString response = ServletUtil.createMessageBoardXML(list);\r\n\t\tServletUtil.createHeaders(resp);\r\n\t\tresp.getWriter().write(response);\r\n\t\tlog.debug(\"SENT:\\n\" + response);\r\n\t}",
"@Override\n public void onResponse(String response) {\n loadSentMessages();\n }"
] | [
"0.66657746",
"0.66162366",
"0.66162366",
"0.6600482",
"0.655086",
"0.65315664",
"0.64456594",
"0.64065605",
"0.6400679",
"0.6288801",
"0.6276382",
"0.6217163",
"0.6108669",
"0.6108333",
"0.61052185",
"0.6103342",
"0.6102629",
"0.60957295",
"0.60902923",
"0.608472",
"0.6058527",
"0.6055071",
"0.6041113",
"0.6040369",
"0.6025733",
"0.6024517",
"0.6015361",
"0.60013545",
"0.5987163",
"0.5978875",
"0.59610456",
"0.5948848",
"0.5946849",
"0.59426796",
"0.59392786",
"0.59303397",
"0.59280187",
"0.59265655",
"0.59176",
"0.59176",
"0.59176",
"0.59119785",
"0.59016645",
"0.5881111",
"0.5877467",
"0.58748645",
"0.58723396",
"0.5872109",
"0.58650506",
"0.58551323",
"0.5852654",
"0.5836716",
"0.58285815",
"0.5818731",
"0.5818433",
"0.57979935",
"0.57943046",
"0.5794264",
"0.57897973",
"0.57897764",
"0.57864845",
"0.57802963",
"0.5775326",
"0.5774886",
"0.577016",
"0.57519865",
"0.574283",
"0.5742618",
"0.57356924",
"0.57351166",
"0.5729516",
"0.5728532",
"0.5727766",
"0.57214266",
"0.57167584",
"0.571444",
"0.56971014",
"0.5695405",
"0.56911355",
"0.56893635",
"0.56881404",
"0.56841046",
"0.56673235",
"0.5664623",
"0.56573457",
"0.56571627",
"0.56529707",
"0.565115",
"0.564602",
"0.56306565",
"0.5628492",
"0.56191194",
"0.5617276",
"0.5616965",
"0.56118864",
"0.56050956",
"0.56048673",
"0.5602504",
"0.5598676",
"0.55970883",
"0.5590661"
] | 0.0 | -1 |
This is the function that is used to balance the load to the servers in case of a get or multiget without sharding | public int loadBalance() {
serverCount++;
serverCount = (serverCount) % (servers.size());
return serverCount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int round_robin()\n {\n current_server++;\n current_server%=tabServerssout.size();\n return current_server;\n }",
"private boolean isLoadAcceptable(ServerName name) throws Exception {\n final int compactionQueueSize =\n queryJMXIntValue(name.getHostname() + \":\" + \"10102\",\n \"hadoop:name=RegionServerStatistics,service=RegionServer\",\n \"compactionQueueSize\",\n jmxremote_password);\n final int cpuSize = queryJMXIntValue(name.getHostname() + \":\" + \"10102\",\n \"java.lang:type=OperatingSystem\",\n \"AvailableProcessors\", jmxremote_password);\n return compactionQueueSize < (cpuSize / throttleFactor);\n }",
"private void storeDemandLoadMap(Map<ServiceIdentifier<?>, Map<RegionIdentifier, Double>> loadMap, RegionIdentifier root) {\n Map<ServiceIdentifier<?>, Map<RegionIdentifier, Double>> excessLoad = deepCopyMap(loadMap);\n \n SortedSet<ServiceIdentifier<?>> sortedServiceSet = new TreeSet<>(new SortServiceByPriorityComparator());\n sortedServiceSet.addAll(excessLoad.keySet());\n \n // Store the load to keepLoadMap AND rootKeepLoadMap.get(getRegionID())\n rootKeepLoadMap.put(getRegionID(), new HashMap<>());\n Map<ServiceIdentifier<?>, Map<RegionIdentifier, Double>> localKeepLoadMap = rootKeepLoadMap.get(getRegionID());\n \n for (ServiceIdentifier<?> service : sortedServiceSet) {\n for (Entry<RegionIdentifier, Double> entry : excessLoad.get(service).entrySet()) {\n RegionIdentifier client = entry.getKey();\n \n // Can't use the function getAvailableCapacity() because it depends on the keepLoadMap\n double availableCapacity = getRegionCapacity() - sumKeyKeyValues(localKeepLoadMap);\n \n // Break if region has no available capacity\n if (compareDouble(availableCapacity, 0) <= 0) {\n break;\n }\n \n// double serviceLoad = excessLoad.get(service);\n double serviceLoad = entry.getValue();\n \n // If availableCapacity >= serviceLoad\n // Store all the load \n if (compareDouble(availableCapacity, serviceLoad) >= 0) {\n updateKeyKeyLoadMap(localKeepLoadMap, service, client, serviceLoad, true);\n excessLoad.get(service).put(client, 0.0);\n } \n // If availableCapacity <= serviceLoad\n // Store availableCapacity, reduce the loadMap by availableCapacity\n // Then break since there is no available capacity\n else {\n updateKeyKeyLoadMap(localKeepLoadMap, service, client, availableCapacity, true);\n excessLoad.get(service).put(client, serviceLoad - availableCapacity);\n } \n }\n \n excessLoad.get(service).values().removeIf(v -> compareDouble(v, 0) == 0);\n } \n }",
"boolean hasHttpLoadBalancing();",
"protected synchronized double getAverageLoad() {\n int numServers = 0, totalLoad = 0;\n for (Map.Entry<ServerName, Set<HRegionInfo>> e: serverHoldings.entrySet()) {\n Set<HRegionInfo> regions = e.getValue();\n ServerName serverName = e.getKey();\n int regionCount = regions.size();\n if (regionCount > 0 || serverManager.isServerOnline(serverName)) {\n totalLoad += regionCount;\n numServers++;\n }\n }\n return numServers == 0 ? 0.0 :\n (double)totalLoad / (double)numServers;\n }",
"com.google.container.v1.HttpLoadBalancing getHttpLoadBalancing();",
"public void preComputeBestReplicaMapping() {\n Map<String, Map<String, Map<String, String>>> collectionToShardToCoreMapping = getZkClusterData().getCollectionToShardToCoreMapping();\n\n for (String collection : collectionNames) {\n Map<String, Map<String, String>> shardToCoreMapping = collectionToShardToCoreMapping.get(collection);\n\n for (String shard : shardToCoreMapping.keySet()) {\n Map<String, String> coreToNodeMap = shardToCoreMapping.get(shard);\n\n for (String core : coreToNodeMap.keySet()) {\n String currentCore = core;\n String node = coreToNodeMap.get(core);\n SolrCore currentReplica = new SolrCore(node, currentCore);\n try {\n currentReplica.loadStatus();\n //Ok this replica is the best. Let us just use that for all the cores\n fillUpAllCoresForShard(currentReplica, coreToNodeMap);\n break;\n } catch (Exception e) {\n logger.info(ExceptionUtils.getFullStackTrace(e));\n continue;\n }\n }\n shardToBestReplicaMapping.put(shard, coreToBestReplicaMappingByHealth);\n }\n\n }\n }",
"private double loadFactor()\n {\n double bucketsLength = buckets.length;\n return currentSize / bucketsLength;\n }",
"int getCacheConcurrency();",
"public int getActivePoolSize(){return activePoolSize;}",
"private void setLoadBalance() {\n deleteAllChildren(\"/soa/config/service\");\n\n Properties prop = new Properties();\n try {\n InputStream in = StaticInfoHelper.class.getClassLoader().getResourceAsStream(\"config.properties\");\n prop.load(in);\n } catch (IOException e) {\n LOGGER.error(\"error reading file config.properties\");\n LOGGER.error(e.getMessage(), e);\n }\n\n Iterator<Map.Entry<Object, Object>> it = prop.entrySet().iterator();\n while (it.hasNext()) {\n Map.Entry<Object, Object> entry = it.next();\n Object key = entry.getKey();\n Object value = entry.getValue();\n String t_value = ((String) value).replaceAll(\"/\", \"=\");\n\n createConfigNodeWithData(\"/soa/config/service/\" + (String) key, t_value);\n }\n\n }",
"BigDecimal getCacheSpaceAvailable();",
"int getPoolSize();",
"public void createOnlyLBPolicy(){\n\t\t\n\t\tIterator<CacheObject> ican = cacheList.iterator();\n\t\t\n\t\tint objcounter = 0;\n\t\t\n\t\twhile(ican.hasNext() && objcounter < (OBJ_FOR_REQ)){\n\t\t\t\n\t\t\tobjcounter ++;\n\t\t\tCacheObject tempCacheObject = ican.next();\n\t\t\tIterator<ASServer> itm = manager.getASServers().values().iterator();\n\t\t\twhile(itm.hasNext()){\n\t\t\t\t\n\t\t\t\tASServer as = itm.next();\n\t\t\t\tif(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(tempCacheObject.cacheKey) == null){\n\t\t\t\t\t//System.out.println(\"Mapping Map is NULL\");\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tArrayList<String> urllist = new ArrayList<String>(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(tempCacheObject.cacheKey));\n\t\t\t\tIterator<String> iurl = urllist.iterator();\n\t\t\t\twhile(iurl.hasNext()){\n\t\t\t\t\tString url = iurl.next();\n\t\t\t\t\tif(!urlList.contains(url)){\n\t\t\t\t\t\turlList.add(url);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tint urlcounter = 0;\n\t\tint urllistsize = urlList.size();\n\t\tCollection<String> it1 = serverList.keySet();\n\t\tArrayList<String> server = new ArrayList<String>(it1);\n\t\t\n\t\twhile(urlcounter < urllistsize){\n\t\t\t\n\t\t\tString serId = server.get( (urlcounter) % NO_SERVERS );\n\t\t\tthis.currentLBPolicy.mapUrlToServers(urlList.get(urlcounter++), Analyser.resolveHost(serId));\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(\"------------LBPolicy start---------------\");\n//\t\tSystem.out.println(currentLBPolicy);\n//\t\t\n\t\tSystem.out.println(\"Number of entries in LBPolicy are: \" + currentLBPolicy.policyMap.size() );\n//\t\n\t\tSystem.out.println(\"------------LBPolicy end-----------------\");\n\t\t/*\n\t\tif(mLogger.isInfoEnabled()){\n\t\t\tmLogger.log(Priority.INFO, \"LBPolicy being printed\");\n\t\tmLogger.log(Priority.INFO, \":\" + this.currentLBPolicy);\n\t\t\n\t}\n\t\t*/\n\t}",
"private void dispatchRequests(RoutingContext context) {\n int initialOffset = 5; // length of `/api/`\n // Run with circuit breaker in order to deal with failure\n circuitBreaker.execute(future -> {\n getAllEndpoints().setHandler(ar -> {\n if (ar.succeeded()) {\n List<Record> recordList = ar.result();\n // Get relative path and retrieve prefix to dispatch client\n String path = context.request().uri();\n if (path.length() <= initialOffset) {\n notFound(context);\n future.complete();\n return;\n }\n\n String prefix = (path.substring(initialOffset).split(\"/\"))[0];\n String newPath = path.substring(initialOffset + prefix.length());\n\n // Get one relevant HTTP client, may not exist\n Optional<Record> client = recordList.stream()\n .filter(record -> record.getMetadata().getString(\"api.name\") != null)\n .filter(record -> record.getMetadata().getString(\"api.name\").equals(prefix))\n .findAny(); // simple load balance\n\n if (client.isPresent()) {\n doDispatch(context, newPath, discovery.getReference(client.get()).get(), future);\n } else {\n notFound(context);\n future.complete();\n }\n } else {\n future.fail(ar.cause());\n }\n });\n }).setHandler(ar -> {\n if (ar.failed()) {\n badGateway(ar.cause(), context);\n }\n });\n }",
"public void createDistributedObjectsPolicy(){\n\t\t\n\t\tint size = 0;\n\t\t\n\t\tIterator<CacheObject> cst = candidateStableOnlyList.iterator();\n\t\t\n\t\twhile(cst.hasNext()){\n\t\t\t\n\t\t\tCacheObject ct = cst.next();\n\t\t\t\n\t\t\tIterator<String> it1 = serverList.keySet().iterator();\n\t\t\t\n\t\t\twhile(it1.hasNext()){\n\t\t\t\t\n\t\t\t\tString serverId = it1.next();\n\t\t\t\tHashMap<String, CacheObject> htemp = individualMap.get(serverId); \n\t\t\t\t\n\t\t\t\tif(htemp.containsKey(ct.cacheKey)){\n\t\t\t\t\t\n\t\t\t\t\tInteger sz = serverList.get(serverId);\n\t\t\t\t\t\n\t\t\t\t\tif(sz.intValue() < STABLE_SIZE){\n\t\t\t\t\t\tArrayList<String> lt = new ArrayList<String>();\n\t\t\t\t\t\tlt.add(serverId);\n\t\t\t\t\t\tRuleList rl = new RuleList(serverId, RuleList.MOVE , RuleList.LONG_TTL, lt);\n\t\t\t\t\t\tListKey lk = new ListKey();\n\t\t\t\t\t\tlk.addtoListKey(ct.cacheKey);\n\t\t\t\t\t\tASPolicyMap.get(serverId).addNewPolicy(lk, rl);\n\t\t\t\t\t\tsz = sz + ct.size;\n\t\t\t\t\t\tsize += ct.size;\n\t\t\t\t\t\tserverList.put(serverId, sz);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tIterator<String> it2 = serverList.keySet().iterator();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile(it2.hasNext()){\n\t\t\t\t\t\t\tString serverId2 = it2.next();\n\t\t\t\t\t\t\tInteger sz2 = serverList.get(serverId2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(sz2.intValue() < STABLE_SIZE){\n\t\t\t\t\t\t\t\tArrayList<String> lt = new ArrayList<String>();\n\t\t\t\t\t\t\t\tlt.add(serverId2);\n\t\t\t\t\t\t\t\tRuleList rl = new RuleList(serverId2, RuleList.MOVE , RuleList.LONG_TTL, lt);\n\t\t\t\t\t\t\t\tListKey lk = new ListKey();\n\t\t\t\t\t\t\t\tlk.addtoListKey(ct.cacheKey);\n\t\t\t\t\t\t\t\tASPolicyMap.get(serverId2).addNewPolicy(lk, rl);\n\t\t\t\t\t\t\t\tsz2 = sz2 + ct.size;\n\t\t\t\t\t\t\t\tsize += ct.size;\n\t\t\t\t\t\t\t\tserverList.put(serverId2, sz2);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(size >= (STABLE_SIZE*NO_SERVERS) ){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Test\n public void heavierTest() throws InterruptedException, ExecutionException {\n Stage stage1 = createStage();\n Stage stage2 = createStage();\n StatelessThing actor1 = Actor.getReference(StatelessThing.class, \"1000\");\n StatelessThing actor2 = Actor.getReference(StatelessThing.class, \"1000\");\n final Set<UUID> set = new HashSet<>();\n set.clear();\n List<Future<UUID>> futures = new ArrayList<>();\n for (int i = 0; i < 50; i++) {\n // this will force the creation of concurrent activations in each node\n stage1.bind();\n futures.add(actor1.getUniqueActivationId());\n stage2.bind();\n futures.add(actor2.getUniqueActivationId());\n }\n futures.forEach(( f) -> {\n try {\n set.add(f.get(10, TimeUnit.SECONDS));\n } catch (Exception e) {\n throw new UncheckedException(e);\n }\n });\n // it is very likely that there will be more than one activation per stage host.\n Assert.assertTrue(((set.size()) > 1));\n // only 25*5 calls => there should not be more than 125 activations\n Assert.assertTrue(((set.size()) <= 100));\n }",
"private void listBalances() {\n\t\t\r\n\t}",
"public static void balanceHeaps()\n {\n // add your code here\n if(Math.abs(s.size()-g.size()) > 1){\n if(s.size() > g.size()){\n g.add(s.poll());\n }\n else {\n s.add(g.poll());\n }\n }\n }",
"public abstract int getBalancesRead();",
"ServiceResponse<String> acquireMostBusyServerIp();",
"public void sendGetRequest() {\r\n\t\tString[] requests = this.input.substring(4, this.input.length()).split(\" \"); \r\n\t\t\r\n\t\tif(requests.length <= 1 || !(MyMiddleware.readSharded)){\r\n\t\t\tnumOfRecipients = 1;\r\n\t\t\trecipient = servers.get(loadBalance());\r\n\r\n\t\t\trecipient.send(this, input);\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\t\r\n\t\t\tif(requests.length <= 1) {\r\n\t\t\t\tnumOfGets++;\r\n\t\t\t\ttype= \"10\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumOfMultiGets++;\r\n\t\t\t\ttype = requests.length+\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString reply = recipient.receive();\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\t\r\n\t\t\tint hit = 0;\r\n\t\t\thit += reply.split(\"VALUE\").length - 1;\r\n\t\t\tmiss += requests.length-hit;\r\n\r\n\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsendBack(currentJob.getClient(), reply);\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnumOfMultiGets++;\r\n\t\t\ttype = requests.length+\"\";\r\n\t\t\tnumOfRecipients = servers.size();\r\n\t\t\trequestsPerServer = requests.length / servers.size();\r\n\t\t\tremainingRequests = requests.length % servers.size() ;\r\n\t\t\t\r\n\t\t\t//The worker thread sends a number of requests to each server equal to requestsPerServer \r\n\t\t\t//and at most requestsPerServer + remainingRequests\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < servers.size(); i++) {\r\n\t\t\t\tmessage = requestType;\r\n\t\t\t\tfor(int j = 0; j < requestsPerServer; j++){\r\n\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\tmessage += requests[requestsPerServer*i+j];\r\n\t\t\t\t\tif(i < remainingRequests) {\r\n\t\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\t\tmessage += requests[requests.length - remainingRequests + i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tservers.get(i).send(this, message);\r\n\t\t\t}\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\tint hit = 0;\r\n\t\t\tfor(ServerHandler s : servers) {\r\n\t\t\t\tString ricevuto = s.receive();\r\n\t\t\t\thit += ricevuto.split(\"VALUE\").length - 1;\r\n\t\t\t\treplies.add(ricevuto);\r\n\t\t\t}\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\r\n\t\t\tmiss += requests.length-hit;\r\n\t\t\t\r\n\t\t\tfinalReply = \"\";\r\n\t\t\tfor(String reply : replies) {\r\n\t\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\t\treplies.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treply = reply.substring(0, reply.length() - 3);\r\n\t\t\t\t\tfinalReply += reply;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalReply += \"END\";\r\n\t\t\tsendBack(currentJob.getClient(), finalReply);\r\n\t\t\treplies.clear();\r\n\r\n\t\t}\r\n\t\t\r\n\t}",
"private void updateIfStale() {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n synchronized (counterShards) {\n if (DateTimeUtils.currentTimeMillis() - globalLastDrainMillis >= maxStaleMillis) {\n drainThreadToShared();\n globalLastDrainMillis = DateTimeUtils.currentTimeMillis();\n }\n }\n }\n }",
"public abstract void rebalance();",
"int getServerProcessingIterations();",
"public LoadBalancerWRR(List<ServerUnit> _ListOfServers)\n\t{\n\t\tsuper(_ListOfServers);\n\t\ttypeOfLoadBalancer = typeOfLoadBalancer.WeightedRoundRobin;\n\t\tinitChosenServerIndex();\n\n\t/*\tinitTableOfServer();\n\t\tinitTempTableOfServer();*/\n\n\t}",
"@Test\n public void simulateHeavyLoad(TestContext context) {\n Async async = context.async();\n try {\n init();\n\n // loading mixed data\n loadSimulatedHeavyData();\n\n put(\"myapi1/v1/test\").then().assertThat().statusCode(503);\n put(\"myapi2/v1/test\").then().assertThat().statusCode(503);\n\n qosHandler.getQosRules().stream().filter(rule -> \"myapi1/v1/test\".matches(rule.getUrlPattern().pattern())).forEach(rule -> {\n context.assertTrue(rule.getActions().contains(QoSHandler.WARN_ACTION));\n context.assertTrue(rule.getActions().contains(QoSHandler.REJECT_ACTION));\n });\n\n // load normal Data\n loadSimulatedNormalData();\n TestUtils.waitSomeTime(6);\n\n put(\"myapi1/v1/test\").then().assertThat().statusCode(200);\n put(\"myapi2/v1/test\").then().assertThat().statusCode(200);\n\n for (QoSRule rule : qosHandler.getQosRules()) {\n context.assertFalse(rule.performAction());\n }\n } catch (Exception failed) {\n context.fail(\"Exception: \" + failed.getMessage());\n }\n\n System.out.println(\"Done\");\n\n async.complete();\n }",
"boolean isClusterBulkLoadEnabled();",
"private void doPing()\r\n {\r\n requestQueue.add( new ChargerHTTPConn( weakContext,\r\n CHARGE_NODE_JSON_DATA, \r\n PING_URL,\r\n SN_HOST,\r\n null, \r\n cookieData,\r\n false,\r\n token,\r\n secret ) );\r\n }",
"@Test(timeout = 10000L)\n public void testGetLoadBalancerInformation() throws Exception {\n CommonDriverAdminTests.testGetLoadBalancerInformation(client);\n }",
"@Test\n public void testZookeeperCacheLoader() throws InterruptedException, KeeperException, Exception {\n\n DiscoveryZooKeeperClientFactoryImpl.zk = mockZookKeeper;\n\n @SuppressWarnings(\"resource\")\n ZookeeperCacheLoader zkLoader = new ZookeeperCacheLoader(new DiscoveryZooKeeperClientFactoryImpl(), \"\", 30_000);\n\n List<String> brokers = Lists.newArrayList(\"broker-1:15000\", \"broker-2:15000\", \"broker-3:15000\");\n for (int i = 0; i < brokers.size(); i++) {\n try {\n LoadManagerReport report = i % 2 == 0 ? getSimpleLoadManagerLoadReport(brokers.get(i))\n : getModularLoadManagerLoadReport(brokers.get(i));\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + brokers.get(i),\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n } catch (Exception e) {\n fail(\"failed while creating broker znodes\");\n }\n }\n\n // strategically wait for cache to get sync\n for (int i = 0; i < 5; i++) {\n if (zkLoader.getAvailableBrokers().size() == 3 || i == 4) {\n break;\n }\n Thread.sleep(1000);\n }\n\n // 2. get available brokers from ZookeeperCacheLoader\n List<LoadManagerReport> list = zkLoader.getAvailableBrokers();\n\n // 3. verify retrieved broker list\n Set<String> cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl())\n .collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n // 4.a add new broker\n final String newBroker = \"broker-4:15000\";\n LoadManagerReport report = getSimpleLoadManagerLoadReport(newBroker);\n zkLoader.getLocalZkCache().getZooKeeper().create(LOADBALANCE_BROKERS_ROOT + \"/\" + newBroker,\n ObjectMapperFactory.getThreadLocal().writeValueAsBytes(report), ZooDefs.Ids.OPEN_ACL_UNSAFE,\n CreateMode.PERSISTENT);\n brokers.add(newBroker);\n\n Thread.sleep(100); // wait for 100 msec: to get cache updated\n\n // 4.b. get available brokers from ZookeeperCacheLoader\n list = zkLoader.getAvailableBrokers();\n\n // 4.c. verify retrieved broker list\n cachedBrokers = list.stream().map(loadReport -> loadReport.getWebServiceUrl()).collect(Collectors.toSet());\n Assert.assertEquals(list.size(), brokers.size());\n Assert.assertTrue(brokers.containsAll(cachedBrokers));\n\n }",
"Future<GetLoadBalancerResponse> getLoadBalancer(\n GetLoadBalancerRequest request,\n AsyncHandler<GetLoadBalancerRequest, GetLoadBalancerResponse> handler);",
"public static void throughput(BasicGraphService bgs) {\n \tRandom random = new Random();\n \tlong timer = System.currentTimeMillis();\n\t\tlong dif = 0l;\n\t\tint ops = 0;\n\t\twhile(dif < 1000) {\n\t\t\tint key = random.nextInt(maxRandInt);\n\t\t\tbgs.getConnections(key);\n\t\t\tdif = System.currentTimeMillis() - timer;\n\t\t\tops++;\n\t\t}\n\t\tdebug(debug, \"operations in 1 second: \" + ops);\n }",
"protected void updateLoading()\n {\n scheduled = false;\n\n if (!valid)\n return;\n\n while (loading.size() < numConnections) {\n updateActiveStats();\n\n final TileInfo tile;\n synchronized (toLoad) {\n if (toLoad.isEmpty())\n break;\n tile = toLoad.last();\n if (tile != null) {\n toLoad.remove(tile);\n }\n }\n if (tile == null) {\n break;\n }\n\n tile.state = TileInfoState.Loading;\n synchronized (loading) {\n if (!loading.add(tile)) {\n Log.w(\"RemoteTileFetcher\", \"Tile already loading: \" + tile.toString());\n }\n }\n\n if (debugMode)\n Log.d(\"RemoteTileFetcher\",\"Starting load of request: \" + tile.fetchInfo.urlReq);\n\n // Set up the fetching task\n tile.task = client.newCall(tile.fetchInfo.urlReq);\n\n if (tile.isLocal) {\n // Try reading the data in the background\n new CacheTask(this,tile).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,(Void)null);\n } else {\n startFetch(tile);\n }\n }\n\n updateActiveStats();\n }",
"@Override\n public void start() {\n KeyValueLib.dataCenters.put(dataCenter1, 1);\n KeyValueLib.dataCenters.put(dataCenter2, 2);\n KeyValueLib.dataCenters.put(dataCenter3, 3);\n final RouteMatcher routeMatcher = new RouteMatcher();\n final HttpServer server = vertx.createHttpServer();\n server.setAcceptBacklog(32767);\n server.setUsePooledBuffers(true);\n server.setReceiveBufferSize(4 * 1024);\n\n mapPutLock = new ReentrantLock();\n getMap = new HashMap<String, PriorityQueue<String>>();\n queuePutLocks = new HashMap<String, ReentrantLock>();\n\n mapGetLock = new ReentrantLock();\n getMap = new HashMap<String, PriorityQueue<String>>();\n queueGetLocks = new ReentrantLock();\n\n dcLock = new HashMap<String, ReentrantLock>();\n keyLockMap = new HashMap<String, KeyLock>();\n\n routeMatcher.get(\"/put\", new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n MultiMap map = req.params();\n final String key = map.get(\"key\");\n final String value = map.get(\"value\");\n // You may use the following timestamp for ordering requests\n final String timestamp = new Timestamp(\n System.currentTimeMillis() + TimeZone.getTimeZone(\"EST\").getRawOffset()).toString();\n\n // lock the map\n mapGetLock.lock();\n mapPutLock.lock();\n\n if (!putMap.containsKey(key)) {\n getMap.put(key, new PriorityQueue<String>());\n putMap.put(key, new PriorityQueue<String>());\n queueGetLocks.put(key, new ReentrantLock());\n queuePutLocks.put(key, new ReentrantLock());\n keyLockMap.put(key, new KeyLock());\n }\n\n putMap.get(key).add(timestamp);\n\n // unlock the map\n mapGetLock.unlock();\n mapPutLock.unlock();\n \n Thread t = new Thread(new Runnable() {\n public void run() {\n // TODO: Write code for PUT operation here.\n // Each PUT operation is handled in a different thread.\n // Highly recommended that you make use of helper\n // functions.\n }\n \n private void replicatePut(String key, String value, String timestamp) {\n queueGetLocks.get(key).lock();\n queuePutLocks.get(key).lock();\n \n while ((putMap.get(key).peek()!=null && !putMap.get(key).peek().equals(timestamp)) \n || (getMap.get(key).peek()!=null && Long.parseLong(getMap.get(key).peek()) > Long.parseLong(timestamp))) {\n \n queueGetLocks.get(key).unlock();\n queuePutLocks.get(key).unlock();\n try {\n synchronized (keyLockMap.get(key)) {\n keyLockMap.get(key).wait();\n }\n } catch(Exception e){\n \n }\n \n queueGetLocks.get(key).lock();\n queuePutLocks.get(key).lock();\n }\n \n queueGetLocks.get(key).unlock();\n queuePutLocks.get(key).unlock();\n\n try{\n KeyValueLib.PUT(dataCenter1, key, value);\n KeyValueLib.PUT(dataCenter2, key, value);\n KeyValueLib.PUT(dataCenter3, key, value);\n } catch (Exception e){\n System.out.println(\"Exception happens in Put\");\n }\n\n queuePutLocks.get(key).lock();\n putMap.get(key).remove(timestamp);\n queuePutLocks.get(key).unlock();\n \n keyLockMap.get(key).notifyAll();\n return;\n\n }\n\n \n });//runnable\n t.start();\n req.response().end(); // Do not remove this\n }\n });\n\n routeMatcher.get(\"/get\", new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n MultiMap map = req.params();\n final String key = map.get(\"key\");\n final String loc = map.get(\"loc\");\n // You may use the following timestamp for ordering requests\n final String timestamp = new Timestamp(\n System.currentTimeMillis() + TimeZone.getTimeZone(\"EST\").getRawOffset()).toString();\n Thread t = new Thread(new Runnable() {\n public void run() {\n // TODO: Write code for GET operation here.\n // Each GET operation is handled in a different thread.\n // Highly recommended that you make use of helper\n // functions.\n req.response().end(\"0\"); // Default response = 0\n }\n });\n t.start();\n }\n });\n\n routeMatcher.get(\"/storage\", new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n MultiMap map = req.params();\n storageType = map.get(\"storage\");\n // This endpoint will be used by the auto-grader to set the\n // consistency type that your key-value store has to support.\n // You can initialize/re-initialize the required data structures\n // here\n req.response().end();\n }\n });\n\n routeMatcher.noMatch(new Handler<HttpServerRequest>() {\n @Override\n public void handle(final HttpServerRequest req) {\n req.response().putHeader(\"Content-Type\", \"text/html\");\n String response = \"Not found.\";\n req.response().putHeader(\"Content-Length\", String.valueOf(response.length()));\n req.response().end(response);\n req.response().close();\n }\n });\n server.requestHandler(routeMatcher);\n server.listen(8080);\n }",
"private List<User> syncDataFromMaster() {\n\n// if (getHostPostOfServer().equals(ClusterInfo.getClusterInfo().getMaster())) {\n// return;\n// }\n String requestUrl;\n requestUrl = \"http://\".concat(ClusterInfo.getClusterInfo().getMaster().concat(\"/users\"));\n List<User> users = restTemplate.getForObject(requestUrl, List.class);\n return users;\n\n }",
"void requestRateLimited();",
"long getEvictions();",
"public void balanceHeaps(){\n \n //If max heap size is greater than min heap then pop the first element and put int min heap\n if(maxHeap.size() > minHeap.size())\n minHeap.add(maxHeap.pollFirst());\n\n }",
"@Override\n public void execute() throws Throwable\n {\n \tlogger.debug(\"--------- Bucket Refresh \" + localNode.getNodeId() +\"--------\");\n \tfor (MId node : localNode.getRoutingTable().getAllNodes()) {\n \t\tlogger.debug(\" - \" + node.toString());\n\t\t};\n \t\n// \tHashMap<String, Integer> nodeMap = new HashMap<>();\n \t\n for (int i = 1; i < MId.ID_LENGTH; i++)\n {\n /* Construct a NodeId that is i bits away from the current node Id */\n final MId current = (localNode.getNodeId()).generateNodeIdByDistance(i);\n\n// System.nanoTime();\n /* Run the Node Lookup Operation, each in a different thread to speed up things */\n new NodeLookupOperation(localNode, current).execute();\n // System.nanoTime();\n \n// localNode.getLookupEventLoop().execute(new Runnable() {\n//\t\t\t\t@Override\n//\t\t\t\tpublic void run() {\n// try\n// {\n// }\n// catch (IOException e)\n// {\n// //System.err.println(\"Bucket Refresh Operation Failed. Msg: \" + e.getMessage());\n// } catch (Throwable e) {\n//\t\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t});\n }\n\t\tlogger.debug(\"--------- Bucket Refresh End --------\");\n }",
"private void monitorHBase() {\n if (hadoopRetrieveService == null) {\n return;\n }\n // logger.info(\"Checking Hbase health status ...\");\n List<PVTypeInfo> pvInfos = new ArrayList<>(aaRetrieveService.getAllPVInfo());\n if (pvInfos.isEmpty()) {\n // logger.info(\"No archving PV.\");\n return;\n }\n // Use the first PV for the checking\n String pv = pvInfos.get(0).getPvName();\n Calendar end = Calendar.getInstance();\n end.setTime(new Date());\n end.add(Calendar.YEAR, -10);\n Calendar start = Calendar.getInstance();\n start.setTime(end.getTime());\n start.add(Calendar.MINUTE, -30);\n try {\n hadoopRetrieveService.getData(pv, new Timestamp(start.getTime().getTime()),\n new Timestamp(end.getTime().getTime()), PostProcessing.FIRSTSAMPLE, 60, false, 1.0);\n } catch (IOException e) {\n logger.warn(\"HBase is down.\");\n hadoopRetrieveService = null;\n scheduledService.scheduleAtFixedRate(() -> reInitializeHBase(), 1000,\n SiteConfigUtil.getHbaseCheckingInterval(), TimeUnit.MILLISECONDS);\n }\n }",
"private void gather(final Session s) throws Exception {\n\t\t//final MeasureHandler mHandler = Appctx.getBean(\"measurehandler\");\n\t\t//final List<CacheClusterBean> cache = s.createQuery(\n\t\t//\t\t\"from CacheClusterBean\").list();\n\t\t//for (final CacheClusterBean cluster : cache) {\n\t\t\t// if (!cluster.getLbStatus().endsWith(\"ready\")) {\n\t\t\t// logger.debug(\"Ignoring AC \" + cluster.getUserId() + \" LB \"\n\t\t\t// + cluster.getLoadBalancerName() + \" Status \"\n\t\t\t// + cluster.getLbStatus());\n\t\t\t// continue;\n\t\t\t// }\n\t\t\t// final long acid = cluster.getAccount().getId();\n\t\t\t// logger.debug(\"Gather AC \" + acid + \" Cluster \" +\n\t\t\t// cluster.getName());\n\t\t\t// final AccountBean acb = cluster.getAccount();\n\t\t\t// final AccountType ac = AccountUtil.toAccount(acb);\n\t\t\t//\n\t\t\t// final DimensionBean dim = CWUtil.getDimensionBean(s, acb.getId(),\n\t\t\t// \"CacheClusterId\", cluster.getName(), true);\n\t\t\t// final Set<DimensionBean> dims = new HashSet<DimensionBean>();\n\t\t\t// dims.add(dim);\n\t\t\t// BinLogDiskUsage Bytes\n\t\t\t// CPUUtilization Percent\n\t\t\t// DatabaseConnections Count\n\t\t\t// FreeableMemory Bytes\n\t\t\t// FreeStorageSpace Bytes\n\t\t\t// ReplicaLag Seconds\n\t\t\t// SwapUsage Bytes\n\t\t\t// ReadIOPS Count/Second\n\t\t\t// WriteIOPS Count/Second\n\t\t\t// ReadLatency Seconds\n\t\t\t// WriteLatency Seconds\n\t\t\t// ReadThroughput Bytes/Second\n\t\t\t// WriteThroughput Bytes/Second\n\n\t\t//}\n\t}",
"protected Map<FullyQualifiedTableName, Map<ServerName, List<HRegionInfo>>>\n getAssignmentsByTable() {\n Map<FullyQualifiedTableName, Map<ServerName, List<HRegionInfo>>> result =\n new HashMap<FullyQualifiedTableName, Map<ServerName,List<HRegionInfo>>>();\n synchronized (this) {\n if (!server.getConfiguration().getBoolean(\"hbase.master.loadbalance.bytable\", false)) {\n Map<ServerName, List<HRegionInfo>> svrToRegions =\n new HashMap<ServerName, List<HRegionInfo>>(serverHoldings.size());\n for (Map.Entry<ServerName, Set<HRegionInfo>> e: serverHoldings.entrySet()) {\n svrToRegions.put(e.getKey(), new ArrayList<HRegionInfo>(e.getValue()));\n }\n result.put(FullyQualifiedTableName.valueOf(\"ensemble\"), svrToRegions);\n } else {\n for (Map.Entry<ServerName, Set<HRegionInfo>> e: serverHoldings.entrySet()) {\n for (HRegionInfo hri: e.getValue()) {\n if (hri.isMetaRegion()) continue;\n FullyQualifiedTableName tablename = hri.getFullyQualifiedTableName();\n Map<ServerName, List<HRegionInfo>> svrToRegions = result.get(tablename);\n if (svrToRegions == null) {\n svrToRegions = new HashMap<ServerName, List<HRegionInfo>>(serverHoldings.size());\n result.put(tablename, svrToRegions);\n }\n List<HRegionInfo> regions = svrToRegions.get(e.getKey());\n if (regions == null) {\n regions = new ArrayList<HRegionInfo>();\n svrToRegions.put(e.getKey(), regions);\n }\n regions.add(hri);\n }\n }\n }\n }\n\n Map<ServerName, ServerLoad>\n onlineSvrs = serverManager.getOnlineServers();\n // Take care of servers w/o assignments.\n for (Map<ServerName, List<HRegionInfo>> map: result.values()) {\n for (ServerName svr: onlineSvrs.keySet()) {\n if (!map.containsKey(svr)) {\n map.put(svr, new ArrayList<HRegionInfo>());\n }\n }\n }\n return result;\n }",
"@Test\n public void testLimitPool() {\n List<Pool> subscribedTo = new ArrayList<Pool>();\n Consumer guestConsumer = TestUtil.createConsumer(systemType, owner);\n guestConsumer.setFact(\"virt.is_guest\", \"true\");\n \n consumerCurator.create(guestConsumer);\n Pool parentPool = null;\n \n assertTrue(limitPools != null && limitPools.size() == 2);\n for (Pool p : limitPools) {\n // bonus pools have the attribute pool_derived\n if (null != p.getAttributeValue(\"pool_derived\")) {\n // consume 2 times so one can get revoked later.\n consumerResource.bind(guestConsumer.getUuid(), p.getId(), null,\n 10, null, null, false, null);\n consumerResource.bind(guestConsumer.getUuid(), p.getId(), null,\n 10, null, null, false, null);\n // ensure the correct # consumed from the bonus pool\n assertTrue(p.getConsumed() == 20);\n assertTrue(p.getQuantity() == 100);\n poolManager.refreshPools(owner);\n // double check after pools refresh\n assertTrue(p.getConsumed() == 20);\n assertTrue(p.getQuantity() == 100);\n // keep this list so we don't need to search again\n subscribedTo.add(p);\n }\n else {\n parentPool = p;\n }\n }\n // manifest consume from the physical pool and then check bonus pool quantities\n consumerResource.bind(manifestConsumer.getUuid(), parentPool.getId(), null, 7, null,\n null, false, null);\n for (Pool p : subscribedTo) {\n assertTrue(p.getConsumed() == 20);\n assertTrue(p.getQuantity() == 30);\n poolManager.refreshPools(owner);\n // double check after pools refresh\n assertTrue(p.getConsumed() == 20);\n assertTrue(p.getQuantity() == 30);\n }\n // manifest consume from the physical pool and then check bonus pool quantities.\n // Should result in a revocation of one of the 10 count entitlements.\n consumerResource.bind(manifestConsumer.getUuid(), parentPool.getId(), null, 2, null,\n null, false, null);\n for (Pool p : subscribedTo) {\n assertTrue(p.getConsumed() == 10);\n assertTrue(p.getQuantity() == 10);\n poolManager.refreshPools(owner);\n // double check after pools refresh\n assertTrue(p.getConsumed() == 10);\n assertTrue(p.getQuantity() == 10);\n }\n // system consume from the physical pool and then check bonus pool quantities.\n // Should result in no change in the entitlements for the guest.\n consumerResource.bind(systemConsumer.getUuid(), parentPool.getId(), null, 1, null,\n null, false, null);\n for (Pool p : subscribedTo) {\n assertTrue(p.getConsumed() == 10);\n assertTrue(p.getQuantity() == 10);\n poolManager.refreshPools(owner);\n // double check after pools refresh\n assertTrue(p.getConsumed() == 10);\n assertTrue(p.getQuantity() == 10);\n }\n }",
"@Override\n public LinkedList<ServerNode> getServerRing() {\n\n List<ServerNode> originalNodes = mapper.findAllEffectiveNodes();\n LinkedList<ServerNode> nodes;\n int tryCount = 3;\n try {\n nodes = buildRing(originalNodes);\n } catch (Exception e) {\n try{\n while(!acquireLock()){\n Thread.sleep(10);\n tryCount --;\n if(tryCount < 0){\n throw new HeartbeatException(\"Acquire lock timeout!\");\n }\n }\n nodes = rebuildRing();\n }\n catch (Throwable t){\n LOG.error(t.getMessage());\n throw new HeartbeatException(t);\n }\n finally{\n releaseLock();\n }\n }\n return nodes;\n }",
"public void balance(int arg1)\n \n {\n \tint sum=0;\n int s;\n int i=0;\n response=RestAssured.get(\"http://18.222.188.206:3333/accounts\");\n Bala=response.jsonPath().getList(\"Balance\");\n while(i<=Bala.size())\n {\n try\n {\n if(Bala.get(i)!=null)\n {\n s=Integer.parseInt(Bala.get(i));\n if(s>arg1)\n {\n sum++;\n }\n }\n }\n catch(Exception e)\n {\n \n }\n i++;\n \n }\n System.out.println(\"The number of accounts with balance 200000= \"+sum);\n }",
"public int getCurrentCpuFailoverResourcesPercent() {\r\n return currentCpuFailoverResourcesPercent;\r\n }",
"public void receiveResultloadBalancer(\n loadbalance.LoadBalanceStub.LoadBalancerResponse result\n ) {\n }",
"int getMinPoolSize();",
"public int getCurrentMemoryFailoverResourcesPercent() {\r\n return currentMemoryFailoverResourcesPercent;\r\n }",
"FailoverShardResult failoverShard(FailoverShardRequest failoverShardRequest);",
"public void createLBPolicy2(){\n\n\t\tIterator<ASServer> itm = manager.getASServers().values().iterator();\n\t\t\n\t\twhile(itm.hasNext()){\n\t\t\t\n\t\t\tASServer as = itm.next();\n\t\t\tAppServerPolicy ap = as.currentPolicy;\n\t\t\tIterator<ObjectKey> ik = ap.policyMap.keySet().iterator();\n\t\t\t\n\t\t\twhile(ik.hasNext()){\n\t\t\t\t\n\t\t\t\tObjectKey ot = ik.next();\n\t\t\t\t\n\t\t\t\tif(ot instanceof ListKey){\n\t\t\t\t\tListKey tlk = (ListKey) ot;\n\t\t\t\t\tString t = tlk.key;\n\t\t\t\t\t//System.out.println(\"Checking for mapping of :\" + t);\n\t\t\t\t\t\n\t\t\t\t\tif(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(t) == null){\n\t\t\t\t\t\t//System.out.println(\"Mapping Map is NULL\");\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tArrayList<String> test = new ArrayList<String>(((ResourceToRequestMap) as.getStruct((String)RequestResourceMappingLogProcessor.OBJ_REQ_MAP)).map.get(t));\n\t\t\t\t\t\n\t\t\t\t\tIterator<String> itemp = test.iterator();\n\t\t\t\t\t\n\t\t\t\t\twhile(itemp.hasNext()){\n\t\t\t\t\t\n\t\t\t\t\t\tString url = itemp.next();\n\t\t\t\t\t\t\n\t\t\t\t\t\tint[] sc = LBPCreatorMap.get(url);\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(sc == null){\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsc = new int[NO_SERVERS];\n\t\t\t\t\t\t\tsc[as.serverNo]++;\n\t\t\t\t\t\t\tLBPCreatorMap.put(url, sc);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tsc[as.serverNo]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tIterator<String> iturl = LBPCreatorMap.keySet().iterator();\n\t\t\n\t\twhile(iturl.hasNext()){\n\t\t\t\n\t\t\tString url = iturl.next();\n\t\t\t\n\t\t\tint[] sc = LBPCreatorMap.get(url);\n\t\t\t\n\t\t\tint size = sc.length;\n\t\t\tint maxtemp=0;\n\t\t\tint maxindex=0;\n\t\t\tint val;\n\t\t\t\n\t\t\t\n\t\t\tfor(int i=0; i< size; i++){\n\t\t\t\t\n\t\t\t\tval = sc[i];\n\t\t\t\tif(val > maxtemp)\n\t\t\t\t{\n\t\t\t\t\tmaxtemp = val;\n\t\t\t\t\tmaxindex = i;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tString xyz = manager.getASServer(maxindex).serverId;\n\t\t\tthis.currentLBPolicy.mapUrlToServers(url, Analyser.resolveHost(xyz));\n\t\t\t\n\t\t\t\n//\t\t\tif(mLogger.isInfoEnabled()){\n//\t\t\t\tmLogger.log(Priority.INFO, \":\" + url + \": being assigned to: \" + xyz);\n//\t\t\t}\n\t\t\t\n\t\t\tInteger sId = LBDMap.get(xyz);\n\t\t\t\n\t\t\tif(sId == null){\n\t\t\t\tsId=new Integer(1);\n\t\t\t\tLBDMap.put(xyz, sId);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tsId++;\n\t\t\t\tLBDMap.put(xyz, sId);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n//\t\tSystem.out.println(\"------------URL ServerCounter start---------------\");\n//\t\t\n//\t\tIterator<String> ilbp = LBPCreatorMap.keySet().iterator();\n//\t\t\n//\t\twhile(ilbp.hasNext()){\n//\t\t\t\n//\t\t\tString url = ilbp.next();\n//\t\t\tint[] pi = LBPCreatorMap.get(url);\n//\t\t\tSystem.out.println(\"url is:\" + url);\n//\t\t\tfor(int i=0; i< pi.length; i++){\n//\t\t\t\tSystem.out.print(\"Site:\"+ i + \":\" + pi[i]);\n//\t\t\t}\n//\t\t}\n//\t\t\n////\t\t//System.out.println(\"Number of entries corresponding to LBPolicy for localhost are: \" + currentLBPolicy.policyMap.values().size() );\n//\t\n//\t\tSystem.out.println(\"------------URL ServerCounter end-----------------\");\n\t\t\n\t\tSystem.out.println(\"------------LBPolicy start---------------\");\n//\t\tSystem.out.println(currentLBPolicy);\n//\t\t\n//\t\tSystem.out.println(\"Number of entries in LBPolicy are: \" + currentLBPolicy.policyMap.size() );\n\t\t\n\t\tIterator<String> itlb = LBDMap.keySet().iterator();\n\t\t\n\t\twhile(itlb.hasNext()){\n\t\t\tString serid = itlb.next();\n\t\t\t\n\t\t\tSystem.out.println(\"Server:\" + serid + \" has been allocated: \" + LBDMap.get(serid) + \" objects\");\n\t\t}\n\t\t\n//\t\n\t\tSystem.out.println(\"------------LBPolicy end-----------------\");\n\t\n\n\t\t\n\t}",
"boolean isNeedSharding();",
"boolean isNodeBulkLoadEnabled();",
"private int spreadWriteRequests() {\n return RANDOM.nextInt(MAX_SLEEP_TIME);\n }",
"public void receiveResultminload(\n loadbalance.LoadBalanceStub.MinloadResponse result\n ) {\n }",
"int getServerWorkIterations();",
"public void receiveResultloadBal(\n loadbalance.LoadBalanceStub.LoadBalResponse result\n ) {\n }",
"void executeWithinLocks(Consumer<MoneyTransferRequest> consumer, MoneyTransferRequest request);",
"private void redistribute() throws SQLException {\n List<Integer> workerIds = new ArrayList<>();\n List<Integer> queueSize = new ArrayList<>();\n int totalTasks = 0;\n\n try (ResultSet rs = getQueueDistribution.executeQuery()) {\n while (rs.next()) {\n int workerId = rs.getInt(1);\n int numTasks = rs.getInt(2);\n workerIds.add(workerId);\n queueSize.add(numTasks);\n LOG.debug(\"workerId: ({}) numTasks: ({})\", workerId, numTasks);\n totalTasks += numTasks;\n }\n }\n if (workerIds.size() == 0) {\n return;\n }\n int averagePerWorker = Math.round((float) totalTasks / (float) workerIds.size());\n int midPoint = Math.round((float) queueSize.size() / 2) + 1;\n for (int i = queueSize.size() - 1, j = 0; i > midPoint && j < midPoint; i--, j++) {\n int shortestQueue = queueSize.get(i);\n int longestQueue = queueSize.get(j);\n if ((shortestQueue < 5 && longestQueue > 5) ||\n longestQueue > 5 && longestQueue > (int) (1.5 * averagePerWorker)) {\n int shortestQueueWorker = workerIds.get(i);\n int longestQueueWorker = workerIds.get(j);\n reallocate.clearParameters();\n reallocate.setLong(1, shortestQueueWorker);\n reallocate.setLong(2, longestQueueWorker);\n reallocate.execute();\n }\n }\n\n }",
"public boolean isPrefetch ();",
"@SuppressWarnings(\"BooleanMethodIsAlwaysInverted\")\n protected boolean acquireCapacity(Limit endpointReserve, Limit globalReserve, int bytes, long currentTimeNanos, long expiresAtNanos)\n {\n ResourceLimits.Outcome outcome = acquireCapacity(endpointReserve, globalReserve, bytes);\n\n if (outcome == ResourceLimits.Outcome.INSUFFICIENT_ENDPOINT)\n ticket = endpointWaitQueue.register(this, bytes, currentTimeNanos, expiresAtNanos);\n else if (outcome == ResourceLimits.Outcome.INSUFFICIENT_GLOBAL)\n ticket = globalWaitQueue.register(this, bytes, currentTimeNanos, expiresAtNanos);\n\n if (outcome != ResourceLimits.Outcome.SUCCESS)\n throttledCount++;\n\n return outcome == ResourceLimits.Outcome.SUCCESS;\n }",
"@Override\n protected int minimumNumberOfShards() {\n return 2;\n }",
"@Override\n protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {\n Invoker<T> balancedInvoker = select(loadbalance, invocation, invokers, null);\n if (balancedInvoker.isAvailable()) {\n return balancedInvoker.invoke(invocation);\n }\n\n // If none of the invokers has a preferred signal or is picked by the loadbalancer, pick the first one available.\n for (Invoker<T> invoker : invokers) {\n ClusterInvoker<T> clusterInvoker = (ClusterInvoker<T>) invoker;\n if (clusterInvoker.isAvailable()) {\n return clusterInvoker.invoke(invocation);\n }\n }\n //if none available,just pick one\n return invokers.get(0).invoke(invocation);\n }",
"public float getLoad(){\n\t\treturn 1.0f*size/capacity;\n\t}",
"public int getPassivePoolSize(){return passivePoolSize;}",
"@Override\n public long getCost(Client client) throws HederaStatusException, HederaNetworkException {\n return Math.max(super.getCost(client), 25);\n }",
"public Map<ByteBuffer, List<ColumnOrSuperColumn>> forced_2round_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice(allKeys = {}, column_parent = {}, predicate = {})\", new Object[]{printKeys(allKeys), column_parent, predicate});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Always Execute 2nd round for micro-benchmarking\n if (true) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n secondRoundKeys.addAll(allKeys);\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n keyToResult.putAll(result.getValue());\n }\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"forced_2round_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n PrintWriter pw= response.getWriter();\n String text = request.getParameter(\"alldata\");\n response.setContentType(\"application/json\"); // Set content type of the response so that jQuery knows what it can expect.\n response.setCharacterEncoding(\"UTF-8\"); // You want world domination, huh? \n String [] JSONdataALL = text.split(\"#\");\n\n int dataLakeGaneshaNo[] = ParsingJsonAll.readJsonNoGaneshaNoLake(JSONdataALL[0], pw);\n \n\n Ganesha[] gan = ParsingJsonAll.readJsonGaneshaLanLon(JSONdataALL[3],pw);\n \n Lake[] lak = ParsingJsonAll.readJsonLankLanLon(JSONdataALL[4],pw);\n \n int noofganesha = dataLakeGaneshaNo[0];\n int nooflakes = dataLakeGaneshaNo[1];\n \n //With or without algorithm?\n //a. With using optimisation algorithm\n //b. Without using optimisation algorithm \n char ch = 'b';\n \n //What Logic for Balancing you want to apply?\n //0. No Balancing\n //1. Min Distance Difference\n //2. Min Distance form minlakeclustercount\n int logic = 0;\n \n \n pw.write(\"Count of: Ganeshas: \"+noofganesha+\"\\tLakes: \"+nooflakes+\"\\n\");\n \n GaneshaLakeId[] gla = new GaneshaLakeId[noofganesha];\n \n GaneshaLakeDist[] gla1=ParsingJsonAll.readJsonGaneshaLakeDist(JSONdataALL[1],pw);\n pw.println(\"Lake Ganesha Dist\");\n for(GaneshaLakeDist gl:gla1){\n response.getWriter().write(gl.lake+\"\\t\"+gl.ganesha+'\\t'+gl.distance+\"\\n\");\n }\n for (int i = 0; i < noofganesha; i++){\n int min = Integer.MAX_VALUE;\n int j = i;\n int lakeId = 0;\n while(j<gla1.length){\n if(min > gla1[j].distance){\n min = gla1[j].distance;\n lakeId = gla1[j].lake;\n }\n j = j + noofganesha;\n }\n GaneshaLakeId glag = new GaneshaLakeId();\n glag.lakeId = lakeId;\n glag.ganesha = i;\n gla[i] = glag;\n }\n \n pw.println(\"Ganesha Before Lake ID\");\n for(GaneshaLakeId gl1:gla){\n response.getWriter().write(gl1.ganesha+\"\\t\"+gl1.lakeId+\"\\n\");\n }\n \n //Balancing Logic Call\n switch(logic){\n case 1:\n //Balancing Logic1\n balancing1(gla,gla1,nooflakes,noofganesha,pw);\n break;\n case 2:\n //Balancing Logic2\n balancing2(gla,gla1,nooflakes,noofganesha,pw);\n break;\n }\n \n GaneshaGaneshaDist[] gla2=ParsingJsonAll.readJsonGaneshaGaneshaDist(JSONdataALL[2],pw);\n pw.println(\"Ganesha Ganesha Dist\");\n for(GaneshaGaneshaDist gl12:gla2)\n response.getWriter().write(gl12.ganesha1+\"\\t\"+gl12.ganesha2+\"\\t\"+gl12.distance+\"\\n\");\n pw.println(\"\\nThe Route is given as: \\n\");\n double[][] resultLatLon=null;\n switch(ch){\n case 'a':\n resultLatLon = makeMSTDouble(gla,gla1,gla2,noofganesha,nooflakes,gan, lak,pw);\n break;\n case 'b':\n resultLatLon = makeWithoutAny(gla,gla1,gla2,noofganesha,nooflakes,gan, lak,pw);\n break;\n }\n for(int i=0;i<(int)resultLatLon[0][0];i++){\n pw.println(resultLatLon[i][0]+\", \"+resultLatLon[i][1]+\", \"+resultLatLon[i][2]+\", \"+resultLatLon[i][3]+\", \"+resultLatLon[i][4]);\n }\n request.setAttribute(\"resultLanLon\", resultLatLon);\n request.getRequestDispatcher(\"displayroute.jsp\").forward(request, response);\n \n }",
"private BytesReference cacheShardLevelResult(\n IndexShard shard,\n DirectoryReader reader,\n BytesReference cacheKey,\n CheckedConsumer<StreamOutput, IOException> loader\n ) throws Exception {\n IndexShardCacheEntity cacheEntity = new IndexShardCacheEntity(shard);\n CheckedSupplier<BytesReference, IOException> supplier = () -> {\n /* BytesStreamOutput allows to pass the expected size but by default uses\n * BigArrays.PAGE_SIZE_IN_BYTES which is 16k. A common cached result ie.\n * a date histogram with 3 buckets is ~100byte so 16k might be very wasteful\n * since we don't shrink to the actual size once we are done serializing.\n * By passing 512 as the expected size we will resize the byte array in the stream\n * slowly until we hit the page size and don't waste too much memory for small query\n * results.*/\n final int expectedSizeInBytes = 512;\n try (BytesStreamOutput out = new BytesStreamOutput(expectedSizeInBytes)) {\n loader.accept(out);\n // for now, keep the paged data structure, which might have unused bytes to fill a page, but better to keep\n // the memory properly paged instead of having varied sized bytes\n return out.bytes();\n }\n };\n return indicesRequestCache.getOrCompute(cacheEntity, supplier, reader, cacheKey);\n }",
"@Override\n public int getTraversalRate() {\n return load;\n }",
"boolean supportsParallelLoad();",
"public abstract boolean isBalanced();",
"public ServersHT() {\n table = new ServerDescEntry[initialCapacity];\n threshold = (int)(initialCapacity * loadFactor);\n }",
"@Test (timeout=180000)\n public void testHbckThreadpooling() throws Exception {\n TableName table =\n TableName.valueOf(\"tableDupeStartKey\");\n try {\n // Create table with 4 regions\n setupTable(table);\n\n // limit number of threads to 1.\n Configuration newconf = new Configuration(conf);\n newconf.setInt(\"hbasefsck.numthreads\", 1);\n assertNoErrors(doFsck(newconf, false));\n\n // We should pass without triggering a RejectedExecutionException\n } finally {\n cleanupTable(table);\n }\n }",
"public interface loadBalanceRoutingService {\n Set<Path> getLoadPaths(Topology topo, ElementId src, ElementId dst);\n Set<Path> getLoadPaths(ElementId src, ElementId dst);\n}",
"private boolean queueFirstServerIfDown(List<URI> allServers) {\n if (allServers.size() < 2) {\n return false;\n }\n URI uri = allServers.get(0);\n HttpGet httpGet = new HttpGet(uri);\n\n RequestConfig config = RequestConfig.custom()\n .setConnectTimeout((int) PING_REQUEST_TIMEOUT.toMillis())\n .setConnectionRequestTimeout((int) PING_REQUEST_TIMEOUT.toMillis())\n .setSocketTimeout((int) PING_REQUEST_TIMEOUT.toMillis()).build();\n httpGet.setConfig(config);\n\n try (CloseableHttpResponse response = client.execute(httpGet)) {\n if (response.getStatusLine().getStatusCode() == 200) {\n return false;\n }\n\n } catch (IOException e) {\n // We ignore this, if server is restarting this might happen.\n }\n // Some error happened, move this server to the back. The other servers should be running.\n Collections.rotate(allServers, -1);\n return true;\n }",
"private void getLargeOrderList(){\n sendPacket(CustomerTableAccess.getConnection().getLargeOrderList());\n \n }",
"@GetMapping(\"/balance/{id}\")\n public Integer getBalance(@PathVariable(\"id\") String id){\n System.out.println(id);\n\n HashMap<Integer,Integer> dataStore = new HashMap<>();\n dataStore.put(1,10);\n dataStore.put(2,20);\n\n return dataStore.get(Integer.parseInt(id));\n }",
"@Test\n public void testGIIFromSecondaryWhenDSMDetectsServerLive() throws Exception {\n server1.invoke(HAInterestTestCase::closeCache);\n server2.invoke(HAInterestTestCase::closeCache);\n server3.invoke(HAInterestTestCase::closeCache);\n\n PORT1 = server1.invoke(HAInterestTestCase::createServerCacheWithLocalRegion);\n PORT2 = server2.invoke(HAInterestTestCase::createServerCacheWithLocalRegion);\n PORT3 = server3.invoke(HAInterestTestCase::createServerCacheWithLocalRegion);\n\n server1.invoke(HAInterestTestCase::createEntriesK1andK2);\n server2.invoke(HAInterestTestCase::createEntriesK1andK2);\n server3.invoke(HAInterestTestCase::createEntriesK1andK2);\n\n createClientPoolCache(getName(), NetworkUtils.getServerHostName(server1.getHost()));\n\n VM backup1 = getBackupVM();\n VM backup2 = getBackupVM(backup1);\n backup1.invoke(HAInterestTestCase::stopServer);\n backup2.invoke(HAInterestTestCase::stopServer);\n verifyDeadAndLiveServers(2, 1);\n registerK1AndK2();\n verifyRefreshedEntriesFromServer();\n backup1.invoke(HAInterestTestCase::putK1andK2);\n backup1.invoke(HAInterestTestCase::startServer);\n verifyDeadAndLiveServers(1, 2);\n verifyRefreshedEntriesFromServer();\n }",
"public static void main(String[] args) throws InterruptedException, IOException, ClassNotFoundException {\n\t\tbyte[] id = new byte[160];\r\n\t\tif (args[0].equals(\"bootstraper\")) {\r\n\t\t\tfor (int i = 0; i < id.length; i++)\r\n\t\t\t\tid[i] = 0;\r\n\t\t\tint port = Integer.parseInt(args[1]);\r\n\t\t\tNode n = new Node(id, port);\r\n\t\t\tRouting.initialize(n);\r\n//\t\t\tbyte[] bid = new byte[160];\r\n//\t\t\tfor (int i = 0; i < 160; i++)\r\n//\t\t\t\tbid[i] = 0;\r\n//\t\t\tbid[159] = 1;\r\n//\t\t\tRouting.insert(b);\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tbyte[] bid = new byte[160];\r\n\t\t\tfor (int i = 0; i < id.length; i++)\r\n\t\t\t\tbid[i] = 0;\r\n\t\t\tfor (int i = 0; i < id.length; i++)\r\n\t\t\t{\r\n\t\t\t\t\tid[i] = 0;\r\n\t\t\t}\r\n\t\t\tid[2] = 1;\r\n\t\t\tint port = Integer.parseInt(args[0]);\r\n\t\t\tmyPort = port;\r\n\t\t\tNode n = new Node(id, port);\r\n\t\t\tRouting.initialize(n);\r\n\t\t\tNode b = new Node(bid, InetAddress.getByName(args[1]), Integer.parseInt(args[2]));\r\n\t\t\tRouting.insert(b);\r\n\r\n\t\t\tPing p = new Ping(bid, b.getIP(), b.getPort());\r\n\t\t\tThread t = new Thread(p);\r\n\t\t\tt.start();\r\n\t\t}\r\n\r\n\t\tbyte[] id1 = new byte[160];\r\n\t\tfor (int i = 0; i < id1.length; i++)\r\n\t\t\tid1[i] = 0;\r\n\t\tid1[159]=1;\r\n\t\t\r\n\t\tbyte[] id2 = new byte[160];\r\n\t\tfor (int i = 0; i < id1.length; i++)\r\n\t\t\tid2[i] = 0;\r\n\r\n\t\tid2[158]=1;\r\n\t\t\r\n\t\tbyte[] id3 = new byte[160];\r\n\t\tfor (int i = 0; i < id1.length; i++)\r\n\t\t\tid3[i] = 0;\r\n\r\n\t\tid3[158]=1;\r\n\t\tid3[159]=1;\r\n\t\t\r\n\t\tbyte[] id4 = new byte[160];\r\n\t\tfor (int i = 0; i < id1.length; i++)\r\n\t\t\tid4[i] = 0;\r\n\r\n\t\tid4[157]=1;\r\n\t\t\r\n\t\tbyte[] id5= new byte[160];\r\n\t\tfor (int i = 0; i < id1.length; i++)\r\n\t\t\tid5[i] = 0;\r\n\r\n\t\tid5[157]=1;\r\n\t\tid5[159]=1;\r\n\t\t\r\n\t\tNode n1 = new Node(id1, InetAddress.getByName(\"192.168.2.134\"), 8000);\r\n\t\tNode n2 = new Node(id2, InetAddress.getByName(\"192.168.2.146\"), 8000);\r\n\t\tNode n4 = new Node(id4, InetAddress.getByName(\"192.168.34.154\"), 8000);\r\n\t\tNode n3 = new Node(id3, InetAddress.getByName(\"192.168.34.146\"), 8000);\r\n\t\tNode n5 = new Node(id5, InetAddress.getByName(\"192.168.34.147\"), 8000);\r\n\t\t\r\n\r\n\t\tRouting.insert(n1);\r\n//\t\tRouting.insert(n2);\r\n//\t\tRouting.insert(n4);\r\n//\t\tRouting.insert(n3);\r\n//\t\tRouting.insert(n5);\r\n\t\t\r\n\t\tReceivingThread thread;\r\n\t\tif (args[0].equals(\"bootstraper\"))\r\n\t\t\tthread = new ReceivingThread(Integer.parseInt(args[1]));\r\n\t\telse\r\n\t\t\tthread = new ReceivingThread(Integer.parseInt(args[0]));\r\n\t\tThread real = new Thread(thread);\r\n\t\treal.start();\r\n\t\t//\r\n\t\tTextInterface.main(null);\r\n\r\n\t}",
"boolean shouldRebalance() {\n if (ThreadLocalRandom.current().nextInt(100) > REBALANCE_PROB_PERC) {\n return false;\n }\n\n // if another thread already runs rebalance -- skip it\n if (!isEngaged(null)) {\n return false;\n }\n int numOfEntries = entryIndex.get() / FIELDS;\n int numOfItems = statistics.getCompactedCount();\n int sortedCount = this.sortedCount.get();\n // Reasons for executing a rebalance:\n // 1. There are no sorted keys and the total number of entries is above a certain threshold.\n // 2. There are sorted keys, but the total number of unsorted keys is too big.\n // 3. Out of the occupied entries, there are not enough actual items.\n return (sortedCount == 0 && numOfEntries * MAX_ENTRIES_FACTOR > maxItems) ||\n (sortedCount > 0 && (sortedCount * SORTED_REBALANCE_RATIO) < numOfEntries) ||\n (numOfEntries * MAX_IDLE_ENTRIES_FACTOR > maxItems && numOfItems * MAX_IDLE_ENTRIES_FACTOR < numOfEntries);\n }",
"private void initiatePreElection() {\n\t\tpreElectionInProgress = true;\n\t\tbackupHeartbeatTimer.cancel();\n\t\tif (reElectionTimer != null) {\n\t\t\treElectionTimer.cancel();\n\t\t}\n\t\tif (backupHeartbeatBroadcaster != null) {\n\t\t\tbackupHeartbeatBroadcaster.cancel();\n\t\t}\n\t\t// Broadcast election ordinality and reset isElectedFlag for all nodes\n\t\tfor (RemoteLoadBalancer remoteLoadBalancer : remoteLoadBalancers) {\n\t\t\tif (remoteLoadBalancer.isConnected() && remoteLoadBalancer.getState().equals(LoadBalancerState.PASSIVE)) {\n\t\t\t\tByteBuffer buffer = ByteBuffer.allocate(9);\n\t\t\t\tbuffer.put((byte) MessageType.ELECTION_MESSAGE.getValue());\n\t\t\t\tbuffer.putDouble(averageServerLatency);\t\n\t\t\t\tbuffer.flip();\n\t\t\t\ttry {\n\t\t\t\t\twhile (buffer.hasRemaining()) {\n\t\t\t\t\t\tremoteLoadBalancer.getSocketChannel().write(buffer);\n\t\t\t\t\t}\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t}\n\t\t\t}\n\t\t\tremoteLoadBalancer.setIsElectedBackup(false);\n\t\t}\n\n\t\t// TimerTask created that will determine the election results after the\n\t\t// timeout occurs.\n\t\tTimerTask timerTask = new TimerTask() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tRemoteLoadBalancer lowestLatencyCandidate = null;\n\t\t\t\tfor (RemoteLoadBalancer remoteLoadBalancer : remoteLoadBalancers) {\n\t\t\t\t\tif (remoteLoadBalancer.getState().equals(LoadBalancerState.PASSIVE)\n\t\t\t\t\t\t\t&& remoteLoadBalancer.getCandidacyValue() != null) {\n\t\t\t\t\t\tif (lowestLatencyCandidate == null\n\t\t\t\t\t\t\t\t&& remoteLoadBalancer.getCandidacyValue() < averageServerLatency) {\n\t\t\t\t\t\t\tlowestLatencyCandidate = remoteLoadBalancer;\n\t\t\t\t\t\t} else if (lowestLatencyCandidate != null && remoteLoadBalancer\n\t\t\t\t\t\t\t\t.getCandidacyValue() < lowestLatencyCandidate.getCandidacyValue()) {\n\t\t\t\t\t\t\tlowestLatencyCandidate = remoteLoadBalancer;\n\t\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Didn't get a lowest latency election message so assume this\n\t\t\t\t// load balancer is now the backup\n\t\t\t\tif (lowestLatencyCandidate == null) {\n\t\t\t\t\tbackupHeartbeatTimer.cancel();\n\t\t\t\t\tisElectedBackup = true;\n\t\t\t\t\tbackupHeartbeatBroadcaster = new HeartbeatBroadcaster(remoteLoadBalancers, backupHeartbeatIntervalMillis,\n\t\t\t\t\t\t\tLoadBalancerState.PASSIVE);\n\t\t\t\t\tnew Thread(backupHeartbeatBroadcaster).start();\n\t\t\t\t\t\n\t\t\t\t\t// Start timer for next pre-election\n\t\t\t\t\tstartReElectionTimer();\n\t\t\t\t\t\n\t\t\t\t\tComponentLogger.getInstance().log(LogMessageType.LOAD_BALANCER_ELECTED_AS_BACKUP);\n\t\t\t\t\tSystem.out.println(\"Elected as backup\");\n\t\t\t\t} else {\n\t\t\t\t\tlowestLatencyCandidate.setIsElectedBackup(true);\n\t\t\t\t\tisElectedBackup = false;\n\t\t\t\t\tresetBackupHeartbeatTimer();\n\t\t\t\t\tSystem.out.println(\"Election winner:\" + lowestLatencyCandidate.getAddress().getHostString());\n\t\t\t\t}\n\n\t\t\t\t// Clear candidacy values for future elections\n\t\t\t\tfor (RemoteLoadBalancer remoteLoadBalancer : remoteLoadBalancers) {\n\t\t\t\t\tremoteLoadBalancer.setCandidacyValue(null);\n\t\t\t\t}\n\t\t\t\tpreElectionInProgress = false;\n\t\t\t}\n\t\t};\n\n\t\tpreElectionTimeoutTimer = new Timer();\n\t\tpreElectionTimeoutTimer.schedule(timerTask, defaultTimeoutMillis);\n\t}",
"Energy getMaxLoad();",
"public int calculateShard(Integer userId) {\n\t\ttry {\n\t\t\twhile(this.updating) {\n\t\t\t\tthis.wait();\n\t\t\t}\n\t\t\treturn this.calculateShard(userId, this.numServers);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn Integer.MIN_VALUE;\n\t}",
"protected static List<ServerInfo> computeLossesStepServer(Algo algo) {\n\t\t\n\t\t//final int numTotal = algo.problem.V;\n\t\t//final AtomicInteger processed = new AtomicInteger();\n\t\tExecutorService executor = Executors.newFixedThreadPool(Manu.NUM_THREADS); \n\t\t\n\t\tfinal List<ServerInfo> serverInfos = new ArrayList<ServerInfo>();\n\t\tfor(CacheServer cs : algo.servers) {\n\t\t\tif(cs.getSpaceTaken() > algo.problem.X) {\n\t\t\t\tServerInfo si = new ServerInfo(cs);\n\t\t\t\tserverInfos.add(si);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t// Spawn threads\n\t\tfor(final ServerInfo serverInfo : serverInfos) {\n\t\t\texecutor.execute(new Runnable(){\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\t//int numProcessed = processed.incrementAndGet();\n\t\t\t\t\t\t//if(numProcessed%100==0) logger.info(\"Computing gains \"+numProcessed+\"/\"+numTotal);\n\n\t\t\t\t\t\t// synchronized (anything) {}\n\t\t\t\t\t\t\n\t\t \t\t\tfor(int videoId : serverInfo.server.videos) {\n\t\t \t\t\t\t\n\t\t \t\t\t\tlong loss = Manu.computeLossOut(videoId, serverInfo.server, algo);\n\t\t \t\t\t\t\n\t\t \t\t\t\tfloat lossPerMegabyteFreed = loss*1f/algo.problem.videoSizes[videoId]; \n\t\t \t\t\t\t\n\t\t \t\t\t\t\n\t\t \t\t\t\tif(lossPerMegabyteFreed < serverInfo.tmpSmallestLossPerMegabyteFreed) {\n\t\t \t\t\t\t\tserverInfo.tmpBestVideoId = videoId;\n\t\t \t\t\t\t\tserverInfo.tmpSmallestLossPerMegabyteFreed = lossPerMegabyteFreed;\n\t\t \t\t\t\t\tserverInfo.tmpSmallestLoss = loss;\n\t\t \t\t\t\t}\n\t\t \t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tlogger.log(Level.WARNING, \"Failure computing losses, serverId: \" + serverInfo.server.serverId, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\texecutor.shutdown();\n\t\t// Wait until all threads are finished\n\t\twhile (!executor.isTerminated()) {\n\t\t\ttry {\n\t\t\t\texecutor.awaitTermination(50, TimeUnit.MILLISECONDS);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t}\n\t\t}\n\t\t//logger.log(Level.INFO, \"Finished multithreaded comoutation of gains.\");\n\t\t\n\t\tCollections.sort(serverInfos, new Comparator<ServerInfo>() {\n\t\t public int compare(ServerInfo a, ServerInfo b) {\n\t\t \treturn Long.compare(a.tmpSmallestLoss, b.tmpSmallestLoss);\n\t\t \t//return Double.compare(a.tmpSmallestLossPerMegabyteFreed, b.tmpSmallestLossPerMegabyteFreed);\n\t\t }\n\t\t});\n\t\t\n\t\treturn serverInfos;\n\t}",
"@Override\n public RateLimiter load(String token) {\n Map<String, Integer> customizeTenantQpsRate = trafficConfiguration.getCustomizeTenantQpsRate();\n int tenantQuota = trafficConfiguration.getDefaultTenantQpsRate();\n if (MapUtils.isNotEmpty(customizeTenantQpsRate)) {\n tenantQuota = customizeTenantQpsRate.getOrDefault(token, trafficConfiguration.getDefaultTenantQpsRate());\n }\n // use tenant default rate limit\n return RateLimiter.create(tenantQuota, 1, TimeUnit.SECONDS);\n }",
"Future<ListLoadBalancersResponse> listLoadBalancers(\n ListLoadBalancersRequest request,\n AsyncHandler<ListLoadBalancersRequest, ListLoadBalancersResponse> handler);",
"private double getLoadFactor() {\r\n\t\t\treturn numberOfElements / (double) currentCapacity;\r\n\t\t}",
"int getMaxPoolSize();",
"protected void ensureResultsAreFetched(int last) {\n\t\twhile(last > cacheStatus) {\n\t\t\tfetchNextBlock();\n\t\t}\n\t}",
"public void run(){\n\t\t\t\t\t\tif(consistency.equals(\"strong\")){\r\n\t\t\t\t\t\t\tcheckPosition(key, timestamp);\r\n\t\t\t\t\t\t\t//If it's not strong consistency, check if the new timestamp is greater than the last written\r\n\t\t\t\t\t\t\t//timestamp. If it's not, then don't do anything.\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!latestTimeHashMap.containsKey(key)){\r\n\t\t\t\t\t\t\t\tlatestTimeHashMap.put(key, timestamp);\r\n\t\t\t\t\t\t\t}else if(timestamp > latestTimeHashMap.get(key)){\r\n\t\t\t\t\t\t\t\tlatestTimeHashMap.put(key, timestamp);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Check the ConcurrentHashMap to see if the key is already in there. Replace if true, otherwise\r\n\t\t\t\t\t\t//Add key and value\r\n\t\t\t\t\t\tif(dataHashMap.containsKey(key)){\r\n\t\t\t\t\t\t\tdataHashMap.replace(key, value);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tdataHashMap.putIfAbsent(key, value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//if(consistency.equals(\"strong\")){\r\n\t\t\t\t\t\t\tString response = \"stored\";\r\n\t\t\t\t\t\t\treq.response().putHeader(\"Content-Type\", \"text/plain\");\r\n\t\t\t\t\t\t\treq.response().putHeader(\"Content-Length\",\r\n\t\t\t\t\t\t\t\t\tString.valueOf(response.length()));\r\n\t\t\t\t\t\t\treq.response().end(response);\r\n\t\t\t\t\t\t\treq.response().close();\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t}",
"private void readPools(String bucketToFind) throws ConfigurationException {\n // the intent with this method is to encapsulate all of the walking of URIs\n // and populating an internal object model of the configuration to one place\n for (URI baseUri : baseList) {\n try {\n // get and parse the response from the current base uri\n URLConnection baseConnection = urlConnBuilder(null, baseUri);\n String base = readToString(baseConnection);\n if (\"\".equals(base)) {\n getLogger().warn(\"Provided URI \" + baseUri + \" has an empty response... skipping\");\n continue;\n }\n Map<String, Pool> pools = this.configurationParser.parseBase(base);\n\n // check for the default pool name\n if (!pools.containsKey(DEFAULT_POOL_NAME)) {\n getLogger().warn(\"Provided URI \" + baseUri + \" has no default pool... skipping\");\n continue;\n }\n // load pools\n for (Pool pool : pools.values()) {\n URLConnection poolConnection = urlConnBuilder(baseUri, pool.getUri());\n String poolString = readToString(poolConnection);\n configurationParser.loadPool(pool, poolString);\n URLConnection poolBucketsConnection = urlConnBuilder(baseUri, pool.getBucketsUri());\n String sBuckets = readToString(poolBucketsConnection);\n Map<String, Bucket> bucketsForPool = configurationParser.parseBuckets(sBuckets);\n pool.replaceBuckets(bucketsForPool);\n\n }\n // did we find our bucket?\n boolean bucketFound = false;\n for (Pool pool : pools.values()) {\n if (pool.hasBucket(bucketToFind)) {\n bucketFound = true;\n\t\t\tbreak;\n }\n }\n if (bucketFound) {\n for (Pool pool : pools.values()) {\n for (Map.Entry<String, Bucket> bucketEntry : pool.getROBuckets().entrySet()) {\n this.buckets.put(bucketEntry.getKey(), bucketEntry.getValue());\n }\n }\n this.loadedBaseUri = baseUri;\n return;\n }\n } catch (ParseException e) {\n\t\tgetLogger().warn(\"Provided URI \" + baseUri + \" has an unparsable response...skipping\", e);\n\t\tcontinue;\n } catch (IOException e) {\n\t\tgetLogger().warn(\"Connection problems with URI \" + baseUri + \" ...skipping\", e);\n\t\tcontinue;\n }\n\t throw new ConfigurationException(\"Configuration for bucket \" + bucketToFind + \" was not found.\");\n }\n }",
"@SuppressWarnings(\"unchecked\")\n private void preOperation(\n Map<String, Object> req, String userId, Map<String, Integer> contentStateHolder)\n throws ParseException {\n\n SimpleDateFormat simpleDateFormat = ProjectUtil.getDateFormatter();\n simpleDateFormat.setLenient(false);\n\n Util.DbInfo dbInfo = Util.dbInfoMap.get(JsonKey.LEARNER_CONTENT_DB);\n req.put(JsonKey.ID, generatePrimaryKey(req, userId));\n contentStateHolder.put(\n (String) req.get(JsonKey.ID), ((BigInteger) req.get(JsonKey.STATUS)).intValue());\n Response response =\n cassandraOperation.getRecordById(\n dbInfo.getKeySpace(), dbInfo.getTableName(), (String) req.get(JsonKey.ID));\n\n List<Map<String, Object>> resultList =\n (List<Map<String, Object>>) response.getResult().get(JsonKey.RESPONSE);\n\n if (!(resultList.isEmpty())) {\n Map<String, Object> result = resultList.get(0);\n int currentStatus = (int) result.get(JsonKey.STATUS);\n int requestedStatus = ((BigInteger) req.get(JsonKey.STATUS)).intValue();\n\n Integer currentProgressStatus = 0;\n if (isNotNull(result.get(JsonKey.CONTENT_PROGRESS))) {\n currentProgressStatus = (Integer) result.get(JsonKey.CONTENT_PROGRESS);\n }\n if (isNotNull(req.get(JsonKey.CONTENT_PROGRESS))) {\n Integer requestedProgressStatus =\n ((BigInteger) req.get(JsonKey.CONTENT_PROGRESS)).intValue();\n if (requestedProgressStatus > currentProgressStatus) {\n req.put(JsonKey.CONTENT_PROGRESS, requestedProgressStatus);\n } else {\n req.put(JsonKey.CONTENT_PROGRESS, currentProgressStatus);\n }\n } else {\n req.put(JsonKey.CONTENT_PROGRESS, currentProgressStatus);\n }\n\n Date accessTime = parseDate(result.get(JsonKey.LAST_ACCESS_TIME), simpleDateFormat);\n Date requestAccessTime = parseDate(req.get(JsonKey.LAST_ACCESS_TIME), simpleDateFormat);\n\n Date completedDate = parseDate(result.get(JsonKey.LAST_COMPLETED_TIME), simpleDateFormat);\n Date requestCompletedTime = parseDate(req.get(JsonKey.LAST_COMPLETED_TIME), simpleDateFormat);\n\n int completedCount;\n if (!(isNullCheck(result.get(JsonKey.COMPLETED_COUNT)))) {\n completedCount = (int) result.get(JsonKey.COMPLETED_COUNT);\n } else {\n completedCount = 0;\n }\n int viewCount;\n if (!(isNullCheck(result.get(JsonKey.VIEW_COUNT)))) {\n viewCount = (int) result.get(JsonKey.VIEW_COUNT);\n } else {\n viewCount = 0;\n }\n\n if (requestedStatus >= currentStatus) {\n req.put(JsonKey.STATUS, requestedStatus);\n if (requestedStatus == 2) {\n req.put(JsonKey.COMPLETED_COUNT, completedCount + 1);\n req.put(JsonKey.LAST_COMPLETED_TIME, compareTime(completedDate, requestCompletedTime));\n } else {\n req.put(JsonKey.COMPLETED_COUNT, completedCount);\n }\n req.put(JsonKey.VIEW_COUNT, viewCount + 1);\n req.put(JsonKey.LAST_ACCESS_TIME, compareTime(accessTime, requestAccessTime));\n req.put(JsonKey.LAST_UPDATED_TIME, ProjectUtil.getFormattedDate());\n\n } else {\n req.put(JsonKey.STATUS, currentStatus);\n req.put(JsonKey.VIEW_COUNT, viewCount + 1);\n req.put(JsonKey.LAST_ACCESS_TIME, compareTime(accessTime, requestAccessTime));\n req.put(JsonKey.LAST_UPDATED_TIME, ProjectUtil.getFormattedDate());\n req.put(JsonKey.COMPLETED_COUNT, completedCount);\n }\n\n } else {\n // IT IS NEW CONTENT SIMPLY ADD IT\n Date requestCompletedTime = parseDate(req.get(JsonKey.LAST_COMPLETED_TIME), simpleDateFormat);\n if (null != req.get(JsonKey.STATUS)) {\n int requestedStatus = ((BigInteger) req.get(JsonKey.STATUS)).intValue();\n req.put(JsonKey.STATUS, requestedStatus);\n if (requestedStatus == 2) {\n req.put(JsonKey.COMPLETED_COUNT, 1);\n req.put(JsonKey.LAST_COMPLETED_TIME, compareTime(null, requestCompletedTime));\n req.put(JsonKey.COMPLETED_COUNT, 1);\n } else {\n req.put(JsonKey.COMPLETED_COUNT, 0);\n }\n\n } else {\n req.put(JsonKey.STATUS, ProjectUtil.ProgressStatus.NOT_STARTED.getValue());\n req.put(JsonKey.COMPLETED_COUNT, 0);\n }\n\n int progressStatus = 0;\n if (isNotNull(req.get(JsonKey.CONTENT_PROGRESS))) {\n progressStatus = ((BigInteger) req.get(JsonKey.CONTENT_PROGRESS)).intValue();\n }\n req.put(JsonKey.CONTENT_PROGRESS, progressStatus);\n\n req.put(JsonKey.VIEW_COUNT, 1);\n Date requestAccessTime = parseDate(req.get(JsonKey.LAST_ACCESS_TIME), simpleDateFormat);\n\n req.put(JsonKey.LAST_UPDATED_TIME, ProjectUtil.getFormattedDate());\n\n if (requestAccessTime != null) {\n req.put(JsonKey.LAST_ACCESS_TIME, (String) req.get(JsonKey.LAST_ACCESS_TIME));\n } else {\n req.put(JsonKey.LAST_ACCESS_TIME, ProjectUtil.getFormattedDate());\n }\n }\n }",
"OMMPool getPool();",
"public Map<ByteBuffer, List<ColumnOrSuperColumn>> transactional_multiget_slice(List<ByteBuffer> allKeys, ColumnParent column_parent, SlicePredicate predicate, CopsTestingConcurrentWriteHook afterFirstReadWriteHook, CopsTestingConcurrentWriteHook afterFirstRoundWriteHook)\n throws Exception\n {\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"transactional_multiget_slice(allKeys = {}, column_parent = {}, predicate = {}, afterFirstReadWriteHook = {}, afterFirstRoundWriteHook = {})\", new Object[]{printKeys(allKeys), column_parent, predicate, afterFirstReadWriteHook, afterFirstRoundWriteHook});\n //}\n //Split up into one request for each server in the local cluster\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys);\n\n //testing only logic -- ensure we can create a 2 rounds situation by sending 1st round request in at least 2 batches\n List<ByteBuffer> laterKeys = null;\n if (afterFirstReadWriteHook != null && asyncClientToFirstRoundKeys.size() == 1) {\n assert allKeys.size() > 1 : \"Must have more than 1 key to split up the first round\";\n //logger.trace(\"Splitting keys to ensure concurrent writes\");\n laterKeys = allKeys.subList(0, allKeys.size()-1);\n asyncClientToFirstRoundKeys = partitionByAsyncClients(allKeys.subList(allKeys.size()-1, allKeys.size()));\n }\n if (afterFirstReadWriteHook != null || afterFirstRoundWriteHook != null) {\n assert clientContext.getDeps().size() == 0 : \"you must clear the clientContext before you use these testing hooks\";\n }\n\n //Send Round 1 Requests\n Queue<BlockingQueueCallback<multiget_slice_call>> firstRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_call>>();\n boolean firstIteration = true;\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToFirstRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_call> callback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n asyncClient.multiget_slice(keysForThisClient, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), callback);\n\n //testing purposes only\n if (firstIteration) {\n if (afterFirstReadWriteHook != null) {\n //busywait on allowing the first read to finish AND update LamportClock\n while (true) {\n multiget_slice_call response = callback.peekResponse();\n if (response != null) {\n LamportClock.updateTime(response.getResult().lts);\n break;\n }\n }\n\n //logger.trace(\"Issuing afterFirstRead writes during round 1\");\n afterFirstReadWriteHook.issueWrites();\n clientContext.clearDeps();\n\n if (laterKeys != null) {\n BlockingQueueCallback<multiget_slice_call> laterCallback = new BlockingQueueCallback<multiget_slice_call>();\n firstRoundCallbacks.add(laterCallback);\n\n //logger.trace(\"round 1': get \" + printKeys(laterKeys) + \" from \" + asyncClient);\n asyncClient.multiget_slice(laterKeys, column_parent, predicate, consistencyLevel, LamportClock.sendTimestamp(), laterCallback);\n }\n }\n firstIteration = false;\n }\n }\n\n //testing purposes only\n if (afterFirstRoundWriteHook != null) {\n //busywait on allowing all the first reads to finish AND update LamportClock\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n while (true) {\n multiget_slice_call response = callback.peekResponse();\n if (response != null) {\n LamportClock.updateTime(response.getResult().lts);\n break;\n }\n }\n }\n\n //logger.trace(\"Issuing afterFirstRound writes between rounds\");\n afterFirstRoundWriteHook.issueWrites();\n clientContext.clearDeps();\n }\n\n //Gather responses, track both max_evt and min_lvt\n long overallMaxEvt = Long.MIN_VALUE;\n long overallMinLvt = Long.MAX_VALUE;\n\n Map<ByteBuffer, List<ColumnOrSuperColumn>> keyToResult = new HashMap<ByteBuffer, List<ColumnOrSuperColumn>>();\n NavigableMap<Long, List<ByteBuffer>> lvtToKeys = new TreeMap<Long, List<ByteBuffer>>();\n for (BlockingQueueCallback<multiget_slice_call> callback : firstRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n keyToResult.put(key, coscList);\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 1 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n }\n //if (logger.isTraceEnabled()) { logger.trace(\"Min LVT:\" + overallMinLvt + \" Max EVT: \" + overallMaxEvt); }\n\n //Execute 2nd round if necessary\n if (overallMinLvt < overallMaxEvt) {\n //get the smallest lvt > maxEvt\n long chosenTime = lvtToKeys.navigableKeySet().higher(overallMaxEvt);\n\n List<ByteBuffer> secondRoundKeys = new LinkedList<ByteBuffer>();\n for (List<ByteBuffer> keyList : lvtToKeys.headMap(chosenTime).values()) {\n secondRoundKeys.addAll(keyList);\n }\n\n //Send Round 2 Requests\n Map<Cassandra.AsyncClient, List<ByteBuffer>> asyncClientToSecondRoundKeys = partitionByAsyncClients(secondRoundKeys);\n Queue<BlockingQueueCallback<multiget_slice_by_time_call>> secondRoundCallbacks = new LinkedList<BlockingQueueCallback<multiget_slice_by_time_call>>();\n for (Entry<Cassandra.AsyncClient, List<ByteBuffer>> entry : asyncClientToSecondRoundKeys.entrySet()) {\n Cassandra.AsyncClient asyncClient = entry.getKey();\n List<ByteBuffer> keysForThisClient = entry.getValue();\n\n BlockingQueueCallback<multiget_slice_by_time_call> callback = new BlockingQueueCallback<multiget_slice_by_time_call>();\n secondRoundCallbacks.add(callback);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2: get \" + printKeys(keysForThisClient) + \" from \" + asyncClient); }\n\n asyncClient.multiget_slice_by_time(keysForThisClient, column_parent, predicate, consistencyLevel, chosenTime, LamportClock.sendTimestamp(), callback);\n }\n\n //Gather second round responses\n overallMaxEvt = Long.MIN_VALUE;\n overallMinLvt = Long.MAX_VALUE;\n for (BlockingQueueCallback<multiget_slice_by_time_call> callback : secondRoundCallbacks) {\n MultigetSliceResult result = callback.getResponseNoInterruption().getResult();\n LamportClock.updateTime(result.lts);\n\n substituteValidFirstRoundResults(result, keyToResult);\n\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 responses for \" + printKeys(result.getValue().keySet())); }\n\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : result.value.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n //find the evt and lvt for the entire row\n EvtAndLvt evtAndLvt = ColumnOrSuperColumnHelper.extractEvtAndLvt(coscList);\n if (!lvtToKeys.containsKey(evtAndLvt.getLatestValidTime())) {\n lvtToKeys.put(evtAndLvt.getLatestValidTime(), new LinkedList<ByteBuffer>());\n }\n lvtToKeys.get(evtAndLvt.getLatestValidTime()).add(key);\n //if (logger.isTraceEnabled()) { logger.trace(\"round 2 response for \" + printKey(key) + \" evt: \" + evtAndLvt.getEarliestValidTime() + \" lvt: \" + evtAndLvt.getLatestValidTime()); }\n\n overallMaxEvt = Math.max(overallMaxEvt, evtAndLvt.getEarliestValidTime());\n overallMinLvt = Math.min(overallMinLvt, evtAndLvt.getLatestValidTime());\n }\n\n keyToResult.putAll(result.getValue());\n }\n assert overallMaxEvt < overallMinLvt : overallMaxEvt + \" !< \" + overallMinLvt;\n }\n\n //Add dependencies on anything returned and removed deleted columns\n for (Entry<ByteBuffer, List<ColumnOrSuperColumn>> entry : keyToResult.entrySet()) {\n ByteBuffer key = entry.getKey();\n List<ColumnOrSuperColumn> coscList = entry.getValue();\n\n for (Iterator<ColumnOrSuperColumn> cosc_it = coscList.iterator(); cosc_it.hasNext(); ) {\n ColumnOrSuperColumn cosc = cosc_it.next();\n try {\n clientContext.addDep(key, cosc);\n } catch (NotFoundException nfe) {\n //remove deleted results, it's okay for all result to be removed\n cosc_it.remove();\n }\n }\n }\n //if (logger.isTraceEnabled()) {\n // logger.trace(\"transactional_multiget_slice result = {}\", keyToResult);\n //}\n return keyToResult;\n }",
"public void testBrokerListWithTwoBrokersDefaultsToRoundRobinPolicy() throws Exception\n {\n _url = \"amqp://user:pass@clientid/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'\";\n _connectionUrl = new AMQConnectionURL(_url);\n _connection = createStubConnection();\n\n _failoverPolicy = new FailoverPolicy(_connectionUrl, _connection);\n\n assertTrue(\"Unexpected failover method\", _failoverPolicy.getCurrentMethod() instanceof FailoverRoundRobinServers);\n }",
"Endpoint<R> borrowEndpoint() throws EndpointBalancerException;",
"public void run() {\n boolean quiesceRequested = false;\n // A sleeper that sleeps for msgInterval.\n Sleeper sleeper = new Sleeper(this.msgInterval, this.stopRequested);\n try {\n init(reportForDuty(sleeper));\n long lastMsg = 0;\n // Now ask master what it wants us to do and tell it what we have done\n for (int tries = 0; !stopRequested.get() && isHealthy();) {\n long now = System.currentTimeMillis();\n if (lastMsg != 0 && (now - lastMsg) >= serverLeaseTimeout) {\n // It has been way too long since we last reported to the master.\n LOG.warn(\"unable to report to master for \" + (now - lastMsg) +\n \" milliseconds - retrying\");\n }\n if ((now - lastMsg) >= msgInterval) {\n HMsg outboundArray[] = null;\n synchronized(this.outboundMsgs) {\n outboundArray =\n this.outboundMsgs.toArray(new HMsg[outboundMsgs.size()]);\n this.outboundMsgs.clear();\n }\n try {\n doMetrics();\n this.serverInfo.setLoad(new HServerLoad(requestCount.get(),\n onlineRegions.size(), this.metrics.storefiles.get(),\n this.metrics.memcacheSizeMB.get()));\n this.requestCount.set(0);\n HMsg msgs[] = hbaseMaster.regionServerReport(\n serverInfo, outboundArray, getMostLoadedRegions());\n lastMsg = System.currentTimeMillis();\n if (this.quiesced.get() && onlineRegions.size() == 0) {\n // We've just told the master we're exiting because we aren't\n // serving any regions. So set the stop bit and exit.\n LOG.info(\"Server quiesced and not serving any regions. \" +\n \"Starting shutdown\");\n stopRequested.set(true);\n this.outboundMsgs.clear();\n continue;\n }\n \n // Queue up the HMaster's instruction stream for processing\n boolean restart = false;\n for(int i = 0;\n !restart && !stopRequested.get() && i < msgs.length;\n i++) {\n LOG.info(msgs[i].toString());\n switch(msgs[i].getType()) {\n case MSG_CALL_SERVER_STARTUP:\n // We the MSG_CALL_SERVER_STARTUP on startup but we can also\n // get it when the master is panicing because for instance\n // the HDFS has been yanked out from under it. Be wary of\n // this message.\n if (checkFileSystem()) {\n closeAllRegions();\n try {\n log.closeAndDelete();\n } catch (Exception e) {\n LOG.error(\"error closing and deleting HLog\", e);\n }\n try {\n serverInfo.setStartCode(System.currentTimeMillis());\n log = setupHLog();\n this.logFlusher.setHLog(log);\n } catch (IOException e) {\n this.abortRequested = true;\n this.stopRequested.set(true);\n e = RemoteExceptionHandler.checkIOException(e); \n LOG.fatal(\"error restarting server\", e);\n break;\n }\n reportForDuty(sleeper);\n restart = true;\n } else {\n LOG.fatal(\"file system available check failed. \" +\n \"Shutting down server.\");\n }\n break;\n \n case MSG_REGIONSERVER_STOP:\n stopRequested.set(true);\n break;\n \n case MSG_REGIONSERVER_QUIESCE:\n if (!quiesceRequested) {\n try {\n toDo.put(new ToDoEntry(msgs[i]));\n } catch (InterruptedException e) {\n throw new RuntimeException(\"Putting into msgQueue was \" +\n \"interrupted.\", e);\n }\n quiesceRequested = true;\n }\n break;\n \n default:\n if (fsOk) {\n try {\n toDo.put(new ToDoEntry(msgs[i]));\n } catch (InterruptedException e) {\n throw new RuntimeException(\"Putting into msgQueue was \" +\n \"interrupted.\", e);\n }\n }\n }\n }\n // Reset tries count if we had a successful transaction.\n tries = 0;\n \n if (restart || this.stopRequested.get()) {\n toDo.clear();\n continue;\n }\n } catch (Exception e) {\n if (e instanceof IOException) {\n e = RemoteExceptionHandler.checkIOException((IOException) e);\n }\n if (tries < this.numRetries) {\n LOG.warn(\"Processing message (Retry: \" + tries + \")\", e);\n tries++;\n } else {\n LOG.error(\"Exceeded max retries: \" + this.numRetries, e);\n checkFileSystem();\n }\n if (this.stopRequested.get()) {\n \tLOG.info(\"Stop was requested, clearing the toDo \" +\n \t\t\t\"despite of the exception\");\n toDo.clear();\n continue;\n }\n }\n }\n // Do some housekeeping before going to sleep\n housekeeping();\n sleeper.sleep(lastMsg);\n } // for\n } catch (OutOfMemoryError error) {\n abort();\n LOG.fatal(\"Ran out of memory\", error);\n } catch (Throwable t) {\n LOG.fatal(\"Unhandled exception. Aborting...\", t);\n abort();\n }\n RegionHistorian.getInstance().offline();\n this.leases.closeAfterLeasesExpire();\n this.worker.stop();\n this.server.stop();\n if (this.infoServer != null) {\n LOG.info(\"Stopping infoServer\");\n try {\n this.infoServer.stop();\n } catch (InterruptedException ex) {\n ex.printStackTrace();\n }\n }\n \n // Send interrupts to wake up threads if sleeping so they notice shutdown.\n // TODO: Should we check they are alive? If OOME could have exited already\n cacheFlusher.interruptIfNecessary();\n logFlusher.interrupt();\n compactSplitThread.interruptIfNecessary();\n logRoller.interruptIfNecessary();\n \n if (abortRequested) {\n if (this.fsOk) {\n // Only try to clean up if the file system is available\n try {\n if (this.log != null) {\n this.log.close();\n LOG.info(\"On abort, closed hlog\");\n }\n } catch (IOException e) {\n LOG.error(\"Unable to close log in abort\",\n RemoteExceptionHandler.checkIOException(e));\n }\n closeAllRegions(); // Don't leave any open file handles\n }\n LOG.info(\"aborting server at: \" +\n serverInfo.getServerAddress().toString());\n } else {\n ArrayList<HRegion> closedRegions = closeAllRegions();\n try {\n log.closeAndDelete();\n } catch (IOException e) {\n LOG.error(\"Close and delete failed\",\n RemoteExceptionHandler.checkIOException(e));\n }\n try {\n HMsg[] exitMsg = new HMsg[closedRegions.size() + 1];\n exitMsg[0] = HMsg.REPORT_EXITING;\n // Tell the master what regions we are/were serving\n int i = 1;\n for (HRegion region: closedRegions) {\n exitMsg[i++] = new HMsg(HMsg.Type.MSG_REPORT_CLOSE,\n region.getRegionInfo());\n }\n \n LOG.info(\"telling master that region server is shutting down at: \" +\n serverInfo.getServerAddress().toString());\n hbaseMaster.regionServerReport(serverInfo, exitMsg, (HRegionInfo[])null);\n } catch (IOException e) {\n LOG.warn(\"Failed to send exiting message to master: \",\n RemoteExceptionHandler.checkIOException(e));\n }\n LOG.info(\"stopping server at: \" +\n serverInfo.getServerAddress().toString());\n }\n if (this.hbaseMaster != null) {\n HbaseRPC.stopProxy(this.hbaseMaster);\n this.hbaseMaster = null;\n }\n join();\n LOG.info(Thread.currentThread().getName() + \" exiting\");\n }",
"protected boolean checkLoad() {\n\t\treturn size <= maxThreshold;\n\t\t//return (size >= minThreshold || size <= minCapacity) && size <= maxThreshold;\n\t}"
] | [
"0.59445035",
"0.573165",
"0.5716255",
"0.5554652",
"0.5543585",
"0.5492609",
"0.53254694",
"0.5272842",
"0.52553064",
"0.51974434",
"0.51847637",
"0.5129835",
"0.51176304",
"0.5093279",
"0.50866985",
"0.50773764",
"0.50724775",
"0.5068846",
"0.50575584",
"0.5035459",
"0.50193846",
"0.50192904",
"0.4990283",
"0.49797738",
"0.49692732",
"0.49631697",
"0.49472076",
"0.4942315",
"0.4940249",
"0.49390224",
"0.4926253",
"0.49261358",
"0.49208748",
"0.49095744",
"0.489896",
"0.48937517",
"0.48867348",
"0.4884263",
"0.48817354",
"0.48695445",
"0.48560485",
"0.4855444",
"0.48472205",
"0.48258734",
"0.4823706",
"0.48229706",
"0.48093915",
"0.48078036",
"0.4806386",
"0.48021924",
"0.47979376",
"0.47924522",
"0.478705",
"0.47746193",
"0.47744122",
"0.47675148",
"0.4729546",
"0.47267684",
"0.47230744",
"0.4720863",
"0.47162646",
"0.47142848",
"0.4710961",
"0.4692421",
"0.46793237",
"0.46787953",
"0.46719414",
"0.46718904",
"0.4657309",
"0.465396",
"0.46501008",
"0.46455368",
"0.46396366",
"0.46355438",
"0.46315092",
"0.4630502",
"0.46257484",
"0.46252525",
"0.4613143",
"0.46121985",
"0.46117717",
"0.4611596",
"0.4609334",
"0.46013033",
"0.4601283",
"0.4599942",
"0.45971107",
"0.45913348",
"0.4590598",
"0.4590096",
"0.4587164",
"0.45822477",
"0.4578212",
"0.45773584",
"0.45726234",
"0.4572488",
"0.45685312",
"0.45683616",
"0.45624176",
"0.45521244"
] | 0.6658676 | 0 |
TODO Autogenerated method stub | @Override
public int insertAppInfo(AppInfo info) {
return devAppInfoMapper.insertAppInfo(info);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public int getId() {
return id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
/ Constructor Creates a new method signature matcher with a given name regex and a list of expected parameters as strings. | private MethodSignatureMatcher(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {
this.namePattern = Pattern.compile(nameRegex);
if (parameters == null) {
this.parameters = new String[0];
} else {
this.parameters = parameters;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n return new MethodSignatureMatcher(nameRegex, parameters);\n }",
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements Class<?>... parameters) {\n final @Nonnull String[] typeNames;\n if (parameters == null) {\n typeNames = new String[0];\n } else {\n typeNames = new String[parameters.length];\n int i = 0;\n for (@Nonnull Class<?> parameter : parameters) {\n typeNames[i] = parameter.getCanonicalName();\n i++;\n }\n }\n return new MethodSignatureMatcher(nameRegex, typeNames);\n }",
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex) {\n return new MethodSignatureMatcher(nameRegex, null);\n }",
"abstract UrlPatternMatcher create( String pattern );",
"public RegexPatternBuilder (String regex)\n {\n this.regex = regex;\n }",
"HxMethod createConstructor(final String... parameterTypes);",
"public Checks(kotlin.text.Regex r8, kotlin.reflect.jvm.internal.impl.util.Check[] r9, kotlin.jvm.functions.Function1<? super kotlin.reflect.jvm.internal.impl.descriptors.FunctionDescriptor, java.lang.String> r10) {\n /*\n r7 = this;\n java.lang.String r0 = \"regex\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r8, r0)\n java.lang.String r0 = \"checks\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r9, r0)\n java.lang.String r0 = \"additionalChecks\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r10, r0)\n int r0 = r9.length\n kotlin.reflect.jvm.internal.impl.util.Check[] r6 = new kotlin.reflect.jvm.internal.impl.util.Check[r0]\n int r0 = r9.length\n r1 = 0\n java.lang.System.arraycopy(r9, r1, r6, r1, r0)\n r2 = 0\n r4 = 0\n r1 = r7\n r3 = r8\n r5 = r10\n r1.<init>((kotlin.reflect.jvm.internal.impl.name.Name) r2, (kotlin.text.Regex) r3, (java.util.Collection<kotlin.reflect.jvm.internal.impl.name.Name>) r4, (kotlin.jvm.functions.Function1<? super kotlin.reflect.jvm.internal.impl.descriptors.FunctionDescriptor, java.lang.String>) r5, (kotlin.reflect.jvm.internal.impl.util.Check[]) r6)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.jvm.internal.impl.util.Checks.<init>(kotlin.text.Regex, kotlin.reflect.jvm.internal.impl.util.Check[], kotlin.jvm.functions.Function1):void\");\n }",
"RegExConstraint createRegExConstraint();",
"public RegularExpression() {\n }",
"public BodyMatchesRegexAnalyzer(BodyRegexProperties properties) {\n super(properties);\n this.pattern = Pattern.compile(properties.getPattern());\n }",
"boolean match(String mnemonic, List<ParameterType>[] parameters);",
"Match createMatch();",
"public static MethodType fromParameters(String name, Type... paramTypes) {\n MethodType type = new MethodType(name);\n type.paramTypes = Arrays.copyOf(paramTypes, paramTypes.length);\n return type;\n }",
"boolean match(String mnemonic, ParameterType[] parameters);",
"static Extractor byRegex(String format, Object... args) {\n\t\t\treturn byRegex(RegexUtil.compile(format, args));\n\t\t}",
"private JBurgPatternMatcher()\n\t{\n\t}",
"public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}",
"HxMethod createMethod(final String returnType,\n final String methodName,\n final String... parameterTypes);",
"public NameBuilderInfoImpl(Matcher matcher) {\n\t\tthis.matcher = matcher;\n\t}",
"public static void matchMaker()\n {\n \n }",
"public void addExpectedParameter(String name, Matcher<String> matcher) {\n expected.put(name, matcher);\n }",
"public void testCreateMethodWithParameters() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setParameters(new String[] { \"String\", \"int\", \"char[]\" }, new String[] { \"name\", \"number\", \"buffer\" });\n assertSourceEquals(\"source code incorrect\", \"public void foo(String name, int number, char[] buffer) {\\n\" + \"}\\n\", method.getContents());\n }",
"public RegexFileFilter(String pattern, int flags) {\n/* 91 */ if (pattern == null) {\n/* 92 */ throw new IllegalArgumentException(\"Pattern is missing\");\n/* */ }\n/* 94 */ this.pattern = Pattern.compile(pattern, flags);\n/* */ }",
"public Match( ) {\n\n }",
"protected abstract Regex pattern();",
"public interface Matcher {\n\n char WILDCARD = '*';\n\n void addFilter(String filter);\n\n boolean matches(String word);\n}",
"private Pattern fileNameMatch(final String name) {\n final StringBuilder sb = new StringBuilder(name.length());\n for (int i = 0; i < name.length(); i++) {\n final char c = name.charAt(i);\n if (c == '.') {\n sb.append('\\\\').append('.');\n } else if (c == '?') {\n sb.append('.');\n } else if (c == '*') {\n sb.append('.').append('*').append('?');\n } else {\n sb.append(c);\n }\n }\n return Pattern.compile(sb.toString(), Pattern.CASE_INSENSITIVE);\n }",
"public RegexFileFilter(Pattern pattern) {\n/* 104 */ if (pattern == null) {\n/* 105 */ throw new IllegalArgumentException(\"Pattern is missing\");\n/* */ }\n/* */ \n/* 108 */ this.pattern = pattern;\n/* */ }",
"public static void main(String[] args)\n {\n try\n {\n System.out.println(\"Regular expression [\"+args[0]+\"]\");\n NameParser parser = new NameParser();\n StringMatcher matcher = parser.parse(args[0]);\n for (int index = 1; index < args.length; index++)\n {\n String string = args[index];\n System.out.print(\"String [\"+string+\"]\");\n System.out.println(\" -> match = \"+matcher.matches(args[index]));\n }\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }",
"public /* synthetic */ Checks(Regex regex2, Check[] checkArr, Function1 function1, int i, DefaultConstructorMarker defaultConstructorMarker) {\n this(regex2, checkArr, (Function1<? super FunctionDescriptor, String>) (i & 4) != 0 ? C33773.INSTANCE : function1);\n }",
"@Override\n protected void compileRegex(String regex) {\n }",
"public JavaRE(String regex) throws Exception {\n if (ignoreCase) {\n pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);\n } else {\n pattern = Pattern.compile(regex);\n }\n }",
"HxMethod createConstructor(final HxType... parameterTypes);",
"public Method(String name, Type returnType, Type[] argumentTypes) {\n/* 98 */ this(name, Type.getMethodDescriptor(returnType, argumentTypes));\n/* */ }",
"public RegexFormatter(Pattern pattern) {\n this();\n setPattern(pattern);\n }",
"public RegexFileFilter(String pattern, IOCase caseSensitivity) {\n/* 73 */ if (pattern == null) {\n/* 74 */ throw new IllegalArgumentException(\"Pattern is missing\");\n/* */ }\n/* 76 */ int flags = 0;\n/* 77 */ if (caseSensitivity != null && !caseSensitivity.isCaseSensitive()) {\n/* 78 */ flags = 2;\n/* */ }\n/* 80 */ this.pattern = Pattern.compile(pattern, flags);\n/* */ }",
"public NaiveStringMatcher(String pattern) {\n super(pattern);\n }",
"public Method getMethodByName(String nameRegex) {\r\n \t\t\r\n \t\tPattern match = Pattern.compile(nameRegex);\r\n \t\t\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (match.matcher(method.getName()).matches()) {\r\n \t\t\t\t// Right - this is probably it. \r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tthrow new RuntimeException(\"Unable to find a method with the pattern \" + \r\n \t\t\t\t\t\t\t\t\tnameRegex + \" in \" + source.getName());\r\n \t}",
"public MethodSortMatcher(Sort sort) {\n this.sort = sort;\n }",
"public Match(){\n this(-1, null, 0, 0, null, null);\n }",
"@Override\n public String getAnalyzerName() {\n return \"Body Regex: \" + pattern.pattern();\n }",
"public RuleRegExp(String ruleName, String regExp) {\n this.ruleName = ruleName;\n pattern = Pattern.compile(regExp);\n }",
"private Pattern(String name, int minimumApplications, int maximumApplications, double applicationChance, PatternFreeze freeze, ArrayList<Sequence> sequences) {\n\t\tthis.name = name;\n\t\tthis.minimumApplications = minimumApplications;\n\t\tthis.maximumApplications = maximumApplications;\n\t\tthis.applicationChance = applicationChance;\n\t\tthis.freeze = freeze;\n\t\tthis.sequences = sequences;\n\t}",
"protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }",
"@Override\n public Matcher matches(LexerToken[] lexerTokens, Builder builder){\n return new Matcher(this,lexerTokens,builder);\n }",
"@SafeVarargs\n protected ListMatcher(Matcher<? super T>... matchers) {\n this.matchers = matchers;\n }",
"@Factory\r\n public static Matcher<Proc> raises(String regex) {\r\n return raises(IsThrowable.throwable(regex));\r\n }",
"public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}",
"private static FilenameFilter createFilter(final List<Pattern> patterns) {\n return new FilenameFilter() {\n \n @Override\n public boolean accept(File dir, String name) {\n for (Pattern p : patterns) {\n if (p.matcher(name).matches()) {\n return true;\n }\n }\n return false;\n }\n };\n }",
"protected abstract boolean matches(String paramString, int paramInt);",
"@objid (\"d7eead28-9a1c-4037-9797-4868268b54d4\")\n public RegexVerifier(String regex) {\n this.regex = regex;\n }",
"public NameVerificationSlip()\n {\n this(null, null);\n }",
"protected abstract Matcher<? super ExpressionTree> specializedMatcher();",
"public TokenMatcherList addMatcher(final String tokens,\n final Function<List<String>, String> fun) {\n TokenPattern tp = new TokenPattern(tokens);\n TokenMatcher tm = tp.compile();\n tm.setFunction(fun);\n return addMatcher(tm);\n }",
"public interface Patterns {\n String LOGIN = \"[a-zA-Z0-9]+\";\n String PASSWORD = \"[a-zA-Z0-9.-]+\";\n String EMAIL = \"[a-zA-Z0-9.-@]+\";\n}",
"public Method(String name, String desc) {\n/* 82 */ this.name = name;\n/* 83 */ this.desc = desc;\n/* */ }",
"protected MethodNameRecord(){}",
"private IfFileName(final String glob, final String regex, final PathCondition... nestedConditions) {\n if (regex == null && glob == null) {\n throw new IllegalArgumentException(\"Specify either a path glob or a regular expression. \"\n + \"Both cannot be null.\");\n }\n this.syntaxAndPattern = createSyntaxAndPatternString(glob, regex);\n this.pathMatcher = FileSystems.getDefault().getPathMatcher(syntaxAndPattern);\n this.nestedConditions = PathCondition.copy(nestedConditions);\n }",
"public NameParser(WildcardManager wildcardManager)\n {\n this.wildcardManager = wildcardManager;\n }",
"public static ObjectInputFilter createFilter(String param1String) {\n/* 381 */ Objects.requireNonNull(param1String, \"pattern\");\n/* 382 */ return Global.createFilter(param1String, true);\n/* */ }",
"public static MethodBuilder constructor(String name) {\n\t\treturn new MethodBuilder().returnType(\"\").name(name);\n\t}",
"HxMethod createConstructorReference(final String declaringType,\n final String... parameterTypes);",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"public RegularExpressionJSONComparator exact(final String... regexes)\n {\n Stream.of(regexes).map(Pattern::compile).forEach(this.searchPatterns::add);\n return this;\n }",
"public static ObjectInputFilter createFilter(String param1String) {\n/* 383 */ Objects.requireNonNull(param1String, \"pattern\");\n/* 384 */ return Global.createFilter(param1String, true);\n/* */ }",
"public GrammaticaRE(String regex) throws Exception {\n regExp = new RegExp(regex, ignoreCase);\n }",
"default HxMethod createConstructor(final Class<?>... parameterTypes) {\n return createConstructor(getHaxxor().toNormalizedClassnames(parameterTypes));\n }",
"@Factory\r\n public static Matcher<Proc> raisesException(String regex) {\r\n return new Raises(IsThrowable.exception(regex));\r\n }",
"public X10MethodInstance createMethodInstance(Type container, Name name, List<Type> typeArgs, List<Type> argTypes, Context context) {\n try {\n return xts.findMethod(container, xts.MethodMatcher(container, name, typeArgs, argTypes, context));\n } catch (SemanticException e) {\n throw new InternalCompilerError(\"Unable to find required method instance\", container.position(), e);\n }\n }",
"public GlobFilenameFilter(String regex) {\n super(__CACHE, __MATCHER, regex);\n }",
"public MockClass(String arg) {\n\t}",
"private Matcher() {\n super(querySpecification());\n }",
"public MatchInfo(android.icu.text.TimeZoneNames.NameType r1, java.lang.String r2, java.lang.String r3, int r4) {\n /*\n // Can't load method instructions: Load method exception: null in method: android.icu.text.TimeZoneNames.MatchInfo.<init>(android.icu.text.TimeZoneNames$NameType, java.lang.String, java.lang.String, int):void, dex: in method: android.icu.text.TimeZoneNames.MatchInfo.<init>(android.icu.text.TimeZoneNames$NameType, java.lang.String, java.lang.String, int):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.icu.text.TimeZoneNames.MatchInfo.<init>(android.icu.text.TimeZoneNames$NameType, java.lang.String, java.lang.String, int):void\");\n }",
"public Matcher matcher(String uri);",
"public RegexPatternBuilder ()\n {\n this.regex = null;\n }",
"public PropertySpecBuilder<T> validator(String regex)\n {\n return validator(Pattern.compile(regex));\n }",
"private OFMatch construct_match() throws IllegalArgumentException \n {\n List<String> match_string_as_list = new ArrayList<String>();\n if (ingress_port != null)\n {\n match_string_as_list.add(\n OFMatch.STR_IN_PORT + \"=\" + ingress_port);\n }\n \n if (src_mac_address != null)\n {\n match_string_as_list.add(\n OFMatch.STR_DL_SRC + \"=\" + src_mac_address);\n }\n\n if (dst_mac_address != null)\n {\n match_string_as_list.add(\n OFMatch.STR_DL_DST + \"=\" + dst_mac_address);\n }\n\n if (vlan_id != null)\n {\n match_string_as_list.add(\n OFMatch.STR_DL_VLAN + \"=\" + vlan_id);\n }\n\n if (vlan_priority != null)\n {\n match_string_as_list.add(\n OFMatch.STR_DL_VLAN_PCP + \"=\" + vlan_priority);\n }\n\n if (ether_type != null)\n {\n match_string_as_list.add(\n OFMatch.STR_DL_TYPE + \"=\" + ether_type);\n }\n\n if (tos_bits != null)\n {\n match_string_as_list.add(\n OFMatch.STR_NW_TOS + \"=\" + tos_bits);\n }\n\n if (protocol != null)\n {\n match_string_as_list.add(\n OFMatch.STR_NW_PROTO + \"=\" + protocol);\n }\n\n if (ip_src != null)\n {\n match_string_as_list.add(\n OFMatch.STR_NW_SRC + \"=\" + ip_src);\n }\n\n if (ip_dst != null)\n {\n match_string_as_list.add(\n OFMatch.STR_NW_DST + \"=\" + ip_dst);\n }\n \n if (src_port != null)\n {\n match_string_as_list.add(\n OFMatch.STR_TP_SRC + \"=\" + src_port);\n }\n\n if (dst_port != null)\n {\n match_string_as_list.add(\n OFMatch.STR_TP_DST + \"=\" + dst_port);\n }\n\n StringBuffer match_string = new StringBuffer();\n for (int i = 0; i < match_string_as_list.size(); ++i)\n {\n match_string.append(match_string_as_list.get(i));\n if (i != (match_string_as_list.size() - 1))\n match_string.append(\",\");\n }\n\n OFMatch match = new OFMatch();\n match.fromString(match_string.toString());\n return match;\n }",
"public Method(final String name,\n final List<PrutReference> nodelist,\n final List<String> arguments,\n final int lineNr) {\n\n this.lineNr = lineNr;\n this.arguments = arguments;\n\n this.name = name;\n if(nodelist == null){\n this.instructions = new ArrayList<>();\n } else{\n this.instructions = nodelist;\n }\n }",
"private static UriMatcher buildUriMatcher(){\r\n UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH);\r\n matcher.addURI(AUTHORITY, \"task\", LIST_TASK);\r\n matcher.addURI(AUTHORITY, \"task/#\", ITEM_TASK);\r\n return matcher;\r\n }",
"private PatternBuilder() { }",
"public WildcardPattern(String pattern) {\r\n this.pattern = pattern;\r\n }",
"public StringSearch(String pattern, String target) {\n/* 190 */ super(null, null); throw new RuntimeException(\"Stub!\");\n/* */ }",
"default String create(String... args) {\n String message = \"\";\n try {\n for (int i = 0; i < args.length; i++) {\n if (args[i] != null) {\n Matcher matcher = CRYPTO_PATTERN.matcher(args[i]);\n if (matcher.find()) {\n int start = args[i].indexOf(':') + 1;\n int end = args[i].indexOf('}');\n args[i] = StringUtils.replace(args[i], matcher.group(), StringUtils.repeat('*', end - start));\n }\n }\n }\n message = String.format(getPattern(), (Object[]) args);\n } catch (Exception e) {\n getLogger().error(\"Report message creation error!\", e);\n }\n return message;\n }",
"HxMethod createMethod(final HxType returnType,\n final String methodName,\n final HxType... parameterTypes);",
"public RegularExpressionValueMatcher() {\n\t\tthis(null);\n\t}",
"public RegexFormatter(String pattern) throws PatternSyntaxException {\n this();\n setPattern(Pattern.compile(pattern));\n }",
"@Test\n public void execute_nameParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"name\", true, false, Collections.emptyList());\n //Single keyword, ignore case, person found.\n execute_parameterPredicate_test(1, \"ElLe\", \"name\", true, false, Arrays.asList(ELLE));\n //Single keyword, case sensitive, person found.\n execute_parameterPredicate_test(0, \"ElLe\", \"name\", false, false, Collections.emptyList());\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(3, \"Kurz Elle Kunz\", \"name\", true, false, Arrays.asList(CARL, ELLE, FIONA));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"kurz Elle kunz\", \"name\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(2, \"kurz Elle Kunz\", \"name\", false, false, Arrays.asList(ELLE, FIONA));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"Kurz Elle kunz\", \"name\", false, true, Collections.emptyList());\n }",
"private FunctionParametersValidator() {}",
"protected abstract void initPatternRepresentation(String[] paramArrayOfString)\n/* */ throws IllegalArgumentException;",
"public interface PacketMatcher {\n public boolean matches(ChatPacket packet);\n\n /**\n * Simple matcher for basing selection on PacketType\n * \n * @author Aaron Rosenfeld <[email protected]>\n * \n */\n public static class TypeMatcher implements PacketMatcher {\n private PacketType[] types;\n\n public TypeMatcher(PacketType... types) {\n this.types = types;\n }\n\n @Override\n public boolean matches(ChatPacket packet) {\n for (PacketType t : types) {\n if (packet.getType() == t) {\n return true;\n }\n }\n return false;\n }\n }\n}",
"protected LogParserMatch() {\n\t}",
"public RegExp (final int type)\n {\n this.type = type;\n }",
"public boolean strictMatches(@Nullable String name, ReflectionClassWrapper[] params) {\n\n if(name != null)\n if(!getName().equals(name))\n return false;\n\n var paramTypes = getExecutable().getParameterTypes();\n\n if(!(paramTypes.length == params.length))\n return false;\n\n for (int i = 0; i < params.length; i++) {\n\n if(!params[i].getName().equals(paramTypes[i].getName()))\n return false;\n\n }\n\n return true;\n\n }",
"public static void addClausesToCallDefinition(\n @NotNull Call call,\n @NotNull Map<Pair<String, Integer>, CallDefinition> callDefinitionByNameArity,\n @NotNull Modular modular,\n @NotNull Timed.Time time,\n @NotNull Inserter<CallDefinition> callDefinitionInserter\n ) {\n Pair<String, IntRange> nameArityRange = CallDefinitionClause.nameArityRange(call);\n\n if (nameArityRange != null) {\n String name = nameArityRange.first;\n IntRange arityRange = nameArityRange.second;\n\n addClausesToCallDefinition(\n call,\n name,\n arityRange,\n callDefinitionByNameArity,\n modular,\n time,\n callDefinitionInserter\n );\n }\n }",
"final RouteMatcher route(String path, Map<String, String[]> requestParams)\n {\n return new RouteMatcher(this, Path.parse(path), requestParams);\n }",
"public BroadcastRegexObject() {\n }",
"HxMethod createMethodReference(final String declaringType,\n final String returnType,\n final String methodName,\n final String... parameterTypes);",
"@Override\n public Notifier newInstance(StaplerRequest req, JSONObject formData) {\n String[] pregEx = req.getParameterValues(\"artifactuploader.patternsRegEx\");\n String[] pAnt = req.getParameterValues(\"artifactuploader.patternsAnt\");\n String[] pregExExc = req.getParameterValues(\"artifactuploader.patternsRegExExc\");\n String[] pAntExc = req.getParameterValues(\"artifactuploader.patternsAntExc\");\n String pType = Values.textOrElse(req.getParameter(\"artifactuploader.patternType\"), null);\n if (pType == null) {\n // Some versions of Jenkins rename the f:radioBlock's request parameter, but the formData JSON is named correctly.\n JSONObject radioBlock = formData.getJSONObject(\"patternType\");\n if (radioBlock != null) {\n pType = radioBlock.getString(\"value\");\n }\n }\n if (pType == null) {\n // Fallback value.\n pType = \"regEx\";\n }\n\n boolean fTip = Values.booleanOrElse(req.getParameter(\"artifactuploader.forceCheckIn\"), false);\n boolean fMerge = Values.booleanOrElse(req.getParameter(\"artifactuploader.forceTip\"), false);\n\n String oPart = Values.textOrElse(req.getParameter(\"artifactuploader.owningPart\"), null);\n boolean fAsSlave = Values.booleanOrElse(req.getParameter(\"artifactuploader.forceAsSlave\"), false);\n\n return new ArtifactUploader(pregEx, fTip, fMerge, oPart, fAsSlave, pType, pAnt, pregExExc, pAntExc);\n }",
"RegisterNameMatchFilter(String posVersionNo) {\r\n\t\t\tthis.posVersionNo = posVersionNo;\r\n\t\t}",
"public Pattern buildPattern ()\n {\n int flags = 0;\n if ( this.canonicalEquivalence ) flags += Pattern.CANON_EQ;\n if ( this.caseInsensitive ) flags += Pattern.CASE_INSENSITIVE;\n if ( this.comments ) flags += Pattern.COMMENTS;\n if ( this.dotall ) flags += Pattern.DOTALL;\n if ( this.multiline ) flags += Pattern.MULTILINE;\n if ( this.unicodeCase ) flags += Pattern.UNICODE_CASE;\n if ( this.unixLines ) flags += Pattern.UNIX_LINES;\n return Pattern.compile(this.regex, flags);\n }"
] | [
"0.7936627",
"0.7400418",
"0.7317346",
"0.570174",
"0.5684067",
"0.55630356",
"0.53550595",
"0.5292943",
"0.52762264",
"0.52221096",
"0.52064717",
"0.5185781",
"0.5183425",
"0.51470566",
"0.51173645",
"0.5091745",
"0.5051839",
"0.5040215",
"0.5031635",
"0.50270313",
"0.5021974",
"0.5016698",
"0.5002227",
"0.49734583",
"0.49638018",
"0.4954588",
"0.49282527",
"0.49182466",
"0.49124098",
"0.48994058",
"0.48788026",
"0.4875475",
"0.4873197",
"0.48607212",
"0.48303828",
"0.48242402",
"0.4794503",
"0.47855294",
"0.4773821",
"0.47704127",
"0.47537893",
"0.47436094",
"0.47409987",
"0.4739783",
"0.47276476",
"0.47142634",
"0.4712901",
"0.47081292",
"0.47066778",
"0.46944457",
"0.46932268",
"0.46803123",
"0.46795744",
"0.4677664",
"0.4664758",
"0.46608436",
"0.4641981",
"0.4633582",
"0.46302754",
"0.46216658",
"0.46113116",
"0.460933",
"0.46068862",
"0.4592754",
"0.4590536",
"0.4586403",
"0.4585164",
"0.4584347",
"0.45842612",
"0.4582374",
"0.457868",
"0.4578172",
"0.45775723",
"0.45774233",
"0.45704696",
"0.4566925",
"0.45611665",
"0.45542598",
"0.4537801",
"0.4535948",
"0.4526858",
"0.45159844",
"0.45101312",
"0.45013595",
"0.45004174",
"0.44989875",
"0.4489258",
"0.448833",
"0.4482685",
"0.44761488",
"0.44610047",
"0.446049",
"0.445135",
"0.4440435",
"0.44364586",
"0.4421942",
"0.4412799",
"0.44123816",
"0.4411224",
"0.44083443"
] | 0.7961313 | 0 |
Returns a method signature matcher with a given name regex and a list of expected parameters as classes. | public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements Class<?>... parameters) {
final @Nonnull String[] typeNames;
if (parameters == null) {
typeNames = new String[0];
} else {
typeNames = new String[parameters.length];
int i = 0;
for (@Nonnull Class<?> parameter : parameters) {
typeNames[i] = parameter.getCanonicalName();
i++;
}
}
return new MethodSignatureMatcher(nameRegex, typeNames);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n return new MethodSignatureMatcher(nameRegex, parameters);\n }",
"private MethodSignatureMatcher(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n this.namePattern = Pattern.compile(nameRegex);\n if (parameters == null) {\n this.parameters = new String[0];\n } else {\n this.parameters = parameters;\n }\n }",
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex) {\n return new MethodSignatureMatcher(nameRegex, null);\n }",
"boolean match(String mnemonic, List<ParameterType>[] parameters);",
"boolean match(String mnemonic, ParameterType[] parameters);",
"public Method getMethodByName(String nameRegex) {\r\n \t\t\r\n \t\tPattern match = Pattern.compile(nameRegex);\r\n \t\t\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (match.matcher(method.getName()).matches()) {\r\n \t\t\t\t// Right - this is probably it. \r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tthrow new RuntimeException(\"Unable to find a method with the pattern \" + \r\n \t\t\t\t\t\t\t\t\tnameRegex + \" in \" + source.getName());\r\n \t}",
"public boolean strictMatches(@Nullable String name, ReflectionClassWrapper[] params) {\n\n if(name != null)\n if(!getName().equals(name))\n return false;\n\n var paramTypes = getExecutable().getParameterTypes();\n\n if(!(paramTypes.length == params.length))\n return false;\n\n for (int i = 0; i < params.length; i++) {\n\n if(!params[i].getName().equals(paramTypes[i].getName()))\n return false;\n\n }\n\n return true;\n\n }",
"public MethodSignature getMatchingMethod(\n String methodName,\n SequenceType arguments,\n SequenceType typeArguments,\n List<ShadowException> errors) {\n boolean hasTypeArguments = typeArguments != null;\n MethodSignature candidate = null;\n\n for (MethodSignature signature : recursivelyGetMethodOverloads(methodName)) {\n MethodType methodType = signature.getMethodType();\n\n if (methodType.isParameterized()) {\n if (hasTypeArguments) {\n SequenceType parameters = methodType.getTypeParameters();\n try {\n if (parameters.canAccept(typeArguments, SubstitutionKind.TYPE_PARAMETER)) {\n signature = signature.replace(parameters, typeArguments);\n } else continue;\n } catch (InstantiationException ignored) {\n }\n }\n }\n\n // the list of method signatures starts with the closest (current class) and then adds parents\n // and outer classes\n // always stick with the current if you can\n // (only replace if signature is a subtype of candidate but candidate is not a subtype of\n // signature)\n if (signature.canAccept(arguments)) {\n if (candidate == null\n || (signature.getParameterTypes().isSubtype(candidate.getParameterTypes())\n && !candidate.getParameterTypes().isSubtype(signature.getParameterTypes())))\n candidate = signature;\n else if (!candidate.getParameterTypes().isSubtype(signature.getParameterTypes())) {\n ErrorReporter.addError(\n errors,\n Error.INVALID_ARGUMENTS,\n \"Ambiguous reference to \" + methodName + \" with arguments \" + arguments,\n arguments);\n return null;\n }\n }\n }\n\n if (candidate == null)\n ErrorReporter.addError(\n errors,\n Error.INVALID_METHOD,\n \"No definition of \" + methodName + \" with arguments \" + arguments + \" in this context\",\n arguments);\n\n return candidate;\n }",
"private static String getMethodSignature(Class[] paramTypes, Class retType) {\n StringBuffer sbuf = new StringBuffer();\n sbuf.append('(');\n for (int i = 0; i < paramTypes.length; i++) {\n sbuf.append(getClassSignature(paramTypes[i]));\n }\n sbuf.append(')');\n sbuf.append(getClassSignature(retType));\n return sbuf.toString();\n }",
"public static MethodType fromParameters(String name, Type... paramTypes) {\n MethodType type = new MethodType(name);\n type.paramTypes = Arrays.copyOf(paramTypes, paramTypes.length);\n return type;\n }",
"private Pattern fileNameMatch(final String name) {\n final StringBuilder sb = new StringBuilder(name.length());\n for (int i = 0; i < name.length(); i++) {\n final char c = name.charAt(i);\n if (c == '.') {\n sb.append('\\\\').append('.');\n } else if (c == '?') {\n sb.append('.');\n } else if (c == '*') {\n sb.append('.').append('*').append('?');\n } else {\n sb.append(c);\n }\n }\n return Pattern.compile(sb.toString(), Pattern.CASE_INSENSITIVE);\n }",
"public Method getMethodByParameters(String name, Class<?>... args) {\r\n \t\t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"public Method getMethodByParameters(String name, Class<?> returnType, Class<?>[] args) {\r\n \t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (method.getReturnType().equals(returnType) && Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"AnnotationProvider getMethodAnnotationProvider(String methodName, Class... parameterTypes);",
"Object isMatch(Object arg, String wantedType);",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"public static Method findMethod(Class<?> clazz, String name, Class<?>... paramTypes) {\n Class<?> searchType = clazz;\n while (searchType != null) {\n Method[] methods = (searchType.isInterface() ? searchType.getMethods() : searchType.getDeclaredMethods());\n for (Method method : methods) {\n if (name.equals(method.getName()) &&\n (paramTypes == null || Arrays.equals(paramTypes, method.getParameterTypes()))) {\n return method;\n }\n }\n searchType = searchType.getSuperclass();\n }\n return null;\n }",
"HxMethod createMethod(final String returnType,\n final String methodName,\n final String... parameterTypes);",
"public static MethodInvoker findMatchingMethod(Class<?> type, String methodName, Object... values) throws NoSuchMethodException, IllegalStateException\n {\n List<Method> methodList = new ArrayList<>(20);\n Class<?> currentType = type;\n while ((currentType != null) && ! currentType.equals(Object.class))\n {\n for (Method method : currentType.getDeclaredMethods())\n {\n if (method.getName().equals(methodName) && (method.getParameterCount() == values.length))\n {\n methodList.add(method);\n }\n }\n currentType = currentType.getSuperclass();\n }\n return findMatchingExecutable(methodList.toArray(new Method[methodList.size()]), values);\n }",
"public Method findMethod(final String methodName, final List<Type> parameterTypes) {\r\n\t\tGeneratorHelper.checkJavaMethodName(\"parameter:methodName\", methodName);\r\n\t\tChecker.notNull(\"parameter:parameterTypes\", parameterTypes);\r\n\r\n\t\tMethod found = null;\r\n\r\n\t\tfinal Iterator<Method> methods = this.getMethods().iterator();\r\n\r\n\t\twhile (methods.hasNext()) {\r\n\t\t\tfinal Method method = methods.next();\r\n\t\t\tif (false == method.getName().equals(methodName)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tfinal List<MethodParameter> methodParameters = method.getParameters();\r\n\t\t\tif (methodParameters.size() != parameterTypes.size()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tfound = method;\r\n\r\n\t\t\tfinal Iterator<MethodParameter> methodParametersIterator = methodParameters.iterator();\r\n\t\t\tfinal Iterator<Type> parameterTypesIterator = parameterTypes.iterator();\r\n\r\n\t\t\twhile (parameterTypesIterator.hasNext()) {\r\n\t\t\t\tfinal Type type = parameterTypesIterator.next();\r\n\t\t\t\tfinal MethodParameter parameter = methodParametersIterator.next();\r\n\t\t\t\tif (false == type.equals(parameter.getType())) {\r\n\t\t\t\t\tfound = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (null != found) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn found;\r\n\t}",
"private static ElementMatcher.Junction getMethodMatcher(TypeDescription typeDescription) {\n ElementMatcher.Junction methodMatcher1 = isDeclaredBy(typeDescription).and(namedIgnoreCase(\"doList\")).and(takesArguments(1));\n\n // private List<Invoker<T>> route(List<Invoker<T>> invokers, String method)\n ElementMatcher.Junction methodMatcher2 = isDeclaredBy(typeDescription).and(namedIgnoreCase(\"route\")).and(takesArguments(2));\n return methodMatcher1.or(methodMatcher2);\n }",
"public final Method mo19982a(Class<?> cls, String str, Class<?>... clsArr) {\n C12932j.m33818b(cls, \"target\");\n C12932j.m33818b(str, \"name\");\n C12932j.m33818b(clsArr, \"parameterTypes\");\n Method declaredMethod = cls.getDeclaredMethod(str, (Class[]) Arrays.copyOf(clsArr, clsArr.length));\n C12932j.m33815a((Object) declaredMethod, \"target.getDeclaredMethod(name, *parameterTypes)\");\n return declaredMethod;\n }",
"protected abstract boolean matches(String paramString, int paramInt);",
"public boolean matches(Method method, Class<?> targetClass)\n/* */ {\n/* 133 */ return ((targetClass != null) && (matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass)))) || \n/* 134 */ (matchesPattern(ClassUtils.getQualifiedMethodName(method)));\n/* */ }",
"@Override\n public boolean evaluate(@Nonnull MethodInformation methodInformation) {\n boolean matches = namePattern.matcher(methodInformation.getName()).matches();\n final @Nonnull @NonNullableElements List<? extends VariableElement> methodParameters = methodInformation.getElement().getParameters();\n if (parameters.length == methodParameters.size()) {\n for (int i = 0; i < methodParameters.size(); i++) {\n final @Nonnull String nameOfDeclaredType = ProcessingUtility.getQualifiedName(methodParameters.get(i).asType());\n ProcessingLog.debugging(\"name of type: $\", nameOfDeclaredType);\n final @Nonnull String parameter = parameters[i];\n if (!parameter.equals(\"?\")) {\n matches = matches && nameOfDeclaredType.equals(parameter);\n }\n }\n } else {\n matches = false;\n }\n return matches;\n }",
"protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }",
"public boolean parametersMatch(Method m, Class[] param) {\n boolean match = false;\n Class[] types = m.getParameterTypes();\n if (types.length!=param.length)\n return false;\n for (int i=0; i<types.length; i++) {\n match = types[i].equals(param[i]);\n }\n return match;\n }",
"abstract UrlPatternMatcher create( String pattern );",
"public interface PacketMatcher {\n public boolean matches(ChatPacket packet);\n\n /**\n * Simple matcher for basing selection on PacketType\n * \n * @author Aaron Rosenfeld <[email protected]>\n * \n */\n public static class TypeMatcher implements PacketMatcher {\n private PacketType[] types;\n\n public TypeMatcher(PacketType... types) {\n this.types = types;\n }\n\n @Override\n public boolean matches(ChatPacket packet) {\n for (PacketType t : types) {\n if (packet.getType() == t) {\n return true;\n }\n }\n return false;\n }\n }\n}",
"HxMethod createConstructor(final String... parameterTypes);",
"HxMethod createMethod(final HxType returnType,\n final String methodName,\n final HxType... parameterTypes);",
"public static void matchMaker()\n {\n \n }",
"private boolean matchesMethod (final Object method, \n\t\tfinal int expectedModifiers, final int optionalModifiers, \n\t\tfinal String expectedReturnType)\n\t{\n\t\tboolean matches = false; \n\n\t\tif (method != null)\n\t\t{\n\t\t\tModel model = getModel();\n\t\t\tint modifiers = model.getModifiers(method);\n\n\t\t\tmatches = (((modifiers == expectedModifiers) || \n\t\t\t\t(modifiers == (expectedModifiers | optionalModifiers))) &&\n\t\t\t\texpectedReturnType.equals(model.getType(method)));\n\t\t}\n\n\t\treturn matches;\n\t}",
"public FindResult findClass(String className);",
"public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}",
"static Extractor byRegex(String format, Object... args) {\n\t\t\treturn byRegex(RegexUtil.compile(format, args));\n\t\t}",
"private boolean methodsMatch(Method method,\n CallStatement.CallStatementEntry entry) throws EngineException {\n if (!method.getName().equals(entry.getName())) {\n return false;\n }\n if (method.getParameterTypes().length != parameters.size()) {\n return false;\n }\n Class[] parameterTypes = method.getParameterTypes();\n for (int index = 0; index < parameters.size(); index++) {\n Class parameterType = parameterTypes[index];\n Object parameterValue = parameters.get(index);\n if (!parameterType.isAssignableFrom(parameterValue.getClass())) {\n return false;\n }\n }\n \n for (int index = 0; index < parameters.size(); index++) {\n Class parameterType = parameterTypes[index];\n Object parameterValue = parameters.get(index);\n parameters.set(index, parameterType.cast(parameterValue));\n }\n return true;\n }",
"public boolean match(ReflectClass classReflector);",
"public void testOneOrMoreParameters() {\n int nrParameters = methodToTest.getParameterTypes().length;\n Class[] params = methodToTest.getParameterTypes();\n Object[] foo = new Object[nrParameters];\n \n // set up all parameters. Some methods are invoked with\n // primitives or collections, so we need to create them\n // accordingly\n for (int i = 0; i < nrParameters; i++) {\n try {\n if (params[i].isPrimitive()) {\n String primitiveName = params[i]\n .getName();\n if (primitiveName.equals(\"int\")) {\n foo[i] = Integer.valueOf(0);\n }\n if (primitiveName.equals(\"boolean\")) {\n foo[i] = Boolean.TRUE;\n }\n if (primitiveName.equals(\"short\")) {\n foo[i] = new Short(\"0\");\n }\n } else if (params[i].getName().equals(\"java.util.Collection\")) {\n foo[i] = new ArrayList();\n } else {\n /*\n * this call could easily fall if there is e.g. no public\n * default constructor. If it fails tweak the if/else tree\n * above to accommodate the parameter or check if we need to\n * test the particular method at all.\n */\n foo[i] = params[i].newInstance();\n }\n } catch (InstantiationException e) {\n fail(\"Cannot create an instance of : \"\n + params[i].getName()\n + \", required for \"\n + methodToTest.getName()\n + \". Check if \"\n + \"test needs reworking.\");\n } catch (IllegalAccessException il) {\n fail(\"Illegal Access to : \"\n + params[i].getName());\n }\n }\n \n try {\n methodToTest.invoke(facade, foo);\n fail(methodToTest.getName()\n + \" does not deliver an IllegalArgumentException\");\n } catch (InvocationTargetException e) {\n if (e.getTargetException() instanceof IllegalArgumentException \n || e.getTargetException() instanceof ClassCastException\n || e.getTargetException() instanceof NotImplementedException) {\n return;\n }\n fail(\"Test failed for \" + methodToTest.toString()\n + \" because of: \"\n + e.getTargetException());\n } catch (NotImplementedException e) {\n // If method not supported ignore failure\n } catch (Exception e) {\n fail(\"Test failed for \" + methodToTest.toString()\n + \" because of: \" + e.toString());\n }\n }",
"public static LambdaExpression lambda(Class type, Expression body, String name, Iterable<ParameterExpression> parameters) { throw Extensions.todo(); }",
"Definition lookup(String name, // the name to locate\n int numParams) { // number of params\n // note that the name isn't used... all definitions contained\n // by the MultiDef have the same name\n \n // walk through the list of symbols\n Enumeration e = defs.elements();\n while(e.hasMoreElements()) {\n Definition d = (Definition)e.nextElement();\n \n // If the symbol is a method and it has the same number of\n // parameters as what we are calling, assume it's the match\n if (d instanceof MethodDef) {\n if (((MethodDef)d).getParamCount() == numParams)\n return d;\n }\n \n // otherwise, if it's not a method, AND we're not looking for\n // a method, return the definition found.\n else if (numParams == -1)\n return d;\n } \n\n // If we didn't find a match return null\n return null;\n }",
"protected abstract Matcher<? super ExpressionTree> specializedMatcher();",
"public Matcher matcher(String uri);",
"@Factory\r\n public static Matcher<Proc> raises(String regex) {\r\n return raises(IsThrowable.throwable(regex));\r\n }",
"@Test\n\tpublic void testClassHasReplaceLessThanMethod() {\n\t\t// EDIT THESE TO MATCH YOUR METHOD\n\t\tmethodName = \"replaceLessThan\";\n\t\targTypes = \"\";\n\t\treturnType = \"void\";\n\t\t// END EDIT\n\t\t// class exists\n\t\ttry {\n\t\t\tPackage pkg = getClass().getPackage();\n\t\t\tString path = pkg == null ? \"\" : pkg.getName() + \".\";\n\t\t\tcls = Class.forName(path + className);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tfail(\"File \\\"\" + className + \".class\\\" doesn't have a \\\"\" + className\n\t\t\t\t\t+ \"\\\" class. (is the class name spelled right?)\");\n\t\t}\n\n\t\t// class has method\n\t\ttry {\n\t\t\t// EDIT HERE TO GIVE PARAMETER TYPES\n\t\t\tmethod = cls.getMethod(methodName, int[].class, int.class);\n\t\t\t// END EDIT\n\t\t} catch (NoSuchMethodException | SecurityException e) {\n\t\t\tfail(\"Class \\\"\" + className + \"\\\" doesn't have a \\\"\" + methodName + \"(\" + argTypes\n\t\t\t\t\t+ \")\\\" method. (is the method name spelled right? are its parameters correct?)\");\n\t\t}\n\t\tinvokation = className + \".\" + methodName + \"(\" + argTypes + \")\";\n\t}",
"public X10MethodInstance createMethodInstance(Type container, Name name, List<Type> typeArgs, List<Type> argTypes, Context context) {\n try {\n return xts.findMethod(container, xts.MethodMatcher(container, name, typeArgs, argTypes, context));\n } catch (SemanticException e) {\n throw new InternalCompilerError(\"Unable to find required method instance\", container.position(), e);\n }\n }",
"Match createMatch();",
"private static Method _getMethodForClass(Class targetClass, String methodName, String[] paramTypeNames)\n throws ClassNotFoundException, NoSuchMethodException\n {\n int numParams = (paramTypeNames != null ? paramTypeNames.length : 0);\n Class[] paramTypes = new Class[numParams];\n ClassLoader loader = targetClass.getClassLoader();\n for (int i = 0; i<numParams; i++)\n {\n\tString typeName = paramTypeNames[i];\n\tif (typeName.equals(\"int\"))\n\t paramTypes[i] = Integer.TYPE;\n\telse if (typeName.equals(\"double\"))\n\t paramTypes[i] = Double.TYPE;\n\telse if (typeName.equals(\"boolean\"))\n\t paramTypes[i] = Boolean.TYPE;\n\telse if (loader == null)\n\t paramTypes[i] = Class.forName(paramTypeNames[i]);\n\telse\n\t paramTypes[i] = loader.loadClass(paramTypeNames[i]);\n }\n Method method = targetClass.getMethod(methodName, paramTypes);\n return method;\n }",
"public interface MethodCandidate extends Ordered {\n\n /**\n * The default position.\n */\n int DEFAULT_POSITION = 0;\n\n /**\n * Whether the given method name matches this finder.\n *\n * @param methodElement The method element. Never null.\n * @param matchContext The match context. Never null.\n * @return true if it does\n */\n boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);\n\n @Override\n default int getOrder() {\n return DEFAULT_POSITION;\n }\n\n /**\n * Builds the method info. The method {@link #isMethodMatch(MethodElement, MatchContext)} should be\n * invoked and checked prior to calling this method.\n *\n * @param matchContext The match context\n * @return The method info or null if it cannot be built. If the method info cannot be built an error will be reported to\n * the passed {@link MethodMatchContext}\n */\n @Nullable\n MethodMatchInfo buildMatchInfo(@NonNull MethodMatchContext matchContext);\n\n}",
"private Method findMethod(Class<?>[] ifaces, String name, Class<?>[] paramTypes, boolean[] primitiveparams)\n throws RemoteObjectWrapperException {\n // Convert the primitive method parameters as needed.\n // It sure is ugly; don't know of a better way to do it.\n for (int i = 0; i < paramTypes.length; i++) {\n if (primitiveparams[i]) {\n if (paramTypes[i].equals(Boolean.class)) {\n paramTypes[i] = Boolean.TYPE;\n } else if (paramTypes[i].equals(Character.class)) {\n paramTypes[i] = Character.TYPE;\n } else if (paramTypes[i].equals(Byte.class)) {\n paramTypes[i] = Byte.TYPE;\n } else if (paramTypes[i].equals(Short.class)) {\n paramTypes[i] = Short.TYPE;\n } else if (paramTypes[i].equals(Integer.class)) {\n paramTypes[i] = Integer.TYPE;\n } else if (paramTypes[i].equals(Long.class)) {\n paramTypes[i] = Long.TYPE;\n } else if (paramTypes[i].equals(Float.class)) {\n paramTypes[i] = Float.TYPE;\n } else if (paramTypes[i].equals(Double.class)) {\n paramTypes[i] = Double.TYPE;\n } else {\n throw new RemoteObjectWrapperException(\"Unrecognized primitive parameter type: \" + paramTypes[i]);\n }\n }\n }\n\n // Iterate over the given interfaces and find the method\n for (int i = 0; i < ifaces.length; i++) {\n try {\n return ifaces[i].getMethod(name, paramTypes);\n } catch (NoSuchMethodException e) {\n }\n }\n // Method not found\n throw new RemoteObjectWrapperException(\"Unable to find method \" + name);\n }",
"public Checks(kotlin.text.Regex r8, kotlin.reflect.jvm.internal.impl.util.Check[] r9, kotlin.jvm.functions.Function1<? super kotlin.reflect.jvm.internal.impl.descriptors.FunctionDescriptor, java.lang.String> r10) {\n /*\n r7 = this;\n java.lang.String r0 = \"regex\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r8, r0)\n java.lang.String r0 = \"checks\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r9, r0)\n java.lang.String r0 = \"additionalChecks\"\n kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r10, r0)\n int r0 = r9.length\n kotlin.reflect.jvm.internal.impl.util.Check[] r6 = new kotlin.reflect.jvm.internal.impl.util.Check[r0]\n int r0 = r9.length\n r1 = 0\n java.lang.System.arraycopy(r9, r1, r6, r1, r0)\n r2 = 0\n r4 = 0\n r1 = r7\n r3 = r8\n r5 = r10\n r1.<init>((kotlin.reflect.jvm.internal.impl.name.Name) r2, (kotlin.text.Regex) r3, (java.util.Collection<kotlin.reflect.jvm.internal.impl.name.Name>) r4, (kotlin.jvm.functions.Function1<? super kotlin.reflect.jvm.internal.impl.descriptors.FunctionDescriptor, java.lang.String>) r5, (kotlin.reflect.jvm.internal.impl.util.Check[]) r6)\n return\n */\n throw new UnsupportedOperationException(\"Method not decompiled: kotlin.reflect.jvm.internal.impl.util.Checks.<init>(kotlin.text.Regex, kotlin.reflect.jvm.internal.impl.util.Check[], kotlin.jvm.functions.Function1):void\");\n }",
"public interface Matcher {\n\n char WILDCARD = '*';\n\n void addFilter(String filter);\n\n boolean matches(String word);\n}",
"public void testSpecificBody(){\n $method $m = $method.of().$body(new Object(){ void m(Object $any$) { \n System.out.println($any$); \n }});\n \n class C {\n public void g(){\n System.out.println(1);\n } \n public void t(){\n // A comment is ignored when matching\n System.out.println( \"Some text \"); \n } \n } \n assertNotNull($m.firstIn(C.class));\n assertNotNull($m.selectFirstIn(C.class).is(\"any\", 1));\n assertEquals(2, $m.listIn(C.class).size()); \n }",
"@Factory\r\n public static Matcher<Proc> raises(Class<? extends Throwable> clazz, String regex) {\r\n return raises(IsThrowable.throwable(clazz, regex));\r\n }",
"public void addExpectedParameter(String name, Matcher<String> matcher) {\n expected.put(name, matcher);\n }",
"RegExConstraint createRegExConstraint();",
"public String getMethodName(Class<?> type, String methodName, Class<?>... params);",
"public void testCreateMethodWithParameters() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setParameters(new String[] { \"String\", \"int\", \"char[]\" }, new String[] { \"name\", \"number\", \"buffer\" });\n assertSourceEquals(\"source code incorrect\", \"public void foo(String name, int number, char[] buffer) {\\n\" + \"}\\n\", method.getContents());\n }",
"public interface PackageScanner {\n String FILE_SUFFIX = \".class\";\n\n /**\n * Find target element blow package except two class name.\n *\n * @param packageName\n * @param except\n * @param except2\n * @return\n * @throws IOException\n */\n Set<String> classNames(String packageName, String except, String except2) throws Exception;\n\n /**\n * Find target element blow package except single class name.\n *\n * @param packageName\n * @param except\n * @return\n * @throws IOException\n */\n Set<String> classNames(String packageName, String except) throws Exception;\n\n /**\n * Scanning target class blow package except @param except and @param except2 class.\n *\n * @param packageName\n * @param except\n * @param except2\n * @return\n */\n Set<?> scan(String packageName, Class<?> except, Class<?> except2) throws Exception;\n\n /**\n * Scanning target class blow package except @param except class.\n *\n * @param packageName\n * @param except\n * @return\n */\n Set<?> scan(String packageName, Class<?> except) throws Exception;\n\n /**\n * Instantiation a class set.\n *\n * @param classNames\n * @return\n */\n Set<?> instantiation(Set<String> classNames, Class<?> tClass) throws IOException;\n}",
"public static Method getMethod(Class<?> paramClass, String paramString, Class<?>[] paramArrayOfClass) throws NoSuchMethodException {\n/* 90 */ ReflectUtil.checkPackageAccess(paramClass);\n/* 91 */ return paramClass.getMethod(paramString, paramArrayOfClass);\n/* */ }",
"default HxMethod createMethod(final Class<?> returnType,\n final String methodName,\n final Class<?>... parameterTypes) {\n return createMethod(returnType.getName(),\n methodName,\n getHaxxor().toNormalizedClassnames(parameterTypes));\n }",
"public static ParameterExpression parameter(Class type, String name) { throw Extensions.todo(); }",
"Match getResultMatch();",
"default boolean match(String mnemonic, InstructionParameterTypes parameters) {\n return match(mnemonic, parameters.getParameters());\n }",
"static MBeanParameterInfo[] methodSignature(Method method) {\r\n Class[] classes = method.getParameterTypes();\r\n MBeanParameterInfo[] params = new MBeanParameterInfo[classes.length];\r\n\r\n for (int i = 0; i < classes.length; i++) {\r\n String parameterName = \"p\" + (i + 1);\r\n params[i] = new MBeanParameterInfo(parameterName, classes[i].getName(), \"\");\r\n }\r\n\r\n return params;\r\n }",
"boolean match(String pattern, String path);",
"public static void main(String[] args)\n {\n try\n {\n System.out.println(\"Regular expression [\"+args[0]+\"]\");\n NameParser parser = new NameParser();\n StringMatcher matcher = parser.parse(args[0]);\n for (int index = 1; index < args.length; index++)\n {\n String string = args[index];\n System.out.print(\"String [\"+string+\"]\");\n System.out.println(\" -> match = \"+matcher.matches(args[index]));\n }\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }",
"public static <T> ConstructorInvoker<T> findMatchingConstructor(Class<T> type, Object... values) throws NoSuchMethodException, IllegalStateException\n {\n return findMatchingExecutable(type.getDeclaredConstructors(), values);\n }",
"public boolean accept(File dir, String name) {\n/* 120 */ return this.pattern.matcher(name).matches();\n/* */ }",
"protected abstract Regex pattern();",
"public static Object invokeMethod(String classname,String funcName, Class paramTypes[],Object paramValues[]) throws Exception {\n\t\t\n\t\tClass myClass=Class.forName(classname);\n\t\tObject o=myClass.newInstance();\n\t\tMethod m=myClass.getDeclaredMethod(funcName, paramTypes);\n\t\t\n\t\tif(Modifier.isStatic(m.getModifiers()))\n\t\t\tSystem.out.println(\"Static\");\n\t\t\n\t\telse\n\t\t\t\n\t\t\tSystem.out.println(\"Not Static\");\n\t\t\n\t\treturn m.invoke(o, paramValues);\t\n\t\t\n\t}",
"@Test\n public void execute_nameParameter() throws ParseException {\n //No user input\n execute_parameterPredicate_test(0, \" \", \"name\", true, false, Collections.emptyList());\n //Single keyword, ignore case, person found.\n execute_parameterPredicate_test(1, \"ElLe\", \"name\", true, false, Arrays.asList(ELLE));\n //Single keyword, case sensitive, person found.\n execute_parameterPredicate_test(0, \"ElLe\", \"name\", false, false, Collections.emptyList());\n //Multiple keywords, ignore case, or condition, multiple people found\n execute_parameterPredicate_test(3, \"Kurz Elle Kunz\", \"name\", true, false, Arrays.asList(CARL, ELLE, FIONA));\n //Multiple keywords, ignore case, and condition, no one found\n execute_parameterPredicate_test(0, \"kurz Elle kunz\", \"name\", true, true, Collections.emptyList());\n //Multiple keywords, case sensitive, or condition, multiple people found\n execute_parameterPredicate_test(2, \"kurz Elle Kunz\", \"name\", false, false, Arrays.asList(ELLE, FIONA));\n //Multiple keywords, case sensitive, and condition, no one found\n execute_parameterPredicate_test(0, \"Kurz Elle kunz\", \"name\", false, true, Collections.emptyList());\n }",
"@Test\n public void multipleClassTest() throws CharSequenceCompilerException, InstantiationException, IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {\n String s = \"public interface MyPredicate { public boolean accept(int i); }\";\n // Implementation for even numbers\n String s2 = \"public class EvenPredicate implements MyPredicate { public boolean accept(int i) { return i%2==0;}}\";\n\n Map<String, CharSequence> classesToCompile = new LinkedHashMap<String, CharSequence>();\n\n // put them in wrong order\n classesToCompile.put(\"EvenPredicate\", s2);\n classesToCompile.put(\"MyPredicate\", s);\n\n // Compile them\n CharSequenceCompiler<Object> compiler = new CharSequenceCompiler<Object>();\n Map<String, Class<Object>> compileClasses = compiler.compile(classesToCompile);\n\n // Invoke accept method\n Class<Object> implementationClass = compileClasses.get(\"EvenPredicate\");\n Object object = implementationClass.newInstance();\n Method method = implementationClass.getMethod(\"accept\", int.class);\n boolean res = (Boolean) method.invoke(object, 2);\n assertTrue(res);\n\n Class<Object> interfaceClass = compileClasses.get(\"MyPredicate\");\n\n try {\n interfaceClass.newInstance();\n fail(\"Can't instantiate an interface!\");\n } catch (InstantiationException e) {\n\n }\n }",
"TestClassExecutionResult assertTestsExecuted(String... testNames);",
"boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);",
"public MethodSignature(Klass returnType, Klass[] parameterTypes) {\n this.returnType = returnType;\n this.parameterTypes = parameterTypes;\n }",
"private Executable matchingExecutable(\n TypeElement autoBuilderType,\n List<Executable> executables,\n ImmutableSet<ExecutableElement> methodsInAutoBuilderType,\n String description) {\n ImmutableList<Executable> matches =\n executables.stream()\n .filter(x -> executableMatches(x, methodsInAutoBuilderType))\n .collect(toImmutableList());\n switch (matches.size()) {\n case 0:\n throw errorReporter()\n .abortWithError(\n autoBuilderType,\n \"[AutoBuilderNoMatch] Property names do not correspond to the parameter names of\"\n + \" any %s:\\n%s\",\n description,\n executableListString(executables));\n case 1:\n return matches.get(0);\n default:\n // More than one match, let's see if we can find the best one.\n }\n int max = matches.stream().mapToInt(e -> e.parameters().size()).max().getAsInt();\n ImmutableList<Executable> maxMatches =\n matches.stream().filter(c -> c.parameters().size() == max).collect(toImmutableList());\n if (maxMatches.size() > 1) {\n throw errorReporter()\n .abortWithError(\n autoBuilderType,\n \"[AutoBuilderAmbiguous] Property names correspond to more than one %s:\\n%s\",\n description,\n executableListString(maxMatches));\n }\n return maxMatches.get(0);\n }",
"public void registerClassMethodSignatures(String targetClassName, \n\t\t\t\t\t String[] methodNames, \n\t\t\t\t\t java.lang.Object[] signatures) \n throws ClassNotFoundException, NoSuchMethodException\n {\n System.out.println(\"G2__BaseImpl::registerClassMethodSignatures \" + targetClassName);\n ClassLoader classloader = getClass().getClassLoader();\n targetClassName = targetClassName.replace('/','.');\n Class targetClass = null; \n if (classloader != null)\n targetClass = classloader.loadClass(targetClassName);\n else\n targetClass = Class.forName(targetClassName);\n Method[] methods = new Method[methodNames.length];\n for (int i=0; i<methodNames.length; i++) {\n methods[i] = _getMethodForClass(targetClass, methodNames[i], (String[])signatures[i]);\n }\n classMethodSignaturesHash.put(targetClass.getName(), methods);\n }",
"public interface Matcher<T> {\n\n\t/**\n\t * This method determines if the element must be allowed to be on the list.\n\t * \n\t * @param element\n\t * \n\t * @return true if the element is allowed. false otherwise.\n\t */\n\tboolean accepts(T element);\n\n}",
"public interface Validator {\n\n /**\n * Validates a pattern against formatting rules. The rules must match the {@link Formatter} this validator will be\n * used with.\n *\n * @param pattern formatting pattern\n * @param types list of parameter types\n * @throws InvalidPatternException if the format is incorrect or the parameter types do not match the pattern\n */\n void validate(String pattern, Type... types) throws InvalidPatternException;\n}",
"ClassMember search (String name, MethodType type, int access,\r\n\t\t int modifier_mask) {\r\n IdentifierList methods = (IdentifierList) get (name);\r\n\r\n if (methods == null) return null;\r\n\r\n java.util.Enumeration ms = methods.elements ();\r\n\r\n ClassMember more_specific = null;\r\n while (ms.hasMoreElements ()) {\r\n ClassMember m = (ClassMember) ms.nextElement ();\r\n\r\n int diff;\r\n try {\r\n\tdiff = m.type.compare (type);\r\n } catch (TypeMismatch e) {\r\n\tcontinue;\r\n }\r\n\r\n if (diff < 0) continue;\r\n\r\n int m_access = m.getAccess ();\r\n\r\n if (access == Constants.PROTECTED) {\r\n\tif (m_access == Constants.PRIVATE) continue;\r\n } else if (access == Constants.PUBLIC) {\r\n\tif (m_access != Constants.PUBLIC) continue;\r\n }\r\n\t \r\n if (modifier_mask > 0 &&\r\n\t ((m.getModifier () & modifier_mask) == 0)) continue;\r\n\r\n if (diff == 0) return m;\r\n\r\n if (more_specific == null) {\r\n\tmore_specific = m;\r\n\tcontinue;\r\n }\r\n\r\n try {\r\n\tif (((MethodType) m.type).isMoreSpecific ((MethodType) more_specific.type))\r\n\t more_specific = m;\r\n } catch (OverloadingAmbiguous ex) {\r\n\t/* this overloading is ambiguous */\r\n\tOzcError.overloadingAmbiguous (m);\r\n\treturn ClassMember.ANY;\r\n }\r\n }\r\n\r\n return more_specific;\r\n }",
"public boolean accept(T object, String pattern);",
"public interface ActionMatcher {\n boolean match(Action action, ActionParameters actionUri);\n}",
"TestClassExecutionResult assertTestFailed(String name, String displayName, Matcher<? super String>... messageMatchers);",
"public static Object invokeMethod(Object receiver, String name, Object... args) {\n try {\n Class<?> clazz = receiver.getClass();\n /*Class<?>[] parameterTypes = new Class<?>[args.length];\n for (int i=0; i<args.length; i++) {\n parameterTypes[i] = args[i].getClass();\n }*/\n \n Method[] methods = clazz.getDeclaredMethods();\n for (Method method : methods) {\n if (method.getName().equals(name)) {\n Class<?>[] parameterTypes = method.getParameterTypes();\n if (parameterTypes.length == args.length) {\n int matched = 0;\n for (; matched<parameterTypes.length; matched++) {\n if (!isAcceptableParameter(parameterTypes[matched], args[matched])) {\n break;\n }\n }\n if (matched == parameterTypes.length) {\n method.setAccessible(true);\n return method.invoke(receiver, args);\n }\n }\n }\n }\n\n /*Method method = clazz.getDeclaredMethod(name, parameterTypes);\n if (method != null) {\n method.setAccessible(true);\n return method.invoke(receiver, args);\n }*/\n } catch (Exception e) {\n Logger.w(\"Reflection\", \"invokeMethod \" + name + \" \" + e.toString());\n }\n return null;\n }",
"@Factory\r\n public static Matcher<Proc> raisesException(Class<? extends Exception> clazz, String regex) {\r\n return new Raises(IsThrowable.exception(clazz, regex));\r\n }",
"public interface ParameterNameDiscoverer {\n\n\t/**\n\t * Return parameter names for a method, or {@code null} if they cannot be determined.\n\t * <p>Individual entries in the array may be {@code null} if parameter names are only\n\t * available for some parameters of the given method but not for others. However,\n\t * it is recommended to use stub parameter names instead wherever feasible.\n\t * @param method the method to find parameter names for\n\t * @return an array of parameter names if the names can be resolved,\n\t * or {@code null} if they cannot\n\t */\n\t@Nullable\n\tString[] getParameterNames(Method method);\n\n\t/**\n\t * Return parameter names for a constructor, or {@code null} if they cannot be determined.\n\t * <p>Individual entries in the array may be {@code null} if parameter names are only\n\t * available for some parameters of the given constructor but not for others. However,\n\t * it is recommended to use stub parameter names instead wherever feasible.\n\t * @param ctor the constructor to find parameter names for\n\t * @return an array of parameter names if the names can be resolved,\n\t * or {@code null} if they cannot\n\t */\n\t@Nullable\n\tString[] getParameterNames(Constructor<?> ctor);\n\n}",
"public abstract Match match();",
"private static boolean matchName(@NotNull PsiMethod method, @NotNull IHasParameterInfos targetMethodInfo, @NotNull String targetMethodName, boolean isConstructor) {\n if (targetMethodName.startsWith(\"@\")) {\n IType returnType = ((IGosuMethodInfo) targetMethodInfo).getReturnType();\n if ((returnType.equals(JavaTypes.BOOLEAN()) || returnType.equals(JavaTypes.pBOOLEAN()) &&\n !method.getName().equals(\"is\" + targetMethodName.substring(1)))) {\n return true;\n }\n if (!method.getName().equals(\"get\" + targetMethodName.substring(1)) && !method.getName().equals(\"set\" + targetMethodName.substring(1))) {\n return true;\n }\n } else if (!targetMethodName.equals(method.getName()) && !(isConstructor && \"construct\".equals(method.getName()))) {\n return true;\n }\n return false;\n }",
"public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}",
"public void searchClassMemberDeclarations(String name, SearchIdConsumer consumer);",
"private static boolean matchesPackage(Class<?> param2Class, String param2String) {\n/* 654 */ String str = param2Class.getName();\n/* 655 */ return (str.startsWith(param2String) && str.lastIndexOf('.') == param2String.length() - 1);\n/* */ }",
"java.lang.String getRegex();",
"java.lang.String getRegex();",
"private Method getDeclaredMethodFor(Class<?> clazz, String name, Class<?>... parameterTypes) {\n try {\n return clazz.getDeclaredMethod(name, parameterTypes);\n } catch (NoSuchMethodException e) {\n Class<?> superClass = clazz.getSuperclass();\n if (superClass != null) {\n return getDeclaredMethodFor(superClass, name, parameterTypes);\n }\n }\n return null;\n }",
"@Factory\r\n public static Matcher<Proc> raisesException(String regex) {\r\n return new Raises(IsThrowable.exception(regex));\r\n }",
"private static Map<String, Method> buildMethoMap(final Class<?> c, String patternStr) throws Exception {\n\t\tMap<String, Method> methodMap = new HashMap<String, Method>();\n\t\tpatternStr = patternStr + \"([A-Z])(\\\\w+)\";\n\t\t\n\t\tfor (Method method : c.getMethods()) {\n\t\t\tString methodName = method.getName();\n\t\t\tPattern pattern = Pattern.compile(patternStr);\n\t\t\tMatcher matcher = pattern.matcher(methodName);\n\t\t\tif (!matcher.find()) continue;\n\t\t\t\n\t\t\tString fieldName = matcher.group(1).toLowerCase() + matcher.group(2);\n\t\t\t// Put the field into the hash table with its name as the key\n\t\t\tmethodMap.put(fieldName, method);\n\t\t}\n\t\t\n\t\treturn methodMap;\n\t}",
"@Override\n public String getAnalyzerName() {\n return \"Body Regex: \" + pattern.pattern();\n }",
"@Override\n public final boolean accept(File dir, String name) {\n return pattern.matcher(name).find();\n }"
] | [
"0.77055365",
"0.71967053",
"0.6976271",
"0.5843866",
"0.57793707",
"0.5355819",
"0.5290093",
"0.5287338",
"0.52480143",
"0.5190466",
"0.51872265",
"0.5179396",
"0.50872177",
"0.5081536",
"0.49613592",
"0.4956851",
"0.49404594",
"0.49371397",
"0.49339703",
"0.49137136",
"0.48902568",
"0.48824948",
"0.48427704",
"0.4830332",
"0.48250163",
"0.48163825",
"0.47411817",
"0.47303027",
"0.4718902",
"0.46956313",
"0.4636829",
"0.46082819",
"0.45970976",
"0.45697325",
"0.45691866",
"0.45424235",
"0.45251718",
"0.45223394",
"0.45126072",
"0.45024186",
"0.44984424",
"0.44956014",
"0.44787914",
"0.44505575",
"0.44499725",
"0.4449541",
"0.44465464",
"0.4436773",
"0.44353056",
"0.4429254",
"0.441759",
"0.44136938",
"0.4398726",
"0.43983412",
"0.43977627",
"0.4394312",
"0.43855846",
"0.43853825",
"0.43587974",
"0.43571606",
"0.4349855",
"0.43384108",
"0.43346876",
"0.43279895",
"0.43264765",
"0.43209904",
"0.43168893",
"0.43134847",
"0.4313131",
"0.43105137",
"0.43078703",
"0.43060693",
"0.4304178",
"0.43040147",
"0.4296021",
"0.42955846",
"0.42930362",
"0.4283779",
"0.42780042",
"0.42758456",
"0.4267844",
"0.4260548",
"0.42547253",
"0.425343",
"0.42529064",
"0.4250045",
"0.42452696",
"0.42425475",
"0.4239239",
"0.42373917",
"0.42341566",
"0.42213625",
"0.42140645",
"0.42116708",
"0.42116708",
"0.42098773",
"0.42093307",
"0.42056468",
"0.420054",
"0.41996312"
] | 0.7997634 | 0 |
Returns a method signature matcher for a given regular expression that matches the method name and a list of parameters as strings. | public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {
return new MethodSignatureMatcher(nameRegex, parameters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements Class<?>... parameters) {\n final @Nonnull String[] typeNames;\n if (parameters == null) {\n typeNames = new String[0];\n } else {\n typeNames = new String[parameters.length];\n int i = 0;\n for (@Nonnull Class<?> parameter : parameters) {\n typeNames[i] = parameter.getCanonicalName();\n i++;\n }\n }\n return new MethodSignatureMatcher(nameRegex, typeNames);\n }",
"private MethodSignatureMatcher(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n this.namePattern = Pattern.compile(nameRegex);\n if (parameters == null) {\n this.parameters = new String[0];\n } else {\n this.parameters = parameters;\n }\n }",
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex) {\n return new MethodSignatureMatcher(nameRegex, null);\n }",
"boolean match(String mnemonic, List<ParameterType>[] parameters);",
"boolean match(String mnemonic, ParameterType[] parameters);",
"protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }",
"public MethodSignature getMatchingMethod(\n String methodName,\n SequenceType arguments,\n SequenceType typeArguments,\n List<ShadowException> errors) {\n boolean hasTypeArguments = typeArguments != null;\n MethodSignature candidate = null;\n\n for (MethodSignature signature : recursivelyGetMethodOverloads(methodName)) {\n MethodType methodType = signature.getMethodType();\n\n if (methodType.isParameterized()) {\n if (hasTypeArguments) {\n SequenceType parameters = methodType.getTypeParameters();\n try {\n if (parameters.canAccept(typeArguments, SubstitutionKind.TYPE_PARAMETER)) {\n signature = signature.replace(parameters, typeArguments);\n } else continue;\n } catch (InstantiationException ignored) {\n }\n }\n }\n\n // the list of method signatures starts with the closest (current class) and then adds parents\n // and outer classes\n // always stick with the current if you can\n // (only replace if signature is a subtype of candidate but candidate is not a subtype of\n // signature)\n if (signature.canAccept(arguments)) {\n if (candidate == null\n || (signature.getParameterTypes().isSubtype(candidate.getParameterTypes())\n && !candidate.getParameterTypes().isSubtype(signature.getParameterTypes())))\n candidate = signature;\n else if (!candidate.getParameterTypes().isSubtype(signature.getParameterTypes())) {\n ErrorReporter.addError(\n errors,\n Error.INVALID_ARGUMENTS,\n \"Ambiguous reference to \" + methodName + \" with arguments \" + arguments,\n arguments);\n return null;\n }\n }\n }\n\n if (candidate == null)\n ErrorReporter.addError(\n errors,\n Error.INVALID_METHOD,\n \"No definition of \" + methodName + \" with arguments \" + arguments + \" in this context\",\n arguments);\n\n return candidate;\n }",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"private static ElementMatcher.Junction getMethodMatcher(TypeDescription typeDescription) {\n ElementMatcher.Junction methodMatcher1 = isDeclaredBy(typeDescription).and(namedIgnoreCase(\"doList\")).and(takesArguments(1));\n\n // private List<Invoker<T>> route(List<Invoker<T>> invokers, String method)\n ElementMatcher.Junction methodMatcher2 = isDeclaredBy(typeDescription).and(namedIgnoreCase(\"route\")).and(takesArguments(2));\n return methodMatcher1.or(methodMatcher2);\n }",
"boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);",
"public Method findMethod(final String methodName, final List<Type> parameterTypes) {\r\n\t\tGeneratorHelper.checkJavaMethodName(\"parameter:methodName\", methodName);\r\n\t\tChecker.notNull(\"parameter:parameterTypes\", parameterTypes);\r\n\r\n\t\tMethod found = null;\r\n\r\n\t\tfinal Iterator<Method> methods = this.getMethods().iterator();\r\n\r\n\t\twhile (methods.hasNext()) {\r\n\t\t\tfinal Method method = methods.next();\r\n\t\t\tif (false == method.getName().equals(methodName)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tfinal List<MethodParameter> methodParameters = method.getParameters();\r\n\t\t\tif (methodParameters.size() != parameterTypes.size()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tfound = method;\r\n\r\n\t\t\tfinal Iterator<MethodParameter> methodParametersIterator = methodParameters.iterator();\r\n\t\t\tfinal Iterator<Type> parameterTypesIterator = parameterTypes.iterator();\r\n\r\n\t\t\twhile (parameterTypesIterator.hasNext()) {\r\n\t\t\t\tfinal Type type = parameterTypesIterator.next();\r\n\t\t\t\tfinal MethodParameter parameter = methodParametersIterator.next();\r\n\t\t\t\tif (false == type.equals(parameter.getType())) {\r\n\t\t\t\t\tfound = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (null != found) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn found;\r\n\t}",
"private boolean matchesMethod (final Object method, \n\t\tfinal int expectedModifiers, final int optionalModifiers, \n\t\tfinal String expectedReturnType)\n\t{\n\t\tboolean matches = false; \n\n\t\tif (method != null)\n\t\t{\n\t\t\tModel model = getModel();\n\t\t\tint modifiers = model.getModifiers(method);\n\n\t\t\tmatches = (((modifiers == expectedModifiers) || \n\t\t\t\t(modifiers == (expectedModifiers | optionalModifiers))) &&\n\t\t\t\texpectedReturnType.equals(model.getType(method)));\n\t\t}\n\n\t\treturn matches;\n\t}",
"public Method getMethodByName(String nameRegex) {\r\n \t\t\r\n \t\tPattern match = Pattern.compile(nameRegex);\r\n \t\t\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (match.matcher(method.getName()).matches()) {\r\n \t\t\t\t// Right - this is probably it. \r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tthrow new RuntimeException(\"Unable to find a method with the pattern \" + \r\n \t\t\t\t\t\t\t\t\tnameRegex + \" in \" + source.getName());\r\n \t}",
"public static Method method(Object receiver, String method, Object[] args) {\n for (Class<?> c : types(receiver)) {\n Method candidate = findMatchingMethod(c, method, args);\n if (candidate != null) {\n return candidate;\n }\n }\n if (receiver instanceof GString) { // cf. GString.invokeMethod\n Method candidate = findMatchingMethod(String.class, method, args);\n if (candidate != null) {\n return candidate;\n }\n }\n return null;\n }",
"public static MethodInvoker findMatchingMethod(Class<?> type, String methodName, Object... values) throws NoSuchMethodException, IllegalStateException\n {\n List<Method> methodList = new ArrayList<>(20);\n Class<?> currentType = type;\n while ((currentType != null) && ! currentType.equals(Object.class))\n {\n for (Method method : currentType.getDeclaredMethods())\n {\n if (method.getName().equals(methodName) && (method.getParameterCount() == values.length))\n {\n methodList.add(method);\n }\n }\n currentType = currentType.getSuperclass();\n }\n return findMatchingExecutable(methodList.toArray(new Method[methodList.size()]), values);\n }",
"HxMethod createMethod(final String returnType,\n final String methodName,\n final String... parameterTypes);",
"private static String getMethodSignature(Class[] paramTypes, Class retType) {\n StringBuffer sbuf = new StringBuffer();\n sbuf.append('(');\n for (int i = 0; i < paramTypes.length; i++) {\n sbuf.append(getClassSignature(paramTypes[i]));\n }\n sbuf.append(')');\n sbuf.append(getClassSignature(retType));\n return sbuf.toString();\n }",
"protected abstract boolean matches(String paramString, int paramInt);",
"public boolean parametersMatch(Method m, Class[] param) {\n boolean match = false;\n Class[] types = m.getParameterTypes();\n if (types.length!=param.length)\n return false;\n for (int i=0; i<types.length; i++) {\n match = types[i].equals(param[i]);\n }\n return match;\n }",
"private boolean methodsMatch(Method method,\n CallStatement.CallStatementEntry entry) throws EngineException {\n if (!method.getName().equals(entry.getName())) {\n return false;\n }\n if (method.getParameterTypes().length != parameters.size()) {\n return false;\n }\n Class[] parameterTypes = method.getParameterTypes();\n for (int index = 0; index < parameters.size(); index++) {\n Class parameterType = parameterTypes[index];\n Object parameterValue = parameters.get(index);\n if (!parameterType.isAssignableFrom(parameterValue.getClass())) {\n return false;\n }\n }\n \n for (int index = 0; index < parameters.size(); index++) {\n Class parameterType = parameterTypes[index];\n Object parameterValue = parameters.get(index);\n parameters.set(index, parameterType.cast(parameterValue));\n }\n return true;\n }",
"public static MethodType fromParameters(String name, Type... paramTypes) {\n MethodType type = new MethodType(name);\n type.paramTypes = Arrays.copyOf(paramTypes, paramTypes.length);\n return type;\n }",
"public boolean matches(Method method, Class<?> targetClass)\n/* */ {\n/* 133 */ return ((targetClass != null) && (matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass)))) || \n/* 134 */ (matchesPattern(ClassUtils.getQualifiedMethodName(method)));\n/* */ }",
"@Override\n public boolean evaluate(@Nonnull MethodInformation methodInformation) {\n boolean matches = namePattern.matcher(methodInformation.getName()).matches();\n final @Nonnull @NonNullableElements List<? extends VariableElement> methodParameters = methodInformation.getElement().getParameters();\n if (parameters.length == methodParameters.size()) {\n for (int i = 0; i < methodParameters.size(); i++) {\n final @Nonnull String nameOfDeclaredType = ProcessingUtility.getQualifiedName(methodParameters.get(i).asType());\n ProcessingLog.debugging(\"name of type: $\", nameOfDeclaredType);\n final @Nonnull String parameter = parameters[i];\n if (!parameter.equals(\"?\")) {\n matches = matches && nameOfDeclaredType.equals(parameter);\n }\n }\n } else {\n matches = false;\n }\n return matches;\n }",
"boolean match(String pattern, String path);",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"public Method getMethodByParameters(String name, Class<?>... args) {\r\n \t\t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"AnnotationProvider getMethodAnnotationProvider(String methodName, Class... parameterTypes);",
"protected abstract Matcher<? super ExpressionTree> specializedMatcher();",
"abstract UrlPatternMatcher create( String pattern );",
"public List<FunctionArgument> resolveArguments(String argumentsPattern) throws InvalidArgumentsPatternException;",
"public void testCreateMethodWithParameters() {\n IDOMMethod method = this.domFactory.createMethod();\n method.setName(\"foo\");\n method.setParameters(new String[] { \"String\", \"int\", \"char[]\" }, new String[] { \"name\", \"number\", \"buffer\" });\n assertSourceEquals(\"source code incorrect\", \"public void foo(String name, int number, char[] buffer) {\\n\" + \"}\\n\", method.getContents());\n }",
"public static String toRegex(String param) \r\n\t{\r\n\t\tStringBuffer regex = new StringBuffer();\r\n\t\tfor( int i=0; i < param.length(); i++ ) \r\n\t\t{\r\n\t\t\tchar next = param.charAt( i );\r\n\t\t\t if ('*' == next) regex.append( \".+\" ); // -> multi-character match wild card\r\n\t\t\telse if ('?' == next) regex.append( \".\" ); // -> single-character match wild card\r\n\t\t\telse if ('.' == next) regex.append( \"\\\\.\" ); // all of these are special regex characters we are quoting\r\n\t\t\telse if ('+' == next) regex.append( \"\\\\+\" ); \r\n\t\t\telse if ('$' == next) regex.append( \"\\\\$\" ); \r\n\t\t\telse if ('\\\\' == next) regex.append( \"\\\\\\\\\" ); \r\n\t\t\telse if ('[' == next) regex.append( \"\\\\[\" ); \r\n\t\t\telse if (']' == next) regex.append( \"\\\\]\" ); \r\n\t\t\telse if ('{' == next) regex.append( \"\\\\{\" ); \r\n\t\t\telse if ('}' == next) regex.append( \"\\\\}\" ); \r\n\t\t\telse if ('(' == next) regex.append( \"\\\\(\" ); \r\n\t\t\telse if (')' == next) regex.append( \"\\\\)\" ); \r\n\t\t\telse if ('&' == next) regex.append( \"\\\\&\" ); \r\n\t\t\telse if ('^' == next) regex.append( \"\\\\^\" ); \r\n\t\t\telse if ('-' == next) regex.append( \"\\\\-\" ); \r\n\t\t\telse if ('|' == next) regex.append( \"\\\\|\" ); \r\n\t\t\telse regex.append( next );\r\n\t\t}\r\n\t\t\r\n\t\treturn regex.toString();\r\n\t}",
"String getRegExpLikeOperator(String column, String regexp);",
"public String[] getParameters(String signature) {\n StringBuilder sb = new StringBuilder();\n String[] tokens = (signature.split(\"\\\\s\"));\n for (int i = 1; i < tokens.length; i++)\n sb.append(tokens[i]);\n String fullParamString = sb.toString().substring(sb.indexOf(\"(\") + 1, sb.indexOf(\")\"));\n String[] params = getParams(fullParamString);\n return params;\n }",
"Object isMatch(Object arg, String wantedType);",
"HxMethod createMethod(final HxType returnType,\n final String methodName,\n final HxType... parameterTypes);",
"public Method addMethod(String sSig)\n {\n int of = sSig.indexOf('(');\n return addMethod(sSig.substring(0, of), sSig.substring(of));\n }",
"public static MatchesSpecification matches( Property<String> property, String regexp )\n {\n return new MatchesSpecification( property( property ), regexp );\n }",
"MethodType (String m, Type r, ExpressionList args) {\r\n name = m;\r\n return_type = r;\r\n arguments = args;\r\n body = null;\r\n }",
"public Matcher matcher(String uri);",
"public interface MethodCandidate extends Ordered {\n\n /**\n * The default position.\n */\n int DEFAULT_POSITION = 0;\n\n /**\n * Whether the given method name matches this finder.\n *\n * @param methodElement The method element. Never null.\n * @param matchContext The match context. Never null.\n * @return true if it does\n */\n boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);\n\n @Override\n default int getOrder() {\n return DEFAULT_POSITION;\n }\n\n /**\n * Builds the method info. The method {@link #isMethodMatch(MethodElement, MatchContext)} should be\n * invoked and checked prior to calling this method.\n *\n * @param matchContext The match context\n * @return The method info or null if it cannot be built. If the method info cannot be built an error will be reported to\n * the passed {@link MethodMatchContext}\n */\n @Nullable\n MethodMatchInfo buildMatchInfo(@NonNull MethodMatchContext matchContext);\n\n}",
"public Method getMethodByParameters(String name, Class<?> returnType, Class<?>[] args) {\r\n \t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (method.getReturnType().equals(returnType) && Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"private Executable matchingExecutable(\n TypeElement autoBuilderType,\n List<Executable> executables,\n ImmutableSet<ExecutableElement> methodsInAutoBuilderType,\n String description) {\n ImmutableList<Executable> matches =\n executables.stream()\n .filter(x -> executableMatches(x, methodsInAutoBuilderType))\n .collect(toImmutableList());\n switch (matches.size()) {\n case 0:\n throw errorReporter()\n .abortWithError(\n autoBuilderType,\n \"[AutoBuilderNoMatch] Property names do not correspond to the parameter names of\"\n + \" any %s:\\n%s\",\n description,\n executableListString(executables));\n case 1:\n return matches.get(0);\n default:\n // More than one match, let's see if we can find the best one.\n }\n int max = matches.stream().mapToInt(e -> e.parameters().size()).max().getAsInt();\n ImmutableList<Executable> maxMatches =\n matches.stream().filter(c -> c.parameters().size() == max).collect(toImmutableList());\n if (maxMatches.size() > 1) {\n throw errorReporter()\n .abortWithError(\n autoBuilderType,\n \"[AutoBuilderAmbiguous] Property names correspond to more than one %s:\\n%s\",\n description,\n executableListString(maxMatches));\n }\n return maxMatches.get(0);\n }",
"private Pattern fileNameMatch(final String name) {\n final StringBuilder sb = new StringBuilder(name.length());\n for (int i = 0; i < name.length(); i++) {\n final char c = name.charAt(i);\n if (c == '.') {\n sb.append('\\\\').append('.');\n } else if (c == '?') {\n sb.append('.');\n } else if (c == '*') {\n sb.append('.').append('*').append('?');\n } else {\n sb.append(c);\n }\n }\n return Pattern.compile(sb.toString(), Pattern.CASE_INSENSITIVE);\n }",
"public TokenMatcherList addMatcher(final String tokens,\n final Function<List<String>, String> fun) {\n TokenPattern tp = new TokenPattern(tokens);\n TokenMatcher tm = tp.compile();\n tm.setFunction(fun);\n return addMatcher(tm);\n }",
"public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}",
"boolean matched(int index, String pattern, T value);",
"private void appendFunctionNamesMatching(List<ModuleFunctionPair> functionNameList, SourceFile m, String partialName)\n\t{\n\t\tint exactHitAt = -1;\n\n\t\t// trim off the trailing parenthesis, if any\n\t\tint parenAt = partialName.lastIndexOf('(');\n\t\tif (parenAt > -1)\n\t\t\tpartialName = partialName.substring(0, parenAt);\n\n\t\tString[] names = m.getFunctionNames(m_session);\n\t\tfor(int i=0; i<names.length; i++)\n {\n String functionName = names[i];\n if (functionName.equals(partialName))\n\t\t\t{\n\t\t\t\texactHitAt = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if (functionName.startsWith(partialName))\n functionNameList.add(new ModuleFunctionPair(m.getId(), functionName));\n }\n\n\t\t// exact match?\n\t\tif (exactHitAt > -1)\n\t\t{\n\t\t\tfunctionNameList.clear();\n\t\t\tfunctionNameList.add(new ModuleFunctionPair(m.getId(), names[exactHitAt]));\n\t\t}\n\t}",
"protected abstract Regex pattern();",
"public List<MethodInfo> getMethod(String methodName) {\n List<MethodInfo> matchedMethodInfo = new ArrayList<MethodInfo>();\n for (MethodInfo method : this.lstMethodInfo) {\n if (methodName.equals(method.getName())) {\n matchedMethodInfo.add(method);\n }\n }\n \n return matchedMethodInfo;\n }",
"static MBeanParameterInfo[] methodSignature(Method method) {\r\n Class[] classes = method.getParameterTypes();\r\n MBeanParameterInfo[] params = new MBeanParameterInfo[classes.length];\r\n\r\n for (int i = 0; i < classes.length; i++) {\r\n String parameterName = \"p\" + (i + 1);\r\n params[i] = new MBeanParameterInfo(parameterName, classes[i].getName(), \"\");\r\n }\r\n\r\n return params;\r\n }",
"public static void main(String[] args)\n {\n try\n {\n System.out.println(\"Regular expression [\"+args[0]+\"]\");\n NameParser parser = new NameParser();\n StringMatcher matcher = parser.parse(args[0]);\n for (int index = 1; index < args.length; index++)\n {\n String string = args[index];\n System.out.print(\"String [\"+string+\"]\");\n System.out.println(\" -> match = \"+matcher.matches(args[index]));\n }\n }\n catch (Exception ex)\n {\n ex.printStackTrace();\n }\n }",
"public interface Matcher {\n\n char WILDCARD = '*';\n\n void addFilter(String filter);\n\n boolean matches(String word);\n}",
"java.lang.String getRegex();",
"java.lang.String getRegex();",
"public boolean methodNameMatches(String methodName, String propertyName) {\n\t\tif (methodName.equalsIgnoreCase(propertyName)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"@Factory\r\n public static Matcher<Proc> raises(String regex) {\r\n return raises(IsThrowable.throwable(regex));\r\n }",
"public boolean accept(T object, String pattern);",
"@Test\n public void execute_multiParameter_namePhone() throws ParseException {\n execute_multipleParameterPredicate_test(2, \"alice 95352563\", \"name phone\", true, false,\n Arrays.asList(ALICE, CARL));\n //different paramters from same person, ignore case, and operation\n execute_multipleParameterPredicate_test(1, \"alice 94351253\", \"name phone\", true, true,\n Arrays.asList(ALICE));\n //different paramters from same person, case sensitive, and operation\n execute_multipleParameterPredicate_test(0, \"alice 94351253\", \"name phone\", false, true,\n Collections.emptyList());\n }",
"private static boolean matchRegex(Pattern regExpression, String filename) {\n\t\tMatcher m = regExpression.matcher(filename);\n\t\tif (m.matches()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public String getRegex();",
"public final void rule__MethodSpec__SignatureAssignment_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:16280:1: ( ( ruleSignature ) )\r\n // InternalGo.g:16281:2: ( ruleSignature )\r\n {\r\n // InternalGo.g:16281:2: ( ruleSignature )\r\n // InternalGo.g:16282:3: ruleSignature\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getMethodSpecAccess().getSignatureSignatureParserRuleCall_0_1_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleSignature();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getMethodSpecAccess().getSignatureSignatureParserRuleCall_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"@Description(\"request body contains substring/matches RegExp '{bodyExpression}'\")\n public static Criteria<HarEntry> recordedRequestBodyMatches(@DescriptionFragment(\"bodyExpression\") String bodyExpression) {\n checkArgument(isNotBlank(bodyExpression), \"Request body substring/RegExp should be defined\");\n\n return condition(entry -> {\n HarPostData postData = entry.getRequest().getPostData();\n\n return ofNullable(postData)\n .map(data -> checkByStringContainingOrRegExp(bodyExpression).test(data.getText()))\n .orElse(false);\n });\n }",
"public interface ActionMatcher {\n boolean match(Action action, ActionParameters actionUri);\n}",
"@Test\n\tpublic void testChangeMethodParameters() {\n\t\tDeclarationListDelta delta = createClassDelta(\n\t\t\t\t\"int someMethod(String x) { return 0;} \",\n\t\t\t\t\"int someMethod(int x) { return 0;}\");\n\n\t\tassertEquals(1, delta.getAddedDeclarations().size());\n\t\tassertEquals(0, delta.getChangedDeclarations().size());\n\t\tassertEquals(1, delta.getRemovedDeclarations().size());\n\n\t\tString removedMethod = methodSignature(delta.getRemovedDeclarations()\n\t\t\t\t.get(0));\n\t\tassertEquals(\"int someMethod(String)\", removedMethod);\n\n\t\tString addedMethod = methodSignature(delta.getAddedDeclarations()\n\t\t\t\t.get(0));\n\t\tassertEquals(\"int someMethod(int)\", addedMethod);\n\t}",
"static String eatParameterSignature (String s, int pos[]) {\r\n int first = pos[0];\r\n if (s.charAt(first)=='V') {\r\n pos[0]++;\r\n int n = eatNumber (s, pos);\r\n pos[0]++; // eat ';'\r\n return \"V\"+n+\";\";\r\n }\r\n int n = eatNumber (s, pos);\r\n if (n==0) return null;\r\n int last = first;\r\n for (int i=0; i<n; i++) {\r\n last = s.indexOf (';', last) + 1;\r\n }\r\n pos[0] = last;\r\n return s.substring (first, last);\r\n }",
"Collection<String> getMethodsForValidRules(Request message);",
"public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}",
"default boolean match(String mnemonic, InstructionParameterTypes parameters) {\n return match(mnemonic, parameters.getParameters());\n }",
"public interface IFunctionArgumentsResolver {\r\n\t/**\r\n\t * Finds all function arguments for the given pattern.\r\n\t * @param argumentsPattern pattern that decribes function arguments.\r\n\t * @return list of all resolved arguments.\r\n\t * @throws InvalidArgumentsPatternException the given pattern is not correct according\r\n\t * to used grammar. \r\n\t */\r\n\tpublic List<FunctionArgument> resolveArguments(String argumentsPattern) throws InvalidArgumentsPatternException;\r\n}",
"public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) {\n\ttry {\n\t\t/* Since this method attempts to find a method by getting all methods from the class,\n\tthis method should only be called if getMethod cannot find the method. */\n\t\tjava.lang.reflect.Method methods[] = aClass.getMethods();\n\t\tfor (int index = 0; index < methods.length; index++){\n\t\t\tjava.lang.reflect.Method method = methods[index];\n\t\t\tif ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) {\n\t\t\t\treturn method;\n\t\t\t}\n\t\t}\n\t} catch (java.lang.Throwable exception) {\n\t\treturn null;\n\t}\n\treturn null;\n}",
"private List<CalledMethodScanResult> findVerifyMethodsFromAnnotation(CalledMethodScanResult whenMethod,\n AnnotationScanResult annotationWithVerify) {\n\n List<CalledMethodScanResult> verifyList = annotationWithVerify.getCalledMethodScanResultList()\n .stream()\n .filter(calledMethod -> calledMethod.getMethodCalledName()\n .equals(MethodType.VERIFY.getType()))\n .filter(calledMethod -> !calledMethod.getMethodCalledArguments().contains(\"any\"))\n .filter(calledMethod -> checkSimilarity(whenMethod.getMethodCalledArguments(),\n calledMethod.getMethodCalledArguments()))\n .collect(Collectors.toList());\n return verifyList;\n }",
"Method getRiggerMethod(String methodName, Class<?>... params) throws Exception {\r\n Rigger rigger = getRiggerInstance();\r\n Class<? extends Rigger> clazz = rigger.getClass();\r\n Method method = clazz.getDeclaredMethod(methodName, params);\r\n method.setAccessible(true);\r\n return method;\r\n }",
"Pattern pattern() {\r\n\t\tArrayList<String> patternSpecs = new ArrayList<String>();\r\n\t\t\r\n\t\tif (delimiters.size() > 0) {\r\n\t\t delimiters.forEach(d -> patternSpecs.add(d.pattern().pattern()));\r\n\t\t} else {\r\n\t\t\tpatternSpecs.add(\"^.*$\");\r\n\t\t}\r\n\t\t\r\n\t\tString completeSpec = Joiner.on(\"|\").join(patternSpecs); // \r\n\t\t\r\n\t\tPattern pattern = Pattern.compile(completeSpec);\r\n\t\t\r\n\t\treturn pattern;\r\n\t}",
"public boolean isEvalMatching(final String expression, final String textPattern);",
"HxMethod createMethodReference(final String declaringType,\n final String returnType,\n final String methodName,\n final String... parameterTypes);",
"private static final boolean matches(String s, String regex)\n throws IllegalArgumentException {\n\n // Check preconditions\n if (regex == null) {\n throw new IllegalArgumentException(\"regex == null\");\n }\n\n // Compile the regular expression pattern\n Pattern pattern;\n try {\n pattern = Pattern.compile(regex);\n } catch (PatternSyntaxException cause) {\n throw new IllegalArgumentException(\"Invalid regular expression \\\"\" + regex + \"\\\".\", cause);\n }\n\n // Short-circuit if the string is null\n if (s == null) {\n return false;\n }\n\n // Find a match\n return pattern.matcher(s).find();\n }",
"public String getMethodName(Class<?> type, String methodName, Class<?>... params);",
"public static MethodCallExpression call(Expression expression, String methodName, Class[] typeArguments, Expression[] arguments) { throw Extensions.todo(); }",
"public boolean strictMatches(@Nullable String name, ReflectionClassWrapper[] params) {\n\n if(name != null)\n if(!getName().equals(name))\n return false;\n\n var paramTypes = getExecutable().getParameterTypes();\n\n if(!(paramTypes.length == params.length))\n return false;\n\n for (int i = 0; i < params.length; i++) {\n\n if(!params[i].getName().equals(paramTypes[i].getName()))\n return false;\n\n }\n\n return true;\n\n }",
"public interface Matcher<T> {\n\n\t/**\n\t * This method determines if the element must be allowed to be on the list.\n\t * \n\t * @param element\n\t * \n\t * @return true if the element is allowed. false otherwise.\n\t */\n\tboolean accepts(T element);\n\n}",
"void computeSignature(String signature) {\n\t\t// In case of IJavaElement signature, replace '/' by '.'\n\t\tchar[] source = signature.replace('/','.').replace('$','.').toCharArray();\n\n\t\t// Init counters and arrays\n\t\tchar[][] signatures = new char[10][];\n\t\tint signaturesCount = 0;\n\t\tint[] lengthes = new int [10];\n\t\tint typeArgsCount = 0;\n\t\tint paramOpening = 0;\n\t\tboolean parameterized = false;\n\t\t\n\t\t// Scan each signature character\n\t\tfor (int idx=0, ln = source.length; idx < ln; idx++) {\n\t\t\tswitch (source[idx]) {\n\t\t\t\tcase '>':\n\t\t\t\t\tparamOpening--;\n\t\t\t\t\tif (paramOpening == 0) {\n\t\t\t\t\t\tif (signaturesCount == lengthes.length) {\n\t\t\t\t\t\t\tSystem.arraycopy(signatures, 0, signatures = new char[signaturesCount+10][], 0, signaturesCount);\n\t\t\t\t\t\t\tSystem.arraycopy(lengthes, 0, lengthes = new int[signaturesCount+10], 0, signaturesCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlengthes[signaturesCount] = typeArgsCount;\n\t\t\t\t\t\ttypeArgsCount = 0;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '<':\n\t\t\t\t\tparamOpening++;\n\t\t\t\t\tif (paramOpening == 1) {\n\t\t\t\t\t\ttypeArgsCount = 0;\n\t\t\t\t\t\tparameterized = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '*':\n\t\t\t\tcase ';':\n\t\t\t\t\tif (paramOpening == 1) typeArgsCount++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '.':\n\t\t\t\t\tif (paramOpening == 0) {\n\t\t\t\t\t\tif (signaturesCount == lengthes.length) {\n\t\t\t\t\t\t\tSystem.arraycopy(signatures, 0, signatures = new char[signaturesCount+10][], 0, signaturesCount);\n\t\t\t\t\t\t\tSystem.arraycopy(lengthes, 0, lengthes = new int[signaturesCount+10], 0, signaturesCount);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsignatures[signaturesCount] = new char[idx+1];\n\t\t\t\t\t\tSystem.arraycopy(source, 0, signatures[signaturesCount], 0, idx);\n\t\t\t\t\t\tsignatures[signaturesCount][idx] = Signature.C_SEMICOLON;\n\t\t\t\t\t\tsignaturesCount++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Store signatures and type arguments\n\t\tthis.typeSignatures = new char[signaturesCount+1][];\n\t\tif (parameterized)\n\t\t\tthis.typeArguments = new char[signaturesCount+1][][];\n\t\tthis.typeSignatures[0] = source;\n\t\tif (parameterized) {\n\t\t\tthis.typeArguments[0] = Signature.getTypeArguments(source);\n\t\t\tif (lengthes[signaturesCount] != this.typeArguments[0].length) {\n\t\t\t\t// TODO (frederic) abnormal signature => should raise an error\n\t\t\t}\n\t\t}\n\t\tfor (int i=1, j=signaturesCount-1; i<=signaturesCount; i++, j--){\n\t\t\tthis.typeSignatures[i] = signatures[j];\n\t\t\tif (parameterized) {\n\t\t\t\tthis.typeArguments[i] = Signature.getTypeArguments(signatures[j]);\n\t\t\t\tif (lengthes[j] != this.typeArguments[i].length) {\n\t\t\t\t\t// TODO (frederic) abnormal signature => should raise an error\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public abstract String[] getMethodNames();",
"HxMethod createConstructor(final String... parameterTypes);",
"public interface PacketMatcher {\n public boolean matches(ChatPacket packet);\n\n /**\n * Simple matcher for basing selection on PacketType\n * \n * @author Aaron Rosenfeld <[email protected]>\n * \n */\n public static class TypeMatcher implements PacketMatcher {\n private PacketType[] types;\n\n public TypeMatcher(PacketType... types) {\n this.types = types;\n }\n\n @Override\n public boolean matches(ChatPacket packet) {\n for (PacketType t : types) {\n if (packet.getType() == t) {\n return true;\n }\n }\n return false;\n }\n }\n}",
"static Extractor byRegex(String format, Object... args) {\n\t\t\treturn byRegex(RegexUtil.compile(format, args));\n\t\t}",
"private static Map<String, Method> buildMethoMap(final Class<?> c, String patternStr) throws Exception {\n\t\tMap<String, Method> methodMap = new HashMap<String, Method>();\n\t\tpatternStr = patternStr + \"([A-Z])(\\\\w+)\";\n\t\t\n\t\tfor (Method method : c.getMethods()) {\n\t\t\tString methodName = method.getName();\n\t\t\tPattern pattern = Pattern.compile(patternStr);\n\t\t\tMatcher matcher = pattern.matcher(methodName);\n\t\t\tif (!matcher.find()) continue;\n\t\t\t\n\t\t\tString fieldName = matcher.group(1).toLowerCase() + matcher.group(2);\n\t\t\t// Put the field into the hash table with its name as the key\n\t\t\tmethodMap.put(fieldName, method);\n\t\t}\n\t\t\n\t\treturn methodMap;\n\t}",
"public final Method mo19982a(Class<?> cls, String str, Class<?>... clsArr) {\n C12932j.m33818b(cls, \"target\");\n C12932j.m33818b(str, \"name\");\n C12932j.m33818b(clsArr, \"parameterTypes\");\n Method declaredMethod = cls.getDeclaredMethod(str, (Class[]) Arrays.copyOf(clsArr, clsArr.length));\n C12932j.m33815a((Object) declaredMethod, \"target.getDeclaredMethod(name, *parameterTypes)\");\n return declaredMethod;\n }",
"public static Method getMethod(Class<?> paramClass, String paramString, Class<?>[] paramArrayOfClass) throws NoSuchMethodException {\n/* 90 */ ReflectUtil.checkPackageAccess(paramClass);\n/* 91 */ return paramClass.getMethod(paramString, paramArrayOfClass);\n/* */ }",
"public final boolean matches(List<Type> typeList) {\n return typeList.equals(pattern);\n }",
"public static Function<CharSequence, Integer> literalMatcher(CharSequence... patterns) {\n return MultiLiteralPattern.forStrings(patterns);\n }",
"public void testOneOrMoreParameters() {\n int nrParameters = methodToTest.getParameterTypes().length;\n Class[] params = methodToTest.getParameterTypes();\n Object[] foo = new Object[nrParameters];\n \n // set up all parameters. Some methods are invoked with\n // primitives or collections, so we need to create them\n // accordingly\n for (int i = 0; i < nrParameters; i++) {\n try {\n if (params[i].isPrimitive()) {\n String primitiveName = params[i]\n .getName();\n if (primitiveName.equals(\"int\")) {\n foo[i] = Integer.valueOf(0);\n }\n if (primitiveName.equals(\"boolean\")) {\n foo[i] = Boolean.TRUE;\n }\n if (primitiveName.equals(\"short\")) {\n foo[i] = new Short(\"0\");\n }\n } else if (params[i].getName().equals(\"java.util.Collection\")) {\n foo[i] = new ArrayList();\n } else {\n /*\n * this call could easily fall if there is e.g. no public\n * default constructor. If it fails tweak the if/else tree\n * above to accommodate the parameter or check if we need to\n * test the particular method at all.\n */\n foo[i] = params[i].newInstance();\n }\n } catch (InstantiationException e) {\n fail(\"Cannot create an instance of : \"\n + params[i].getName()\n + \", required for \"\n + methodToTest.getName()\n + \". Check if \"\n + \"test needs reworking.\");\n } catch (IllegalAccessException il) {\n fail(\"Illegal Access to : \"\n + params[i].getName());\n }\n }\n \n try {\n methodToTest.invoke(facade, foo);\n fail(methodToTest.getName()\n + \" does not deliver an IllegalArgumentException\");\n } catch (InvocationTargetException e) {\n if (e.getTargetException() instanceof IllegalArgumentException \n || e.getTargetException() instanceof ClassCastException\n || e.getTargetException() instanceof NotImplementedException) {\n return;\n }\n fail(\"Test failed for \" + methodToTest.toString()\n + \" because of: \"\n + e.getTargetException());\n } catch (NotImplementedException e) {\n // If method not supported ignore failure\n } catch (Exception e) {\n fail(\"Test failed for \" + methodToTest.toString()\n + \" because of: \" + e.toString());\n }\n }",
"public RegularExpressionJSONComparator startsWith(final String... regexes)\n {\n return exact(Stream.of(regexes).map(regex -> String.format(\"^%s(\\\\W)*(\\\\S)*\", regex))\n .collect(Collectors.toList()).toArray(new String[0]));\n }",
"@Test\n public void testPatter(){\n String str = \"select * from t_user where deletea dropa\";\n str = str.toUpperCase();\n // String re = \"(update|delete|insert|drop|alter)\";\n // String re = \"(update\\\\b)|(delete\\\\b)|(insert)|(drop)|(alter)\";\n // String re = \"\\\\b[(update)|(delete)|(insert)|(drop)|(alter)\\\\b\";\n // System.out.println(str.indexOf(\"updatea\"));\n // System.out.println(\"update\".matches(str));\n // System.out.println(str.matches(re));\n /* System.out.println(re.matches(str));\n String[] ss = str.split(re);\n System.out.println(ss.length);\n for(String s: ss){\n System.out.println(s);\n }*/\n\n String re =\"(\\\\bupdate\\\\b)|(\\\\bdelete\\\\b)|(\\\\binsert\\\\b)|(\\\\bdrop\\\\b)|(\\\\balter\\\\b)\";\n Pattern p = Pattern.compile(re,Pattern.CASE_INSENSITIVE );\n Matcher m = p.matcher(str);\n System.out.println(m.find());\n\n }",
"public static <T> Object invokeAnyMethod(T instance, String method, Class<?>[] argTypes, Object... arguments) throws\n NoSuchMethodException, InvocationTargetException, IllegalAccessException {\n List<Class<?>> types = new ArrayList<Class<?>>();\n if (argTypes == null) {\n for (Object arg : arguments) {\n types.add(arg.getClass());\n }\n argTypes = types.toArray(new Class<?>[types.size()]);\n }\n Method m = instance.getClass().getDeclaredMethod(method, argTypes);\n m.setAccessible(true);\n return m.invoke(instance, arguments);\n }",
"@Override\n public String getAnalyzerName() {\n return \"Body Regex: \" + pattern.pattern();\n }",
"private static boolean matchName(@NotNull PsiMethod method, @NotNull IHasParameterInfos targetMethodInfo, @NotNull String targetMethodName, boolean isConstructor) {\n if (targetMethodName.startsWith(\"@\")) {\n IType returnType = ((IGosuMethodInfo) targetMethodInfo).getReturnType();\n if ((returnType.equals(JavaTypes.BOOLEAN()) || returnType.equals(JavaTypes.pBOOLEAN()) &&\n !method.getName().equals(\"is\" + targetMethodName.substring(1)))) {\n return true;\n }\n if (!method.getName().equals(\"get\" + targetMethodName.substring(1)) && !method.getName().equals(\"set\" + targetMethodName.substring(1))) {\n return true;\n }\n } else if (!targetMethodName.equals(method.getName()) && !(isConstructor && \"construct\".equals(method.getName()))) {\n return true;\n }\n return false;\n }",
"public BodyMatchesRegexAnalyzer(BodyRegexProperties properties) {\n super(properties);\n this.pattern = Pattern.compile(properties.getPattern());\n }",
"public RegularExpressionJSONComparator exact(final String... regexes)\n {\n Stream.of(regexes).map(Pattern::compile).forEach(this.searchPatterns::add);\n return this;\n }",
"public Method findMostDerivedMethod(final String methodName, final List<Type> parameterTypes) {\r\n\t\tChecker.notNull(\"parameter:methodName\", methodName);\r\n\t\tChecker.notNull(\"parameter:parameterTypes\", parameterTypes);\r\n\r\n\t\tfinal MostDerivedMethodFinder finder = new MostDerivedMethodFinder();\r\n\t\tfinder.setMethodName(methodName);\r\n\t\tfinder.setParameterTypes(parameterTypes);\r\n\t\tfinder.start(this);\r\n\t\treturn finder.getFound();\r\n\t}"
] | [
"0.7172949",
"0.66571033",
"0.66110325",
"0.58118093",
"0.57369757",
"0.54848814",
"0.5194658",
"0.5179817",
"0.5142829",
"0.50478077",
"0.5003304",
"0.4980128",
"0.4971662",
"0.49621373",
"0.49564922",
"0.49185175",
"0.47594088",
"0.4756686",
"0.47455233",
"0.47433",
"0.47390068",
"0.47259578",
"0.46801475",
"0.46786818",
"0.4671272",
"0.46649712",
"0.46578583",
"0.46449038",
"0.46263877",
"0.4625771",
"0.46232805",
"0.45781672",
"0.4574924",
"0.45740822",
"0.45707402",
"0.4565841",
"0.45507294",
"0.45469135",
"0.45438004",
"0.45415735",
"0.45161864",
"0.45010048",
"0.44786853",
"0.44716033",
"0.4445926",
"0.4442663",
"0.44303274",
"0.44220102",
"0.4411261",
"0.4392649",
"0.43838453",
"0.43787563",
"0.43713623",
"0.43437508",
"0.43437508",
"0.43225306",
"0.43151468",
"0.42763442",
"0.42676383",
"0.42506197",
"0.42460877",
"0.42445302",
"0.424342",
"0.4230516",
"0.4226574",
"0.42246163",
"0.42208415",
"0.42062408",
"0.41963142",
"0.41954225",
"0.41947168",
"0.4183947",
"0.41803655",
"0.41716138",
"0.41613784",
"0.41612527",
"0.41594085",
"0.41552544",
"0.41545466",
"0.41510522",
"0.41381928",
"0.41375354",
"0.41301024",
"0.4126427",
"0.41254416",
"0.41231704",
"0.41183907",
"0.4110421",
"0.4109478",
"0.41042104",
"0.4101946",
"0.41004947",
"0.40956745",
"0.40951252",
"0.4094251",
"0.40932316",
"0.40915838",
"0.409027",
"0.4082578",
"0.40761557"
] | 0.7449855 | 0 |
Returns a method signature matcher for a given regular expression that matches the method name. | public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex) {
return new MethodSignatureMatcher(nameRegex, null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n return new MethodSignatureMatcher(nameRegex, parameters);\n }",
"public static @Nonnull MethodSignatureMatcher of(@Nonnull String nameRegex, @Nullable @NonNullableElements Class<?>... parameters) {\n final @Nonnull String[] typeNames;\n if (parameters == null) {\n typeNames = new String[0];\n } else {\n typeNames = new String[parameters.length];\n int i = 0;\n for (@Nonnull Class<?> parameter : parameters) {\n typeNames[i] = parameter.getCanonicalName();\n i++;\n }\n }\n return new MethodSignatureMatcher(nameRegex, typeNames);\n }",
"private MethodSignatureMatcher(@Nonnull String nameRegex, @Nullable @NonNullableElements String... parameters) {\n this.namePattern = Pattern.compile(nameRegex);\n if (parameters == null) {\n this.parameters = new String[0];\n } else {\n this.parameters = parameters;\n }\n }",
"public Method getMethodByName(String nameRegex) {\r\n \t\t\r\n \t\tPattern match = Pattern.compile(nameRegex);\r\n \t\t\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (match.matcher(method.getName()).matches()) {\r\n \t\t\t\t// Right - this is probably it. \r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tthrow new RuntimeException(\"Unable to find a method with the pattern \" + \r\n \t\t\t\t\t\t\t\t\tnameRegex + \" in \" + source.getName());\r\n \t}",
"private Pattern fileNameMatch(final String name) {\n final StringBuilder sb = new StringBuilder(name.length());\n for (int i = 0; i < name.length(); i++) {\n final char c = name.charAt(i);\n if (c == '.') {\n sb.append('\\\\').append('.');\n } else if (c == '?') {\n sb.append('.');\n } else if (c == '*') {\n sb.append('.').append('*').append('?');\n } else {\n sb.append(c);\n }\n }\n return Pattern.compile(sb.toString(), Pattern.CASE_INSENSITIVE);\n }",
"boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);",
"protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }",
"java.lang.String getRegex();",
"java.lang.String getRegex();",
"public Method addMethod(String sSig)\n {\n int of = sSig.indexOf('(');\n return addMethod(sSig.substring(0, of), sSig.substring(of));\n }",
"private FamixMethod findInvokedMethodOnName(String fromClass, String fromMethod, String invokedClassName, String invokedMethodName) {\n \tFamixMethod result = null;\n\t\t/* Test Helper\n\t\tif (fromClass.equals(\"domain.direct.violating.AccessLocalVariable_SetArgumentValue\")){\n\t\t\tboolean breakpoint = true;\n\t\t} */\n\n \t// 1) If methodNameAsInInvocation matches with a method unique name, return that method. \n \tString searchKey = invokedClassName + \".\" + invokedMethodName;\n \tif (theModel.behaviouralEntities.containsKey(searchKey)) {\n \t\treturn (FamixMethod) theModel.behaviouralEntities.get(searchKey);\n \t}\n \t// 2) Find out if there are more methods with the same name of the invoked class. If only one method is found, then return this method. \n \tString methodName = invokedMethodName.substring(0, invokedMethodName.indexOf(\"(\")); // Methodname without signature\n \t searchKey = invokedClassName + \".\" + methodName;\n \tif (sequencesPerMethod.containsKey(searchKey)){\n \t\tArrayList<FamixMethod> methodsList = sequencesPerMethod.get(searchKey);\n \t\tif (methodsList.size() == 0) {\n \t\t\treturn result;\n \t\t} else if (methodsList.size() == 1) {\n \t\t\t// FamixMethod result1 = methodsList.get(0);\n \t\t\treturn methodsList.get(0);\n \t\t} else { // 3) if there are more methods with the same name, then compare the invocation arguments with the method parameters.\n \t\t\tString invocationSignature = invokedMethodName.substring(invokedMethodName.indexOf(\"(\"));;\n \t\t\tString contentsInvocationSignature = invocationSignature.substring(invocationSignature.indexOf(\"(\") + 1, invocationSignature.indexOf(\")\")); \n \t\t\tString[] invocationArguments = contentsInvocationSignature.split(\",\");\n \t\t\tint numberOfArguments = invocationArguments.length;\n \t\t\t// 3a) If there is only one method with the same number of parameters as invocationArguments, then return this method\n \t\t\tList<FamixMethod> matchingMethods1 = new ArrayList<FamixMethod>();\n\t \t\tfor (FamixMethod method : methodsList){\n\t \t\t\tif ((method.signature != null) && (!method.signature.equals(\"\"))) {\n\t\t \t\t\tString contentsmethodParameter = method.signature.substring(method.signature.indexOf(\"(\") + 1, method.signature.indexOf(\")\")); \n\t\t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n\t\t \t\t\tif (methodParameters.length == numberOfArguments) {\n\t\t \t\t\t\tmatchingMethods1.add(method);\n\t\t \t\t\t}\n\t \t\t\t}\n\t \t\t} \n\t \t\tif (matchingMethods1.size() == 0)\n\t \t\t\treturn result;\n\t \t\tif (matchingMethods1.size() == 1)\n\t \t\t\treturn matchingMethods1.get(0);\n \t\t\t\n \t\t\t// 3b) If there is only one method where the first parameter type == the first argument type, then return this method \n \t\t\tList<FamixMethod> matchingMethods2 = new ArrayList<FamixMethod>();\n \t\t\tif (numberOfArguments >= 1) {\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[0] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[0]);\n \t \t\tfor (FamixMethod matchingMethod1 : matchingMethods1){\n \t \t\t\tString contentsmethodParameter = matchingMethod1.signature.substring(matchingMethod1.signature.indexOf(\"(\") + 1, matchingMethod1.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 1) {\n \t \t\t\tmethodParameters[0] = getfullPathOfDeclaredType(fromClass, methodParameters[0]);\n \t \t\t\t\tif (methodParameters[0].equals(invocationArguments[0])) {\n \t \t\t\t\t\tmatchingMethods2.add(matchingMethod1);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods2.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods2.size() == 1)\n \t \t\t\treturn matchingMethods2.get(0);\n \t\t\t}\n \t\t\t// If there is only one method where the second parameter type == the first argument type, then return this method \n \t\t\tif (numberOfArguments >= 2) {\n \t\t\t\tmatchingMethods1.clear();\n \t\t\t\t// Replace the argument string by a type, in case of an attribute\n \t\t\t\tinvocationArguments[1] = getTypeOfAttribute(fromClass, fromMethod, invocationArguments[1]);\n \t \t\tfor (FamixMethod matchingMethod2 : matchingMethods2){\n \t \t\t\tString contentsmethodParameter = matchingMethod2.signature.substring(matchingMethod2.signature.indexOf(\"(\") + 1, matchingMethod2.signature.indexOf(\")\")); \n \t \t\t\tString[] methodParameters = contentsmethodParameter.split(\",\");\n \t \t\t\tif (methodParameters.length >= 2) {\n \t \t\t\tmethodParameters[1] = getfullPathOfDeclaredType(fromClass, methodParameters[1]);\n \t \t\t\t\tif (methodParameters[1].equals(invocationArguments[1])) {\n \t \t\t\t\t\tmatchingMethods1.add(matchingMethod2);\n \t \t\t\t\t}\n \t \t\t\t}\n \t \t\t\t\n \t \t\t} \n \t \t\tif (matchingMethods1.size() == 0)\n \t \t\t\treturn result;\n \t \t\tif (matchingMethods1.size() == 1)\n \t \t\t\treturn matchingMethods1.get(0);\n \t\t\t}\n \t\t}\n\t\t}\n \treturn result; \n }",
"boolean match(String pattern, String path);",
"public String getRegex();",
"@Factory\r\n public static Matcher<Proc> raises(String regex) {\r\n return raises(IsThrowable.throwable(regex));\r\n }",
"public boolean matches(Method method, Class<?> targetClass)\n/* */ {\n/* 133 */ return ((targetClass != null) && (matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass)))) || \n/* 134 */ (matchesPattern(ClassUtils.getQualifiedMethodName(method)));\n/* */ }",
"boolean match(String mnemonic, ParameterType[] parameters);",
"public Matcher matcher(String uri);",
"private boolean matchesMethod (final Object method, \n\t\tfinal int expectedModifiers, final int optionalModifiers, \n\t\tfinal String expectedReturnType)\n\t{\n\t\tboolean matches = false; \n\n\t\tif (method != null)\n\t\t{\n\t\t\tModel model = getModel();\n\t\t\tint modifiers = model.getModifiers(method);\n\n\t\t\tmatches = (((modifiers == expectedModifiers) || \n\t\t\t\t(modifiers == (expectedModifiers | optionalModifiers))) &&\n\t\t\t\texpectedReturnType.equals(model.getType(method)));\n\t\t}\n\n\t\treturn matches;\n\t}",
"private static boolean matchRegex(Pattern regExpression, String filename) {\n\t\tMatcher m = regExpression.matcher(filename);\n\t\tif (m.matches()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"String getRegExpLikeOperator(String column, String regexp);",
"public Method findMethod(final String methodName, final List<Type> parameterTypes) {\r\n\t\tGeneratorHelper.checkJavaMethodName(\"parameter:methodName\", methodName);\r\n\t\tChecker.notNull(\"parameter:parameterTypes\", parameterTypes);\r\n\r\n\t\tMethod found = null;\r\n\r\n\t\tfinal Iterator<Method> methods = this.getMethods().iterator();\r\n\r\n\t\twhile (methods.hasNext()) {\r\n\t\t\tfinal Method method = methods.next();\r\n\t\t\tif (false == method.getName().equals(methodName)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tfinal List<MethodParameter> methodParameters = method.getParameters();\r\n\t\t\tif (methodParameters.size() != parameterTypes.size()) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tfound = method;\r\n\r\n\t\t\tfinal Iterator<MethodParameter> methodParametersIterator = methodParameters.iterator();\r\n\t\t\tfinal Iterator<Type> parameterTypesIterator = parameterTypes.iterator();\r\n\r\n\t\t\twhile (parameterTypesIterator.hasNext()) {\r\n\t\t\t\tfinal Type type = parameterTypesIterator.next();\r\n\t\t\t\tfinal MethodParameter parameter = methodParametersIterator.next();\r\n\t\t\t\tif (false == type.equals(parameter.getType())) {\r\n\t\t\t\t\tfound = null;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (null != found) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn found;\r\n\t}",
"abstract UrlPatternMatcher create( String pattern );",
"protected abstract Matcher<? super ExpressionTree> specializedMatcher();",
"public Method getMethod(String sName, String sSig)\n {\n return getMethod(sName + sSig.replace('.', '/'));\n }",
"protected abstract Regex pattern();",
"public static MatchesSpecification matches( Property<String> property, String regexp )\n {\n return new MatchesSpecification( property( property ), regexp );\n }",
"public static Method method(Object receiver, String method, Object[] args) {\n for (Class<?> c : types(receiver)) {\n Method candidate = findMatchingMethod(c, method, args);\n if (candidate != null) {\n return candidate;\n }\n }\n if (receiver instanceof GString) { // cf. GString.invokeMethod\n Method candidate = findMatchingMethod(String.class, method, args);\n if (candidate != null) {\n return candidate;\n }\n }\n return null;\n }",
"public MethodSignature getMatchingMethod(\n String methodName,\n SequenceType arguments,\n SequenceType typeArguments,\n List<ShadowException> errors) {\n boolean hasTypeArguments = typeArguments != null;\n MethodSignature candidate = null;\n\n for (MethodSignature signature : recursivelyGetMethodOverloads(methodName)) {\n MethodType methodType = signature.getMethodType();\n\n if (methodType.isParameterized()) {\n if (hasTypeArguments) {\n SequenceType parameters = methodType.getTypeParameters();\n try {\n if (parameters.canAccept(typeArguments, SubstitutionKind.TYPE_PARAMETER)) {\n signature = signature.replace(parameters, typeArguments);\n } else continue;\n } catch (InstantiationException ignored) {\n }\n }\n }\n\n // the list of method signatures starts with the closest (current class) and then adds parents\n // and outer classes\n // always stick with the current if you can\n // (only replace if signature is a subtype of candidate but candidate is not a subtype of\n // signature)\n if (signature.canAccept(arguments)) {\n if (candidate == null\n || (signature.getParameterTypes().isSubtype(candidate.getParameterTypes())\n && !candidate.getParameterTypes().isSubtype(signature.getParameterTypes())))\n candidate = signature;\n else if (!candidate.getParameterTypes().isSubtype(signature.getParameterTypes())) {\n ErrorReporter.addError(\n errors,\n Error.INVALID_ARGUMENTS,\n \"Ambiguous reference to \" + methodName + \" with arguments \" + arguments,\n arguments);\n return null;\n }\n }\n }\n\n if (candidate == null)\n ErrorReporter.addError(\n errors,\n Error.INVALID_METHOD,\n \"No definition of \" + methodName + \" with arguments \" + arguments + \" in this context\",\n arguments);\n\n return candidate;\n }",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"public Matcher getMatcher(String matchedString, String regex) {\n Pattern r = Pattern.compile(regex);\r\n\r\n // Now create matcher object.\r\n Matcher m = r.matcher(matchedString);\r\n\r\n return m;\r\n }",
"@Override\n public String getAnalyzerName() {\n return \"Body Regex: \" + pattern.pattern();\n }",
"public DynamicMethod searchMethod(String name) {\n return searchWithCache(name).method;\n }",
"public Pattern regexPattern(String regex) {\n return Pattern.compile(regex);\n }",
"private static ElementMatcher.Junction getMethodMatcher(TypeDescription typeDescription) {\n ElementMatcher.Junction methodMatcher1 = isDeclaredBy(typeDescription).and(namedIgnoreCase(\"doList\")).and(takesArguments(1));\n\n // private List<Invoker<T>> route(List<Invoker<T>> invokers, String method)\n ElementMatcher.Junction methodMatcher2 = isDeclaredBy(typeDescription).and(namedIgnoreCase(\"route\")).and(takesArguments(2));\n return methodMatcher1.or(methodMatcher2);\n }",
"@Factory\r\n public static Matcher<Proc> raisesException(String regex) {\r\n return new Raises(IsThrowable.exception(regex));\r\n }",
"boolean match(String mnemonic, List<ParameterType>[] parameters);",
"public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}",
"Methodsig getMethod();",
"public boolean methodNameMatches(String methodName, String propertyName) {\n\t\tif (methodName.equalsIgnoreCase(propertyName)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"Method getRiggerMethod(String methodName, Class<?>... params) throws Exception {\r\n Rigger rigger = getRiggerInstance();\r\n Class<? extends Rigger> clazz = rigger.getClass();\r\n Method method = clazz.getDeclaredMethod(methodName, params);\r\n method.setAccessible(true);\r\n return method;\r\n }",
"public final void rule__MethodSpec__SignatureAssignment_0_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:16280:1: ( ( ruleSignature ) )\r\n // InternalGo.g:16281:2: ( ruleSignature )\r\n {\r\n // InternalGo.g:16281:2: ( ruleSignature )\r\n // InternalGo.g:16282:3: ruleSignature\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getMethodSpecAccess().getSignatureSignatureParserRuleCall_0_1_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleSignature();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getMethodSpecAccess().getSignatureSignatureParserRuleCall_0_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"public interface Matcher {\n\n char WILDCARD = '*';\n\n void addFilter(String filter);\n\n boolean matches(String word);\n}",
"public static MethodInvoker findMatchingMethod(Class<?> type, String methodName, Object... values) throws NoSuchMethodException, IllegalStateException\n {\n List<Method> methodList = new ArrayList<>(20);\n Class<?> currentType = type;\n while ((currentType != null) && ! currentType.equals(Object.class))\n {\n for (Method method : currentType.getDeclaredMethods())\n {\n if (method.getName().equals(methodName) && (method.getParameterCount() == values.length))\n {\n methodList.add(method);\n }\n }\n currentType = currentType.getSuperclass();\n }\n return findMatchingExecutable(methodList.toArray(new Method[methodList.size()]), values);\n }",
"public Function getMethod(int signature)\r\n\t{\r\n\t\t// search own methods:\r\n\t\tfor (Function fn : methods)\r\n\t\t{\r\n\t\t\tif (fn.signature == signature)\r\n\t\t\t\treturn fn;\r\n\t\t}\r\n\t\t// if we have a base class, let it search for methods, or return null\r\n\t\tif (baseClass != null)\r\n\t\t\treturn baseClass.getMethod(signature);\r\n\t\telse\r\n\t\t\treturn null;\r\n\t}",
"MethodType (String m, Type r, ExpressionList args) {\r\n name = m;\r\n return_type = r;\r\n arguments = args;\r\n body = null;\r\n }",
"protected MethodSortMatcher<?> getMatcher() {\n return matcher;\n }",
"public static Term createRegExp(Expression exp) {\r\n\t\tTerm term = Term.function(REGEX, exp);\r\n\t\treturn term;\r\n\t}",
"public interface MethodCandidate extends Ordered {\n\n /**\n * The default position.\n */\n int DEFAULT_POSITION = 0;\n\n /**\n * Whether the given method name matches this finder.\n *\n * @param methodElement The method element. Never null.\n * @param matchContext The match context. Never null.\n * @return true if it does\n */\n boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);\n\n @Override\n default int getOrder() {\n return DEFAULT_POSITION;\n }\n\n /**\n * Builds the method info. The method {@link #isMethodMatch(MethodElement, MatchContext)} should be\n * invoked and checked prior to calling this method.\n *\n * @param matchContext The match context\n * @return The method info or null if it cannot be built. If the method info cannot be built an error will be reported to\n * the passed {@link MethodMatchContext}\n */\n @Nullable\n MethodMatchInfo buildMatchInfo(@NonNull MethodMatchContext matchContext);\n\n}",
"public String getRetType(String signature) {\n String[] tokens = (signature.split(\"\\\\s\"));\n return tokens[0];\n }",
"Object isMatch(Object arg, String wantedType);",
"String getMethodName();",
"String getMethodName();",
"public Method get_MethodByName(String methodname) {\n\t\tfor (Method m : arrayMethods) {\n\t\t\tif (m.getName_method().equals(methodname))\n\t\t\t\treturn m;\n\t\t}\n\n\t\treturn null;\n\t}",
"java.lang.String getMethodName();",
"java.lang.String getMethodName();",
"java.lang.String getMethodName();",
"java.lang.String getMethodName();",
"boolean hasRegex();",
"MethodName getMethod();",
"public boolean matchesRegex(URI uri);",
"public Method getMethodByParameters(String name, Class<?>... args) {\r\n \t\t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"public String getRegEx();",
"private static boolean matchName(@NotNull PsiMethod method, @NotNull IHasParameterInfos targetMethodInfo, @NotNull String targetMethodName, boolean isConstructor) {\n if (targetMethodName.startsWith(\"@\")) {\n IType returnType = ((IGosuMethodInfo) targetMethodInfo).getReturnType();\n if ((returnType.equals(JavaTypes.BOOLEAN()) || returnType.equals(JavaTypes.pBOOLEAN()) &&\n !method.getName().equals(\"is\" + targetMethodName.substring(1)))) {\n return true;\n }\n if (!method.getName().equals(\"get\" + targetMethodName.substring(1)) && !method.getName().equals(\"set\" + targetMethodName.substring(1))) {\n return true;\n }\n } else if (!targetMethodName.equals(method.getName()) && !(isConstructor && \"construct\".equals(method.getName()))) {\n return true;\n }\n return false;\n }",
"public JavaRE(String regex) throws Exception {\n if (ignoreCase) {\n pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);\n } else {\n pattern = Pattern.compile(regex);\n }\n }",
"public List<MethodInfo> getMethod(String methodName) {\n List<MethodInfo> matchedMethodInfo = new ArrayList<MethodInfo>();\n for (MethodInfo method : this.lstMethodInfo) {\n if (methodName.equals(method.getName())) {\n matchedMethodInfo.add(method);\n }\n }\n \n return matchedMethodInfo;\n }",
"public static SendMethod findByName(String name) {\n\t\tfor (SendMethod sendMethod : SendMethod.values()) {\n\t\t\tif (sendMethod.getName().equals(name)) {\n\t\t\t\treturn sendMethod;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public Method getMethod(String sSig)\n {\n ensureLoaded();\n return (Method) m_tblMethod.get(sSig);\n }",
"private PatternType matchPatternEnum(String s){\n s = s.toLowerCase();\n switch(s){\n case \"factory method\":\n return PatternType.FACTORY_METHOD;\n case \"prototype\":\n return PatternType.PROTOTYPE;\n case \"singleton\":\n return PatternType.SINGLETON;\n case \"(object)adapter\":\n return PatternType.OBJECT_ADAPTER;\n case \"command\":\n return PatternType.COMMAND;\n case \"composite\":\n return PatternType.COMPOSITE;\n case \"decorator\":\n return PatternType.DECORATOR;\n case \"observer\":\n return PatternType.OBSERVER;\n case \"state\":\n return PatternType.STATE;\n case \"strategy\":\n return PatternType.STRATEGY;\n case \"bridge\":\n return PatternType.BRIDGE;\n case \"template method\":\n return PatternType.TEMPLATE_METHOD;\n case \"visitor\":\n return PatternType.VISITOR;\n case \"proxy\":\n return PatternType.PROXY;\n case \"proxy2\":\n return PatternType.PROXY2;\n case \"chain of responsibility\":\n return PatternType.CHAIN_OF_RESPONSIBILITY;\n default:\n System.out.println(\"Was not able to match pattern with an enum. Exiting because this should not happen\");\n System.exit(0);\n\n }\n //should never get here because we exit on the default case\n return null;\n }",
"public static int isMethod() {\n return isNameExpr;\n }",
"boolean matched(int index, String pattern, T value);",
"@Override\n public boolean evaluate(@Nonnull MethodInformation methodInformation) {\n boolean matches = namePattern.matcher(methodInformation.getName()).matches();\n final @Nonnull @NonNullableElements List<? extends VariableElement> methodParameters = methodInformation.getElement().getParameters();\n if (parameters.length == methodParameters.size()) {\n for (int i = 0; i < methodParameters.size(); i++) {\n final @Nonnull String nameOfDeclaredType = ProcessingUtility.getQualifiedName(methodParameters.get(i).asType());\n ProcessingLog.debugging(\"name of type: $\", nameOfDeclaredType);\n final @Nonnull String parameter = parameters[i];\n if (!parameter.equals(\"?\")) {\n matches = matches && nameOfDeclaredType.equals(parameter);\n }\n }\n } else {\n matches = false;\n }\n return matches;\n }",
"HxMethod createMethod(final String returnType,\n final String methodName,\n final String... parameterTypes);",
"public static MatchResult exec(String pattern, String input) throws RegexException {\n return exec(pattern, input, 0);\n }",
"public static MethodType fromParameters(String name, Type... paramTypes) {\n MethodType type = new MethodType(name);\n type.paramTypes = Arrays.copyOf(paramTypes, paramTypes.length);\n return type;\n }",
"Method createMethod();",
"Method createMethod();",
"private void isMethod() {\n ArrayAdapter<String> isVariable = new ArrayAdapter<>(this, isNameExpr.isFieldAccessExpr.isFieldAccessExpr, isNameExpr);\n isNameExpr.isMethod(isNameExpr);\n isNameExpr.isMethod((isParameter, isParameter, isParameter, isParameter) -> {\n isNameExpr = isNameExpr.isMethod(isNameExpr.isMethod(isNameExpr), isNameExpr);\n isMethod(isNameExpr);\n isNameExpr = isNameExpr;\n });\n }",
"static Method getDefinitionMethod(ContainerRequestContext requestContext) {\n if (!(requestContext.getUriInfo() instanceof ExtendedUriInfo)) {\n throw new IllegalStateException(\"Could not get Extended Uri Info. Incompatible version of Jersey?\");\n }\n\n ExtendedUriInfo uriInfo = (ExtendedUriInfo) requestContext.getUriInfo();\n ResourceMethod matchedResourceMethod = uriInfo.getMatchedResourceMethod();\n Invocable invocable = matchedResourceMethod.getInvocable();\n return invocable.getDefinitionMethod();\n }",
"public static String toRegex(String param) \r\n\t{\r\n\t\tStringBuffer regex = new StringBuffer();\r\n\t\tfor( int i=0; i < param.length(); i++ ) \r\n\t\t{\r\n\t\t\tchar next = param.charAt( i );\r\n\t\t\t if ('*' == next) regex.append( \".+\" ); // -> multi-character match wild card\r\n\t\t\telse if ('?' == next) regex.append( \".\" ); // -> single-character match wild card\r\n\t\t\telse if ('.' == next) regex.append( \"\\\\.\" ); // all of these are special regex characters we are quoting\r\n\t\t\telse if ('+' == next) regex.append( \"\\\\+\" ); \r\n\t\t\telse if ('$' == next) regex.append( \"\\\\$\" ); \r\n\t\t\telse if ('\\\\' == next) regex.append( \"\\\\\\\\\" ); \r\n\t\t\telse if ('[' == next) regex.append( \"\\\\[\" ); \r\n\t\t\telse if (']' == next) regex.append( \"\\\\]\" ); \r\n\t\t\telse if ('{' == next) regex.append( \"\\\\{\" ); \r\n\t\t\telse if ('}' == next) regex.append( \"\\\\}\" ); \r\n\t\t\telse if ('(' == next) regex.append( \"\\\\(\" ); \r\n\t\t\telse if (')' == next) regex.append( \"\\\\)\" ); \r\n\t\t\telse if ('&' == next) regex.append( \"\\\\&\" ); \r\n\t\t\telse if ('^' == next) regex.append( \"\\\\^\" ); \r\n\t\t\telse if ('-' == next) regex.append( \"\\\\-\" ); \r\n\t\t\telse if ('|' == next) regex.append( \"\\\\|\" ); \r\n\t\t\telse regex.append( next );\r\n\t\t}\r\n\t\t\r\n\t\treturn regex.toString();\r\n\t}",
"String getMethod();",
"String getMethod();",
"@Override\r\n\t\tpublic boolean accept(Path path) {\n\t\t\tboolean flag = path.toString().matches(regex);\r\n\t\t\treturn flag;\r\n\t\t}",
"public Function getStaticMethod(int signature)\r\n\t{\r\n\t\t// search own methods:\r\n\t\tfor (Function fn : staticMethods)\r\n\t\t{\r\n\t\t\tif (fn.signature == signature)\r\n\t\t\t\treturn fn;\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public static Predicate<String> regex(final String pathRegex) {\n return new Predicate<String>() {\n @Override\n public boolean test(String input) {\n return input.matches(pathRegex);\n }\n };\n }",
"public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) {\n\ttry {\n\t\t/* Since this method attempts to find a method by getting all methods from the class,\n\tthis method should only be called if getMethod cannot find the method. */\n\t\tjava.lang.reflect.Method methods[] = aClass.getMethods();\n\t\tfor (int index = 0; index < methods.length; index++){\n\t\t\tjava.lang.reflect.Method method = methods[index];\n\t\t\tif ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) {\n\t\t\t\treturn method;\n\t\t\t}\n\t\t}\n\t} catch (java.lang.Throwable exception) {\n\t\treturn null;\n\t}\n\treturn null;\n}",
"public interface ActionMatcher {\n boolean match(Action action, ActionParameters actionUri);\n}",
"public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}",
"public static void matchMaker()\n {\n \n }",
"protected boolean matchRegExpr(String input, GlobFilenameFilter pattern) {\n File file = new File(input);\n String path = file.toString();\n \n // On systems with a '\\' as pathseparator convert it to a forward slash '/'\n // That makes patterns platform independent\n if (File.separatorChar == '\\\\') {\n path = path.replace('\\\\', '/');\n }\n \n return pattern.accept(file, path);\n }",
"public static boolean isMethodDefinition(Document doc, String methodName, int offset) {\n TokenHierarchy tokenHierarchy = TokenHierarchy.get(doc);\n @SuppressWarnings(\"unchecked\")\n TokenSequence<PlsqlTokenId> ts = tokenHierarchy.tokenSequence(PlsqlTokenId.language());\n\n if (ts != null) {\n ts.move(offset);\n Token<PlsqlTokenId> token = ts.token();\n if (ts.moveNext()) {\n token = ts.token();\n PlsqlTokenId tokenID = token.id();\n\n if (tokenID == PlsqlTokenId.IDENTIFIER) {\n if (token.text().toString().equals(methodName)) {\n while (ts.movePrevious()) {\n token = ts.token();\n if (token.text().toString().equalsIgnoreCase(\"FUNCTION\")\n || token.text().toString().equalsIgnoreCase(\"PROCEDURE\")) {\n return true;\n } else if (token.id() != PlsqlTokenId.WHITESPACE) {\n break;\n }\n }\n }\n }\n }\n }\n return false;\n }",
"private boolean findMethod(String name, MethodDescriptor[] methodDescriptors) {\n for (int i = 0; i < methodDescriptors.length; i++) {\n if (methodDescriptors[i].getName().equals(name)) {\n return true;\n }\n }\n return false;\n }",
"public int isMethod() {\n return isNameExpr;\n }",
"public final void rule__MethodDecl__SignatureAssignment_4() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalGo.g:15800:1: ( ( ruleSignature ) )\r\n // InternalGo.g:15801:2: ( ruleSignature )\r\n {\r\n // InternalGo.g:15801:2: ( ruleSignature )\r\n // InternalGo.g:15802:3: ruleSignature\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getMethodDeclAccess().getSignatureSignatureParserRuleCall_4_0()); \r\n }\r\n pushFollow(FOLLOW_2);\r\n ruleSignature();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getMethodDeclAccess().getSignatureSignatureParserRuleCall_4_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }",
"protected abstract boolean matches(String paramString, int paramInt);",
"private String methodNameMask(String name) {\n\t\tString[] words = name\n\t\t\t\t.replaceAll(\"[\\\\d\\\\'\\\\+\\\\-\\\\:\\\\;\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\\\\~\\\\^\\\\*\\\\&\\\\#\\\\@\\\\$\\\\<\\\\>\\\\,\\\\_\\\\.\\\\\\\"]\", \"\")\n\t\t\t\t.split(\" \");\n\t\tString forReturn = words[0];\n\t\tfor (int i = 1; i < words.length; i++) {\n\t\t\tif (words[i].isEmpty())\n\t\t\t\tcontinue;\n\t\t\tif (Character.isDigit(words[i].charAt(0)))\n\t\t\t\tforReturn = forReturn + words[i];\n\t\t\telse\n\t\t\t\tforReturn = forReturn + words[i].replaceFirst(String.valueOf(words[i].charAt(0)),\n\t\t\t\t\t\tString.valueOf(words[i].charAt(0)).toUpperCase());\n\t\t}\n\t\treturn forReturn;\n\t}",
"boolean hasMethodName();",
"boolean hasMethodName();",
"boolean hasMethodName();",
"com.google.protobuf.ByteString\n getRegexBytes();",
"com.google.protobuf.ByteString\n getRegexBytes();"
] | [
"0.73999584",
"0.6774991",
"0.628718",
"0.61412996",
"0.51802677",
"0.5152522",
"0.5095589",
"0.5023587",
"0.5023587",
"0.5017631",
"0.49929002",
"0.4963608",
"0.4903004",
"0.48907307",
"0.48885226",
"0.4884459",
"0.4869874",
"0.4860421",
"0.48517135",
"0.4847612",
"0.48426512",
"0.48349944",
"0.48254138",
"0.4808152",
"0.47997755",
"0.47619617",
"0.47456086",
"0.4713954",
"0.46757084",
"0.466913",
"0.46371478",
"0.46109298",
"0.45754275",
"0.45681188",
"0.45493454",
"0.45425943",
"0.45198137",
"0.44961992",
"0.44841096",
"0.44809052",
"0.44645637",
"0.44627747",
"0.44589895",
"0.44422",
"0.44351262",
"0.44326696",
"0.44217134",
"0.44187766",
"0.44041505",
"0.439835",
"0.4397657",
"0.4397657",
"0.43945953",
"0.43787783",
"0.43787783",
"0.43787783",
"0.43787783",
"0.4370571",
"0.43676177",
"0.43656",
"0.43515947",
"0.43438742",
"0.43409058",
"0.43350726",
"0.43303984",
"0.43285313",
"0.43202057",
"0.43154404",
"0.4302521",
"0.42980912",
"0.42961535",
"0.42925507",
"0.4290154",
"0.42868328",
"0.42859557",
"0.42859557",
"0.42859155",
"0.42822245",
"0.42809215",
"0.42765173",
"0.42765173",
"0.42764655",
"0.427495",
"0.42660612",
"0.4240394",
"0.42342338",
"0.422203",
"0.42192236",
"0.4218975",
"0.42188358",
"0.42178565",
"0.42171803",
"0.4215261",
"0.41934612",
"0.4187485",
"0.41804665",
"0.41804665",
"0.41804665",
"0.4175133",
"0.41746864"
] | 0.7540638 | 0 |
/ Matcher Checks whether the given object matches this method signature. | @Override
public boolean evaluate(@Nonnull MethodInformation methodInformation) {
boolean matches = namePattern.matcher(methodInformation.getName()).matches();
final @Nonnull @NonNullableElements List<? extends VariableElement> methodParameters = methodInformation.getElement().getParameters();
if (parameters.length == methodParameters.size()) {
for (int i = 0; i < methodParameters.size(); i++) {
final @Nonnull String nameOfDeclaredType = ProcessingUtility.getQualifiedName(methodParameters.get(i).asType());
ProcessingLog.debugging("name of type: $", nameOfDeclaredType);
final @Nonnull String parameter = parameters[i];
if (!parameter.equals("?")) {
matches = matches && nameOfDeclaredType.equals(parameter);
}
}
} else {
matches = false;
}
return matches;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Object isMatch(Object arg, String wantedType);",
"private void assertIsMethod(SymObject object) {\n assertIsOfKind(object, SymObject.KIND_METHOD,\n object.name + \" can't be resolved to a method\");\n }",
"public boolean accept(T object, String pattern);",
"boolean isMethodMatch(@NonNull MethodElement methodElement, @NonNull MatchContext matchContext);",
"boolean hasSignature();",
"boolean hasSignature();",
"public boolean matches(Method method, Class<?> targetClass)\n/* */ {\n/* 133 */ return ((targetClass != null) && (matchesPattern(ClassUtils.getQualifiedMethodName(method, targetClass)))) || \n/* 134 */ (matchesPattern(ClassUtils.getQualifiedMethodName(method)));\n/* */ }",
"boolean mo10605a(Object obj);",
"private boolean matchesMethod (final Object method, \n\t\tfinal int expectedModifiers, final int optionalModifiers, \n\t\tfinal String expectedReturnType)\n\t{\n\t\tboolean matches = false; \n\n\t\tif (method != null)\n\t\t{\n\t\t\tModel model = getModel();\n\t\t\tint modifiers = model.getModifiers(method);\n\n\t\t\tmatches = (((modifiers == expectedModifiers) || \n\t\t\t\t(modifiers == (expectedModifiers | optionalModifiers))) &&\n\t\t\t\texpectedReturnType.equals(model.getType(method)));\n\t\t}\n\n\t\treturn matches;\n\t}",
"boolean isMoreSpecific (MethodType type) throws OverloadingAmbiguous {\r\n boolean status = false;\r\n\r\n try {\r\n for (int i = 0, size = arguments.size (); i < size; i++) {\r\n\tIdentifier this_arg = (Identifier) arguments.elementAt (i);\r\n\tIdentifier target_arg = (Identifier) type.arguments.elementAt (i);\r\n\r\n\tint type_diff = this_arg.type.compare (target_arg.type);\r\n\tif (type_diff == 0)\r\n\t continue;\r\n\telse if (type_diff > 0) {\r\n\t if (status == true) throw new OverloadingAmbiguous ();\r\n\t} else {\r\n\t if (i != 0) throw new OverloadingAmbiguous ();\r\n\t status = true;\r\n\t}\r\n }\r\n } catch (OverloadingAmbiguous ex) {\r\n throw ex;\r\n } catch (TypeMismatch ex) {\r\n throw new OverloadingAmbiguous ();\r\n }\r\n\r\n return status;\r\n }",
"public static void method(Object obj){\n\t System.out.println(\"method with param type - Object\");\n\t }",
"public boolean match(ReflectClass classReflector);",
"private boolean methodsMatch(Method method,\n CallStatement.CallStatementEntry entry) throws EngineException {\n if (!method.getName().equals(entry.getName())) {\n return false;\n }\n if (method.getParameterTypes().length != parameters.size()) {\n return false;\n }\n Class[] parameterTypes = method.getParameterTypes();\n for (int index = 0; index < parameters.size(); index++) {\n Class parameterType = parameterTypes[index];\n Object parameterValue = parameters.get(index);\n if (!parameterType.isAssignableFrom(parameterValue.getClass())) {\n return false;\n }\n }\n \n for (int index = 0; index < parameters.size(); index++) {\n Class parameterType = parameterTypes[index];\n Object parameterValue = parameters.get(index);\n parameters.set(index, parameterType.cast(parameterValue));\n }\n return true;\n }",
"boolean match(String mnemonic, ParameterType[] parameters);",
"public boolean equals(JavaMethodSignature sig) {\n\t\t//if their signatures aren't the same length, we've got problems\n\t\tif (this.sig.size() != sig.sig.size())\n\t\t\treturn false;\n\t\t\n\t\t//signatures are the same length, let's run through the parameters\n\t\tfor (int i = 0; i < this.sig.size(); i++) {\n\t\t\tif (this.sig.get(i).type != sig.sig.get(i).type)\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private boolean checkMethodSignature(final Method method, final List<WaveItem<?>> wParams) {\r\n boolean isCompliant = false;\r\n\r\n final Type[] mParams = method.getGenericParameterTypes();\r\n\r\n if (wParams.isEmpty() && Wave.class.isAssignableFrom(ClassUtility.getClassFromType(mParams[0]))) {\r\n isCompliant = true;\r\n } else if (mParams.length - 1 == wParams.size()) {\r\n\r\n // Flag used to skip a method not compliant\r\n boolean skipMethod = false;\r\n // Check each parameter\r\n for (int i = 0; !skipMethod && i < mParams.length - 1 && !isCompliant; i++) {\r\n if (ClassUtility.getClassFromType(mParams[i]).isAssignableFrom(ClassUtility.getClassFromType(wParams.get(i).getItemType()))) {\r\n // This method has not the right parameters\r\n skipMethod = true;\r\n }\r\n if (i == mParams.length - 2\r\n && Wave.class.isAssignableFrom(ClassUtility.getClassFromType(mParams[i + 1]))) {\r\n // This method is compliant with wave type\r\n isCompliant = true;\r\n }\r\n }\r\n }\r\n return isCompliant;\r\n }",
"public boolean matches(String arg) {\n switch (this.type) {\n case STRING:\n return true;\n case INTEGER:\n return arg.matches(\"\\\\d+\");\n default:\n /* The following default block can never be executed (because all Types are covered), but it must be\n * added, because otherwise I would get a VSCode error (saying that this method must return a boolean).\n */\n throw new IllegalArgumentException(\"The developer made a mistake. Please contact him to solve this\"\n + \" problem.\");\n }\n }",
"boolean match(String mnemonic, List<ParameterType>[] parameters);",
"public static boolean matchTargetAPI(IMethod m){\r\n for(ExpensiveAPI api : Resource.targetAPIs){\r\n if(api.signature.equals(m.getName().toString()) && m.getSignature().contains(api.clsName)){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }",
"boolean isMatch();",
"protected boolean findObject(Object obj){\n \n }",
"protected abstract boolean matches(String paramString, int paramInt);",
"public boolean parametersMatch(Method m, Class[] param) {\n boolean match = false;\n Class[] types = m.getParameterTypes();\n if (types.length!=param.length)\n return false;\n for (int i=0; i<types.length; i++) {\n match = types[i].equals(param[i]);\n }\n return match;\n }",
"public boolean handlesObject(Object object);",
"public abstract boolean canHandle(ObjectInformation objectInformation);",
"abstract protected boolean checkMethod();",
"public String getMethodName() {\n return \"isTrustedObject\";\n }",
"public boolean doesNotMatch(NakedObject nakedObject);",
"public interface SignatureObject {\n}",
"public boolean isObjectReference(Class<?> paramClass) {\n/* 196 */ if (paramClass == null) {\n/* 197 */ throw new IllegalArgumentException();\n/* */ }\n/* */ \n/* 200 */ return (paramClass.isInterface() && Object.class\n/* 201 */ .isAssignableFrom(paramClass));\n/* */ }",
"private boolean match(Type t, Type original) {\n\t\t\t\treturn original.getSort() == Type.METHOD && original.getSort() == t.getSort();\n\t\t\t}",
"@Override\n\t\tpublic boolean matches(EObject eObject) {\n\t\t\treturn false;\n\t\t}",
"private void assertIsType(SymObject object) {\n assertIsOfKind(object, SymObject.KIND_TYPE,\n object.name + \" can't be resolved to a type\");\n }",
"private void isMethod(Context isParameter) {\n try {\n MediaPlayer isVariable = isNameExpr.isMethod(isNameExpr, isNameExpr.isFieldAccessExpr.isFieldAccessExpr);\n isNameExpr.isMethod();\n isNameExpr.isMethod(isIntegerConstant);\n isNameExpr.isMethod();\n isNameExpr.isMethod();\n } catch (Exception isParameter) {\n isNameExpr.isMethod(isNameExpr, isNameExpr.isMethod());\n }\n }",
"protected boolean matchesPattern(String signatureString)\n/* */ {\n/* 143 */ for (int i = 0; i < this.patterns.length; i++) {\n/* 144 */ boolean matched = matches(signatureString, i);\n/* 145 */ if (matched) {\n/* 146 */ for (int j = 0; j < this.excludedPatterns.length; j++) {\n/* 147 */ boolean excluded = matchesExclusion(signatureString, j);\n/* 148 */ if (excluded) {\n/* 149 */ return false;\n/* */ }\n/* */ }\n/* 152 */ return true;\n/* */ }\n/* */ }\n/* 155 */ return false;\n/* */ }",
"public void testSpecificBody(){\n $method $m = $method.of().$body(new Object(){ void m(Object $any$) { \n System.out.println($any$); \n }});\n \n class C {\n public void g(){\n System.out.println(1);\n } \n public void t(){\n // A comment is ignored when matching\n System.out.println( \"Some text \"); \n } \n } \n assertNotNull($m.firstIn(C.class));\n assertNotNull($m.selectFirstIn(C.class).is(\"any\", 1));\n assertEquals(2, $m.listIn(C.class).size()); \n }",
"void validate(T object);",
"int verify(Requirement o);",
"public void isMethod(org.zoolu.sip.dialog.InviteDialog isParameter, String isParameter, String isParameter, Message isParameter);",
"boolean hasReflectionRequest();",
"public boolean matches(T infoObject) {\r\n return matches(infoObject, this.criteria.getPredicate());\r\n }",
"private void doSomething(Object object) {\n\n }",
"public IValidationResult isValid(T object);",
"public boolean sameSignature(MethodType other) {\n return name.equals(name) &&\n Arrays.equals(typeParams, other.typeParams) &&\n Arrays.equals(paramTypes, other.paramTypes);\n }",
"@Override\n \tprotected boolean checkDelegateMethod(Method input) {\n \t\tif (!domain.checkElementType(target, input.getGenericReturnType())) {\n \t\t\treturn false;\n \t\t}\n \n \t\tClass<?>[] delegateParams = input.getParameterTypes();\n \n \t\t// must have first argument of type of the setter container\n \t\tif (!(delegateParams.length == 1 && domain.checkClassifierType(\n \t\t\t\ttarget.getEContainingClass(), delegateParams[0]))) {\n \t\t\treturn false;\n \t\t}\n \n \t\treturn true;\n \t}",
"public boolean equals(Object obj) {\n\n if (!this.getClass().equals(obj.getClass())) {\n System.out.println(\"different classes\");\n return false;\n }\n\n Proto cmd = (Proto)obj;\n for (String key : cmd.getArguments().keySet()) {\n if (this.getArguments().containsKey(key)) {\n if(!this.getArguments().containsValue(cmd.getArgument(key))) {\n return false;\n }\n } else {\n return false;\n }\n }\n return true;\n }",
"boolean hasMethod();",
"boolean hasMethod();",
"boolean hasMethod();",
"public abstract boolean verify();",
"boolean canHandle(Object source, TypeToken<?> targetTypeToken);",
"@Test\r\n public void testParamterizedWithObject()\r\n {\r\n test(Types.create(List.class).withSubtypeOf(Object.class).build());\r\n }",
"public boolean hasPermission(T object, Permission permission, User user);",
"public static boolean isInstance(java.lang.Object param0) {\n throw new java.lang.RuntimeException(\"Not Supported\");\n }",
"public boolean accept(Match arg0) {\n\t\treturn false;\n\t}",
"boolean hasReflectionResponse();",
"public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}",
"public static boolean isInstance(java.lang.Object param0) {\n throw new java.lang.RuntimeException(\"Not Supported\");\n }",
"public boolean appliesTo(ISignature signature) {\n\t\tif (NUMBER_EXPECTED_PARAMETERS != signature.getNumberParameters()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// check that parameters are not null\r\n\t\tfor (int i = 0; i < NUMBER_EXPECTED_PARAMETERS; i++) {\r\n\t\t\tif (null == signature.get(i)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// check types of parameters\r\n\t\tif (!WasPackage.Literals.WAS_NODE_UNIT\r\n\t\t\t\t.isSuperTypeOf(signature.get(NODE_UNIT_PARAMETER_INDEX))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!WasPackage.Literals.WAS_NODE_UNIT.isSuperTypeOf(signature\r\n\t\t\t\t.get(DMGR_NODE_UNIT_PARAMETER_INDEX))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"public boolean verify();",
"public static boolean isMinecraftObject(@Nonnull final Object obj) {\n \t\tif (obj == null) {\n \t\t\tthrow new IllegalArgumentException(\n \t\t\t\t\t\"Cannot determine the type of a null object.\");\n \t\t}\n \n \t\t// Doesn't matter if we don't check for the version here\n \t\treturn obj.getClass().getName().startsWith(MINECRAFT_PREFIX_PACKAGE);\n \t}",
"boolean isSetMethod();",
"void mo67921a(Object obj);",
"public static boolean isInstance(java.lang.Object param0) {\n throw new java.lang.RuntimeException(\"Not Supported\");\n }",
"private boolean isTarget() {\n\t\t// Get a stack trace by constructing an exception here\n\t\tException exc = new Exception();\n\n\t\tfor (PyObject obj : targets.getList()) {\n\t\t\t// Only process proper tuple entries\n\t\t\tif (obj instanceof PyTuple && ((PyTuple) obj).__len__() >= 2) {\n\n\t\t\t\t// Compile the target specification\n\t\t\t\tPyTuple target = (PyTuple) obj;\n\t\t\t\tPattern clazz = getPattern(target.__finditem__(0));\n\t\t\t\tPattern method = getPattern(target.__finditem__(1));\n\n\t\t\t\t// Now scan the stack using this pair of patterns\n\t\t\t\tfor (StackTraceElement ste : exc.getStackTrace()) {\n\t\t\t\t\tif (clazz == null || clazz.matcher(ste.getClassName()).matches()) {\n\t\t\t\t\t\t// Either we don't care about the class it matches, and ...\n\t\t\t\t\t\tif ((method == null || method.matcher(ste.getMethodName()).matches())) {\n\t\t\t\t\t\t\t// Either we don't care about the method name or it matches\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Nothing matched\n\t\treturn false;\n\t}",
"public boolean match(MindObject other){\n return other.isSubtypeOf(this) || isSubtypeOf(other);\n }",
"Methodsig getMethod();",
"public void a(Object obj) {\n }",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"public boolean testVerify(Synth synth2, String key, Object obj1, Object obj2)\n {\n return false;\n }",
"@Test\n\tpublic void validObjectShouldValidate() {\n\t\tT validObject = buildValid();\n\t\tAssertions.assertThat(isValid(validObject))\n\t\t\t\t.as(invalidMessage(validObject))\n\t\t\t\t.isTrue();\n\t}",
"public interface Matcher<T> {\n\n\t/**\n\t * This method determines if the element must be allowed to be on the list.\n\t * \n\t * @param element\n\t * \n\t * @return true if the element is allowed. false otherwise.\n\t */\n\tboolean accepts(T element);\n\n}",
"boolean hasMethodName();",
"boolean hasMethodName();",
"boolean hasMethodName();",
"public IValidationResult isIdentityValid(T object);",
"boolean isAttribute(Object object);",
"public void testObjectMethodOnInterface() throws NoSuchMethodException {\n Method toString = Object.class.getMethod(\"toString\");\n assertEquals(String.class, GenericTypeReflector.getExactReturnType(toString, ArrayList.class));\n assertEquals(String.class, GenericTypeReflector.getExactReturnType(toString, List.class));\n assertEquals(String.class, GenericTypeReflector.getExactReturnType(toString, String[].class));\n }",
"void m21805a(Object obj);",
"boolean hasSig();",
"abstract boolean hasFunctionSelfArgument(Object definedOn);",
"@Test\n public void canDetect_ParameterAnnotation_OneRuntimeRetention_OneClassRetention() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"oneRuntimeRetention_OneClassRetention\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }",
"public void mo1774a(Object obj) {\n }",
"boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }",
"void mo6504by(Object obj);",
"public boolean isMethodCallAllowed(Object obj, String sMethod) {\r\n\t\tif (_sess.isNew())\r\n\t\t\treturn false;\r\n\t\tBoolean bAllowed = (Boolean) _sess.getAttribute(_reflectionallowedattribute);\r\n\t\tif (bAllowed != null && !bAllowed.booleanValue())\r\n\t\t\treturn false;\r\n\t\treturn super.isMethodCallAllowed(obj, sMethod);\r\n\t}",
"public boolean checkInterface(Object obj) {\n return true;\n }",
"public boolean objectMatchRegex(Object left, Object right) {\n Pattern pattern;\n if (right instanceof Pattern) {\n pattern = (Pattern) right;\n }\n else {\n pattern = Pattern.compile(toString(right));\n }\n String stringToCompare = toString(left);\n return pattern.matcher(stringToCompare).matches();\n }",
"boolean isCustom(Object custom);",
"private boolean hasExplicitInvocant() {\n PsiElement signatureContainer = getSignatureContent();\n return signatureContainer != null && signatureContainer.getFirstChild() instanceof PsiPerlMethodSignatureInvocant;\n }",
"public abstract boolean isObject(T type);",
"@java.lang.Override\n public boolean hasSignature() {\n return instance.hasSignature();\n }",
"void mo3207a(Object obj);",
"@Override\r\n\tpublic boolean validate(Object object) {\n\t\treturn this.validate(object);\r\n\t}",
"private void assertIsOfKind(SymObject object, int kind, String error) {\n if (object.kind != kind) {\n error(error);\n }\n }",
"@Test\n public void canDetect_ParameterAnnotation_OneRuntimeRetention_OneSourceRetention() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"oneRuntimeRetention_OneSourceRetention\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n }",
"@Test\n public void canDetect_TwoAnnotations_WithRuntimeRetention_ForSingleParam() {\n final MethodInfo methodInfo = classInfo.getMethodInfo()\n .getSingleMethod(\"twoAnnotations_WithRuntimeRetention_ForSingleParam\");\n\n assertThat(methodInfo.hasParameterAnnotation(ParamAnnoRuntime.class)).isTrue();\n\n assertThat(methodInfo.hasParameterAnnotation(SecondParamAnnoRuntime.class)).isTrue();\n }",
"@Override\n public boolean equals(Object o) {\n boolean result = (o instanceof PLambda);\n if (result) {\n result = parameters.size() == ((PLambda) o).parameters.size() && body.equals(((PLambda) o).body);\n }\n return result;\n }",
"boolean hasParameters();",
"boolean supports(Object descriptor);"
] | [
"0.6828164",
"0.6288999",
"0.6262719",
"0.5915592",
"0.58299315",
"0.58299315",
"0.58271277",
"0.5789783",
"0.5789281",
"0.5631596",
"0.56311154",
"0.56184036",
"0.55673707",
"0.555237",
"0.54732645",
"0.54399633",
"0.5430368",
"0.53602624",
"0.5308428",
"0.5295531",
"0.5292359",
"0.529099",
"0.5275753",
"0.52726364",
"0.5268058",
"0.5266726",
"0.5262635",
"0.52249384",
"0.5216241",
"0.5212209",
"0.52085066",
"0.5181803",
"0.51711726",
"0.5167349",
"0.51443595",
"0.5139814",
"0.51292384",
"0.5126855",
"0.511841",
"0.5114797",
"0.51130927",
"0.5106389",
"0.51032364",
"0.5097713",
"0.5089713",
"0.5078558",
"0.5062256",
"0.5062256",
"0.5062256",
"0.5040378",
"0.5005057",
"0.49933785",
"0.498878",
"0.4976645",
"0.49604675",
"0.49539423",
"0.49503782",
"0.49498767",
"0.49454415",
"0.4942364",
"0.49393478",
"0.4938282",
"0.49343172",
"0.49341825",
"0.49280325",
"0.49171916",
"0.49169704",
"0.490793",
"0.49058318",
"0.49046043",
"0.4901128",
"0.48915675",
"0.4888214",
"0.4888214",
"0.4888214",
"0.4887457",
"0.48818585",
"0.48706204",
"0.485001",
"0.48432148",
"0.4843017",
"0.48379964",
"0.48376676",
"0.48367617",
"0.48263887",
"0.48235732",
"0.4821283",
"0.48207992",
"0.48180676",
"0.48159772",
"0.48117146",
"0.48031816",
"0.47813058",
"0.47800016",
"0.47792268",
"0.47791106",
"0.4774297",
"0.4772983",
"0.47720367",
"0.47684252"
] | 0.5063232 | 46 |
Setup the mapper for all of our beans. Only fields having non identical names need mapping if we also use byDefault() following. | protected final void configure(final MapperFactory factory) {
factory.classMap(Case.class, CaseDTO.class).byDefault().register();
factory.classMap(Case.class, CaseDetailsDTO.class).byDefault().register();
factory
.classMap(CaseGroup.class, CaseGroupDTO.class)
.field("status", "caseGroupStatus")
.byDefault()
.register();
factory.classMap(CaseEvent.class, CaseEventDTO.class).byDefault().register();
factory
.classMap(Category.class, CategoryDTO.class)
.field("categoryName", "name")
.byDefault()
.register();
factory.classMap(Response.class, ResponseDTO.class).byDefault().register();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ResultSetMapper() {\n registerAttributeConverters();\n this.fieldNamingStrategy = new IdentityFieldNamingStrategy();\n logger.info(\"No specific field naming strategy has been set. It will default to the {} field naming strategy.\", this.fieldNamingStrategy);\n }",
"public ObjectMappers() {\n\t\tthis.objectMappers = ImmutableList.of();\n\t}",
"@Test\n public void map() {\n \n /*\n * Construct the mapper factory;\n */\n MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();\n \n /*\n * Register mappings for the fields whose names done match; 'byDefault' covers the matching ones\n */\n mapperFactory.classMap(A.class, B1.class)\n .field(\"a1.Pa11\", \"Pb11\")\n .field(\"a1.Pa12\", \"Pb12\")\n .byDefault()\n .register();\n \n mapperFactory.classMap(A.class, B2.class)\n .field(\"a2.Pa21\", \"Pb21\")\n .field(\"a2.Pa22\", \"Pb22\")\n .byDefault()\n .register();\n \n /*\n * Construct some test object\n */\n A source = new A();\n source.p1 = new Property(\"p1\", \"p1.value\");\n source.p2 = new Property(\"p2\", \"p2.value\");\n source.a1 = new A1();\n source.a1.Pa11 = new Property(\"Pa11\", \"Pa11.value\");\n source.a1.Pa12 = new Property(\"Pa12\", \"Pa12.value\");\n source.a2 = new A2();\n source.a2.Pa21 = new Property(\"Pa21\", \"Pa21.value\");\n source.a2.Pa22 = new Property(\"Pa22\", \"Pa22.value\");\n \n MapperFacade mapper = mapperFactory.getMapperFacade();\n \n Collection<A> collectionA = new ArrayList<>();\n collectionA.add(source);\n\n /*\n * Map the collection of A into a collection of B1 using 'mapAsList'\n */\n Collection<B1> collectionB1 = mapper.mapAsList(collectionA, B1.class);\n \n Assert.assertNotNull(collectionB1);\n B1 b1 = collectionB1.iterator().next();\n Assert.assertEquals(source.p1, b1.p1);\n Assert.assertEquals(source.p2, b1.p2);\n Assert.assertEquals(source.a1.Pa11, b1.Pb11);\n Assert.assertEquals(source.a1.Pa12, b1.Pb12);\n \n /*\n * Map the collection of A into a collection of B2 using 'mapAsList'\n */\n Collection<B2> collectionB2 = mapper.mapAsList(collectionA, B2.class);\n \n B2 b2 = collectionB2.iterator().next();\n Assert.assertNotNull(b2);\n Assert.assertEquals(source.p1, b2.p1);\n Assert.assertEquals(source.p2, b2.p2);\n Assert.assertEquals(source.a2.Pa21, b2.Pb21);\n Assert.assertEquals(source.a2.Pa22, b2.Pb22);\n }",
"protected MXBeanMappingFactory() {}",
"@BeanMapping( ignoreByDefault = true )\n @Mapping( target = \"key\", ignore = true)\n @Mapping( target = \"modificationDate\", ignore = true)\n @Mapping( target = \"creationDate\", ignore = true)\n BaseEntity mapBase(Object o);",
"@Autowired\n\t@Override\n\tpublic void setBaseMapper() {\n\t\tthis.baseMapper=trxMapper;\n\t}",
"private FieldSetMapper<Card> createCardFieldSetMapper() {\r\n\t\tBeanWrapperFieldSetMapper<Card> fieldSetMapper = new BeanWrapperFieldSetMapper<>();\r\n\t\tfieldSetMapper.setTargetType(Card.class);\r\n\t\treturn fieldSetMapper;\r\n\t}",
"@Mapper(componentModel = \"spring\", uses = {UserMapper.class, })\npublic interface PeopleMapper extends EntityMapper <PeopleDTO, People> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.firstName\", target = \"userFirstName\")\n @Mapping(source = \"user.lastName\", target = \"userLastName\")\n PeopleDTO toDto(People people);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(target = \"seminarsPresenteds\", ignore = true)\n @Mapping(target = \"seminarsAttendeds\", ignore = true)\n @Mapping(target = \"specialGuestAts\", ignore = true)\n People toEntity(PeopleDTO peopleDTO);\n default People fromId(Long id) {\n if (id == null) {\n return null;\n }\n People people = new People();\n people.setId(id);\n return people;\n }\n\n default String peopleName(People people) {\n String name = \"\";\n if (people == null) {\n return null;\n }\n if (people.getUser() == null) {\n return null;\n }\n String firstName = people.getUser().getFirstName();\n if (firstName != null) {\n name += firstName;\n }\n String lastName = people.getUser().getLastName();\n if (lastName != null) {\n name += \" \" + lastName;\n }\n return name;\n }\n}",
"@BeanMapping( ignoreByDefault = false ) // needed to override the one from the BeanMapping mapBase\n @InheritConfiguration( name = \"mapBase\" )\n @Mapping(target = \"description\", source = \"articleDescription\")\n WorkBenchEntity mapBenchWithImplicit(WorkBenchDto source);",
"private void initMapper() {\n final BeanPropertyFilter filterOutAllExcept =\n SimpleBeanPropertyFilter.filterOutAllExcept(\"fname\", \"executionTimeNano\");\n this.mapper.addMixInAnnotations(\n PortalEvent.class, PortletRenderExecutionEventFilterMixIn.class);\n final SimpleFilterProvider filterProvider = new SimpleFilterProvider();\n filterProvider.addFilter(\n PortletRenderExecutionEventFilterMixIn.FILTER_NAME, filterOutAllExcept);\n this.portletEventWriter = this.mapper.writer(filterProvider);\n }",
"private BeanMapping createMapping(Object bean, String name) {\n // first\n BeanMapping mapping = new BeanMapping(name);\n return mapping;\n }",
"@Mapper(withIoC = IoC.SPRING, withIgnoreMissing = IgnoreMissing.ALL)\npublic interface RemainMapper extends SelmaObjectMapper<RemainTadbir, Remain> {\n}",
"@Bean\n public MapperFactory mapperFactory() {\n\n //1. Build the mapperFactory\n DefaultMapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();\n\n //2. Register all the configurable mappers\n mapperConfiguration.registerConfigurableMappers(mapperFactory);\n\n //3. Register all converters\n converterConfiguration.registerCustomConverters(mapperFactory);\n\n return mapperFactory;\n }",
"private void initialiseAll() {\n // now that all the BeanDescriptors are in their map\n // we can initialise them which sorts out circular\n // dependencies for OneToMany and ManyToOne etc\n BeanDescriptorInitContext initContext = new BeanDescriptorInitContext(asOfTableMap, draftTableMap, asOfViewSuffix);\n\n // PASS 1:\n // initialise the ID properties of all the beans\n // first (as they are needed to initialise the\n // associated properties in the second pass).\n for (BeanDescriptor<?> d : descMap.values()) {\n d.initialiseId(initContext);\n }\n\n // PASS 2:\n // now initialise all the inherit info\n for (BeanDescriptor<?> d : descMap.values()) {\n d.initInheritInfo();\n }\n\n // PASS 3:\n // now initialise all the associated properties\n for (BeanDescriptor<?> d : descMap.values()) {\n // also look for intersection tables with\n // associated history support and register them\n // into the asOfTableMap\n d.initialiseOther(initContext);\n }\n\n // PASS 4:\n // now initialise document mapping which needs target descriptors\n for (BeanDescriptor<?> d : descMap.values()) {\n d.initialiseDocMapping();\n }\n\n // create BeanManager for each non-embedded entity bean\n for (BeanDescriptor<?> d : descMap.values()) {\n d.initLast();\n if (!d.isEmbedded()) {\n beanManagerMap.put(d.fullName(), beanManagerFactory.create(d));\n checkForValidEmbeddedId(d);\n }\n }\n }",
"private void initMapNameMapping() {\n mMapNameMapping.clear();\n\n // Load the name mapping from the config\n ConfigurationSection mappingSection = getConfig().getConfigurationSection(MappingSectionName);\n if (mappingSection != null) {\n // Load and check the mapping found in the config\n Map<String, Object> configMap = mappingSection.getValues(false);\n for (Map.Entry<String, Object> entry : configMap.entrySet()) {\n mMapNameMapping.put(entry.getKey(), (String) entry.getValue());\n }\n } else {\n getLogger().warning(String.format(\"[%s] found no configured mapping, creating a default one.\", mPdfFile.getName()));\n }\n\n // If there are new worlds in the server add them to the mapping\n List<World> serverWorlds = getServer().getWorlds();\n for (World w : serverWorlds) {\n if (!mMapNameMapping.containsKey(w.getName())) {\n mMapNameMapping.put(w.getName(), w.getName());\n }\n }\n\n // Set the new mapping in the config\n getConfig().createSection(MappingSectionName, mMapNameMapping);\n }",
"private static void generateMaps(Object bean)\n {\n try\n {\n att_map = new HashMap<>();\n getter_map = new HashMap<>();\n setter_map = new HashMap<>();\n\n Arrays.stream(Introspector.getBeanInfo(bean.getClass(), Object.class)\n .getPropertyDescriptors())\n // filter out properties with setters only\n .filter(pd -> Objects.nonNull(pd.getReadMethod()))\n .forEach(pd ->\n { // invoke method to get value\n try\n {\n Object value = pd.getReadMethod().invoke(bean);\n if (value != null)\n {\n att_map.put(pd.getName(), value);\n getter_map.put(pd.getName(), pd.getReadMethod());\n setter_map.put(pd.getName(), pd.getWriteMethod());\n }\n } catch (Exception e)\n {\n // add proper error handling here\n }\n });\n att_map = sortAsDeclaredOrder(bean,att_map);\n getter_map = sortAsDeclaredOrder(getter_map, bean);\n setter_map = sortAsDeclaredOrder(setter_map, bean);\n currentObject = bean;\n } catch (IntrospectionException e)\n {\n // and here, too\n att_map = null;\n getter_map = null;\n setter_map = null;\n currentObject = null;\n }\n }",
"private FieldSetMapper<IdentityCard2> createIdentityCard2FieldSetMapper() {\r\n\t\tBeanWrapperFieldSetMapper<IdentityCard2> fieldSetMapper = new BeanWrapperFieldSetMapper<>();\r\n\t\tfieldSetMapper.setTargetType(IdentityCard2.class);\r\n\t\treturn fieldSetMapper;\r\n\t}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface CustomerMapper {\n\n CustomerDTO customerToCustomerDTO(Customer customer);\n\n List<CustomerDTO> customersToCustomerDTOs(List<Customer> customers);\n\n @Mapping(target = \"orders\", ignore = true)\n Customer customerDTOToCustomer(CustomerDTO customerDTO);\n\n List<Customer> customerDTOsToCustomers(List<CustomerDTO> customerDTOs);\n}",
"@Mapper(componentModel = \"spring\", uses = {AuthorityMapper.class, })\npublic interface BizUserMapper {\n\n BizUserDTO bizUserToBizUserDTO(BizUser bizUser);\n\n List<BizUserDTO> bizUsersToBizUserDTOs(List<BizUser> bizUsers);\n\n @Mapping(target = \"companies\", ignore = true)\n @Mapping(target = \"products\", ignore = true)\n BizUser bizUserDTOToBizUser(BizUserDTO bizUserDTO);\n\n List<BizUser> bizUserDTOsToBizUsers(List<BizUserDTO> bizUserDTOs);\n\n default Authority authorityFromId(Long id) {\n if (id == null) {\n return null;\n }\n Authority authority = new Authority();\n authority.setId(id);\n return authority;\n }\n}",
"@Bean\n public TypeMap<DriverDto, Driver> getDriverDtoDriverTypeMap() {\n return getModelMapper().createTypeMap(DriverDto.class, Driver.class)\n .addMappings(mapper -> mapper.when(isNotNull()).map(DriverDto::getPersonalNum, Driver::setPersonalNum))\n .addMappings(mapper -> mapper.when(isNotNull()).map(DriverDto::getStatus, Driver::setStatus))\n\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(DriverDto::getCity, Driver::setCity))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(DriverDto::getCarriage, Driver::setCarriage))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(DriverDto::getUser, Driver::setUser))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(DriverDto::getVehicle, Driver::setVehicle))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(DriverDto::getShifts, Driver::setShifts));\n }",
"protected AusschreibungMapper() {\r\n\t}",
"protected MapperIF getBeanMapper() {\r\n\t\treturn beanMapper;\r\n\t}",
"private ModuleMapper() {\n mapper = new HashMap<String, String>();\n mapper.put(\"accounts\", \"Accounts\");\n mapper.put(\"acl_actions\", \"ACLActions\");\n mapper.put(\"acl_roles\", \"ACLRoles\");\n mapper.put(\"bugs\", \"Bugs\");\n mapper.put(\"calls\", \"Calls\");\n mapper.put(\"campaign_log\", \"CampaignLog\");\n mapper.put(\"campaign_trkrs\", \"CampaignTrackers\");\n mapper.put(\"campaigns\", \"Campaigns\");\n mapper.put(\"cases\", \"Cases\");\n mapper.put(\"contacts\", \"Contacts\");\n mapper.put(\"currencies\", \"Currencies\");\n mapper.put(\"document_revisions\", \"DocumentRevisions\");\n mapper.put(\"documents\", \"Documents\");\n mapper.put(\"eapm\", \"EAPM\");\n mapper.put(\"email_addresses\", \"EmailAddresses\");\n mapper.put(\"email_marketing\", \"EmailMarketing\");\n mapper.put(\"email_templates\", \"EmailTemplates\");\n mapper.put(\"emailman\", \"EmailMan\");\n mapper.put(\"emails\", \"Emails\");\n mapper.put(\"inbound_email\", \"InboundEmail\");\n mapper.put(\"job_queue\", \"SchedulersJobs\");\n mapper.put(\"leads\", \"Leads\");\n mapper.put(\"meetings\", \"Meetings\");\n mapper.put(\"notes\", \"Notes\");\n mapper.put(\"oauth_consumer\", \"OAuthKeys\");\n mapper.put(\"oauth_tokens\", \"OAuthTokens\");\n mapper.put(\"opportunities\", \"Opportunities\");\n mapper.put(\"project\", \"Project\");\n mapper.put(\"project_task\", \"ProjectTask\");\n mapper.put(\"prospect_lists\", \"ProspectLists\");\n mapper.put(\"prospects\", \"Prospects\");\n mapper.put(\"releases\", \"Releases\");\n mapper.put(\"roles\", \"Roles\");\n mapper.put(\"saved_search\", \"SavedSearch\");\n mapper.put(\"schedulers\", \"Schedulers\");\n mapper.put(\"sugarfeed\", \"SugarFeed\");\n mapper.put(\"tasks\", \"Tasks\");\n mapper.put(\"users\", \"Users\");\n }",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface TipoTelaMapper {\n\n @Mapping(source = \"direccionamientoTela.id\", target = \"direccionamientoTelaId\")\n @Mapping(source = \"direccionamientoTela.nombre\", target = \"direccionamientoTelaNombre\")\n TipoTelaDTO tipoTelaToTipoTelaDTO(TipoTela tipoTela);\n\n @Mapping(source = \"direccionamientoTelaId\", target = \"direccionamientoTela\")\n @Mapping(target = \"telaCrudas\", ignore = true)\n TipoTela tipoTelaDTOToTipoTela(TipoTelaDTO tipoTelaDTO);\n\n default DireccionamientoTela direccionamientoTelaFromId(Long id) {\n if (id == null) {\n return null;\n }\n DireccionamientoTela direccionamientoTela = new DireccionamientoTela();\n direccionamientoTela.setId(id);\n return direccionamientoTela;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface Record25HerfinancieeringMapper extends EntityMapper<Record25HerfinancieeringDTO, Record25Herfinancieering> {\n\n\n\n default Record25Herfinancieering fromId(Long id) {\n if (id == null) {\n return null;\n }\n Record25Herfinancieering record25Herfinancieering = new Record25Herfinancieering();\n record25Herfinancieering.setId(id);\n return record25Herfinancieering;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {ArquivoAnexoMapper.class})\npublic interface ProcessoAnexoMapper{\n\n ProcessoAnexoDTO processoAnexoToProcessoAnexoDTO(ProcessoAnexo processoAnexo);\n\n List<ProcessoAnexoDTO> processoAnexosToProcessoAnexoDTOs(List<ProcessoAnexo> processoAnexos);\n\n @Mapping(target = \"processo\", ignore = true)\n ProcessoAnexo processoAnexoDTOToProcessoAnexo(ProcessoAnexoDTO processoAnexoDTO);\n\n List<ProcessoAnexo> processoAnexoDTOsToProcessoAnexos(List<ProcessoAnexoDTO> processoAnexoDTOs);\n\n\n}",
"@Override\n\t\tprotected Set<BeanDefinitionHolder> doScan(String... basePackages) {\n\t\t\tSet<BeanDefinitionHolder> beanDefinitions = super.doScan(basePackages);\n\t\t\t\n\t\t\tif (beanDefinitions.isEmpty()) {\n\t\t\t\tlogger.warn(\"No MyBatis mapper was found in '\" + PagingMapperScannerConfigurer.this.basePackage\n\t\t\t\t\t\t+ \"' package. Please check your configuration.\");\n\t\t\t} else {\n\t\t\t\tfor (BeanDefinitionHolder holder : beanDefinitions) {\n\t\t\t\t\t\n\t\t\t\t\tGenericBeanDefinition definition = (GenericBeanDefinition) holder.getBeanDefinition();\n\n\t\t\t\t\tif (logger.isDebugEnabled()) {\n\t\t\t\t\t\tlogger.debug(\"Creating MapperFactoryBean with name '\" + holder.getBeanName()\n\t\t\t\t\t\t\t\t+ \"' and '\" + definition.getBeanClassName() + \"' mapperInterface\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// the mapper interface is the original class of the bean\n\t\t\t\t\t// but, the actual class of the bean is MapperFactoryBean\n\t\t\t\t\tdefinition.getPropertyValues().add(\"mapperInterface\", definition.getBeanClassName());\n\t\t\t\t\tdefinition.setBeanClass(PagingMapperFactoryBean.class);\n\t\t\t\t\tdefinition.getPropertyValues().add(\"addToConfig\", PagingMapperScannerConfigurer.this.addToConfig);\n\t\t\t\t\t\n\t\t\t\t\t// checking sql session factory of mybatis object and inject it \n\t\t\t\t\tboolean explicitFactoryUsed = false;\n\t\t\t\t\tif (StringUtils.hasLength(PagingMapperScannerConfigurer.this.sqlSessionFactoryBeanName)) {\n\t\t\t\t\t\tdefinition.getPropertyValues().add(\"sqlSessionFactory\", \n\t\t\t\t\t\t\t\tnew RuntimeBeanReference(PagingMapperScannerConfigurer.this.sqlSessionFactoryBeanName));\n\t\t\t\t\t\texplicitFactoryUsed = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (StringUtils.hasLength(PagingMapperScannerConfigurer.this.sqlSessionTemplateBeanName)) {\n\t\t\t\t\t\tif (explicitFactoryUsed) {\n\t\t\t\t\t\t\tlogger.warn(\"Cannot use both: sqlSessionTemplate and sqlSessionFactory together. sqlSessionFactory is ignored.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefinition.getPropertyValues().add(\"sqlSessionTemplate\",\n\t\t\t\t\t\t\t\tnew RuntimeBeanReference(PagingMapperScannerConfigurer.this.sqlSessionTemplateBeanName));\n\t\t\t\t\t\tdefinition.getPropertyValues().add(\"sqlSessionFactory\", null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn beanDefinitions;\n\t\t}",
"private static TableMapper buildTableMapper(Class<?> dtoClass) {\r\n\r\n\t\tMap<String, FieldMapper> fieldMapperCache = null;\r\n\t\tField[] fields = dtoClass.getDeclaredFields();\r\n\r\n\t\tFieldMapper fieldMapper = null;\r\n\t\tTableMapper tableMapper = null;\r\n\t\ttableMapper = tableMapperCache.get(dtoClass);\r\n\t\tif (tableMapper != null) {\r\n\t\t\treturn tableMapper;\r\n\t\t}\r\n\t\ttableMapper = new TableMapper();\r\n\t\ttableMapper.setClazz(dtoClass);\r\n\t\tList<FieldMapper> uniqueKeyList = new LinkedList<FieldMapper>();\r\n\t\tList<FieldMapper> opVersionLockList = new LinkedList<FieldMapper>();\r\n\t\tAnnotation[] classAnnotations = dtoClass.getDeclaredAnnotations();\r\n\t\tfor (Annotation an : classAnnotations) {\r\n\t\t\tif (an instanceof TableMapperAnnotation) {\r\n\t\t\t\ttableMapper.setTableMapperAnnotation((TableMapperAnnotation) an);\r\n\t\t\t} else if (an instanceof Table) {\r\n\t\t\t\ttableMapper.setTable((Table) an);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfieldMapperCache = new WeakHashMap<String, FieldMapper>(16);\r\n\t\tfor (Field field : fields) {\r\n\t\t\tfieldMapper = new FieldMapper();\r\n\t\t\tboolean b = fieldMapper.buildMapper(field);\r\n\t\t\tif (!b) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tswitch (fieldMapper.getOpLockType()) {\r\n\t\t\tcase Version:\r\n\t\t\t\tfieldMapper.setOpVersionLock(true);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (fieldMapper.isUniqueKey()) {\r\n\t\t\t\tuniqueKeyList.add(fieldMapper);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.getIgnoreTag().length > 0) {\r\n\t\t\t\tfor (String t : fieldMapper.getIgnoreTag()) {\r\n\t\t\t\t\tfieldMapper.getIgnoreTagSet().add(t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!\"\".equals(fieldMapper.getDbAssociationUniqueKey())) {\r\n\t\t\t\tfieldMapper.setForeignKey(true);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.isForeignKey()) {\r\n\t\t\t\tif (!tableMapperCache.containsKey(field.getType())) {\r\n\t\t\t\t\tbuildTableMapper(field.getType());\r\n\t\t\t\t}\r\n\t\t\t\tTableMapper tm = tableMapperCache.get(field.getType());\r\n\t\t\t\tString foreignFieldName = getFieldMapperByDbFieldName(tm.getFieldMapperCache(),\r\n\t\t\t\t\t\tfieldMapper.getDbAssociationUniqueKey()).getFieldName();\r\n\t\t\t\tfieldMapper.setForeignFieldName(foreignFieldName);\r\n\t\t\t}\r\n\r\n\t\t\tif (!\"\".equals(fieldMapper.getDbCrossedAssociationUniqueKey())) {\r\n\t\t\t\tfieldMapper.setCrossDbForeignKey(true);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.isCrossDbForeignKey()) {\r\n\t\t\t\tif (!tableMapperCache.containsKey(field.getType())) {\r\n\t\t\t\t\tbuildTableMapper(field.getType());\r\n\t\t\t\t}\r\n\t\t\t\tTableMapper tm = tableMapperCache.get(field.getType());\r\n\t\t\t\tString foreignFieldName = getFieldMapperByDbFieldName(tm.getFieldMapperCache(),\r\n\t\t\t\t\t\tfieldMapper.getDbCrossedAssociationUniqueKey()).getFieldName();\r\n\t\t\t\tfieldMapper.setForeignFieldName(foreignFieldName);\r\n\t\t\t}\r\n\r\n\t\t\tif (fieldMapper.isOpVersionLock()) {\r\n\t\t\t\topVersionLockList.add(fieldMapper);\r\n\t\t\t}\r\n\t\t\tfieldMapperCache.put(fieldMapper.getDbFieldName(), fieldMapper);\r\n\t\t}\r\n\t\ttableMapper.setFieldMapperCache(fieldMapperCache);\r\n\t\ttableMapper.setUniqueKeyNames(uniqueKeyList.toArray(new FieldMapper[uniqueKeyList.size()]));\r\n\t\ttableMapper.setOpVersionLocks(opVersionLockList.toArray(new FieldMapper[opVersionLockList.size()]));\r\n\t\ttableMapper.buildTableName();\r\n\t\ttableMapperCache.put(dtoClass, tableMapper);\r\n\t\treturn tableMapper;\r\n\t}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface CountryMapper extends EntityMapper<CountryDTO, Country> {\n\n\n @Mapping(target = \"cities\", ignore = true)\n @Mapping(target = \"countryLanguages\", ignore = true)\n Country toEntity(CountryDTO countryDTO);\n\n default Country fromId(Long id) {\n if (id == null) {\n return null;\n }\n Country country = new Country();\n country.setId(id);\n return country;\n }\n}",
"public void init() throws IllegalArgumentException {\r\n\t\tthis.listItemMapper = ListItemMapper.listitemMapper();\r\n\t\tthis.itemMapper = ItemMapper.itemMapper();\r\n\t\tthis.personMapper = PersonMapper.personMapper();\r\n\t\tthis.shoppingListMapper = ShoppingListMapper.shoppinglistMapper();\r\n\t\tthis.storeMapper = StoreMapper.storeMapper();\r\n\t\tthis.groupMapper = GroupMapper.groupMapper();\r\n\t\tthis.responsibilityMapper = ResponsibilityMapper.responsibilityMapper();\r\n\t\tthis.favoriteItemMapper = FavoriteItemMapper.favoriteItemMapper();\r\n\r\n\t}",
"private void mapSetUp() {\n\t\tfor (int i = 0; i < allChar.length; i++) {\n\t\t\tmap.put(allChar[i], shuffledChar[i]);\n\t\t}\n\t}",
"@Mapper(componentModel = \"spring\", uses = {ExchangeMapper.class, MarketMapper.class, UserMapper.class})\npublic interface OrdersMapper extends EntityMapper<OrdersDTO, Orders> {\n\n @Mapping(source = \"market.id\", target = \"marketId\")\n @Mapping(source = \"user.id\", target = \"userId\")\n OrdersDTO toDto(Orders orders);\n\n @Mapping(target = \"source\", ignore = true)\n @Mapping(source = \"marketId\", target = \"market\")\n @Mapping(source = \"userId\", target = \"user\")\n Orders toEntity(OrdersDTO ordersDTO);\n\n default Orders fromId(Long id) {\n if (id == null) {\n return null;\n }\n Orders orders = new Orders();\n orders.setId(id);\n return orders;\n }\n}",
"@Override\n protected void configureFactoryBuilder(final DefaultMapperFactory.Builder factoryBuilder) {\n factoryBuilder.mapNulls(false).build();\n }",
"@Override\n public HashMap<String, List<String>> initializeMapping(HashMap<String, List<String>> mapping) {\n mapping.put(\"xEncoder\", Arrays.asList(\"outtakeMotor1\", \"outtake1\"));\n mapping.put(\"yEncoder\", Arrays.asList(\"wobbleMotor\"));\n\n return mapping;\n }",
"@Mapper(componentModel = \"spring\", uses = {Business.class})\npublic interface BusinessMapper {\n\n BusinessDTO toDTO(Business business);\n\n @Mapping(target = \"advertisements\", ignore = true)\n Business toEntity(BusinessDTO businessDTO);\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface MisteriosoMapper extends EntityMapper<MisteriosoDTO, Misterioso> {\n\n \n\n \n\n default Misterioso fromId(Long id) {\n if (id == null) {\n return null;\n }\n Misterioso misterioso = new Misterioso();\n misterioso.setId(id);\n return misterioso;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface ExerciseFamilyMapper {\n\n ExerciseFamilyDTO exerciseFamilyToExerciseFamilyDTO(ExerciseFamily exerciseFamily);\n\n List<ExerciseFamilyDTO> exerciseFamiliesToExerciseFamilyDTOs(List<ExerciseFamily> exerciseFamilies);\n\n @Mapping(target = \"exercises\", ignore = true)\n ExerciseFamily exerciseFamilyDTOToExerciseFamily(ExerciseFamilyDTO exerciseFamilyDTO);\n\n List<ExerciseFamily> exerciseFamilyDTOsToExerciseFamilies(List<ExerciseFamilyDTO> exerciseFamilyDTOs);\n}",
"@BeforeEach\n public void setUp() throws Exception {\n this.mapping = new ObjectMapping();\n }",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface WwtreatmentthreeMapper {\n\n WwtreatmentthreeDTO wwtreatmentthreeToWwtreatmentthreeDTO(Wwtreatmentthree wwtreatmentthree);\n\n List<WwtreatmentthreeDTO> wwtreatmentthreesToWwtreatmentthreeDTOs(List<Wwtreatmentthree> wwtreatmentthrees);\n\n Wwtreatmentthree wwtreatmentthreeDTOToWwtreatmentthree(WwtreatmentthreeDTO wwtreatmentthreeDTO);\n\n List<Wwtreatmentthree> wwtreatmentthreeDTOsToWwtreatmentthrees(List<WwtreatmentthreeDTO> wwtreatmentthreeDTOs);\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface OTHERMapper extends EntityMapper<OTHERDTO, OTHER> {\n\n\n\n default OTHER fromId(Long id) {\n if (id == null) {\n return null;\n }\n OTHER oTHER = new OTHER();\n oTHER.setId(id);\n return oTHER;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface AddressMapper {\n\n @Mapping(source = \"city.id\", target = \"cityId\")\n AddressDTO addressToAddressDTO(Address address);\n\n List<AddressDTO> addressesToAddressDTOs(List<Address> addresses);\n\n @Mapping(source = \"cityId\", target = \"city\")\n Address addressDTOToAddress(AddressDTO addressDTO);\n\n List<Address> addressDTOsToAddresses(List<AddressDTO> addressDTOs);\n\n default City cityFromId(Long id) {\n if (id == null) {\n return null;\n }\n City city = new City();\n city.setId(id);\n return city;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface StockOutFrozenTubeMapper {\n\n @Mapping(source = \"stockOutFrozenBox.id\", target = \"stockOutFrozenBoxId\")\n @Mapping(source = \"frozenTube.id\", target = \"frozenTubeId\")\n StockOutFrozenTubeDTO stockOutFrozenTubeToStockOutFrozenTubeDTO(StockOutFrozenTube stockOutFrozenTube);\n\n List<StockOutFrozenTubeDTO> stockOutFrozenTubesToStockOutFrozenTubeDTOs(List<StockOutFrozenTube> stockOutFrozenTubes);\n\n @Mapping(source = \"stockOutFrozenBoxId\", target = \"stockOutFrozenBox\")\n @Mapping(source = \"frozenTubeId\", target = \"frozenTube\")\n StockOutFrozenTube stockOutFrozenTubeDTOToStockOutFrozenTube(StockOutFrozenTubeDTO stockOutFrozenTubeDTO);\n\n List<StockOutFrozenTube> stockOutFrozenTubeDTOsToStockOutFrozenTubes(List<StockOutFrozenTubeDTO> stockOutFrozenTubeDTOs);\n\n default StockOutFrozenBox stockOutFrozenBoxFromId(Long id) {\n if (id == null) {\n return null;\n }\n StockOutFrozenBox stockOutFrozenBox = new StockOutFrozenBox();\n stockOutFrozenBox.setId(id);\n return stockOutFrozenBox;\n }\n\n default FrozenTube frozenTubeFromId(Long id) {\n if (id == null) {\n return null;\n }\n FrozenTube frozenTube = new FrozenTube();\n frozenTube.setId(id);\n return frozenTube;\n }\n}",
"@Bean\n public TypeMap<Carriage, CarriageDto> getCarriageCarriageDtoTypeMap() {\n Converter<List<Driver>, List<DriverDto>> toDriverDtoList = new AbstractConverter<List<Driver>, List<DriverDto>>() {\n protected List<DriverDto> convert(List<Driver> source) {\n if (source == null) {\n return null;\n } else {\n List<DriverDto> driverDtos = new ArrayList<>(source.size());\n for (Driver driver : source) {\n driverDtos.add(getModelMapper().getTypeMap(Driver.class, DriverDto.class, \"DriverDriverDto\").map(driver));\n }\n return driverDtos;\n }\n }\n };\n\n Converter<Vehicle, VehicleDto> toVehicleDto = new AbstractConverter<Vehicle, VehicleDto>() {\n @Override\n protected VehicleDto convert(Vehicle vehicle) {\n if (vehicle == null) {\n return null;\n } else {\n return getModelMapper().getTypeMap(Vehicle.class, VehicleDto.class, \"VehicleVehicleDto\")\n .map(vehicle);\n }\n }\n };\n\n /*\n\n Converter<? super Cargo, CargoDto> toCargoDto = new AbstractConverter<Cargo, CargoDto>() {\n @Override\n protected CargoDto convert(Cargo cargo) {\n if (cargo == null) {\n return null;\n } else {\n return getModelMapper().getTypeMap(Cargo.class, CargoDto.class, \"CargoCargoDto\")\n .map(cargo);\n }\n }\n };*/\n\n return getModelMapper().createTypeMap(Carriage.class, CarriageDto.class, \"CarriageCarriageDto\")\n .addMappings(mapper -> mapper.skip(CarriageDto::setMaxWeight))\n\n// .addMappings(mapper -> mapper.using(toCargoDto).map(Carriage::getCargoes, CarriageDto::setCargoes))\n// .addMappings(mapper -> mapper.using(toWaypointDto).map(Carriage::getWaypoints, CarriageDto::setWaypoints))\n .addMappings(mapper -> mapper.using(toVehicleDto).map(Carriage::getVehicle, CarriageDto::setVehicle))\n .addMappings(mapper -> mapper.using(toDriverDtoList).map(Carriage::getDrivers, CarriageDto::setDrivers));\n }",
"@Mapper(componentModel = \"spring\")\npublic interface FrecuenciaMapper extends AbstractMapper<FrecuenciaVO, Frecuencia> {\n}",
"public void setBeanMapper(MapperIF beanMapper) {\r\n\t\tthis.beanMapper = beanMapper;\r\n\t}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface SampleClassificationMapper {\n\n SampleClassificationDTO sampleClassificationToSampleClassificationDTO(SampleClassification sampleClassification);\n\n List<SampleClassificationDTO> sampleClassificationsToSampleClassificationDTOs(List<SampleClassification> sampleClassifications);\n\n SampleClassification sampleClassificationDTOToSampleClassification(SampleClassificationDTO sampleClassificationDTO);\n\n List<SampleClassification> sampleClassificationDTOsToSampleClassifications(List<SampleClassificationDTO> sampleClassificationDTOs);\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface PerformerMapper extends EntityMapper<PerformerDTO, Performer> {\n\n\n\n default Performer fromId(Long id) {\n if (id == null) {\n return null;\n }\n Performer performer = new Performer();\n performer.setId(id);\n return performer;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {OrgaoMapper.class, PermissaoMapper.class})\npublic interface UsuarioMapper {\n\n @Mapping(target = \"orgao\", ignore = true)\n UsuarioDTO usuarioToUsuarioDTO(Usuario usuario);\n\n List<UsuarioDTO> usuariosToUsuarioDTOs(List<Usuario> usuarios);\n\n Usuario usuarioDTOToUsuario(UsuarioDTO usuarioDTO);\n\n List<Usuario> usuarioDTOsToUsuarios(List<UsuarioDTO> usuarioDTOs);\n}",
"protected StreamsJacksonMapper() {\n super();\n registerModule(new StreamsJacksonModule(configuration.getDateFormats()));\n if ( configuration.getEnableScala()) {\n registerModule(new DefaultScalaModule());\n }\n configure();\n }",
"@Override\n\tprotected Mapping getMapping() {\n\t\treturn new Mapping()\n\t\t\t.add(\"firstname\", driver.getFirstName())\n\t\t\t.add(\"lastname\", driver.getLastName())\n\t\t\t.add(\"dateofbirth\", driver.getDateOfBirth())\n\t\t\t.add(\"gender\", driver.getGender())\n\t\t\t.add(\"age\", computeAge())\n\t\t\t.add(\"numberOfAccidents\", driver.getNumberOfAccidents())\n\t\t\t.add(\"numberOfTickets\", driver.getNumberOfTickets());\n\t}",
"@Mapper(componentModel = \"spring\", uses = {ClientMapper.class, UserAppMapper.class, DistrictMapper.class})\npublic interface CampusMapper extends EntityMapper<CampusDTO, Campus> {\n\n @Mapping(source = \"client\", target = \"clientDto\")\n @Mapping(source = \"district\", target = \"districtDto\")\n CampusDTO toDto(Campus campus);\n\n @Mapping(source = \"clientDto\", target = \"client\")\n @Mapping(source = \"districtDto\", target = \"district\")\n @Mapping(target = \"fields\", ignore = true)\n Campus toEntity(CampusDTO campusDTO);\n\n default Campus fromId(Long id) {\n if (id == null) {\n return null;\n }\n Campus campus = new Campus();\n campus.setId(id);\n return campus;\n }\n}",
"public JsonSchemaMappingLookup() {\n // initialize all mappings from URLs to the respective schema\n businessObjectToJsonSchema.put(\"/rules\", DCC_VALIDATION_RULE_JSON_CLASSPATH);\n businessObjectToJsonSchema.put(\"/bnrules\", DCC_VALIDATION_RULE_JSON_CLASSPATH);\n businessObjectToJsonSchema.put(\"/cclrules\", CCL_JSON_SCHEMA);\n }",
"@Before\n public void setup()\n {\n mapper.registerModules(new S3InputSourceDruidModule().getJacksonModules());\n }",
"private void processPropertyPlaceHolders() {\n\t\tMap<String, PropertyResourceConfigurer> prcs = applicationContext.getBeansOfType(PropertyResourceConfigurer.class);\n\n\t\tif (!prcs.isEmpty() && applicationContext instanceof GenericApplicationContext) {\n\t\t\tBeanDefinition mapperScannerBean = ((GenericApplicationContext) applicationContext)\n\t\t\t\t\t.getBeanFactory().getBeanDefinition(beanName);\n\n\t\t\t// PropertyResourceConfigurer does not expose any methods to explicitly perform\n\t\t\t// property placeholder substitution. Instead, create a BeanFactory that just\n\t\t\t// contains this mapper scanner and post process the factory.\n\t\t\tDefaultListableBeanFactory factory = new DefaultListableBeanFactory();\n\t\t\tfactory.registerBeanDefinition(beanName, mapperScannerBean);\n\n\t\t\tfor (PropertyResourceConfigurer prc : prcs.values()) {\n\t\t\t\tprc.postProcessBeanFactory(factory);\n\t\t\t}\n\n\t\t\tPropertyValues values = mapperScannerBean.getPropertyValues();\n\n\t\t\tthis.basePackage = updatePropertyValue(\"basePackage\", values);\n\t\t\tthis.sqlSessionFactoryBeanName = updatePropertyValue(\"sqlSessionFactoryBeanName\", values);\n\t\t\tthis.sqlSessionTemplateBeanName = updatePropertyValue(\"sqlSessionTemplateBeanName\", values);\n\t\t}\n\t}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface LocationMapper {\n\n @Mapping(source = \"address.id\", target = \"addressId\")\n @Mapping(source = \"address.streetAddressOne\", target = \"addressStreetAddressOne\")\n LocationDTO locationToLocationDTO(Location location);\n\n List<LocationDTO> locationsToLocationDTOs(List<Location> locations);\n\n @Mapping(target = \"gym\", ignore = true)\n @Mapping(source = \"addressId\", target = \"address\")\n Location locationDTOToLocation(LocationDTO locationDTO);\n\n List<Location> locationDTOsToLocations(List<LocationDTO> locationDTOs);\n\n default Address addressFromId(Long id) {\n if (id == null) {\n return null;\n }\n Address address = new Address();\n address.setId(id);\n return address;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {CompanyMapper.class})\npublic interface VehicleMapper extends EntityMapper<VehicleDTO, Vehicle> {\n\n @Mapping(source = \"company.id\", target = \"companyId\")\n VehicleDTO toDto(Vehicle vehicle);\n\n @Mapping(target = \"vehicleDocuments\", ignore = true)\n @Mapping(target = \"vehicleStaffs\", ignore = true)\n @Mapping(source = \"companyId\", target = \"company\")\n Vehicle toEntity(VehicleDTO vehicleDTO);\n\n default Vehicle fromId(Long id) {\n if (id == null) {\n return null;\n }\n Vehicle vehicle = new Vehicle();\n vehicle.setId(id);\n return vehicle;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface TourBubblRoutePointMapper {\n\n @Mapping(source = \"tourBubbl.id\", target = \"tourBubblId\")\n TourBubblRoutePointDTO tourBubblRoutePointToTourBubblRoutePointDTO(TourBubblRoutePoint tourBubblRoutePoint);\n\n List<TourBubblRoutePointDTO> tourBubblRoutePointsToTourBubblRoutePointDTOs(List<TourBubblRoutePoint> tourBubblRoutePoints);\n\n @Mapping(source = \"tourBubblId\", target = \"tourBubbl\")\n TourBubblRoutePoint tourBubblRoutePointDTOToTourBubblRoutePoint(TourBubblRoutePointDTO tourBubblRoutePointDTO);\n\n List<TourBubblRoutePoint> tourBubblRoutePointDTOsToTourBubblRoutePoints(List<TourBubblRoutePointDTO> tourBubblRoutePointDTOs);\n\n default TourBubbl tourBubblFromId(Long id) {\n if (id == null) {\n return null;\n }\n TourBubbl tourBubbl = new TourBubbl();\n tourBubbl.setId(id);\n return tourBubbl;\n }\n}",
"public void mapping() {\n\t\t\n\t}",
"protected Map<MarshallerType, AbstractType> getDefaultMarshallers(CfDef cfDef) throws IOException\n {\n Map<MarshallerType, AbstractType> marshallers = new EnumMap<MarshallerType, AbstractType>(MarshallerType.class);\n AbstractType comparator;\n AbstractType subcomparator;\n AbstractType default_validator;\n AbstractType key_validator;\n\n comparator = parseType(cfDef.getComparator_type());\n subcomparator = parseType(cfDef.getSubcomparator_type());\n default_validator = parseType(cfDef.getDefault_validation_class());\n key_validator = parseType(cfDef.getKey_validation_class());\n\n marshallers.put(MarshallerType.COMPARATOR, comparator);\n marshallers.put(MarshallerType.DEFAULT_VALIDATOR, default_validator);\n marshallers.put(MarshallerType.KEY_VALIDATOR, key_validator);\n marshallers.put(MarshallerType.SUBCOMPARATOR, subcomparator);\n return marshallers;\n }",
"@Mapper\npublic interface UserMapper {\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param appUser\n * @return int\n */\n int registerAppUser(AppUser appUser);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param baseUser\n * @return int\n */\n int registerBaseUser(BaseUser baseUser);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param appUser\n * @return com.example.app.entity.BaseUser\n */\n AppUser loginAppUser(AppUser appUser);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param\n * @return java.util.List<com.example.app.entity.College>\n */\n @Select(\"select * from col\")\n List<College> allCollege();\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param user\n * @return int\n */\n int hasUser(BaseUser user);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param col_id\n * @return int\n */\n int hasCol(int col_id);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param sms\n * @return int\n */\n int registerCode(SMS sms);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param code\n * @return int\n */\n int getCode(@Param(\"code\") Integer code);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param order\n * @return int\n */\n int insertOrder(Order order);\n /**\n * 功能描述\n * @author xgl\n * @date 2019/12/12\n * @param order\n * @return int\n */\n int insertOrderCount(Order order);\n\n}",
"@Mapper(componentModel = \"spring\", uses = {TipoDocumentoMapper.class, GeneroMapper.class, AseguradoraMapper.class, GrupoEtnicoMapper.class, RegimenMapper.class, MunicipioMapper.class, TipoResidenciaMapper.class})\npublic interface PacienteMapper extends EntityMapper<PacienteDTO, Paciente> {\n\n @Mapping(source = \"tipoDocumento.id\", target = \"tipoDocumentoId\")\n @Mapping(source = \"tipoDocumento.nombre\", target = \"tipoDocumentoNombre\")\n @Mapping(source = \"genero.id\", target = \"generoId\")\n @Mapping(source = \"genero.nombre\", target = \"generoNombre\")\n @Mapping(source = \"aseguradora.id\", target = \"aseguradoraId\")\n @Mapping(source = \"aseguradora.nombre\", target = \"aseguradoraNombre\")\n @Mapping(source = \"grupoEtnico.id\", target = \"grupoEtnicoId\")\n @Mapping(source = \"grupoEtnico.nombre\", target = \"grupoEtnicoNombre\")\n @Mapping(source = \"regimen.id\", target = \"regimenId\")\n @Mapping(source = \"regimen.nombre\", target = \"regimenNombre\")\n @Mapping(source = \"municipio.id\", target = \"municipioId\")\n @Mapping(source = \"municipio.nombre\", target = \"municipioNombre\")\n @Mapping(source = \"tipoResidencia.id\", target = \"tipoResidenciaId\")\n @Mapping(source = \"tipoResidencia.nombre\", target = \"tipoResidenciaNombre\")\n PacienteDTO toDto(Paciente paciente);\n\n @Mapping(target = \"aplicacions\", ignore = true)\n @Mapping(target = \"acudientes\", ignore = true)\n @Mapping(source = \"tipoDocumentoId\", target = \"tipoDocumento\")\n @Mapping(source = \"generoId\", target = \"genero\")\n @Mapping(source = \"aseguradoraId\", target = \"aseguradora\")\n @Mapping(source = \"grupoEtnicoId\", target = \"grupoEtnico\")\n @Mapping(source = \"regimenId\", target = \"regimen\")\n @Mapping(source = \"municipioId\", target = \"municipio\")\n @Mapping(source = \"tipoResidenciaId\", target = \"tipoResidencia\")\n Paciente toEntity(PacienteDTO pacienteDTO);\n\n default Paciente fromId(Long id) {\n if (id == null) {\n return null;\n }\n Paciente paciente = new Paciente();\n paciente.setId(id);\n return paciente;\n }\n}",
"@Mapper(componentModel = \"spring\")\npublic interface DataDictItemMapping {\n DataDictItemVo asDataDictItemVo(DataDictItem entity);\n\n DataDictItemOrdinaryVo asOrdinary(DataDictItem entity);\n\n @Mapping(target = \"priority\", ignore = true)\n @Mapping(target = \"lastUpdater\", ignore = true)\n @Mapping(target = \"lastUpdatedAt\", ignore = true)\n @Mapping(target = \"id\", ignore = true)\n @Mapping(target = \"dictId\", ignore = true)\n @Mapping(target = \"creator\", ignore = true)\n @Mapping(target = \"createdAt\", ignore = true)\n DataDictItem asDataDictItem(DataDictItemInsertRo ro);\n\n DataDictItemComplexVo asComplex(DataDictItem entity);\n\n DataDictItem asDataDictItem(DataDictItemUpdateRo ro);\n}",
"@Bean\n public TypeMap<User, User> getUserUserTypeMap() {\n return getModelMapper().createTypeMap(User.class, User.class)\n .addMappings(mapper -> mapper.skip(User::setId))\n .addMappings(mapper -> mapper.skip(User::setPassword))\n .addMappings(mapper -> mapper.when(isNotNull()).map(User::getRole, User::setRole))\n .addMappings(mapper -> mapper.skip(User::setCreateDate))\n .addMappings(mapper -> mapper.skip(User::setUpdateDate))\n .addMappings(mapper -> mapper.when(isNotNull()).map(User::getAvatar, User::setAvatar));\n }",
"private void processNameToObjectMap() {\r\n for (int i = 0; i < this.getObjectGroupCount(); i++) {\r\n ObjectGroup g = this.objectGroups.get(i);\r\n this.objectGroupNameToOffset.put(g.name, i);\r\n HashMap<String, Integer> nameToObjectMap = new HashMap<String, Integer>();\r\n for (int ib = 0; ib < this.getObjectCount(i); ib++) {\r\n nameToObjectMap.put(this.getObjectName(i, ib), ib);\r\n }\r\n g.setObjectNameMapping(nameToObjectMap);\r\n }\r\n }",
"protected BusinessObjectMapper() {\n }",
"private void configureForBoot (Map<String, Collection<?>> beans)\n {\n customerAttributeList = new ArrayList<String>();\n population = minCount + generator.nextInt(Math.abs(maxCount - minCount));\n log.info(\"Configuring \" + population + \" customers for class \"\n + this.getName());\n\n // Prepare for the joins\n ArrayList<SocialGroup> groupList =\n new ArrayList<SocialGroup>(groups.values());\n double cgProbability = 0.0;\n for (SocialGroup group : groupList) {\n cgProbability += classGroups.get(group.getId()).getProbability();\n }\n ArrayList<CarType> carList = new ArrayList<CarType>(carTypes.values());\n double ccProbability = 0.0;\n for (CarType car : carList) {\n ClassCar cc = classCars.get(car.getName());\n if (null != cc) {\n ccProbability += cc.getProbability();\n }\n else {\n log.info(\"Car type {} not configured for {}\",\n car.getName(), this.getName());\n }\n }\n\n for (int i = 0; i < population; i++) {\n // pick a random social group\n SocialGroup thisGroup = pickGroup(groupList, cgProbability);\n ClassGroup groupDetails = classGroups.get(thisGroup.getId());\n // pick a gender\n String gender = \"female\";\n if (generator.nextDouble() < groupDetails.getMaleProbability()) {\n gender = \"male\";\n }\n // pick a random car\n CarType car = pickCar(carList, ccProbability);\n // name format is class.groupId.gender.carName.index\n String customerName = this.name + \"_\" + i;\n // The extra character at the end of the attribute string is padding,\n // due to the fact that XStream seems to drop the last character\n // of the last attribute.\n String attributes = thisGroup.getId() + \".\" + gender\n + \".\" + car.getName() + \".x\";\n customerAttributeList.add(attributes);\n instantiateCustomer(beans, thisGroup, gender, car, customerName);\n }\n }",
"@Mapper\npublic interface TestMapper extends MyMapper<Person1> {\n //List<Person1> findAll();\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface AlterationDisplayTypeMapper {\n\n AlterationDisplayTypeDTO alterationDisplayTypeToAlterationDisplayTypeDTO(AlterationDisplayType alterationDisplayType);\n\n List<AlterationDisplayTypeDTO> alterationDisplayTypesToAlterationDisplayTypeDTOs(List<AlterationDisplayType> alterationDisplayTypes);\n\n @Mapping(target = \"alterations\", ignore = true)\n AlterationDisplayType alterationDisplayTypeDTOToAlterationDisplayType(AlterationDisplayTypeDTO alterationDisplayTypeDTO);\n\n List<AlterationDisplayType> alterationDisplayTypeDTOsToAlterationDisplayTypes(List<AlterationDisplayTypeDTO> alterationDisplayTypeDTOs);\n}",
"private void addMapping(Class... types)\n {\n for (Class type : types)\n {\n if (mappings.put(type.getSimpleName(), type.getName()) != null)\n {\n throw new IllegalStateException(\"A mapping already exists for \" + type.getSimpleName());\n }\n }\n }",
"private void init() {\n\t\tmap = new LinkedHashMap<String, HeaderData>();\r\n\t\tList<HeaderData> list = config.getColumns();\r\n\t\tfor(HeaderData info: list){\r\n\t\t\tString id = info.getId();\r\n\t\t\tif(id == null) throw new IllegalArgumentException(\"Null id found for \"+info.getClass().getName());\r\n\t\t\t// Map the id to info\r\n\t\t\tmap.put(info.getId(), info);\r\n\t\t}\r\n\t}",
"public static Map<String, Property> getDefaultMapping() {\n\t\tMap<String, Property> props = new HashMap<String, Property>();\n\t\tprops.put(\"nstd\", Property.of(p -> p.nested(n -> n.enabled(true))));\n\t\tprops.put(\"properties\", Property.of(p -> {\n\t\t\t\tif (nestedMode()) {\n\t\t\t\t\tp.nested(n -> n.enabled(true));\n\t\t\t\t} else {\n\t\t\t\t\tp.object(n -> n.enabled(true));\n\t\t\t\t}\n\t\t\t\treturn p;\n\t\t\t}\n\t\t));\n\t\tprops.put(\"latlng\", Property.of(p -> p.geoPoint(n -> n.nullValue(v -> v.text(\"0,0\")))));\n\t\tprops.put(\"_docid\", Property.of(p -> p.long_(n -> n.index(false))));\n\t\tprops.put(\"updated\", Property.of(p -> p.date(n -> n.format(DATE_FORMAT))));\n\t\tprops.put(\"timestamp\", Property.of(p -> p.date(n -> n.format(DATE_FORMAT))));\n\n\t\tprops.put(\"tag\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"id\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"key\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"name\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"type\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"tags\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"token\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"email\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"appid\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"groups\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"password\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"parentid\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"creatorid\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\tprops.put(\"identifier\", Property.of(p -> p.keyword(n -> n.index(true))));\n\t\treturn props;\n\t}",
"@Mapper(componentModel = \"spring\", uses = {AanvraagberichtMapper.class})\npublic interface FdnAanvragerMapper extends EntityMapper<FdnAanvragerDTO, FdnAanvrager> {\n\n @Mapping(source = \"aanvraagbericht.id\", target = \"aanvraagberichtId\")\n FdnAanvragerDTO toDto(FdnAanvrager fdnAanvrager);\n\n @Mapping(target = \"adres\", ignore = true)\n @Mapping(target = \"legitimatiebewijs\", ignore = true)\n @Mapping(target = \"werksituaties\", ignore = true)\n @Mapping(target = \"gezinssituaties\", ignore = true)\n @Mapping(target = \"financieleSituaties\", ignore = true)\n @Mapping(source = \"aanvraagberichtId\", target = \"aanvraagbericht\")\n FdnAanvrager toEntity(FdnAanvragerDTO fdnAanvragerDTO);\n\n default FdnAanvrager fromId(Long id) {\n if (id == null) {\n return null;\n }\n FdnAanvrager fdnAanvrager = new FdnAanvrager();\n fdnAanvrager.setId(id);\n return fdnAanvrager;\n }\n}",
"public ResultSetMapper(final FieldNamingStrategy fieldNamingStrategy) {\n registerAttributeConverters();\n logger.info(\"The {} field naming strategy will be used for mapping.\", fieldNamingStrategy);\n this.fieldNamingStrategy = fieldNamingStrategy;\n }",
"@Mapper(componentModel = \"spring\", uses = {GovernorateMapper.class, DelegationMapper.class, UserMapper.class, })\npublic interface PolicyHolderMapper extends EntityMapper <PolicyHolderDTO, PolicyHolder> {\n\n @Mapping(source = \"governorate.id\", target = \"governorateId\")\n @Mapping(source = \"governorate.label\", target = \"governorateLabel\")\n\n @Mapping(source = \"delegation.id\", target = \"delegationId\")\n @Mapping(source = \"delegation.label\", target = \"delegationLabel\")\n\n @Mapping(source = \"creationUser.id\", target = \"creationUserId\")\n @Mapping(source = \"creationUser.login\", target = \"creationUserLogin\")\n\n @Mapping(source = \"updateUser.id\", target = \"updateUserId\")\n @Mapping(source = \"updateUser.login\", target = \"updateUserLogin\")\n PolicyHolderDTO toDto(PolicyHolder policyHolder); \n\n @Mapping(source = \"governorateId\", target = \"governorate\")\n\n @Mapping(source = \"delegationId\", target = \"delegation\")\n\n @Mapping(source = \"creationUserId\", target = \"creationUser\")\n\n @Mapping(source = \"updateUserId\", target = \"updateUser\")\n PolicyHolder toEntity(PolicyHolderDTO policyHolderDTO); \n default PolicyHolder fromId(Long id) {\n if (id == null) {\n return null;\n }\n PolicyHolder policyHolder = new PolicyHolder();\n policyHolder.setId(id);\n return policyHolder;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {SabegheMapper.class, NoeSabegheMapper.class})\npublic interface AdamKhesaratMapper extends EntityMapper<AdamKhesaratDTO, AdamKhesarat> {\n\n @Mapping(source = \"sabeghe.id\", target = \"sabegheId\")\n @Mapping(source = \"sabeghe.name\", target = \"sabegheName\")\n @Mapping(source = \"noeSabeghe.id\", target = \"noeSabegheId\")\n @Mapping(source = \"noeSabeghe.name\", target = \"noeSabegheName\")\n AdamKhesaratDTO toDto(AdamKhesarat adamKhesarat);\n\n @Mapping(source = \"sabegheId\", target = \"sabeghe\")\n @Mapping(source = \"noeSabegheId\", target = \"noeSabeghe\")\n AdamKhesarat toEntity(AdamKhesaratDTO adamKhesaratDTO);\n\n default AdamKhesarat fromId(Long id) {\n if (id == null) {\n return null;\n }\n AdamKhesarat adamKhesarat = new AdamKhesarat();\n adamKhesarat.setId(id);\n return adamKhesarat;\n }\n}",
"@Bean\n public ObjectMapper mapper() {\n return new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)\n .setDateFormat(dateFormat());\n }",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface EmploymentTypeMapper extends EntityMapper<EmploymentTypeDTO, EmploymentType> {\n\n\n @Mapping(target = \"people\", ignore = true)\n EmploymentType toEntity(EmploymentTypeDTO employmentTypeDTO);\n\n default EmploymentType fromId(Long id) {\n if (id == null) {\n return null;\n }\n EmploymentType employmentType = new EmploymentType();\n employmentType.setId(id);\n return employmentType;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface Owner3Mapper extends EntityMapper <Owner3DTO, Owner3> {\n \n @Mapping(target = \"car3S\", ignore = true)\n Owner3 toEntity(Owner3DTO owner3DTO); \n default Owner3 fromId(Long id) {\n if (id == null) {\n return null;\n }\n Owner3 owner3 = new Owner3();\n owner3.setId(id);\n return owner3;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface EheartMapper {\n\n EheartDTO eheartToEheartDTO(Eheart eheart);\n\n List<EheartDTO> eheartsToEheartDTOs(List<Eheart> ehearts);\n\n Eheart eheartDTOToEheart(EheartDTO eheartDTO);\n\n List<Eheart> eheartDTOsToEhearts(List<EheartDTO> eheartDTOs);\n}",
"@Override\n protected final Map<String, String> createFieldToPropertyMapping() {\n // get super class mapping\n final Map<String, String> mapping = super.createFieldToPropertyMapping();\n \n mapping.put(this.tableName + \".rmres_id\", \"id\");\n mapping.put(this.tableName + \".cost_rmres\", \"cost\");\n mapping.put(this.tableName + \".config_id\", \"configId\");\n mapping.put(this.tableName + \".rm_arrange_type_id\", \"arrangeTypeId\");\n mapping.put(this.tableName + \".guests_external\", \"externalGuests\");\n mapping.put(this.tableName + \".guests_internal\", \"internalGuests\");\n \n return mapping;\n }",
"@Mapper(uses = {PassengerMapper.class, TicketScheduleSectionMapper.class})\npublic interface TicketMapper {\n\n /**\n * To dto ticket dto.\n *\n * @param ticketEntity the ticket entity\n * @return the ticket dto\n */\n @Mappings({\n @Mapping(target = \"passengerDto\", source = \"ticketEntity.passengerEntity\"),\n @Mapping(target = \"ticketScheduleSectionDtoList\", source = \"ticketEntity.ticketScheduleSectionEntityList\")\n })\n TicketDto toDto(TicketEntity ticketEntity);\n\n /**\n * To dto list list.\n *\n * @param ticketEntityList the ticket entity list\n * @return the list\n */\n List<TicketDto> toDtoList(List<TicketEntity> ticketEntityList);\n\n /**\n * To entity ticket entity.\n *\n * @param ticketDto the ticket dto\n * @return the ticket entity\n */\n @Mappings({\n\n @Mapping(target = \"passengerEntity\", source = \"ticketDto.passengerDto\"),\n @Mapping(target = \"ticketScheduleSectionEntityList\", source = \"ticketDto.ticketScheduleSectionDtoList\")\n })\n TicketEntity toEntity(TicketDto ticketDto);\n\n /**\n * To entity list list.\n *\n * @param ticketDtoList the ticket dto list\n * @return the list\n */\n List<TicketEntity> toEntityList(List<TicketDto> ticketDtoList);\n\n}",
"protected void initDaosFromSpringBeans() {\n this.waitUntilApplicationContextIsReady();\n final String[] beanNamesToLoad = this.m_applicationContext\n .getBeanNamesForType(GenericDao.class);\n for (final String name : beanNamesToLoad) {\n if (!PatternMatchUtils.simpleMatch(this.m_daoNamePattern, name)) {\n // Doesn't match - so skip it.\n continue;\n }\n final GenericDao<?> dao = (GenericDao<?>) this.m_applicationContext.getBean(name);\n // avoid adding a DAO again\n if (!this.m_daos.values().contains(dao)) {\n this.initDao(dao);\n this.m_daos.put(dao.getPersistentClass(), dao);\n }\n }\n }",
"@Bean\n @Primary\n public ObjectMapper objectMapper() {\n final ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);\n objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);\n objectMapper.addMixIn(IdentifiableDocument.class, MixIn.class);\n return objectMapper;\n }",
"@Mapper(componentModel = \"spring\")\npublic interface MessageMapper {\n\n\t@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)\n\tpublic MessageDto convertToMessageDto(Message message);\n}",
"protected void fillMapFromProperties(Properties props)\n {\n Enumeration<?> en = props.propertyNames();\n\n while (en.hasMoreElements())\n {\n String propName = (String) en.nextElement();\n\n // ignore map, pattern_map; they are handled separately\n if (!propName.startsWith(\"map\") &&\n !propName.startsWith(\"pattern_map\"))\n {\n String propValue = props.getProperty(propName);\n String fieldDef[] = new String[4];\n fieldDef[0] = propName;\n fieldDef[3] = null;\n if (propValue.startsWith(\"\\\"\"))\n {\n // value is a constant if it starts with a quote\n fieldDef[1] = \"constant\";\n fieldDef[2] = propValue.trim().replaceAll(\"\\\"\", \"\");\n }\n else\n // not a constant\n {\n // split it into two pieces at first comma or space\n String values[] = propValue.split(\"[, ]+\", 2);\n if (values[0].startsWith(\"custom\") || values[0].equals(\"customDeleteRecordIfFieldEmpty\") ||\n values[0].startsWith(\"script\"))\n {\n fieldDef[1] = values[0];\n\n // parse sections of custom value assignment line in\n // _index.properties file\n String lastValues[];\n // get rid of empty parens\n if (values[1].indexOf(\"()\") != -1)\n values[1] = values[1].replace(\"()\", \"\");\n\n // index of first open paren after custom method name\n int parenIx = values[1].indexOf('(');\n\n // index of first unescaped comma after method name\n int commaIx = Utils.getIxUnescapedComma(values[1]);\n\n if (parenIx != -1 && commaIx != -1 && parenIx < commaIx) {\n // remainder should be split after close paren\n // followed by comma (optional spaces in between)\n lastValues = values[1].trim().split(\"\\\\) *,\", 2);\n\n // Reattach the closing parenthesis:\n if (lastValues.length == 2) lastValues[0] += \")\";\n }\n else\n // no parens - split comma preceded by optional spaces\n lastValues = values[1].trim().split(\" *,\", 2);\n\n fieldDef[2] = lastValues[0].trim();\n\n fieldDef[3] = lastValues.length > 1 ? lastValues[1].trim() : null;\n // is this a translation map?\n if (fieldDef[3] != null && fieldDef[3].contains(\"map\"))\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n } // end custom\n else if (values[0].equals(\"xml\") ||\n values[0].equals(\"raw\") ||\n values[0].equals(\"date\") ||\n values[0].equals(\"json\") ||\n values[0].equals(\"json2\") ||\n values[0].equals(\"index_date\") ||\n values[0].equals(\"era\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n if (fieldDef[2].equals(\"era\") && fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n else if (values[0].equalsIgnoreCase(\"FullRecordAsXML\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsMARC\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsJson2\") ||\n values[0].equalsIgnoreCase(\"FullRecordAsText\") ||\n values[0].equalsIgnoreCase(\"DateOfPublication\") ||\n values[0].equalsIgnoreCase(\"DateRecordIndexed\"))\n {\n fieldDef[1] = \"std\";\n fieldDef[2] = values[0];\n fieldDef[3] = values.length > 1 ? values[1].trim() : null;\n // NOTE: assuming no translation map here\n }\n else if (values.length == 1)\n {\n fieldDef[1] = \"all\";\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n }\n else\n // other cases of field definitions\n {\n String values2[] = values[1].trim().split(\"[ ]*,[ ]*\", 2);\n fieldDef[1] = \"all\";\n if (values2[0].equals(\"first\") ||\n (values2.length > 1 && values2[1].equals(\"first\")))\n fieldDef[1] = \"first\";\n\n if (values2[0].startsWith(\"join\"))\n fieldDef[1] = values2[0];\n\n if ((values2.length > 1 && values2[1].startsWith(\"join\")))\n fieldDef[1] = values2[1];\n\n if (values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\") ||\n (values2.length > 1 && values2[1].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\")))\n fieldDef[1] = \"DeleteRecordIfFieldEmpty\";\n\n fieldDef[2] = values[0];\n fieldDef[3] = null;\n\n // might we have a translation map?\n if (!values2[0].equals(\"all\") &&\n !values2[0].equals(\"first\") &&\n !values2[0].startsWith(\"join\") &&\n !values2[0].equalsIgnoreCase(\"DeleteRecordIfFieldEmpty\"))\n {\n fieldDef[3] = values2[0].trim();\n if (fieldDef[3] != null)\n {\n try\n {\n fieldDef[3] = loadTranslationMap(props, fieldDef[3]);\n }\n catch (IllegalArgumentException e)\n {\n logger.error(\"Unable to find file containing specified translation map (\" + fieldDef[3] + \")\");\n throw new IllegalArgumentException(\"Error: Problems reading specified translation map (\" + fieldDef[3] + \")\");\n }\n }\n }\n } // other cases of field definitions\n\n } // not a constant\n\n fieldMap.put(propName, fieldDef);\n\n } // if not map or pattern_map\n\n } // while enumerating through property names\n\n // verify that fieldMap is valid\n verifyCustomMethodsAndTransMaps();\n }",
"public interface Mapper<T, T2> {\n\n /**\n * Sets the source object.\n *\n * @param source the source instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> from(T source);\n\n /**\n * Sets the target class.\n *\n * @param target the target class.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> to(Class<T2> target);\n\n /**\n * Sets an ignorable object with the ignorable fields for mapping operation.\n *\n * @param ignorable the ignorable instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> ignoring(Ignorable ignorable);\n\n /**\n * Sets a customizable object with the fields for the explicit mapping.\n *\n * @param customizable the customizable instance.\n * @return a <b>IOMap</b> instance.\n */\n Mapper<T, T2> relate(Customizable customizable);\n\n /**\n * Starts with the building target object\n *\n * @return a target object instance.\n */\n T2 build();\n\n}",
"@Mapper\npublic interface UserConvert {\n\n UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);\n\n static UserConvertConvertor instance() {\n return INSTANCE;\n }\n\n @Mappings({})\n User toUser(UserDTO userDTO);\n\n @Mappings({})\n UserDTO toUserDTO(User user);\n\n List<UserDTO> toUserDTOs(List<User> users);\n\n List<User> toUsers(List<UserDTO> userDTOs);\n}",
"@Mapper(componentModel = \"spring\", uses = {UserMapper.class, CustomerMapper.class})\npublic interface WorkDayMapper extends EntityMapper<WorkDayDTO, WorkDay> {\n\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.login\", target = \"userLogin\")\n @Mapping(source = \"customer.id\", target = \"customerId\")\n WorkDayDTO toDto(WorkDay workDay);\n\n @Mapping(source = \"userId\", target = \"user\")\n @Mapping(source = \"customerId\", target = \"customer\")\n WorkDay toEntity(WorkDayDTO workDayDTO);\n\n default WorkDay fromId(Long id) {\n if (id == null) {\n return null;\n }\n WorkDay workDay = new WorkDay();\n workDay.setId(id);\n return workDay;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface EightydMapper extends EntityMapper<EightydDTO, Eightyd> {\n\n\n\n default Eightyd fromId(Long id) {\n if (id == null) {\n return null;\n }\n Eightyd eightyd = new Eightyd();\n eightyd.setId(id);\n return eightyd;\n }\n}",
"@Bean\n public TypeMap<VehicleDto, Vehicle> getVehicleDtoVehicleTypeMap() {\n return getModelMapper().createTypeMap(VehicleDto.class, Vehicle.class)\n .addMappings(mapper -> mapper.when(isNotNull()).map(VehicleDto::getLicPlateNum, Vehicle::setLicPlateNum))\n .addMappings(mapper -> mapper.when(isNotNull()).map(VehicleDto::getState, Vehicle::setState))\n .addMappings(mapper -> mapper.when(isNotNull()).map(VehicleDto::getPassSeatsNum, Vehicle::setPassSeatsNum))\n .addMappings(mapper -> mapper.when(isNotNull()).map(VehicleDto::getLoadCapacity, Vehicle::setLoadCapacity))\n\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(VehicleDto::getCity, Vehicle::setCity))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(VehicleDto::getCarriage, Vehicle::setCarriage))\n .addMappings(mapper -> mapper.using(MappingContext::getDestination).map(VehicleDto::getCoDrivers, Vehicle::setCoDrivers));\n }",
"JavaTypeMapping getMapping(Class javaType, boolean serialised, boolean embedded, String fieldName);",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface UserMessageAccountMapper extends EntityMapper<UserMessageAccountDTO, UserMessageAccount> {\n\n \n\n @Mapping(target = \"jobs\", ignore = true)\n UserMessageAccount toEntity(UserMessageAccountDTO userMessageAccountDTO);\n\n default UserMessageAccount fromId(Long id) {\n if (id == null) {\n return null;\n }\n UserMessageAccount userMessageAccount = new UserMessageAccount();\n userMessageAccount.setId(id);\n return userMessageAccount;\n }\n}",
"@org.apache.ibatis.annotations.Mapper\npublic interface UserMapper extends Mapper<User>{\n}",
"@Component\n@Mapper(componentModel = \"spring\")\npublic interface CarriageMapper {\n\n Carriage carriageModelToCarriage(CarriageModel carriageModel);\n\n CarriageModel carriageToCarriageModel(Carriage carriage);\n\n CarriageModel carriageDtoToCarriageModel(CarriageDto carriageDto);\n\n CarriageDto carriageModelToCarriageDto(CarriageModel carriageModel);\n\n List<CarriageModel> carriagesToCarriageModels(List<Carriage> carriages);\n\n List<CarriageDto> carriageModelsToCarriageDtos(List<CarriageModel> carriageModels);\n\n List<Carriage> carriageModelsToCarriages(List<CarriageModel> carriageModels);\n}",
"@Mapper\npublic interface RecruitMapper {\n\n /**\n * 根据招募表主键ID查询\n * @param id\n * @return\n */\n public Recruit getRecruitById(String id);\n\n /**\n * 根据商家ID查询对应招募信息\n * @param owner\n * @return\n */\n public List<Recruit> getRecruitListByOwner(String owner);\n\n public int insertRecruit(Recruit recruit);\n\n public int updateRecruit(Recruit recruit);\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface HeritageMediaMapper {\n\n @Mapping(source = \"category.id\", target = \"categoryId\")\n @Mapping(source = \"category.categoryName\", target = \"categoryCategoryName\")\n @Mapping(source = \"language.id\", target = \"languageId\")\n @Mapping(source = \"language.heritageLanguage\", target = \"languageHeritageLanguage\")\n @Mapping(source = \"group.id\", target = \"groupId\")\n @Mapping(source = \"group.name\", target = \"groupName\")\n @Mapping(source = \"heritageApp.id\", target = \"heritageAppId\")\n @Mapping(source = \"heritageApp.name\", target = \"heritageAppName\")\n @Mapping(source = \"user.id\", target = \"userId\")\n @Mapping(source = \"user.login\", target = \"userLogin\")\n HeritageMediaDTO heritageMediaToHeritageMediaDTO(HeritageMedia heritageMedia);\n\n @Mapping(source = \"categoryId\", target = \"category\")\n @Mapping(source = \"languageId\", target = \"language\")\n @Mapping(source = \"groupId\", target = \"group\")\n @Mapping(source = \"heritageAppId\", target = \"heritageApp\")\n @Mapping(source = \"userId\", target = \"user\")\n HeritageMedia heritageMediaDTOToHeritageMedia(HeritageMediaDTO heritageMediaDTO);\n\n default HeritageCategory heritageCategoryFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageCategory heritageCategory = new HeritageCategory();\n heritageCategory.setId(id);\n return heritageCategory;\n }\n\n default HeritageLanguage heritageLanguageFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageLanguage heritageLanguage = new HeritageLanguage();\n heritageLanguage.setId(id);\n return heritageLanguage;\n }\n\n default HeritageGroup heritageGroupFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageGroup heritageGroup = new HeritageGroup();\n heritageGroup.setId(id);\n return heritageGroup;\n }\n\n default HeritageApp heritageAppFromId(Long id) {\n if (id == null) {\n return null;\n }\n HeritageApp heritageApp = new HeritageApp();\n heritageApp.setId(id);\n return heritageApp;\n }\n\n default User userFromId(Long id) {\n if (id == null) {\n return null;\n }\n User user = new User();\n user.setId(id);\n return user;\n }\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface TxnActivityAuditMapper {\n\n @Mapping(source = \"editedBy.id\", target = \"editedById\")\n TxnActivityAuditDTO txnActivityAuditToTxnActivityAuditDTO(TxnActivityAudit txnActivityAudit);\n\n @Mapping(source = \"editedById\", target = \"editedBy\")\n TxnActivityAudit txnActivityAuditDTOToTxnActivityAudit(TxnActivityAuditDTO txnActivityAuditDTO);\n\n default Staff staffFromId(Long id) {\n if (id == null) {\n return null;\n }\n Staff staff = new Staff();\n staff.setId(id);\n return staff;\n }\n}",
"@Mapper(componentModel = \"spring\",\n uses = { LongDateMapper.class },\n nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS,\n collectionMappingStrategy = CollectionMappingStrategy.ADDER_PREFERRED)\npublic interface ProtobufMapper {\n\n /**\n * Convert Protocol buffer phone to DTO\n *\n * @param phone the Protocol buffer phone\n *\n * @return the DTO\n */\n @Mapping(target = \"id\", ignore = true)\n PhoneDTO fromProtobuf(Customer.Phone phone);\n\n /**\n * Convert Protocol buffer phone type to DTO\n *\n * @param type Protocol buffer phone type\n *\n * @return the DTO\n */\n @ValueMapping(source = \"UNKNOWN\", target = MappingConstants.NULL)\n @ValueMapping(source = \"UNRECOGNIZED\", target = MappingConstants.NULL)\n PhoneDTO.Type fromProtobuf(Customer.Phone.PhoneType type);\n\n /**\n * Convert DTO phone to Protocol buffer\n *\n * @param phone the DTO phone\n *\n * @return the Protocol buffer phone\n */\n @Mapping(target = \"mergeFrom\", ignore = true)\n @Mapping(target = \"clearField\", ignore = true)\n @Mapping(target = \"clearOneof\", ignore = true)\n @Mapping(target = \"mergeUnknownFields\", ignore = true)\n @Mapping(target = \"unknownFields\", ignore = true)\n @Mapping(target = \"allFields\", ignore = true)\n @Mapping(target = \"numberBytes\", ignore = true)\n @Mapping(target = \"typeValue\", ignore = true)\n Customer.Phone toProtobuf(PhoneDTO phone);\n\n /**\n * Convert Protocol buffer address to DTO\n *\n * @param address the Protocol buffer address\n *\n * @return the DTO\n */\n @Mapping(target = \"lines\", source = \"linesList\")\n AddressDTO fromProtobuf(Customer.Address address);\n\n /**\n * DTO to protocol buffer for builder\n *\n * @param customer the DTO address\n *\n * @return the builder\n */\n @Mapping(source=\"lines\",target=\"linesList\")\n @Mapping(target = \"mergeFrom\", ignore = true)\n @Mapping(target = \"clearField\", ignore = true)\n @Mapping(target = \"clearOneof\", ignore = true)\n @Mapping(target = \"mergeUnknownFields\", ignore = true)\n @Mapping(target = \"unknownFields\", ignore = true)\n @Mapping(target = \"allFields\", ignore = true)\n @Mapping(target = \"cityBytes\", ignore = true)\n @Mapping(target = \"countryBytes\", ignore = true)\n @Mapping(target = \"zipCodeBytes\", ignore = true)\n Customer.Address toProtobuf(AddressDTO address);\n\n /**\n * Convert Protocol buffer customer to DTO\n *\n * @param customer the Protocol buffer customer\n *\n * @return the DTO\n */\n @Mapping(target = \"phones\", source = \"phonesList\")\n CustomerDTO fromProtobuf(Customer customer);\n\n /**\n * DTO to protocol buffer for builder\n *\n * @param customer the DTO customer\n *\n * @return the builder\n */\n @Mapping(target = \"phonesList\", source = \"phones\")\n @Mapping(target = \"mergeFrom\", ignore = true)\n @Mapping(target = \"clearField\", ignore = true)\n @Mapping(target = \"clearOneof\", ignore = true)\n @Mapping(target = \"mergeUnknownFields\", ignore = true)\n @Mapping(target = \"unknownFields\", ignore = true)\n @Mapping(target = \"allFields\", ignore = true)\n @Mapping(target = \"mergeAddress\", ignore = true)\n @Mapping(target = \"removePhones\", ignore = true)\n @Mapping(target = \"emailBytes\", ignore = true)\n @Mapping(target = \"firstNameBytes\", ignore = true)\n @Mapping(target = \"lastNameBytes\", ignore = true)\n @Mapping(target = \"idBytes\", ignore = true)\n @Mapping(target = \"phonesBuilderList\", ignore = true)\n @Mapping(target = \"phonesOrBuilderList\", ignore = true)\n Customer toProtobuf(CustomerDTO customer);\n\n}",
"@Mapper(uses = DateMapper.class)\npublic interface ExerciseMapper {\n\n // Autogenerated code will map exercise object to ExerciseDTO\n // @Mapping(source = \"firstName\", target = \"name\") can be used if the field names do not match.\n ExerciseDTO convertToExerciseDTO(Exercise exercise);\n\n Exercise convertToExercise(ExerciseDTO exerciseDTO);\n\n}",
"@Mapper(componentModel = \"spring\", uses = {})\npublic interface ProgrammePropMapper extends EntityMapper<ProgrammePropDTO, ProgrammeProp> {\n\n\n\n default ProgrammeProp fromId(Long id) {\n if (id == null) {\n return null;\n }\n ProgrammeProp programmeProp = new ProgrammeProp();\n programmeProp.setId(id);\n return programmeProp;\n }\n}"
] | [
"0.6463802",
"0.62447935",
"0.58162427",
"0.574806",
"0.5740074",
"0.5710037",
"0.56981647",
"0.5697858",
"0.56382334",
"0.5635797",
"0.56280565",
"0.56207985",
"0.56186223",
"0.56127876",
"0.5610656",
"0.5546792",
"0.55455154",
"0.5514388",
"0.55096316",
"0.549059",
"0.54537743",
"0.5436186",
"0.5434287",
"0.5427002",
"0.53707254",
"0.5369209",
"0.53604674",
"0.5342116",
"0.5337867",
"0.53322756",
"0.53318745",
"0.5321435",
"0.5320338",
"0.5313616",
"0.52832144",
"0.52807176",
"0.5276016",
"0.5267874",
"0.5263998",
"0.52549183",
"0.524116",
"0.52405304",
"0.52395046",
"0.5234538",
"0.52337337",
"0.52271277",
"0.52187485",
"0.5216928",
"0.5212286",
"0.5203049",
"0.52025837",
"0.5183044",
"0.51807666",
"0.51767933",
"0.5159881",
"0.5153238",
"0.5149659",
"0.5142098",
"0.51287246",
"0.5127833",
"0.51271516",
"0.51264936",
"0.51109564",
"0.5109682",
"0.51079977",
"0.5098793",
"0.5096282",
"0.50926083",
"0.5082986",
"0.5081791",
"0.5077676",
"0.5076034",
"0.5075981",
"0.5073731",
"0.507121",
"0.50711",
"0.5064767",
"0.50568175",
"0.50476635",
"0.5045628",
"0.5039509",
"0.5032722",
"0.50317883",
"0.50290656",
"0.50256735",
"0.5018062",
"0.5016884",
"0.5006484",
"0.5005809",
"0.50045824",
"0.50007117",
"0.4991604",
"0.4989976",
"0.4989863",
"0.4985604",
"0.49847737",
"0.49700913",
"0.49610364",
"0.49600616",
"0.49576694"
] | 0.5730455 | 5 |
There is confusion about whether ORPHANET IDs should be coded as ORPHA:1234 or ORPHANET:1234. | private String normalizeDiseaseId(String diseaseId) {
String[] tokens = diseaseId.split(":");
if ("ORPHANET".equals(tokens[0])) {
diseaseId = "ORPHA:" + tokens[1];
}
return diseaseId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String mo10312id();",
"java.lang.String getAoisId();",
"private String setPartyId(String partyName){\n\n if (partyName.contains(\"REP\")) {\n return \"6\";\n }\n else if (partyName.contains(\"DEM\")) {\n return \"7\";\n }\n else {\n return \"16\";\n }\n }",
"public static void AuId2Id3hop(){\n\t\t\r\n\t\tlong AID=2052648321L;\r\n\t\tlong AID2=2041650587L;\r\n\t\tlong ID=1511277043L;\r\n\t\tlong AFID=97018004L;\r\n\t\tSearchWrapper.search( AID, ID);\r\n\t}",
"private String createId() {\n int idLength = 5;\n String possibleChars = \"1234567890\";\n Random random = new Random();\n StringBuilder newString = new StringBuilder();\n\n for (int i = 0; i < idLength; i++) {\n int randomInt = random.nextInt(10);\n newString.append(possibleChars.charAt(randomInt));\n }\n\n return newString.toString();\n }",
"@Override\n public int hashCode() {\n return orcid != null ? orcid.hashCode() : 0;\n }",
"public void testNumberID() {\n String testID = generator.generatePrefixedIdentifier(\"123\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"_123\" + ID_REGEX));\n }",
"public void setOrginid(String orginid) {\n this.orginid = orginid == null ? null : orginid.trim();\n }",
"public void testNullID() {\n String testID = generator.generatePrefixedIdentifier(null);\n assertNotNull(testID);\n assertTrue(testID.matches(ID_REGEX));\n }",
"public void setHORAOPRCN(int value) {\n this.horaoprcn = value;\n }",
"@Override\n public String getToID()\n {\n \tStringBuilder sb = new StringBuilder();\n\n\t\tint prefix = getPrefix();\n \tint ident = getIdent1();\n\n \tswitch( IdentType.fromIdent( ident ) )\n \t{\n \t\tcase IPFIXI:\n \t\t\tsb.append( \"INTER-PREFIX\" );\n \t\t\tbreak;\n \t\tcase ALLI:\n \t\t\tsb.append( \"ALL RADIOS\" );\n \t\t\tbreak;\n \t\tcase PABXI:\n \t\t\tsb.append( \"PABX EXT\" );\n \t\t\tbreak;\n \t\tcase PSTNSI1:\n \t\tcase PSTNSI2:\n \t\tcase PSTNSI3:\n \t\tcase PSTNSI4:\n \t\tcase PSTNSI5:\n \t\tcase PSTNSI6:\n \t\tcase PSTNSI7:\n \t\tcase PSTNSI8:\n \t\tcase PSTNSI9:\n \t\tcase PSTNSI10:\n \t\tcase PSTNSI11:\n \t\tcase PSTNSI12:\n \t\tcase PSTNSI13:\n \t\tcase PSTNSI14:\n \t\tcase PSTNSI15:\n \t\t\tsb.append( \"PRE-DEFINED PSTN\" );\n \t\t\tbreak;\n \t\tcase PSTNGI:\n \t\t\tsb.append( \"PSTN GATEWAY\" );\n \t\t\tbreak;\n \t\tcase TSCI:\n \t\t\tsb.append( \"SYSTEM CONTROLLER\" );\n \t\t\tbreak;\n \t\tcase DIVERTI:\n \t\t\tsb.append( \"CALL DIVERT\" );\n \t\t\tbreak;\n \t\tcase USER:\n\t\t\tdefault:\n\t\t\t\tif( prefix != 0 || ident != 0 )\n\t\t\t\t{\n\t \tsb.append( format( prefix, 3 ) );\n\t \tsb.append( \"-\" );\n\t \tsb.append( format( ident, 4) );\n\t\t\t\t}\n \tbreak;\n \t}\n\n \treturn sb.toString();\n }",
"@Test\n public void testIncorrectId(){\n UserRegisterKYC idTooLong = new UserRegisterKYC(\"hello\",\"S12345678B\",\"26/02/1995\",\"738583\");\n int requestResponse = idTooLong.sendRegisterRequest();\n assertEquals(400, requestResponse);\n\n UserRegisterKYC nonAlphanumId = new UserRegisterKYC(\"hello\",\"S12345!8B\",\"26/02/1995\",\"738583\");\n requestResponse = nonAlphanumId.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC invalidPrefixId = new UserRegisterKYC(\"hello\",\"A\"+validId3.substring(1),\"26/02/1995\",\"738583\");\n requestResponse = invalidPrefixId.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC alphaInMiddleId = new UserRegisterKYC(\"hello\",\"S1234A68B\",\"26/02/1995\",\"738583\");\n requestResponse = alphaInMiddleId.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC idTooShort = new UserRegisterKYC(\"hello\",\"S123678B\",\"26/02/1995\",\"738583\");\n requestResponse = idTooShort.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n UserRegisterKYC invalidChecksum = new UserRegisterKYC(\"hello\",\"S1234578B\",\"26/02/1995\",\"738583\");\n requestResponse = invalidChecksum.sendRegisterRequest();\n assertEquals(400,requestResponse);\n\n }",
"public static String get_olts_id(){\r\n\t\t_olts_id ++;\r\n\t\treturn \"OLTS\" + _olts_id;\r\n\t}",
"private String genSenderID(String phoneNumber) {\r\n String sid = phoneNumber.replaceAll(senderIDRegex, \"\");\r\n return sid.length() > 11 ? sid.substring(sid.length() - 11, sid.length()) : sid;\r\n }",
"String getOrganizationPartyId();",
"private String webId(String web) {\n return \" and \"+\r\n \" p.email_key = \"+getEMailKeyStr(web)+\" and \"+\r\n \" pt.email_key = \"+getEMailKeyStr(web)+\" and \"+\r\n \" ct.email_key = \"+getEMailKeyStr(web)+\" \"\r\n ;\r\n }",
"public boolean validateEmployeeID() {\n if (employeeID.length() - 1 != 6) {\n return false;\n }\n else if (employeeID.toCharArray()[2] != '-') {\n return false;\n }\n else if (Character.isLetter(employeeID.toCharArray()[0] & employeeID.toCharArray()[1])) {\n return true;\n }\n else if (Character.isDigit(employeeID.toCharArray()[3] & employeeID.toCharArray()[4]\n & employeeID.toCharArray()[5] & employeeID.toCharArray()[6])) {\n return true;\n }\n else{\n return false;\n }\n }",
"public String getUniqueIdentifier(){\n return (streetAddress + aptNumber + zip).toLowerCase().replaceAll(\"\\\\s+\",\"\"); \n }",
"public static String createId(CalendarDB db) {\n char[] skipChars = {\n 34, 39, 64, 91, 92, 93, 123, 125\n };\n \n int len = 10;\n char[] cArray = new char[len];\n\n for (int i = 0; i < len; i++) {\n\n boolean isAllowed = false;\n\n Random rand = new Random();\n char r = '0';\n// char test = 53;\n// System.out.println(\"Test char(\"+test+\")\");\n\n //[0] 48-57 0-9\n //[1] 65-90 A-Z\n //[2] 97- 122 a-z\n char[] valids = new char[3];\n \n //checkif the char is valid\n while (!isAllowed) {\n /*\n only takes valid chars. The fourth random just chooses one of the\n three in valids[]. \n */\n valids[0] = (char) RandomHandler.createIntegerFromRange(48, 57, rand);\n valids[1] = (char) RandomHandler.createIntegerFromRange(65, 90, rand);\n valids[2] = (char) RandomHandler.createIntegerFromRange(97, 122, rand);\n int start = 0;\n \n //the first char must not be a number\n if(i == 0)\n start += 1;\n \n r = valids[RandomHandler.createIntegerFromRange(start, 2, rand)];\n\n for (char ch : skipChars) {\n if (r != ch) {\n isAllowed = true;\n } else {\n isAllowed = false;\n }\n }\n }\n\n cArray[i] = r;\n }\n String s = new String(cArray);\n \n //retry creating id when the same is already used in database\n if(db.isIdAvailable(s))\n createId(db);\n \n System.out.println(\"ID created: \" + s);\n return s;\n }",
"public interface ID_TYPE {\r\n public static final int OWNER = 1;\r\n public static final int ATTENDANT = 2;\r\n public static final int DRIVER = 3;\r\n }",
"public void testStringID() {\n String testID = generator.generatePrefixedIdentifier(\"test\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"test\" + ID_REGEX));\n }",
"String getIdNumber();",
"private String createConvID(int port, String ipAddress) {\n\n\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(port+ipAddress);\n\n\t\treturn sb.toString();\n\t}",
"public int getHORAOPRCN() {\n return horaoprcn;\n }",
"java.lang.String getPhonenumber();",
"public java.lang.String getAoisId() {\n java.lang.Object ref = aoisId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n aoisId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public interface OidValidator {\n\n /**\n * Determines whether or not an input String is a valid OID.\n *\n * @param candidateOid the input String.\n * @return whether or not the input String is a valid OID.\n */\n boolean isValid(String candidateOid);\n}",
"public static void setPeerId(){\n Random ran = new Random();\n int rand_id = ran.nextInt(5555555 - 1000000 + 1) + 1000000;\n String peer_id_string = \"GROUP4AREL33t\" + rand_id;\n PEER_ID = peer_id_string.getBytes();\n }",
"public String getOrginid() {\n return orginid;\n }",
"String getTheirPartyId();",
"public interface KitchenId {}",
"public int getHC_Org2_ID();",
"public java.lang.String getAoisId() {\n java.lang.Object ref = aoisId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n aoisId_ = s;\n return s;\n }\n }",
"static int type_of_ora(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}",
"public String getIdentificationPrefix();",
"public java.lang.String getPlayerExternalOmniId() {\n java.lang.Object ref = playerExternalOmniId_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n playerExternalOmniId_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public interface CalendarIDs {\n\n String SANTA_ANA_ID = \"thoughtworks.com_526f6f6d2d494e2d42322d53616e7461416e61@resource.calendar.google.com\";\n String PARADE_CAFE_ID = \"thoughtworks.com_34363632303338312d333030@resource.calendar.google.com\";\n}",
"String idProvider();",
"public java.lang.String getTOR_ID()\n {\n \n return __TOR_ID;\n }",
"private String formatTccId(TCC tcc) {\n\t\tString id = Integer.toString(tcc.getIdTCC());\n\t\twhile (id.length() < 5) {\n\t\t\tid = \"0\" + id;\n\t\t}\n\t\treturn id;\n\t}",
"private int traslationType(Terser terser) throws HL7Exception{\n\t\t\n\t\tString destHosp = terser.get(\"PV1-3-4-1\");\n\t\tString orgHosp = terser.get(\"PV1-6-4-1\");\n\t\t\n\t\tif(orgHosp.endsWith(destHosp))\n\t\t\treturn SAME_HOSPITAL;\n\t\telse if(orgHosp.equals(HIE_ID))\n\t\t\treturn FROM_HIE2OTHER;\n\t\telse\n\t\t\treturn FROM_OTHER2HIE;\t\n\n\t}",
"private String getID()\n {\n String chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()_+{}|:<>?/.,';][=-`~\";\n String id = \"\";\n int max = new Random().nextInt((16 - 12) + 1)+12;\n for(int i=0;i<16;i++)\n {\n int r = new Random().nextInt((chars.length()-1 - 0) + 1)+0;\n id+=chars.charAt(r);\n }\n return id;\n }",
"private OwBootstrapToIdMapping()\r\n {\r\n\r\n }",
"public interface IDs {\n\n static final String SERIES_STANDARD_ID = \"c7fb8441-d5db-4113-8af0-e4ba0c3f51fd\";\n static final String EPISODE_STANDARD_ID = \"a99a8588-93df-4811-8403-fe22c70fa00a\";\n static final String FILE_STANDARD_ID = \"c5919cbf-fbf3-4250-96e6-3fefae51ffc5\";\n static final String RECORDING_STANDARD_ID = \"4a40811d-c067-467f-8ff6-89f37eddb933\";\n static final String ZAP2IT_STANDARD_ID = \"545c4b00-5409-4d92-9cda-59a44f0ec7a9\";\n}",
"@Override\n public int hashCode() {\n return ASNID;\n }",
"@java.lang.Override\n public java.lang.String getPlayerExternalOmniId() {\n java.lang.Object ref = playerExternalOmniId_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n playerExternalOmniId_ = s;\n return s;\n }\n }",
"protected boolean isAirportIDValid(String airportID) {\n return (airportID.length() <= 5 && airportID.matches(\"[0-9]+\"));\n }",
"private boolean isIDCode(SimpleType typeCode) {\n if (typeCode == BuiltInAtomicType.ID) {\n return true;\n }\n if (typeCode instanceof BuiltInAtomicType) {\n return false; // No other built-in type is an ID\n }\n\n if (nonIDs == null) {\n nonIDs = new HashSet<SimpleType>(20);\n }\n if (nonIDs.contains(typeCode)) {\n return false;\n }\n if (typeCode.isAtomicType()) {\n if (getConfiguration().getTypeHierarchy().isSubType((AtomicType) typeCode, BuiltInAtomicType.ID)) {\n return true;\n } else {\n nonIDs.add(typeCode);\n return false;\n }\n } else {\n return false;\n }\n }",
"public String getValidIdentifier(String baseName, boolean truncateUsingRandomDigits);",
"public void setIdentificationPrefix(String prefix);",
"private String setProtocolNumber() {\n\t\tRandom rnd = new Random();\n\t\treturn Integer.toString(rnd.nextInt(999999));\n\t}",
"@Test\n public void testGetOtherPersonTestId() throws ParsingException, ParseException, NoSuchFieldException, IllegalAccessException {\n //Init\n Person person = new Person(null);\n Person partner = new Person(null);\n Union union = new Union(person, partner, new FullDate(\"05 MAR 2020\"), new Town(\"Saintes\", \"Charente-Maritime\"), UnionType.HETERO_MAR);\n\n //Reflection init\n Field idField = person.getClass().getDeclaredField(\"id\");\n idField.setAccessible(true);\n\n //Reflection set\n idField.set(person, \"1\");\n idField.set(partner, \"2\");\n\n //Verification\n assertEquals(partner, union.getOtherPerson(\"1\"));\n assertEquals(person, union.getOtherPerson(\"2\"));\n assertNull(union.getOtherPerson(\"3\"));\n }",
"org.hl7.fhir.Identifier addNewIdentifier();",
"int getNidFromSNOMED(String sctid);",
"private String idString(int occurrence) {\n if (occurrence == 0) {\n return null;\n }\n String stringRep = \"\";\n while (occurrence > 0) {\n // generate character from A-Z and add to stringRep\n char nextChar = (char) ((occurrence - 1) % 26 + 'A');\n stringRep = nextChar + stringRep;\n occurrence = (occurrence - 1) / 26;\n }\n return stringRep;\n }",
"public static String getHymnNoFromID(String hymnId) {\n if (Character.isLetter(hymnId.charAt(1))) {\n return hymnId.substring(2);\n } else {\n return hymnId.substring(1);\n }\n }",
"static boolean inAreaHuh ( PhoneNumber pn, int someArea ) {\n\t// return ... pn.areaCode ... pn.prefix ... pn.line ... someArea ;\n\treturn pn.areaCode == someArea ;\n }",
"static boolean verifyIDRelaxed(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif(Character.isLetterOrDigit(c)) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ' || c == '_' || c == '-')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn id.length() > 0;\r\n\t}",
"RandomIdNoLuhnProvider(int length) {\n this.length = length;\n }",
"public String getInoId();",
"private static String modifyID(final String fifteenid) {\n String eightid = fifteenid.substring(0, 6);\n eightid = eightid + \"19\";\n eightid = eightid + fifteenid.substring(6, 15);\n eightid = eightid + getVerify(eightid);\n return eightid;\n }",
"private static long getGeyserIdFromString(String appId){\n\t\ttry{\n\t\t\treturn new Long(appId.substring(appId.lastIndexOf(\"_\")+1));\n\t\t} catch (Exception e){\n\t\t\tlogger.error(\"Geyser ID failure. Using defualt ID '0000'\"); \n\t\t\treturn (long)0000;\n\t\t}\n\t}",
"private boolean m81839a(String str) {\n return C6969H.m41409d(\"G738BDC12AA\").equals(str) || C6969H.m41409d(\"G738BDC12AA39A528F61E\").equals(str);\n }",
"private String generatePhone() {\n\t\tString ret = \"\";\n\t\tString[] areaCode = { \"051\", \"055\", \"045\", \"043\", \"053\" };\n\n\t\t// Gets an area code\n\t\tret = areaCode[(new Random()).nextInt(5)];\n\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tint n = (new Random()).nextInt(9);\n\n\t\t\t// Checks if the first number is 0\n\t\t\tif (i == 0 && n == 0) {\n\t\t\t\ti -= 1;\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tret += n;\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t}",
"public void setIDINTERNOPE1(int value) {\n this.idinternope1 = value;\n }",
"String getPersonalityIdentifier();",
"@Test\n\tpublic void test() {\n\t\tString r1 = CGroup.createRandomId();\n\t\tassertTrue(r1.matches(\"[0-9]+\"));\n\t\t\n\t\tString r2 = CGroup.createRandomId();\n\t\tassertFalse(r1.equals(r2));\n\t}",
"public String makeLoginID(){\r\n int firstAlphabet = firstName.charAt(0);\r\n if ( firstAlphabet <= 'Z' && firstAlphabet >= 'A' ){//user entered first alphabet of the first name as capital letter \r\n \tfirstAlphabet = firstAlphabet - 'A' + 'a';\r\n }\r\n String temp = \"\"+ (char)( firstAlphabet ) ;//add first alphabet of the first name to the string \r\n temp += getLastNameForID();\r\n temp += digitalRoot();\r\n return temp;\r\n }",
"public java.lang.String getOA_ID() {\n return OA_ID;\n }",
"Optional<String> getOId();",
"@Override\n public java.lang.String generateRackID() {\n String randomString = \"\";\n String rackId = \"\";\n for (int i = 0; i < 2; i++) {\n char[] arr = \"abcdefghijklmnopqrstuvwxyz\".toCharArray();\n int select = new Random().nextInt(arr.length);\n randomString += arr[select];\n }\n\n rackId = randomString.toUpperCase() + \".\" + rackCounter + \".\" + copyrightYear;\n rackCounter++;\n return rackId;\n }",
"java.lang.String getProtocolId();",
"long getCodeId();",
"long getCodeId();",
"long getCodeId();",
"public StrColumn getBindingPartnerAsymId() {\n return (StrColumn) (isText ? textFields.computeIfAbsent(\"binding_partner_asym_id\", StrColumn::new) :\n getBinaryColumn(\"binding_partner_asym_id\"));\n }",
"@ParameterizedTest(name = \"{index} => oid = {0}\")\n\t//@MethodSource(\"sp800_73_4_DiscoveryObjectTestProvider\")\n @ArgumentsSource(ParameterizedArgumentsProvider.class)\n\t@DisplayName(\"SP800-73-4.55 test\")\n\tvoid sp800_73_4_Test_55 (String oid, TestReporter reporter) {\n\t\t\t\t\n\t\tPIVDataObject o = AtomHelper.getDataObject(oid);\n\t\t\n\t\tList<BerTag> tagList = o.getTagList();\n\t\t\n\t\tBerTag cardAppAIDTag = new BerTag(TagConstants.PIV_CARD_APPLICATION_AID_TAG);\n\t\t\n\t\tint tagIndex = tagList.indexOf(cardAppAIDTag);\n\t\t\n\t\t//Confirm (0x4F, 0x5F2F) tag order\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex).bytes,TagConstants.PIV_CARD_APPLICATION_AID_TAG));\n\t\tassertTrue(Arrays.equals(tagList.get(tagIndex+1).bytes,TagConstants.PIN_USAGE_POLICY_TAG));\n\t}",
"com.google.protobuf.ByteString\n getAoisIdBytes();",
"private boolean CheckID(String id) {\n\t\tif ((!id.matches(\"([0-9])+\") || id.length() != 9) && (!id.matches(\"S([0-9])+\") || id.length() != 10)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public abstract java.lang.String getIdpc();",
"@Test\n public void smartIdEmptyCode() throws Exception {\n String errorMessage = authenticateWithSmartIdInvalidInputPollError(\"\", 2000);\n assertEquals(\"Isikukood puuduIntsidendi number:\", errorMessage);\n }",
"public void setOridestId(Number value) {\n setAttributeInternal(ORIDESTID, value);\n }",
"public abstract String getIdPrefix();",
"java.lang.String getCombatNpcPersonalityId();",
"org.hl7.fhir.Identifier getIdentifier();",
"public String generatePlayerID() {\n List<Player> players = getAllOrdered();\n int idNum;\n \n if (players == null || players.isEmpty())\n idNum = 0;\n else {\n String idStr = players.get(players.size() - 1).getPlayerID();\n idNum = Integer.parseInt(idStr.substring(2, idStr.length()));\n }\n \n String playerID;\n int newIdNum = idNum + 1;\n if (newIdNum <= 9)\n playerID = \"P_000\" + newIdNum;\n else if (newIdNum <= 99) \n playerID = \"P_00\" + newIdNum;\n else if (newIdNum <= 999)\n playerID = \"P_0\" + newIdNum;\n else \n playerID = \"P_\" + newIdNum;\n \n return playerID;\n }",
"String getBusi_id();",
"@Override\n\tprotected String getProgramId(HttpServletRequest request)\n\t{\n\t\treturn \"BPRA02\";\n\t}",
"public String generatePhoneId() {\n String device = Build.DEVICE.equals(\"generic\") ? \"emulator\" : Build.DEVICE;\n String network = getNetwork();\n String carrier = (network == NETWORK_WIFI) ?\n getWifiCarrierName() : getTelephonyCarrierName();\n\n StringBuilder stringBuilder = new StringBuilder(ANDROID_STRING);\n stringBuilder.append('-').append(device).append('_')\n .append(Build.VERSION.RELEASE).append('_').append(network)\n .append('_').append(carrier).append('_').append(getTelephonyPhoneType())\n .append('_').append(isLandscape() ? \"Landscape\" : \"Portrait\");\n\n return stringBuilder.toString();\n }",
"boolean isValid(String candidateOid);",
"int getAptitudeId();",
"public static void main(String[] args) {\n String idNum = \"410326880818551\";\n System.out.println(verify15(idNum));\n// String idNum2 = \"411111198808185510\";\n String idNum2 = \"410326198808185515\";\n System.out.println(verify(idNum2));\n }",
"private static int checkCnapSpecialCases(String n) {\n if (n.equals(\"PRIVATE\") ||\n n.equals(\"P\") ||\n n.equals(\"RES\")) {\n if (DBG) log(\"checkCnapSpecialCases, PRIVATE string: \" + n);\n return PhoneConstants.PRESENTATION_RESTRICTED;\n } else if (n.equals(\"UNAVAILABLE\") ||\n n.equals(\"UNKNOWN\") ||\n n.equals(\"UNA\") ||\n n.equals(\"U\")) {\n if (DBG) log(\"checkCnapSpecialCases, UNKNOWN string: \" + n);\n return PhoneConstants.PRESENTATION_UNKNOWN;\n } else {\n if (DBG) log(\"checkCnapSpecialCases, normal str. number: \" + n);\n return CNAP_SPECIAL_CASE_NO;\n }\n }",
"String getCidr();",
"@Test\n public void identifierTest() {\n assertEquals(\"ident1\", authResponse.getIdentifier());\n }",
"public RandomIdNoLuhnProvider() {\n this(DEFAULT_ID_LENGTH);\n }",
"public static boolean empidValidate(String emp_id){\n if(emp_id.matches(\"\\\\p{IsAlphabetic}{2}-\\\\d{4}\"))\n return true;\n\n else {\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n return false;\n }\n\n }",
"boolean hasLetterId();",
"boolean hasLetterId();",
"UUID getInitiativeId();"
] | [
"0.5787606",
"0.5710863",
"0.55282795",
"0.5403654",
"0.53474814",
"0.53442466",
"0.5331341",
"0.5207953",
"0.51941454",
"0.51939267",
"0.5167249",
"0.51551104",
"0.5153578",
"0.5134273",
"0.50936085",
"0.5086571",
"0.5067396",
"0.50414747",
"0.5020425",
"0.50138944",
"0.501171",
"0.4994128",
"0.4990497",
"0.49791086",
"0.4971461",
"0.49705905",
"0.49622157",
"0.4957966",
"0.49574435",
"0.49560747",
"0.495534",
"0.49358755",
"0.49349368",
"0.49286106",
"0.49232003",
"0.49224773",
"0.49192375",
"0.49182096",
"0.49087924",
"0.49078667",
"0.49027833",
"0.48839477",
"0.4883126",
"0.48742738",
"0.48698297",
"0.4863074",
"0.48625848",
"0.48611352",
"0.4855072",
"0.48528957",
"0.48509678",
"0.48456654",
"0.48277143",
"0.4825743",
"0.48119074",
"0.48078796",
"0.48068652",
"0.48056844",
"0.48018262",
"0.4797809",
"0.4780511",
"0.47763622",
"0.47700128",
"0.47665197",
"0.47625822",
"0.47540495",
"0.4750303",
"0.47497624",
"0.4746009",
"0.47349563",
"0.473427",
"0.47333127",
"0.4733069",
"0.4733069",
"0.4733069",
"0.47223198",
"0.47190845",
"0.47139102",
"0.47130758",
"0.47080243",
"0.47078404",
"0.47077066",
"0.47032806",
"0.47009584",
"0.47005937",
"0.4698181",
"0.46945217",
"0.46943903",
"0.4692567",
"0.46923786",
"0.469195",
"0.4691209",
"0.46909943",
"0.46888775",
"0.46875507",
"0.468635",
"0.46809635",
"0.46800786",
"0.46800786",
"0.46766827"
] | 0.55266684 | 3 |
TODO Autogenerated method stub | private void ViewMatching() {
tx1 = (TextView) findViewById(R.id.k1);
a1 = (TextView) findViewById(R.id.t1);
a2 = (TextView) findViewById(R.id.t2);
a3 = (TextView) findViewById(R.id.t3);
a4 = (TextView) findViewById(R.id.t4);
a5 = (TextView) findViewById(R.id.t5);
a6 = (TextView) findViewById(R.id.t6);
a7 = (TextView) findViewById(R.id.t7);
c1 = (TextView) findViewById(R.id.n1);
c2 = (TextView) findViewById(R.id.n2);
c3 = (TextView) findViewById(R.id.n3);
c4 = (TextView) findViewById(R.id.n4);
c5 = (TextView) findViewById(R.id.n5);
c6 = (TextView) findViewById(R.id.n6);
c7 = (TextView) findViewById(R.id.n7);
b1 = (Button) findViewById(R.id.ed);
b2 = (Button) findViewById(R.id.ima);
b1.setOnClickListener(this);
b2.setOnClickListener(this);
c1.setText("NAME : ");
c2.setText("NICKNAME : ");
c3.setText("CODE : ");
c4.setText("SUB : ");
c5.setText("TEL : ");
c6.setText("E-MAIL : ");
c7.setText("BUU : ");
String p1 = getIntent().getStringExtra("dd1");
String p2 = getIntent().getStringExtra("dd2");
String p3 = getIntent().getStringExtra("dd3");
String p4 = getIntent().getStringExtra("dd4");
String p5 = getIntent().getStringExtra("dd5");
String p6 = getIntent().getStringExtra("dd6");
String p7 = getIntent().getStringExtra("dd7");
if(tx1!=null){
tx1.setText("SUWAPHIT KETKUN");
a1.setText(" Suwaphit Ketkun");
a2.setText(" Kai");
a3.setText(" 55410595");
a4.setText(" Information Technology");
a5.setText(" 088-5283660");
a6.setText(" [email protected]");
a7.setText(" Burapha University ");
}
if(p1!=null){
a1.setText(p1);
a2.setText(p2);
a3.setText(p3);
a4.setText(p4);
a5.setText(p5);
a6.setText(p6);
a7.setText(p7);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
The add service is called in order to Add the new user | @Path("/add")
@POST
@Produces("application/json")
public String addUser( User user ) throws UnsupportedEncodingException
{
//Encrypting the given given password and storing it in the Db using Base64
//String encryptedpassword = Base64.getEncoder().encodeToString(user.getPwd().getBytes("utf-8"));
//user.setPwd(encryptedpassword);
return userService.addUser(user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addUser(User user) {\n\t\t\r\n\t}",
"public void addUser(User user);",
"@Override\r\n\tpublic void add(User user) {\n\r\n\t}",
"void addUser(User user);",
"void addUser(User user);",
"public void addUser(UserModel user);",
"@Override\n\tpublic void add() {\n\n\t\tSystem.out.println(\"UserServiceImpl....\");\n\t\tthis.repository.respository();\n\n\t}",
"public String add() {\r\n\t\tuserAdd = new User();\r\n\t\treturn \"add\";\r\n\t}",
"public void addUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk addUser\");\r\n\t}",
"public void addUser(User user){\r\n users.add(user);\r\n }",
"ResponseMessage addUser(User user);",
"public void addUser() {\n\t\tthis.users++;\n\t}",
"public void add(User user) {\r\n this.UserList.add(user);\r\n }",
"Integer addUser(ServiceUserEntity user);",
"public void addUser(User user) {\n\t\tSystem.out.println(\"adding user :\"+user.toString());\n\t\tuserList.add(user);\n\t}",
"public void addUser() {\r\n PutItemRequest request = new PutItemRequest().withTableName(\"IST440Users\").withReturnConsumedCapacity(\"TOTAL\");\r\n PutItemResult response = client.putItem(request);\r\n }",
"public void addUser() {\n\t\tUser user = dataManager.findCurrentUser();\r\n\t\tif (user != null) {\r\n\t\t\tframeManager.addUser(user);\r\n\t\t\tpesquisar();\r\n\t\t} else {\r\n\t\t\tAlertUtils.alertSemPrivelegio();\r\n\t\t}\r\n\t}",
"@Override\n public boolean addUser(User user) {\n return controller.addUser(user);\n }",
"public void addUser(Customer user) {}",
"@Override\r\n\tpublic String addUser(taskPojo addUser,HttpServletRequest request, HttpServletResponse response) {\n\t\treturn dao.addUser(addUser,request,response);\r\n\t}",
"@Override\n\tpublic void addUser(User user) {\n mapper.addUser(user);\n\t}",
"@Override\r\n\tpublic Utilisateur addUser() {\n\t\treturn null;\r\n\t}",
"public Boolean addUser(User user) throws ApplicationException;",
"@POST(\"/AddUser\")\n\tint addUser(@Body User user);",
"public boolean addUser(UserDTO user);",
"@Override\n\tpublic void addPerson(User pUser) {\n\t\t\n\t}",
"@Override\r\n\tpublic void add(User1 user) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tsession.save(user);\r\n\t}",
"public void addUser(String userId) {\n addUser(new IndividualUser(userId));\n }",
"@Override\n\tpublic void add(UserModel um) throws Exception {\n\t\tuserMapper.insert(um);\n\t}",
"public void addUserBtn(){\n\t\t\n\t\t// TODO: ERROR CHECK\n\t\t\n\t\tUserEntry user = new UserEntry(nameTF.getText(), (String)usertypeCB.getValue(), emailTF.getText());\n\t\tAdminController.userEntryList.add(user);\n\t\t\n\t\t\n\t\t// Create a UserEntry and add it to the observable list\n\t\tAdminController.userList.add(user);\t\t\n\t\t\n\t //AdminController.adminTV.setItems(AdminController.userList);\n\t\t\n\t\t//Close current stage\n\t\tAdminController.addUserStage.close();\n\t\t\n\t}",
"public void newUser(User user) {\n users.add(user);\n }",
"@Override\n\tpublic void addNewUser(User user) {\n\t\tusersHashtable.put(user.getAccount(),user);\n\t}",
"@Override\r\n\tpublic int addUser(User user) {\n\t\treturn userMapper.addUser(user);\r\n\t}",
"void add(User user) throws AccessControlException;",
"@Override\n\tpublic void addUser(ERSUser user) {\n\t\tuserDao.insertUser(user);\n\t}",
"public void addUser(User user) {\n\t\tuserList.addUser(user);\n\t}",
"@WebMethod public void addUser(String name, String lastName, String email, String nid, String user, String password);",
"public String addUser() {\n\t\t\t\treturn null;\r\n\t\t\t}",
"public int add(Userinfo user) {\n\t\treturn userDAO.AddUser(user);\r\n\t}",
"public void addUserUI() throws IOException {\n System.out.println(\"Add user: id;surname;first name;username;password\");\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n User user = new User(a[1], a[2], a[3], a[4], \" \");\n user.setId(Long.parseLong(a[0]));\n try\n {\n User newUser = service.addUser(user);\n if(newUser != null)\n System.out.println(\"ID already exists for \" + user.toString());\n else\n System.out.println(\"User added successfully!\");\n }\n catch (ValidationException ex)\n {\n System.out.println(ex.getMessage());\n }\n catch (IllegalArgumentException ex)\n {\n System.out.println(ex.getMessage());\n }\n }",
"boolean addUser(int employeeId, String name, String password, String role);",
"@Override\r\n\tpublic boolean addNewUser(User user) {\n\t\treturn false;\r\n\t}",
"public void addUser(User user){\n loginDAO.saveUser(user.getId(),user.getName(),user.getPassword());\n }",
"public void addAccount(String user, String password);",
"@Override\n\tpublic boolean addNewUser() {\n\t\treturn false;\n\t}",
"public int addUser(Users users);",
"@Override\n\tpublic User add(String name, String pwd, String phone) {\n\t\tSystem.out.println(\"OracleDao is add\");\n\t\treturn null;\n\t}",
"public static void addUser(String name)\n {\n userList.add(name);\n }",
"void addUser(String uid, String firstname, String lastname, String pseudo);",
"@Override\n\tpublic int addUser(TbUser user) {\n\t\treturn new userDaoImpl().addUser(user);\n\t}",
"@PostMapping(\"/add\")\n\tpublic User addUser( @Valid @RequestBody User user) {\n\t\tcontrollerLogger.info(\"new user sign up\");\n\t\treturn service.signUp(user);\n\t}",
"@Override\n\tpublic void addUser(User user) {\n\t\tuserMapper.addUser(user);\n\t}",
"public User addUser(User user) {\n\t\treturn null;\r\n\t}",
"public boolean addUser(User user) {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic void addItem(User entity) {\n\t\tuserRepository.save(entity);\n\t\t\n\t}",
"public void add(User user) {\n\t\tuserDao.add(user);\n\t}",
"public int userAdd(User user) {\n\t\treturn userDao.userAdd(user);\r\n\t}",
"@Override\n\tpublic User addUser(User user) {\n\t\treturn userDatabase.put(user.getEmail(), user);\n\t}",
"@Override\n\tpublic void add(UserModel um) throws Exception {\n\t\tsf.getCurrentSession().save(um);\n\t}",
"@Override\n\tpublic ResponseEntity<String> addUser() {\n\t\treturn null;\n\t}",
"public void addUser(User user) {\n \t\tuser.setId(userCounterIdCounter);\n \t\tusers.add(user);\n \t\tuserCounterIdCounter++;\n \t}",
"@Override\r\n\tpublic User addUser(User user) {\n\t\treturn userReposotory.save(user);\r\n\t}",
"@Override\r\n\tpublic boolean addUser(user user) {\n\t\tif(userdao.insert(user)==1){\r\n\t\t\treturn true;}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}",
"@Override\n\tpublic int addUser(User user) {\n\t\treturn userDao.addUser(user);\n\t}",
"void add(User user) throws SQLException;",
"E add(IApplicationUser user, C createDto);",
"public void addUser(String name)\r\n\t{\r\n\t\tperson= new User(name);\r\n\t\tusers.put(name, person);\r\n\t}",
"@Override\n\tpublic void addUser(User user) {\n\t\tiUserDao.addUser(user);\n\t}",
"User addUser(IDAOSession session, String fullName, String userName,\n\t\t\tString password);",
"public void Adduser(User u1) {\n\t\tUserDao ua=new UserDao();\n\t\tua.adduser(u1);\n\t\t\n\t}",
"@Override\n\tpublic boolean addUser(User user) {\n\t\tObject object = null;\n\t\tboolean flag = false;\n\t\ttry {\n\t\t\tobject = client.insert(\"addUser\", user);\n\t\t\tSystem.out.println(\"添加学生信息的返回值:\" + object);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (object != null) {\n\t\t\tflag = true;\n\t\t}\n\t\treturn flag;\n\t}",
"@Override\n\tpublic String addUser(Map<String, Object> reqs) {\n\t\treturn null;\n\t}",
"private void addUser(People value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureUserIsMutable();\n user_.add(value);\n }",
"void registerUser(User newUser);",
"public eu.aladdin_project.xsd.User addNewUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.xsd.User target = null;\n target = (eu.aladdin_project.xsd.User)get_store().add_element_user(USER$0);\n return target;\n }\n }",
"public void setAddUser(Long addUser) {\n this.addUser = addUser;\n }",
"public void add(User user) {\n\t\tmapper.add(user);\n\t}",
"public void addUser(User user) {\n\t\tuserDao.addUser(user);\r\n\r\n\t}",
"public void addUsuario(Usuario usuario) {\n\t\t\n\t}",
"@Override\n\tpublic int AddUser(UserBean userbean) {\n\t\treturn 0;\n\t}",
"@Transactional\r\n\tpublic void addUser(){\r\n\t}",
"private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}",
"private void addNewUser(User user) {\n\t\tSystem.out.println(\"BirdersRepo. Adding new user to DB: \" + user.getUsername());\n\t\tDocument document = Document.parse(gson.toJson(user));\n\t\tcollection.insertOne(document);\n\t}",
"public void newUserAdded(String userID);",
"@Override\n public void addUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.persist(u);\n logger.info(\"User saved successfully, User Details=\"+u);\n }",
"public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}",
"@PostMapping(\"/addUser\")\n public User addUser(@RequestBody User user){\n repo.save(user);\n return user;\n }",
"public void addNewSystemUser()\n {\n\n DietTreatmentSystemUserBO newUser = new DietTreatmentSystemUserBO();\n // default user\n newUser.setSystemUser(SystemUserController.getInstance()\n .getCurrentUser());\n // default function\n newUser.setFunction(SystemUserFunctionBO.TREATING_ASSISTANT);\n\n _dietTreatment.addSystemUsers(newUser);\n }",
"void addNewUser(User user, int roleId) throws DAOException;",
"@Override\r\n\tpublic int register(User user) {\n\t\treturn dao.addUser(user);\r\n\t}",
"@GetMapping(\"/addUser\")\n @ApiOperation(\"添加user\")\n public Boolean addUser(TUserDO userDO){\n\n userService.addUser(userDO);\n return true;\n }",
"@Override\n\tpublic int addUser(User_role user) throws Exception{\n\t\treturn userMapper.insertByUser(user);\n\t}",
"public void addUser(String userName,String name) {\n\t\tUser newUser = new User(userName, name, false);\n\t\tusers.add(newUser);\t\n\t}",
"public boolean add(User user)\n\t\t{\n\t\t\t\treturn users.add(user);\n\t\t}",
"@GetMapping(\"/addUser\")\n public String home() {\n User user = new User();\n user.setUserName(\"Gitika\");\n user.setPassword(passwordEncoder.encode(\"saurabh321\"));\n user.setActive(true);\n user.setRoles(\"Role_Admin\");\n userRepository.save(user);\n return \"User created successfully\";\n }",
"@GetMapping(value= \"/add\")\n public String add(Model model) {\n\n \tmodel.addAttribute(\"user\",new User());\n \tmodel.addAttribute(\"success\", true);\n\n \treturn \"addUser\";\n }",
"@PostMapping(path = \"/v1/add\")\n public JsonData addUser(@RequestBody User user) {\n int user_id = userService.add(user);\n\n JsonData jsonData = new JsonData(\"2019\", \"添加成功\", user_id);\n return jsonData;\n }",
"public int add(User user) {\n\t\treturn this.userDao.insert(user);\r\n\t}",
"UserDTO addNewData(UserDTO userDTO);",
"void onUserAdded();",
"@Test\n\tpublic void testAddUser() {\n\t\tresetTestVars();\n\t\tuser1.setID(\"1\");\n\t\tuser2.setID(\"1\");\n\t\tassertFalse(\"User is invalid\", sn.addUser(user3));\n\t\tassertTrue(\"User is valid\", sn.addUser(user1));\n\t\tassertFalse(\"Same user cant be added\", sn.addUser(user1));\n\t\tassertFalse(\"ID already exists\", sn.addUser(user2));\n\t}"
] | [
"0.818184",
"0.8163103",
"0.8081002",
"0.80387706",
"0.80387706",
"0.7930233",
"0.7901816",
"0.78890866",
"0.7674051",
"0.76389205",
"0.7547759",
"0.75424445",
"0.7487945",
"0.7483409",
"0.74649155",
"0.7403103",
"0.73843336",
"0.7354895",
"0.73515654",
"0.73261464",
"0.7323052",
"0.7311492",
"0.72792745",
"0.7254351",
"0.7249141",
"0.7213681",
"0.7196529",
"0.7188493",
"0.7164149",
"0.7151581",
"0.7133705",
"0.71293885",
"0.7113094",
"0.71112645",
"0.70976484",
"0.7097594",
"0.7086437",
"0.7081061",
"0.70783085",
"0.70617914",
"0.7058009",
"0.7055481",
"0.70227516",
"0.7020875",
"0.70168686",
"0.69987535",
"0.6995107",
"0.69829834",
"0.69645154",
"0.69590706",
"0.69518334",
"0.6949113",
"0.69279003",
"0.69041294",
"0.6902881",
"0.68825877",
"0.6872333",
"0.6864944",
"0.68585736",
"0.68584096",
"0.6857028",
"0.6838969",
"0.6830121",
"0.6826238",
"0.68260187",
"0.68222076",
"0.6821864",
"0.6814496",
"0.6813143",
"0.68056935",
"0.6805492",
"0.680351",
"0.67911667",
"0.67823213",
"0.67773014",
"0.6773173",
"0.67711705",
"0.676781",
"0.67663443",
"0.67596805",
"0.6752158",
"0.67513365",
"0.6745966",
"0.67430806",
"0.6742891",
"0.67365277",
"0.67260504",
"0.6724083",
"0.6720991",
"0.67142713",
"0.6711749",
"0.6710964",
"0.6701425",
"0.67012495",
"0.66971517",
"0.66936475",
"0.66850686",
"0.6680983",
"0.66792935",
"0.66694045",
"0.66667175"
] | 0.0 | -1 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }"
] | [
"0.7004024",
"0.66585696",
"0.66031146",
"0.6510023",
"0.6447109",
"0.64421695",
"0.64405906",
"0.64321136",
"0.6428049",
"0.6424289",
"0.6424289",
"0.6419742",
"0.6419742",
"0.6419742",
"0.6418235",
"0.64143145",
"0.64143145",
"0.6400266",
"0.63939095",
"0.63939095",
"0.639271",
"0.63919044",
"0.63919044",
"0.63903785",
"0.63903785",
"0.63903785",
"0.63903785",
"0.63887113",
"0.63887113",
"0.6380285",
"0.63783026",
"0.63781637",
"0.637677",
"0.63761306",
"0.6370491",
"0.63626",
"0.63626",
"0.63614637",
"0.6355308",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896"
] | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doGet( )\n {\n \n }",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }",
"public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}",
"@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}",
"public Result get(Get get) throws IOException;",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }",
"@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}",
"@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}",
"@NonNull\n public String getAction() {\n return \"GET\";\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }",
"@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }",
"@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }",
"public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }",
"public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}",
"@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}",
"public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}",
"public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}",
"private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }",
"HttpGet getRequest(HttpServletRequest request, String address) throws IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}",
"private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}"
] | [
"0.7589609",
"0.71665615",
"0.71148175",
"0.705623",
"0.7030174",
"0.70291144",
"0.6995984",
"0.697576",
"0.68883485",
"0.6873811",
"0.6853569",
"0.6843572",
"0.6843572",
"0.6835363",
"0.6835363",
"0.6835363",
"0.68195957",
"0.6817864",
"0.6797789",
"0.67810035",
"0.6761234",
"0.6754993",
"0.6754993",
"0.67394847",
"0.6719924",
"0.6716244",
"0.67054695",
"0.67054695",
"0.67012346",
"0.6684415",
"0.6676695",
"0.6675696",
"0.6675696",
"0.66747975",
"0.66747975",
"0.6669016",
"0.66621476",
"0.66621476",
"0.66476154",
"0.66365504",
"0.6615004",
"0.66130257",
"0.6604073",
"0.6570195",
"0.6551141",
"0.65378064",
"0.6536579",
"0.65357745",
"0.64957607",
"0.64672184",
"0.6453189",
"0.6450501",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.64067316",
"0.6395873",
"0.6379907",
"0.63737476",
"0.636021",
"0.6356937",
"0.63410467",
"0.6309468",
"0.630619",
"0.630263",
"0.63014317",
"0.6283933",
"0.62738425",
"0.62680805",
"0.62585783",
"0.62553537",
"0.6249043",
"0.62457556",
"0.6239428",
"0.6239428",
"0.62376446",
"0.62359244",
"0.6215947",
"0.62125194",
"0.6207376",
"0.62067443",
"0.6204527",
"0.6200444",
"0.6199078",
"0.61876005",
"0.6182614",
"0.61762017",
"0.61755335",
"0.61716276",
"0.6170575",
"0.6170397",
"0.616901"
] | 0.0 | -1 |
Handles the HTTP POST method. | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String userName = request.getParameter("userName");
String password = request.getParameter("pass");
ControladorEmpleados co = new ControladorEmpleados();
if (co.verificarUserName(userName)) {
Usuario usuario = co.obtenerUsuario(userName, password);
HttpSession nuevoSession = request.getSession(true);
nuevoSession.setAttribute("Usuario", usuario);
if (usuario != null) {
request.setAttribute("Usuario", usuario);
switch (usuario.getArea().getCodigo()) {
case Area.CONDIGO_CONTRATADOR:
getServletContext().getRequestDispatcher("/Contratador/Home.jsp").forward(request, response);
break;
case Area.CONDIGO_FARMACEUTICO:
getServletContext().getRequestDispatcher("/Farmacia/HomeFarmacia.jsp").forward(request, response);
break;
case Area.CONDIGO_CONSULTOR:
getServletContext().getRequestDispatcher("/Recepcion/HomeRecepcion.jsp").forward(request, response);
break;
default:
throw new AssertionError();
}
} else {
request.setAttribute("errorPassword", userName);
RequestDispatcher dispatcher = request.getRequestDispatcher("/Inicio/Login.jsp");
dispatcher.forward(request, response);
}
} else {
request.setAttribute("errorUserName", userName);
RequestDispatcher dispatcher = request.getRequestDispatcher("/Inicio/Login.jsp");
dispatcher.forward(request, response);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"public void doPost( )\n {\n \n }",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public String post();",
"@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }",
"protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }",
"public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}",
"public void postData() {\n\n\t}",
"@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}",
"@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public abstract boolean handlePost(FORM form, BindException errors) throws Exception;",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}",
"public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}",
"@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }",
"@Override\n\tvoid post() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }",
"protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}",
"public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }",
"@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}",
"private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }"
] | [
"0.73289514",
"0.71383566",
"0.7116213",
"0.7105215",
"0.7100045",
"0.70236707",
"0.7016248",
"0.6964149",
"0.6889435",
"0.6784954",
"0.67733276",
"0.67482096",
"0.66677034",
"0.6558593",
"0.65582114",
"0.6525548",
"0.652552",
"0.652552",
"0.652552",
"0.65229493",
"0.6520197",
"0.6515622",
"0.6513045",
"0.6512626",
"0.6492367",
"0.64817846",
"0.6477479",
"0.64725804",
"0.6472099",
"0.6469389",
"0.6456206",
"0.6452577",
"0.6452577",
"0.6452577",
"0.6450273",
"0.6450273",
"0.6438126",
"0.6437522",
"0.64339423",
"0.64253825",
"0.6422238",
"0.6420897",
"0.6420897",
"0.6420897",
"0.6407662",
"0.64041835",
"0.64041835",
"0.639631",
"0.6395677",
"0.6354875",
"0.63334197",
"0.6324263",
"0.62959254",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6280875",
"0.6272104",
"0.6272104",
"0.62711537",
"0.62616795",
"0.62544584",
"0.6251865",
"0.62274224",
"0.6214439",
"0.62137586",
"0.621211",
"0.620854",
"0.62023044",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61638993",
"0.61603814",
"0.6148914",
"0.61465937",
"0.61465937",
"0.614548",
"0.6141879",
"0.6136717",
"0.61313903",
"0.61300284",
"0.6124381",
"0.6118381",
"0.6118128",
"0.61063534",
"0.60992104",
"0.6098801",
"0.6096766"
] | 0.0 | -1 |
Returns a short description of the servlet. | @Override
public String getServletInfo() {
return "Short description";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getServletInfo()\n {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }",
"@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }"
] | [
"0.87634975",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8531295",
"0.8531295",
"0.85282224",
"0.85282224",
"0.85282224",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8516995",
"0.8512296",
"0.8511239",
"0.8510324",
"0.84964365"
] | 0.0 | -1 |
Created by innobotlinux2 on 9/2/18. | public interface SpeedListener {
void speedSelected(String speed);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"public final void mo51373a() {\n }",
"private void kk12() {\n\n\t}",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"private void init() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"protected boolean func_70814_o() { return true; }",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"public void mo38117a() {\n }",
"private static void cajas() {\n\t\t\n\t}",
"private void m50366E() {\n }",
"public abstract void mo70713b();",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n public void init() {\n\n }",
"public void gored() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private void poetries() {\n\n\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"private void strin() {\n\n\t}",
"@Override\n protected void init() {\n }",
"@Override\n\tpublic void nghe() {\n\n\t}",
"public void mo6081a() {\n }",
"@Override\n public void init() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public abstract void mo56925d();",
"@Override\r\n\tpublic void init() {}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n public void init() {}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"protected void mo6255a() {\n }",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"private Rekenhulp()\n\t{\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void prot() {\n }",
"@Override\n void init() {\n }",
"@Override\n protected void initialize() {\n\n \n }",
"public abstract void mo6549b();",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n public int describeContents() { return 0; }",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n public void init() {\n\n }",
"@Override\n\tpublic void init() {\n\t}",
"public void method_4270() {}",
"static void feladat9() {\n\t}",
"public void mo12628c() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void mo21877s() {\n }",
"public void mo21825b() {\n }",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"private void init() {\n\n\n\n }",
"private void initialize() {\n\t\t\n\t}",
"@Override\n\tpublic void init()\n\t{\n\n\t}",
"static void feladat7() {\n\t}",
"public abstract void mo27386d();",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}"
] | [
"0.5934391",
"0.58535385",
"0.5829747",
"0.57764846",
"0.5704619",
"0.56892836",
"0.5686215",
"0.56797445",
"0.56457436",
"0.562489",
"0.56150866",
"0.56150866",
"0.5606947",
"0.5606947",
"0.5606947",
"0.5606947",
"0.5606947",
"0.5595542",
"0.5585703",
"0.55853623",
"0.5583198",
"0.5573163",
"0.5563454",
"0.5554117",
"0.55528975",
"0.5543744",
"0.5533467",
"0.5525815",
"0.5525815",
"0.55154103",
"0.551254",
"0.54980505",
"0.54893917",
"0.5485556",
"0.54826206",
"0.5481496",
"0.5480958",
"0.5472827",
"0.5465815",
"0.5451901",
"0.54480815",
"0.54441786",
"0.5433501",
"0.5433501",
"0.5432795",
"0.5432795",
"0.5432795",
"0.5432409",
"0.5431402",
"0.5431377",
"0.5430839",
"0.54307437",
"0.5428988",
"0.5428988",
"0.5428988",
"0.5428988",
"0.5428988",
"0.5428988",
"0.5428988",
"0.5425598",
"0.5423555",
"0.5421884",
"0.5421884",
"0.5421884",
"0.5421882",
"0.5419617",
"0.5419617",
"0.5419617",
"0.5419617",
"0.5419617",
"0.5419617",
"0.5419454",
"0.5417897",
"0.54074126",
"0.5406673",
"0.53996265",
"0.53996265",
"0.53996265",
"0.5398313",
"0.5396338",
"0.539338",
"0.53916496",
"0.53838706",
"0.53831494",
"0.53831494",
"0.5375668",
"0.5367872",
"0.53666276",
"0.536454",
"0.5363937",
"0.53610986",
"0.53476304",
"0.5337784",
"0.5337562",
"0.5334859",
"0.53291154",
"0.5322318",
"0.5318467",
"0.53157395",
"0.5312477",
"0.53037375"
] | 0.0 | -1 |
Updates the Firebase Database with new information for the usernames TODO: check that update works on Firebase | private void update() {
for (ArrayList<String> pair: list) {
String username = pair.get(0);
String val = pair.get(1);
ref.child(username).setValue(val);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void updateUserInfo(String txtName) {\n\n FirebaseDatabase.getInstance().getReference().child(\"Users\").\n child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n dataSnapshot.getRef().child(\"name\").setValue(txtName);\n\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n\n readInfoUser();\n\n }",
"private void updateUsernameInFirebase() {\n\n binding.profileActivityProgressBar.setVisibility(View.VISIBLE);\n\n //String username = this.mTextInputEditTextUsername.getText().toString();\n String username = Objects.requireNonNull(binding.profileActivityEditTextUsername.getText()).toString();\n\n\n if (this.getCurrentUser() != null) {\n if (!username.isEmpty() && !username.equals(getString(R.string.info_no_username_found))) {\n UserHelper.updateUsername(username, this.getCurrentUser().getUid()).addOnFailureListener(this.onFailureListener()).addOnSuccessListener(this.updateUIAfterRESTRequestsCompleted(UPDATE_USERNAME));\n\n }\n }\n\n }",
"private void updateDatabase(DatabaseReference userDatabase) {\n userDatabase.child(mNameField).setValue(editTextValue).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"DATABASE-PROFILE\", \"Updated successfully\");\n Utility.MakeLongToastToast(activity, \"Updated successfully\");\n onButtonPressed();\n spotsDialog.dismiss();\n\n }\n\n }\n });\n\n }",
"private void saveData() {\n firebaseUser = firebaseAuth.getInstance().getCurrentUser();\n String uID = firebaseUser.getUid();\n\n //Get auth credentials from the user for re-authentication\n credential = EmailAuthProvider.getCredential(mEmailField, mPassField);\n\n\n final DatabaseReference userDatabase = firebaseDatabase.getInstance().getReference().child(\"users\").child(uID);\n //Get the value of edit text\n editTextValue = changeFieldEt.getText().toString().trim();\n //Check whether edit text is empty\n if (!TextUtils.isEmpty(editTextValue)) {\n //if change name\n if (mNameField.equals(\"name\")) {\n UserProfileChangeRequest userProfileChangeRequest = new UserProfileChangeRequest.Builder()\n .setDisplayName(editTextValue).build();\n firebaseUser.updateProfile(userProfileChangeRequest).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"PROFILE\", \"User profile updated.\");\n updateDatabase(userDatabase);\n spotsDialog.dismiss();\n }\n }\n });\n }//if change password\n else if (mNameField.equals(\"password\")) {\n\n firebaseUser.reauthenticate(credential)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n firebaseUser.updatePassword(editTextValue).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"PASSWORD\", \"User password updated.\");\n updateDatabase(userDatabase);\n } else {\n Log.i(\"PASSWORD\", \"User cannot updated.\");\n Utility.MakeLongToastToast(activity, \"Password must have more than 7 characters\");\n spotsDialog.dismiss();\n }\n }\n });\n } else {\n Log.i(\"AUTH\", \"Error auth failed\");\n }\n }\n });\n }//if change email\n else if (mNameField.equals(\"email\")) {\n firebaseUser.reauthenticate(credential)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n firebaseUser.updateEmail(editTextValue).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Log.i(\"EMAIL\", \"User email address updated.\");\n updateDatabase(userDatabase);\n } else {\n Utility.MakeLongToastToast(activity, \"Cannot Updated. Please try another name \");\n spotsDialog.dismiss();\n }\n }\n });\n } else {\n Log.i(\"AUTH\", \"Error auth failed\");\n }\n }\n });\n\n }\n\n\n } else {\n Utility.MakeLongToastToast(getActivity(), \"Please enter your change.\");\n spotsDialog.dismiss();\n }\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if(firebaseMethods.checkIfUsernameExists(username, dataSnapshot)){\n append = myRef.push().getKey().substring(0,7);\n }\n username = username + append;\n\n //add new user to the database\n firebaseMethods.addNewUser(\"notdone\",username,\"emp\",userID);\n Toast.makeText(mContext, \"Signup successful. Admin Verification \" +\n \"Left.\", Toast.LENGTH_SHORT).show();\n Intent i = new Intent(Register.this, Login.class);\n startActivity(i);\n finish();\n }",
"public void updateUser(){\n\n Log.d(\"ACCESS\", \"In update\");\n\n DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();\n\n userRef = FirebaseDatabase.getInstance().getReference().child(\"users\").child(winnerName);\n\n userRef.addListenerForSingleValueEvent(new ValueEventListener(){\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n Users updateUser = dataSnapshot.getValue(Users.class);\n Log.v(\"RETRIEVEinUPDATE\", \"Name value = \" + updateUser.getName() + \"Score value = \" + updateUser.getScore());\n String scoreString = updateUser.getScore();\n\n int score = Integer.parseInt(scoreString);\n\n score++;\n updateUser.setScore(String.valueOf(score));\n userRef.setValue(updateUser);\n\n }\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.d(\"ERROR TAG\", \"Failed to read value.\", error.toException());\n }\n\n\n public void onChildRemoved(DataSnapshot dataSnapshot) {\n\n }\n\n public void onChildChanged(DataSnapshot dataSnapshot, String s) {\n\n }\n\n\n // @Override\n public void onChildMoved(DataSnapshot dataSnapshot, String s) {\n\n }\n\n\n\n\n\n\n });\n\n endGame();\n\n }",
"private void updateUserInfo(final String username, String em, String status) {\r\n FirebaseDatabase.getInstance().getReference().child(\"Users\").addListenerForSingleValueEvent(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n Log.d(TAG, \"onDataChange: \" + dataSnapshot);\r\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\r\n }\r\n\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n progressDialog.setMessage(\"Please wait while your your profile gets updated\");\r\n progressDialog.show();\r\n final Map<String, Object> userMap = new HashMap<>();\r\n userMap.put(\"name\", Handy.getTrimmedName(username));\r\n userMap.put(\"email\", em);\r\n userMap.put(\"status\", status);\r\n Map map = new HashMap();\r\n Double v = points + 0.25;\r\n map.put(\"points\", v);\r\n map.put(\"fitnessPoint\", Handy.fitnessPoint(v));\r\n userPoints.setValue(map);\r\n databaseReference.updateChildren(userMap).addOnCompleteListener(new OnCompleteListener<Void>() {\r\n @Override\r\n public void onComplete(@NonNull Task<Void> task) {\r\n if (task.isSuccessful()) {\r\n userSearchNode.updateChildren(userMap);\r\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\r\n .setDisplayName(Handy.getTrimmedName(username))\r\n .build();\r\n user.updateProfile(profileUpdates).addOnCompleteListener(new OnCompleteListener<Void>() {\r\n @Override\r\n public void onComplete(@NonNull Task<Void> task) {\r\n progressDialog.dismiss();\r\n Log.d(TAG, \"onComplete: Updated success\");\r\n Toast.makeText(EditProfileActivity.this, \"Information has been updated successfully\", Toast.LENGTH_SHORT).show();\r\n finish();\r\n }\r\n });\r\n } else {\r\n progressDialog.hide();\r\n Toast.makeText(EditProfileActivity.this, \"Sorry could not update your profile Info\", Toast.LENGTH_SHORT).show();\r\n }\r\n }\r\n });\r\n\r\n }",
"private void addUserChangeListener() {\n ref.child(userid).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n data dat = dataSnapshot.getValue(data.class);\n\n // Check for null\n if (dat == null) {\n Log.e(TAG, \"User data is null!\");\n return;\n }\n\n // Log.e(TAG, \"User data is changed!\" + user.name + \", \" + user.email);\n\n Toast.makeText(moredata.this, \"\"+dat.address+dat.name, Toast.LENGTH_SHORT).show();\n e1.setText(\"\");\n e2.setText(\"\");\n // Display newly updated name and email\n /* txtDetails.setText(user.name + \", \" + user.email);\n\n // clear edit text\n inputEmail.setText(\"\");\n inputName.setText(\"\");\n\n toggleButton();*/\n }\n\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.e(TAG, \"Failed to read user\", error.toException());\n }\n });\n }",
"protected static void updateUsername(User user, String newUsername) {\n String friendsString = \"{\";\n for (User friend : user.getFriendsList()) {\n friendsString += friend.getUsername() + \",\";\n }\n friendsString = Utils.removeStartEndChars(friendsString);\n String [] strings = Utils.splitCommas(friendsString);\n\n for (String string : strings) {\n try {\n // connect to database\n Connection connection = DriverManager.getConnection(secrets.getUrl(), secrets.getUsername(), secrets.getPassword());\n\n // create a statement\n Statement statement = connection.createStatement();\n\n // execute SQL query\n String query = String.format(\"SELECT * FROM users WHERE username='%s'\", string);\n ResultSet result = statement.executeQuery(query);\n\n while (result.next()) {\n String usernameFriends = result.getString(\"friends\");\n usernameFriends = Utils.parseString(usernameFriends);\n String[] users = Utils.splitCommas(Utils.removeStartEndChars(usernameFriends));\n usernameFriends = \"{\";\n\n for (int j=0; j<users.length; j++) {\n if (users[j].equals(user.getUsername())) {\n users[j] = newUsername;\n }\n usernameFriends += users[j] + \",\";\n }\n usernameFriends = Utils.removeEndChar(usernameFriends) + \"}\";\n query = String.format(\"UPDATE users SET friends='%s' WHERE username='%s'\", usernameFriends, string);\n updateDBWithQuery(query);\n }\n\n connection.close();\n } catch (Exception e) {\n e.printStackTrace();\n\n return;\n }\n }\n\n // and companies followers list\n String companiesListString = \"{\";\n for (Company company : user.getCompaniesList()) {\n companiesListString += company.getName() + \",\";\n }\n\n companiesListString = Utils.removeStartEndChars(companiesListString);\n String [] arrayOfCompaniesName = Utils.splitCommas(companiesListString);\n\n for (String companyName : arrayOfCompaniesName) {\n try {\n // connect to database\n Connection connection = DriverManager.getConnection(secrets.getUrl(), secrets.getUsername(), secrets.getPassword());\n\n // create a statement\n Statement statement = connection.createStatement();\n\n // execute SQL query\n String query = String.format(\"SELECT * FROM companies WHERE name='%s'\", companyName);\n ResultSet result = statement.executeQuery(query);\n\n while (result.next()) {\n String followersList = result.getString(\"followers_list\");\n followersList = Utils.parseString(followersList);\n String[] users = Utils.splitCommas(Utils.removeStartEndChars(followersList));\n followersList = \"{\";\n\n for (int j=0; j<users.length; j++) {\n if (users[j].equals(user.getUsername())) users[j] = newUsername;\n\n followersList += users[j] + \",\";\n }\n followersList = Utils.removeEndChar(followersList) + \"}\";\n query = String.format(\"UPDATE companies SET followers_list='%s' WHERE name='%s'\", followersList, companyName);\n updateDBWithQuery(query);\n\n }\n\n connection.close();\n } catch (Exception e) {\n e.printStackTrace();\n\n return;\n }\n }\n\n // sql update username query command\n String query = String.format(\"UPDATE users SET username='%s' WHERE username='%s'\", newUsername, user.getUsername());\n updateDBWithQuery(query);\n }",
"private void updateName(FirebaseUser user) {\n UserProfileChangeRequest profile = new UserProfileChangeRequest.Builder()\n .setDisplayName(name.getText().toString())\n .build();\n\n user.updateProfile(profile)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n Toast.makeText(Profile.this, \"Name Updated\", Toast.LENGTH_SHORT).show();\n }\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(Profile.this, e.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }",
"private void updateUserBio(String txtBio) {\n\n FirebaseDatabase.getInstance().getReference()\n .child(\"Users\").child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n dataSnapshot.getRef().child(\"bio\").setValue(txtBio);\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n readInfoUser();\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String name=dataSnapshot.child(\"UserInformation\").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).child(\"name\").getValue(String.class);\n user_name.setText(name);\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n data[0]= dataSnapshot.child(userID).child(\"Name\").getValue(String.class);\n data[1]= FirebaseAuth.getInstance().getCurrentUser().getEmail();\n\n name.setText(data[0]);\n email.setText(data[1]);\n\n\n }",
"public static void addNewToDataBase(String name, String bio) {\n FirebaseAuth mAuth = FirebaseAuth.getInstance();\n String uid = mAuth.getUid();\n DatabaseReference ref = FirebaseDatabase.getInstance().getReference();\n\n // Initialize the new user with a fridge, a list of friends, a list of allergies, and preferred units\n ref.child(\"users\").child(uid).child(\"fridge\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"followers\").child(uid).setValue(uid);\n ref.child(\"users\").child(uid).child(\"following\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"allergies\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"units\").setValue(\"imperial\");\n ref.child(\"users\").child(uid).child(\"feed\").setValue(\"null\");\n ref.child(\"users\").child(uid).child(\"name\").setValue(name);\n ref.child(\"displayNames\").child(name).setValue(name);\n ref.child(\"users\").child(uid).child(\"bio\").setValue(bio);\n ref.child(\"users\").child(uid).child(\"posts\").setValue(\"null\");\n }",
"public void updateUser(int uid, String name, String phone, String email, String password, int money, int credit);",
"private void MakemeOnlion() {\n progressDialog.setMessage(\"Checking user....\");\n Map<String,Object>map=new HashMap<>();\n map.put(\"onlion\",\"true\");\n\n //update value to db\n DatabaseReference databaseReference= FirebaseDatabase.getInstance().getReference(\"Users\");\n databaseReference.child(firebaseAuth.getCurrentUser().getUid()).updateChildren(map).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n \n CheckuserType();\n\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n progressDialog.dismiss();\n Toast.makeText(Login_Activity.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n\n }\n });\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n for (DataSnapshot snapshot: dataSnapshot.getChildren()){\n if (snapshot.getKey().equals(currentUser)){\n Intent login = new Intent(getApplicationContext(), MainActivity.class);\n login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(login);\n }\n }\n Map<String, Object> user = new HashMap<String, Object>();\n user.put(\"username\", mAuth.getCurrentUser().getDisplayName());\n user.put(\"kilometer\", 0);\n user.put(\"points\", 0);\n user.put(\"number\", \"\");\n user.put(\"firstName\", \"\");\n user.put(\"lastName\", \"\");\n user.put(\"dob\", \"\");\n user.put(\"reward\", null);\n\n DatabaseReference myRef = FirebaseDatabase.getInstance().getReference().child(\"users\").child(currentUser);\n myRef.setValue(user);\n\n\n Intent freshGoogleLogin = new Intent(getApplicationContext(), MainActivity.class);\n freshGoogleLogin.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(freshGoogleLogin);\n\n }",
"@Override\n public void onClick(View v) {\n String nameEdit = name1.getText().toString().trim();\n String age1 = ageEditText.getText().toString().trim();\n String address = addressEditText.getText().toString().trim();\n String occupation = occupationEditText.getText().toString().trim();\n String about = aboutEditText.getText().toString().trim();\n\n if (nameEdit != null && !nameEdit.isEmpty()) {\n databaseReference.child(\"Name\").setValue(nameEdit);\n }\n if (age1 != null && !age1.isEmpty()) {\n databaseReference.child(\"Age\").setValue(age1);\n }\n if (address != null && !address.isEmpty()) {\n databaseReference.child(\"Address\").setValue(address);\n }\n if (occupation != null && !occupation.isEmpty()) {\n databaseReference.child(\"Occupation\").setValue(occupation);\n }\n if (about != null && !about.isEmpty()) {\n databaseReference.child(\"About\").setValue(about);\n }\n\n Toast.makeText(UserAccount.this, \"The details have been successfully updated\", Toast.LENGTH_SHORT).show();\n\n }",
"private void saveUserInformation() {\n name.setText(nameInput.getText().toString());\n\n if (name.getText().toString().isEmpty()) {\n name.setError(\"Name required\");\n name.requestFocus();\n return;\n }\n\n FirebaseUser user = mAuth.getCurrentUser();\n if (user != null) {\n if (isBname()) {\n updateName(user);\n }\n if (isBtitle()) {\n updateTitle(user);\n }\n }\n }",
"private void saveUserInformation() {\n String name = editTextName.getText().toString().trim();\n String add = editTextAddress.getText().toString().trim();\n\n //creating a userinformation object\n UserInformation userInformation = new UserInformation(name, add);\n\n //getting the current logged in user\n FirebaseUser user = firebaseAuth.getCurrentUser();\n\n //saving data to firebase database\n /*\n * first we are creating a new child in firebase with the\n * unique id of logged in user\n * and then for that user under the unique id we are saving data\n * for saving data we are using setvalue method this method takes a normal java object\n * */\n databaseReference.child(user.getUid()).setValue(userInformation);\n\n //displaying a success toast\n Toast.makeText(this, \"Information Saved...\", Toast.LENGTH_LONG).show();\n }",
"@Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\n checkifUsernameExists(username);\r\n\r\n }",
"private void updateData() {\n user.setNewPassword(newPassword.getText().toString());\n user.setPassword(password.getText().toString());\n\n FirebaseUser firebaseUser = mAuth.getCurrentUser();\n\n if (firebaseUser == null) {\n return;\n }\n\n firebaseUser\n .updatePassword(user.getNewPassword())\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n\n if (task.isSuccessful()) {\n newPassword.setText(Util.EMPTY);\n password.setText(Util.EMPTY);\n\n Toast.makeText(\n getContext(), getResources().getString(R.string.password_updated),\n Toast.LENGTH_SHORT\n ).show();\n }\n }\n })\n .addOnFailureListener((Activity) getContext(), new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n FirebaseCrash.report(e);\n Toast.makeText(\n getContext(),\n e.getMessage(),\n Toast.LENGTH_SHORT\n ).show();\n }\n });\n }",
"public void createNewUser(){\n Users user = new Users(winnerName);\n mDatabase.child(\"users\").child(winnerName).setValue(user);\n Log.d(\"DB\", \"Writing new user \" + winnerName + \" to the database\");\n\n Toast.makeText(this, \"Scoreboard has been updated!\", Toast.LENGTH_SHORT).show();\n\n endGame();\n\n\n\n }",
"private void updateUserProfileInfo() {\n currentUserName=userProfileName.getText().toString();\n currentUserPassword=userProfilePassword.getText().toString();\n currentUserCity=userProfileCity.getText().toString();\n if(!TextUtils.isEmpty(currentUserName)&& !TextUtils.isEmpty(currentUserPassword)&& !TextUtils.isEmpty(currentUserCity)){\n databaseReference.child(\"Users Data\").child(\"Sign Up Info\").child(\"UID \"+currentUserUid).child(\"Name\").setValue(currentUserName);\n databaseReference.child(\"Users Data\").child(\"Sign Up Info\").child(\"UID \"+currentUserUid).child(\"Password\").setValue(currentUserPassword);\n databaseReference.child(\"Users Data\").child(\"Sign Up Info\").child(\"UID \"+currentUserUid).child(\"City\").setValue(currentUserCity);\n authorization.getCurrentUser().updatePassword(currentUserPassword);\n Toast toast=Toast.makeText(getActivity(),\"Your profile info has been update.\",Toast.LENGTH_SHORT);\n toast.setGravity(Gravity.CENTER, 0, 0);\n toast.show();\n }\n else if(TextUtils.isEmpty(currentUserName)){\n userProfileName.setError(\"Name is required\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));\n } else {\n //deprecated in API 26\n vibrator.vibrate(500);\n }\n\n }\n else if(TextUtils.isEmpty(currentUserPassword)){\n userProfilePassword.setError(\"Password is required\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));\n } else {\n //deprecated in API 26\n vibrator.vibrate(500);\n }\n }\n else if(TextUtils.isEmpty(currentUserCity)){\n userProfileCity.setError(\"City is required\");\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n vibrator.vibrate(VibrationEffect.createOneShot(500, VibrationEffect.DEFAULT_AMPLITUDE));\n } else {\n //deprecated in API 26\n vibrator.vibrate(500);\n }\n }\n loadCurrentUserInformation();\n }",
"String updateUserInfo(String usernameToUpdate, UserInfo userInfo);",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String svalue = dataSnapshot.getValue(String.class);\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference upd = database.getReference(\"Info\").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).child(\"oldsubject\");\n upd.setValue(svalue);\n\n }",
"public void userExists(){\n\n DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference();\n DatabaseReference userNameRef = rootRef.child(\"users\").child(winnerName);\n ValueEventListener eventListener = new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if(!dataSnapshot.exists()) {\n createNewUser();\n }\n else{\n updateUser();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Log.d(\"TAG\", databaseError.getMessage()); //Don't ignore errors!\n }\n };\n userNameRef.addListenerForSingleValueEvent(eventListener);\n\n\n }",
"private void updateFriend(DatabaseReference friendsReference) {\n String name = \"John Jones\";\n int number = 654321;\n String key = \"2\";\n friendsReference.child(key).child(\"friendName\").setValue(name);\n friendsReference.child(key).child(\"telephoneNumber\").setValue(number);\n }",
"private void checkifUsernameExists(final String username) {\r\n Log.d(TAG, \"checkifUsernameExists: Checking if\" + username + \"Alredy Exists\");\r\n\r\n DatabaseReference reference=FirebaseDatabase.getInstance().getReference();\r\n Query query=reference.child(getString(R.string.dbname_users))\r\n .orderByChild(getString(R.string.field_username))\r\n .equalTo(username);\r\n query.addListenerForSingleValueEvent(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n\r\n for(DataSnapshot singleSnapshot:dataSnapshot.getChildren())\r\n {\r\n if(singleSnapshot.exists())\r\n {\r\n Log.d(TAG, \"checkIfUsernameExists: FOUND A MATCH \"+singleSnapshot.getValue(User.class));\r\n append=myRef.push().getKey().substring(3,10);\r\n Log.d(TAG, \"onDataChange: username alredy exists,appending random string to name\"+append);\r\n }\r\n }\r\n String mUsername;\r\n mUsername = username + append;\r\n\r\n //add new user account settings to the database\r\n firebaseMethods.addNewUser(email,mUsername,\"\",\"\",\"\");\r\n Toast.makeText(mContext,\"Signup succesfull : sending Verification Email\",Toast.LENGTH_SHORT).show();\r\n mAuth.signOut();//Log out\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError databaseError) {\r\n\r\n }\r\n });\r\n\r\n }",
"private void addUserChangeListener() {\n // User data change listener\n mFirebaseDatabase.child(userId).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n needy needy = dataSnapshot.getValue(needy.class);\n\n // Check for null\n if (needy == null) {\n Log.e(TAG, \"User data is null!\");\n return;\n }\n\n Log.e(TAG, \"User data is changed!\" + needy.Address + \", \" + needy.Phone_number+\",\"+ needy.needy);\n\n // Display newly updated name and email\n // txtDetails.setText(user.Address + \", \" + user.Phone_number+\",\"+user.needy);\n\n // clear edit text\n inputAddress.setText(\"\");\n inputPhone_number.setText(\"\");\n inputneedy.setText(\"\");\n\n\n toggleButton();\n }\n\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.e(TAG, \"Failed to read user\", error.toException());\n }\n });\n }",
"public static void createUser(Context context, String email, String password, String name, String bio) {\n if (name.isEmpty() || name.contains(\".\") || name.contains(\"$\") || name.contains(\"#\") || name.contains(\"[\") || name.contains(\"]\") || name.contains(\"/\")) { // No characters that would conflict with firebase path name restrictions\n Log.d(\"RecipeFinderAuth\", \"Sign up Failed!\");\n Toast.makeText(context, \"Sign Up Failed!\", Toast.LENGTH_SHORT).show();\n return;\n }\n FirebaseDatabase.getInstance().getReference().child(\"displayNames\").addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n if (snapshot.hasChild(name)) { // Display name taken\n Log.d(\"RecipeFinderAuth\", \"Sign up Failed!\");\n Toast.makeText(context, \"Sign Up Failed!\", Toast.LENGTH_SHORT).show();\n } else {\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(new OnCompleteListener<AuthResult> () {\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) { // Account was successfully created\n Log.d(\"RecipeFinderAuth\", \"Account Created!\");\n Toast.makeText(context, \"Account Created!\", Toast.LENGTH_SHORT).show();\n addNewToDataBase(name, bio); // Add the user to the database of users\n ((AppCompatActivity)(context)).finish();\n\n // Logged in, show home\n Intent intent = new Intent(context, HomeActivity.class);\n context.startActivity(intent);\n } else { // Account was not successfully created\n Log.d(\"RecipeFinderAuth\", \"Sign up Failed!\");\n Toast.makeText(context, \"Sign Up Failed!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n }",
"private void updateUI(FirebaseUser user) {\n\n HashMap<String, Object> data = new HashMap<>();\n data.put(\"FName\", user.getDisplayName());\n data.put(\"LName\", user.getDisplayName());\n data.put(\"email\", user.getEmail());\n data.put(\"password\", \"No need this\");\n data.put(\"uid\", mAuth.getCurrentUser().getUid());\n data.put(\"token\", user.getIdToken(true).toString());\n\n db.collection(\"users\").document(mAuth.getCurrentUser().getUid())\n .set(data).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n\n finish();\n startActivity(new Intent(Login.this, CollectingData.class));\n }\n });\n\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n Log.d(\"Test\",\"Facebook to firebase success\");\n User userToAdd = new User();\n userToAdd.setEmailAddress(email);\n String[] splited = fullName.split(\"\\\\s+\");\n userToAdd.setFirstName(splited[0]);\n userToAdd.setLastName(splited[1]);\n userToAdd.setPictureUrl(pictureUrl);\n usersTable.child(FirebaseAuth.getInstance().getCurrentUser().getUid()).setValue(userToAdd).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.d(\"Failure\",e.getMessage());\n }\n });\n Toast.makeText(activity, \"added to database \", Toast.LENGTH_LONG).show();\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String phn = dataSnapshot.child(\"Phone\").getValue(String.class);\n String nam = dataSnapshot.child(\"Name\").getValue(String.class);\n\n String pass2 = dataSnapshot.child(\"Password\").getValue(String.class);\n String ema = dataSnapshot.child(\"Email\").getValue(String.class);\n\n username.setText(nam);\n email.setText(ema);\n phone.setText(phn);\n password.setText(pass2);\n }",
"private void updateUser(String Address, String Phone_number,String needy) {\n if (!TextUtils.isEmpty(Address))\n mFirebaseDatabase.child(userId).child(\"name\").setValue(Address);\n\n if (!TextUtils.isEmpty(Phone_number))\n mFirebaseDatabase.child(userId).child(\"email\").setValue(Phone_number);\n\n if (!TextUtils.isEmpty(needy))\n mFirebaseDatabase.child(userId).child(\"email\").setValue(needy);\n }",
"private void writeNewUser(String name,String email,String password) {\n mDatabase.child(\"User\").child(name).child(\"Email\").setValue(email);\n mDatabase.child(\"User\").child(name).child(\"Password\").setValue(password);\n }",
"@Override\n public void onChildAdded(DataSnapshot snapshot, String previousChildKey) {\n DataBaseUsers user = snapshot.getValue(DataBaseUsers.class);\n //System.out.println(user.getEmail());\n userList.add(user);\n }",
"@Override\n public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s)\n {\n final ModelForNoc nocModel = dataSnapshot.getValue(ModelForNoc.class);\n\n // get user name\n DatabaseReference userNameRef = dbRef.child(\"Users\").child(nocModel.getUid());\n userNameRef.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot)\n {\n String userName = dataSnapshot.child(\"user_name\").getValue().toString();\n\n // set , add and send data to recycler adapter\n nocModel.setUserName(userName);\n nocList.add(nocModel);\n nocView.onSetNocRecyclerAdapter(nocList);\n\n }\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {}\n });\n }",
"private void saveSettings(){\n // get current user from shared preferences\n currentUser = getUserFromSharedPreferences();\n\n final User newUser = currentUser;\n Log.i(\"currentUser name\",currentUser.getUsername());\n String username = ((EditText)findViewById(R.id.usernameET)).getText().toString();\n\n if(\"\".equals(username)||username==null){\n Toast.makeText(getApplicationContext(),\"Failed to save, user name cannot be empty\",Toast.LENGTH_LONG).show();\n return;\n }\n\n newUser.setUsername(username);\n\n // update user data in firebase\n Firebase.setAndroidContext(this);\n Firebase myFirebaseRef = new Firebase(Config.FIREBASE_URL);\n\n // set value and add completion listener\n myFirebaseRef.child(\"users\").child(newUser.getFireUserNodeId()).setValue(newUser,new Firebase.CompletionListener() {\n @Override\n public void onComplete(FirebaseError firebaseError, Firebase firebase) {\n if (firebaseError != null) {\n\n Toast.makeText(getApplicationContext(),\"Data could not be saved. \" + firebaseError.getMessage(),Toast.LENGTH_SHORT).show();\n } else {\n // if user info saved successfully, then save user image\n uploadPhoto();\n Toast.makeText(getApplicationContext(),\"User data saved successfully.\",Toast.LENGTH_SHORT).show();\n }\n }\n });\n\n }",
"public void doDataAddToDb() {\n String endScore = Integer.toString(pointsScore);\r\n String mLongestWordScore = Integer.toString(longestWordScore);\r\n String date = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.US).format(new Date());\r\n Log.e(TAG, \"date\" + date);\r\n\r\n // creating a new user for the database\r\n User newUser = new User(userNameString, endScore, date, longestWord, mLongestWordScore); // creating a new user object to hold that data\r\n\r\n // add new node in database\r\n DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();\r\n mDatabase.child(\"users\").child(userNameString).setValue(newUser);\r\n\r\n Log.e(TAG, \"pointsScore\" + pointsScore);\r\n Log.e(TAG, \"highestScore\" + highestScore);\r\n\r\n\r\n // if high score is achieved, send notification\r\n if (highestScore > pointsScore) {\r\n new Thread(new Runnable() {\r\n @Override\r\n public void run() {\r\n sendMessageToNews();\r\n }\r\n }).start();\r\n }\r\n }",
"private void updateUserAccount() {\n final UserDetails details = new UserDetails(HomeActivity.this);\n //Get Stored User Account\n final Account user_account = details.getUserAccount();\n //Read Updates from Firebase\n final Database database = new Database(HomeActivity.this);\n DatabaseReference user_ref = database.getUserReference().child(user_account.getUser().getUser_id());\n user_ref.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n //Read Account Balance\n String account_balance = dataSnapshot.child(Database.USER_ACC_BALANCE).getValue().toString();\n //Read Expire date\n String expire_date = dataSnapshot.child(Database.USER_ACC_SUB_EXP_DATE).getValue().toString();\n //Read Bundle Type\n String bundle_type = dataSnapshot.child(Database.USER_BUNDLE_TYPE).getValue().toString();\n //Attach new Values to the Account Object\n user_account.setBalance(Double.parseDouble(account_balance));\n //Attach Expire date\n user_account.setExpire_date(expire_date);\n //Attach Bundle Type\n user_account.setBundle_type(bundle_type);\n //Update Local User Account\n details.updateUserAccount(user_account);\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n //No Implementation\n }\n });\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n Profile profile = Profile.getCurrentProfile();\n if (profile != null) {\n FirebaseUser user = mAuth.getCurrentUser();\n DatabaseReference dbref = FirebaseDatabase.getInstance().getReference();\n //DatabaseReference childrf = dbref.child(\"user\");\n if (!dataSnapshot.hasChildren()) {\n // db has no children\n String facebook_id = profile.getId();\n String f_name = profile.getFirstName();\n String m_name = profile.getMiddleName();\n String l_name = profile.getLastName();\n String full_name = profile.getName();\n String token = FirebaseInstanceId.getInstance().getToken();\n\n String profile_image = profile.getProfilePictureUri(300, 300).toString();\n dbref.child(\"user\").child(mAuth.getUid()).child(\"info\").child(\"full_name\").setValue(full_name);\n dbref.child(\"user\").child(mAuth.getUid()).child(\"info\").child(\"profile_image\").setValue(profile_image);\n dbref.child(\"user\").child(mAuth.getUid()).child(\"info\").child(\"tel\").setValue(\"null\");\n dbref.child(\"user\").child(mAuth.getUid()).child(\"info\").child(\"token\").setValue(token);\n\n intent = new Intent(getApplication(), firstLoginDetail.class);\n finish();\n startActivity(intent);\n } else {\n checkTel();\n\n }\n\n\n //Toast.makeText(getApplication(),\"ยินดีต้อนรับ : \"+full_name, Toast.LENGTH_LONG).show();\n\n\n// dbref.child(\"user\").child(user.getUid()).child(\"info\").child(\"name\").setValue(\"null\");\n// dbref.child(\"user\").child(user.getUid()).child(\"info\").child(\"lastname\").setValue(\"null\");\n\n\n }\n\n\n }",
"private void updateUserName() {\n\t\t// if the customer has a first and last name update their username to be\n\t\t// the concatenation of their first and last name (in lower case)\n\t\t// else, make their username their first name\n\t\tif (!this.lastName.equals(Customer.EMPTY_LAST_NAME)) {\n\t\t\tthis.userName = (this.firstName + this.lastName).toLowerCase();\n\t\t} else {\n\t\t\tthis.userName = this.firstName.toLowerCase();\n\t\t}\n\t}",
"private void saveDetails() {\n //get the editted data\n String name = m_ChangeName.getText().toString();\n final String age = m_ChangeAge.getText().toString();\n final String bio = m_ChangeBio.getText().toString();\n\n //get the image from the image view\n final Bitmap img = ((BitmapDrawable) m_ProfilePic.getDrawable()).getBitmap();\n\n //get a reference to firebase database\n final DatabaseReference ref = FirebaseDatabase.getInstance().getReference();\n\n //get the current logged in user\n final FirebaseUser fUser = FirebaseAuth.getInstance().getCurrentUser();\n\n // add the new name of the user\n ref.child(\"user\").child(fUser.getUid()).child(\"name\").setValue(name);\n\n // when the name is updated, update the other relevant info\n ref.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n // update the age and bio\n ref.child(\"user\").child(fUser.getUid()).child(\"age\").setValue(age);\n ref.child(\"user\").child(fUser.getUid()).child(\"bio\").setValue(bio);\n //object to convert image to byte array for storage on firebase\n ByteArrayOutputStream imgConverted = new ByteArrayOutputStream();\n\n //save the image as a .jpg file\n img.compress(Bitmap.CompressFormat.JPEG, 100, imgConverted);\n\n String imageEncoded = Base64.encodeToString(imgConverted.toByteArray(), Base64.DEFAULT);\n ref.child(\"user\").child(fUser.getUid()).child(\"image\").setValue(imageEncoded);\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n //display error if any occur\n Toasty.error(m_context, \"Error\" + databaseError, Toast.LENGTH_SHORT).show();\n }\n });\n\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n userName.set(position, dataSnapshot.getValue().toString());\n chatUserAdapter.notifyDataSetChanged();\n Log.d(TAG, \"User Name: \" + userName);\n }",
"private void sendUserData() {\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\n DatabaseReference myref = firebaseDatabase.getReference(Objects.requireNonNull(firebaseAuth.getUid()));\n UserProfile userProfile = new UserProfile(name, email, post, 0);\n myref.setValue(userProfile);\n }",
"@Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n\n FirebaseUser usuarioActual = FirebaseAuth.getInstance().getCurrentUser();\n UserProfileChangeRequest profileUpdates = new UserProfileChangeRequest.Builder()\n .setDisplayName(name.getText().toString() + \" \" + lastname.getText().toString()).build();\n usuarioActual.updateProfile(profileUpdates);\n\n ref.child(projectnameNew.getText().toString());\n\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(i);\n }\n if (!task.isSuccessful()) {\n Toast.makeText(RegisterActivity.this, \"Algo está mal :C\",\n Toast.LENGTH_SHORT).show();\n }\n\n // ...\n }",
"public void updateUsername(String newUsername, String tablename) {\n\t\ttry {\n\t\t\tmyCon.execute(\"UPDATE \" + tablename + \" SET Username= '\" + newUsername + \"';\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n}",
"private void updateStudentOnFirebaseDatabase() {\n String studentName = mStudentNameEditText.getText().toString().toLowerCase().trim();\n int studentSex = mStudentSex;\n long studentBirthdate = mStudentBirthdate;\n int studentGrade = Integer.parseInt(mStudentGradeEditText.getText().toString());\n String studentId = mCurrentStudent.getStudentId();\n\n if (mViewModel.studentPicBitmap != null) {\n saveStudentPhotoToFirebaseStorage(studentId);\n } else {\n // Check if the student already has a photo saved\n String photoUrl;\n if (studentHasPhoto) {\n // if has photo, resave the photo to the student database\n photoUrl = mCurrentStudent.getPhotoUrl();\n } else {\n photoUrl = null;\n }\n\n mStudentsDatabaseReference.child(studentId)\n .setValue(new Student(studentName, studentSex, studentBirthdate, studentGrade,\n mChosenClassesList, photoUrl, studentId));\n\n // Close activity\n finish();\n }\n }",
"private void addUserToDatabase( DatabaseReference postRef) {\n\n // check username, password cannot be null and may not have spaces\n final String usernameChecked = checkNullString(usernameText.getText().toString());\n final String password = checkNullString(passwordText.getText().toString());\n final String confirmPassword = checkNullString(confirmPasswordText.getText().toString());\n\n if (usernameChecked == null || password == null) {\n Toast.makeText(this, \"Entries may not be null, and may not have spaces!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n if (!password.equals(confirmPassword)){\n Toast.makeText(this, \"Passwords do not match!\", Toast.LENGTH_LONG).show();\n return;\n }\n\n if (users.contains(usernameChecked)){\n Toast.makeText(this, \"Username is already taken\", Toast.LENGTH_LONG).show();\n return;\n }\n\n // initialize data for SentCount\n postRef\n .child(\"Users\")\n .child(usernameChecked)\n .runTransaction(new Transaction.Handler() {\n\n @NonNull\n @Override\n public Transaction.Result doTransaction(@NonNull MutableData currentData) {\n User newUser = new User(usernameChecked, password);\n currentData.setValue(newUser);\n return Transaction.success(currentData);\n }\n\n @Override\n public void onComplete(@Nullable DatabaseError error, boolean committed,\n @Nullable DataSnapshot currentData) {\n Log.d(TAG, \"postTransaction:onComplete:\" + currentData);\n Toast.makeText(getApplicationContext(), \"Sign up successful!\", Toast.LENGTH_LONG);\n finish();\n }\n });\n }",
"@Override\n public void onSuccess(Map<String, Object> result) {\n Firebase newUserRef = ref.child(\"users\").child(\"username\");\n User newUser = new User();\n\n newUser.email = signUpEmail;\n newUser.fullName = fullName;\n newUser.password = password;\n\n newUserRef.setValue(newUser);\n\n Toast.makeText(SignupActivity.this, \"Successfully created new account\", Toast.LENGTH_LONG).show();\n finish();\n }",
"private void prosesUpdate() {\n final String name = tvName.getText().toString();\r\n\r\n //get dari tabel/collection user\r\n Constants.refAcademicCal.addValueEventListener(new ValueEventListener() {\r\n @Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\r\n //mengambil data email\r\n AcademicModel emails = dataSnapshot.getValue(AcademicModel.class);\r\n\r\n Constants.refAcademicCal.child(\"name\").setValue(name);\r\n if (isPicChange)\r\n Constants.refAcademicCal.child(\"imgUrl\").setValue(photoUrl.toString());\r\n\r\n Toast.makeText(AcademicCal.this, \"Update berhasil!\", Toast.LENGTH_SHORT).show();\r\n finish();\r\n\r\n }\r\n\r\n @Override\r\n public void onCancelled(DatabaseError error) {\r\n // Failed to read value\r\n Log.w(\"\", \"Failed to read value.\", error.toException());\r\n //showProgress(false);\r\n }\r\n });\r\n }",
"private void realTimeUpdate(){\r\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\r\n\r\n if (user == null) {\r\n return;\r\n }\r\n\r\n String userId = user.getUid();\r\n String email = user.getEmail();\r\n DocumentReference reference = mFirebaseFirestore.collection(\"users\").document(userId);\r\n reference.addSnapshotListener(new EventListener<DocumentSnapshot>() {\r\n @Override\r\n public void onEvent(@Nullable DocumentSnapshot documentSnapshot, @Nullable FirebaseFirestoreException e) {\r\n if (e != null){\r\n Toast.makeText(Testing.this, \"Error: \" + e.toString(), Toast.LENGTH_LONG).show();\r\n return;\r\n }else if (documentSnapshot != null && documentSnapshot.exists()) {\r\n Toast.makeText(Testing.this, \"Current data:\" + documentSnapshot.getData(), Toast.LENGTH_LONG).show();\r\n }\r\n }\r\n });\r\n }",
"private void fillYourInfo(){\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\n if (user != null) {\n // Name, email address, and profile photo Url\n String user_name = user.getDisplayName();\n String email = user.getEmail();\n Uri photoUrl = user.getPhotoUrl();\n\n // Check if user's email is verified\n boolean emailVerified = user.isEmailVerified();\n\n // The user's ID, unique to the Firebase project. Do NOT use this value to\n // authenticate with your backend server, if you have one. Use\n // FirebaseUser.getToken() instead.\n TextView UserName = findViewById(R.id.playername1);\n ImageView ProfilePic = findViewById(R.id.playerimg1);\n UserName.setText(user_name);\n if (photoUrl != null) {\n Picasso.with(this).load(photoUrl).into(ProfilePic);\n }\n }\n if (user == null){\n TextView UserName = findViewById(R.id.playername1);\n ImageView ProfilePic = findViewById(R.id.playerimg1);\n UserName.setText(getText(R.string.def_user));\n ProfilePic.setImageResource(R.drawable.def_icon);\n }\n }",
"void updateNames(Long id, String firstName, String lastName);",
"@Override\n\tpublic void updateUserProfileInfo(String name) throws Exception {\n\n\t}",
"public void updateUser() {\r\n users.clear();\r\n RestaurantHelper.getCollectionFromARestaurant(currentRest.getPlaceId(), \"luncherId\").addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {\r\n @Override\r\n public void onComplete(@NonNull Task<QuerySnapshot> task) {\r\n for (DocumentSnapshot docSnap : task.getResult()) {\r\n UserHelper.getUser(docSnap.getId()).addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {\r\n @Override\r\n public void onComplete(@NonNull Task<DocumentSnapshot> task) {\r\n if(!task.getResult().getId().equals(currentUser.getUid())){\r\n users.add(task.getResult().toObject(User.class));\r\n mCoworkerAdapter.notifyDataSetChanged();\r\n }\r\n }\r\n });\r\n }\r\n }\r\n }).addOnFailureListener(this.onFailureListener());\r\n }",
"protected static void updateName(Company company, String newName) {\n String followersString = \"{\";\n for (User follower : company.getFollowersList()) {\n followersString += follower.getUsername() + \",\";\n }\n followersString = Utils.removeStartEndChars(followersString);\n String [] strings = Utils.splitCommas(followersString);\n\n for (String follower : strings) {\n try {\n Connection connection = DriverManager.getConnection(secrets.getUrl(), secrets.getUsername(), secrets.getPassword());\n Statement statement = connection.createStatement();\n String query = String.format(\"SELECT * FROM users WHERE username='%s'\", follower);\n ResultSet result = statement.executeQuery(query);\n\n while (result.next()) {\n String companiesList = result.getString(\"companies\");\n companiesList = Utils.parseString(companiesList);\n String [] companies = Utils.splitCommas(Utils.removeStartEndChars(companiesList));\n companiesList = \"{\";\n\n for (int j=0; j<companies.length; j++) {\n if (companies[j].equals(company.getName())) companies[j] = newName;\n\n companiesList += companies[j] + \",\";\n }\n companiesList = Utils.removeEndChar(companiesList) + \"}\";\n query = String.format(\"UPDATE users SET companies='%s' WHERE username='%s'\", companiesList, follower);\n updateDBWithQuery(query);\n }\n\n // close connection to db\n connection.close();\n } catch (Exception e) {\n e.printStackTrace();\n\n return;\n }\n }\n\n String networksList = \"{\";\n for (Company network : company.getNetworksList()) {\n networksList += network.getName() + \",\";\n }\n\n networksList = Utils.removeStartEndChars(networksList);\n String [] networks = Utils.splitCommas(networksList);\n\n for (String networkName : networks) {\n try {\n Connection connection = DriverManager.getConnection(secrets.getUrl(), secrets.getUsername(), secrets.getPassword());\n Statement statement = connection.createStatement();\n String query = String.format(\"SELECT * FROM companies WHERE name='%s'\", networkName);\n ResultSet result = statement.executeQuery(query);\n\n while (result.next()) {\n String networksNetworksList = result.getString(\"network_list\");\n networksNetworksList = Utils.parseString(networksNetworksList);\n String [] companies = Utils.splitCommas(Utils.removeStartEndChars(networksNetworksList));\n networksNetworksList = \"{\";\n\n for (int j=0; j<companies.length; j++) {\n if (companies[j].equals(company.getName())) companies[j] = newName;\n\n networksNetworksList += companies[j] + \",\";\n }\n networksNetworksList = Utils.removeEndChar(networksNetworksList) + \"}\";\n query = String.format(\"UPDATE companies SET network_list='%s' WHERE name='%s'\", networksNetworksList, networkName);\n updateDBWithQuery(query);\n }\n\n } catch (Exception e) {\n e.printStackTrace();\n\n return;\n }\n }\n\n String query = String.format(\"UPDATE companies SET name='%s' WHERE name='%s'\", newName, company.getName());\n updateDBWithQuery(query);\n }",
"private void updateProfile() {\r\n\r\n builder.setMessage(\"Are you sure you want to update?\")\r\n .setCancelable(false)\r\n .setTitle(\"Profile Update\")\r\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();\r\n\r\n if (user == null) {\r\n return;\r\n }\r\n\r\n //Validate fields\r\n if (!validateData()){\r\n return;\r\n }\r\n\r\n String userId = user.getUid();\r\n String email = user.getEmail();\r\n DocumentReference reference = mFirebaseFirestore.collection(\"users\").document(userId);\r\n reference.update(\"contact\", mTextViewContact.getText().toString());\r\n reference.update(\"estate\", mTextViewEstate.getText().toString());\r\n reference.update(\"houseno\", mTextViewHouseNo.getText().toString());\r\n reference.update(\"name\", mTextViewName.getText().toString())\r\n .addOnSuccessListener(new OnSuccessListener<Void>() {\r\n @Override\r\n public void onSuccess(Void aVoid) {\r\n Toast.makeText(Testing.this, \"User: \" + mTextViewName.getText().toString() + \" Profile updated successfully!\", Toast.LENGTH_LONG).show();\r\n resetFieldData();\r\n }\r\n })\r\n .addOnFailureListener(new OnFailureListener() {\r\n @Override\r\n public void onFailure(@NonNull Exception e) {\r\n Toast.makeText(Testing.this, \"Error while updating your profile. KIndly check your internet connection!\" + e.toString(), Toast.LENGTH_LONG).show();\r\n }\r\n });\r\n }\r\n })\r\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\r\n @Override\r\n public void onClick(DialogInterface dialogInterface, int i) {\r\n dialogInterface.cancel();\r\n }\r\n });\r\n AlertDialog alertDialog = builder.create();\r\n alertDialog.show();\r\n }",
"private void updateTitle(FirebaseUser user) {\n tittle.setText(nameInput.getText().toString());\n }",
"public void updateContact(View v){\n\n receivedPersonInfo.name = nameField.getText().toString();\n receivedPersonInfo.address = addressField.getText().toString();\n receivedPersonInfo.business = primbusiness.getItemAtPosition(primbusiness.getSelectedItemPosition()).toString();\n receivedPersonInfo.province = province.getItemAtPosition(province.getSelectedItemPosition()).toString();\n receivedPersonInfo.toMap(); // update hash\n appState.firebaseReference.child(receivedPersonInfo.uid).setValue(receivedPersonInfo);\n }",
"@Override\n public void onSuccess(final User user) {\n list.get(position).name = newName;\n notifyDataSetChanged();\n }",
"public static String updateUsersUName(String newName, String account){\n return \"update users set u_name = '\"+newName+\"' where u_accountnum = '\"+account+\"'\";\n }",
"private void CreateNewAccount(final String phone, final String password, final String name) {\n if (TextUtils.isEmpty(phone)){\n Toast.makeText(this,\"Please enter your phone number ...\",Toast.LENGTH_SHORT).show();\n }\n else if(TextUtils.isEmpty(password)){\n Toast.makeText(this,\"Please enter your phone password ...\",Toast.LENGTH_SHORT).show();\n }\n else if(TextUtils.isEmpty(name)){\n Toast.makeText(this,\"Please enter your phone name ...\",Toast.LENGTH_SHORT).show();\n }\n else{\n //start creating account\n LoadingBar.show();\n\n final DatabaseReference mRef;\n mRef = FirebaseDatabase.getInstance().getReference();\n mRef.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n if (!(snapshot.child(\"Users\").child(phone).exists())){\n //if user not exist then we create account in database\n HashMap<String,Object> userdata = new HashMap<>();\n userdata.put(\"phone\",phone);\n userdata.put(\"password\",password);\n userdata.put(\"name\",name);\n mRef.child(\"Users\").child(phone).updateChildren(userdata)\n .addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()){\n LoadingBar.dismiss();\n Toast.makeText(RegisterActivity.this,\"Registration Successful\",Toast.LENGTH_SHORT).show();\n }\n else{\n LoadingBar.dismiss();\n Toast.makeText(RegisterActivity.this,\"Please try again after sometime ....\",Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n else{\n LoadingBar.dismiss();\n Toast.makeText(RegisterActivity.this,\"User with this number already exist ....\",Toast.LENGTH_SHORT).show();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError error) {\n\n }\n });\n\n }\n }",
"public void UpdateData(View v){\n boolean isUpdated = myDB.updateData(et_id.getText().toString(),\n et_name.getText().toString(),\n et_surname.getText().toString(),\n et_marks.getText().toString());\n if(isUpdated){\n // show update message\n Toast.makeText(getApplicationContext(), \"Update successful.\", Toast.LENGTH_LONG).show();\n }else{\n Toast.makeText(getApplicationContext(), \"Update failure.\", Toast.LENGTH_LONG).show();\n }\n }",
"public void updateEntry(String userName, String password) {\n // create object of ContentValues\n ContentValues updatedValues = new ContentValues();\n // Assign values for each Column.\n updatedValues.put(\"USERNAME\", userName);\n updatedValues.put(\"PASSWORD\", password);\n\n String where = \"USERNAME = ?\";\n db.update(\"LOGIN\", updatedValues, where, new String[] { userName });\n }",
"@Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if (isNotAlreadyAdded(dataSnapshot, user)) {\n friendRef.setValue(user);\n mActivity.finish();\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n Demo_User demo_user = new Demo_User();\n demo_user.setEmail(editEmail.getText().toString());\n demo_user.setPassword(editPassword.getText().toString());\n demo_user.setName(editName.getText().toString());\n demo_user.setPhone(editPhone.getText().toString());\n\n //user email to key\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(demo_user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Snackbar.make(rootLayout,\"Register success fully\",Snackbar.LENGTH_LONG).show();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(rootLayout,\"Failed\" + e.getMessage(),Snackbar.LENGTH_LONG).show();\n }\n });\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n view = inflater.inflate(R.layout.company_activity_profile, container, false);\n\n b3 = getArguments();\n username = b3.getString(\"username\");\n myRef = database.getReference(\"companies/\"+username+\"/profile\");\n\n\n\n\n\n\n companyName = view.findViewById(R.id.companyName1);\n address = view.findViewById(R.id.address1);\n city = view.findViewById(R.id.city1);\n contact = view.findViewById(R.id.contact1);\n update = view.findViewById(R.id.update);\n\n\n\n\n\n\n update.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(\"Are you sure to update details\")\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n\n boolean valid = validate(companyName.getText().toString(),\n address.getText().toString(), city.getText().toString(), contact.getText().toString());\n if (valid) {\n\n try {\n myRef.child(\"companyName\").setValue(companyName.getText().toString());\n myRef.child(\"address\").setValue(address.getText().toString());\n myRef.child(\"city\").setValue(city.getText().toString());\n myRef.child(\"contact\").setValue(contact.getText().toString());\n Toast.makeText(getActivity(), \"Details Updated \\n Sucessfully\", Toast.LENGTH_LONG).show();\n } catch (Exception e) {\n Toast.makeText(getActivity(), \"error updating\", Toast.LENGTH_LONG);\n }\n }\n else{\n Toast.makeText(getActivity(),\"Correct the details\",Toast.LENGTH_LONG).show();\n }\n\n }\n }).setNegativeButton(\"cancel\",null);\n AlertDialog alert = builder.create();\n alert.show();\n }\n });\n\n\n\n\n\n\n\n\n\n myRef.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n // This method is called once with the initial value and again\n // whenever data at this location is updated.\n value = dataSnapshot;\n // Toast.makeText(getActivity(),\" loading\",Toast.LENGTH_LONG ).show();\n try {\n companyName.setText(value.child(\"companyName\").getValue().toString());\n city.setText(value.child(\"city\").getValue().toString());\n address.setText(value.child(\"address\").getValue().toString());\n contact.setText(value.child(\"contact\").getValue().toString());\n }\n catch(Exception e){\n Toast.makeText(getActivity(),\"error loading\",Toast.LENGTH_LONG ).show();\n }\n }\n\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }\n });\n return view;\n }",
"void save_Online(String firebase_id){\n\n DatabaseReference records_ref =\n FirebaseDatabase.getInstance().getReference(getResources().getString(R.string.records_ref));\n DatabaseReference all_users_ref =\n FirebaseDatabase.getInstance().getReference(getResources().getString(R.string.all_users));\n\n User_Class klinuser = common.userBundle(registration_bundle);\n\n if (klinuser != null){\n String cell_number = \"0\"+String.valueOf(klinuser.getNumber());\n records_ref.child(cell_number).child(\"uid\").setValue(klinuser.getFirebaseID());\n\n //save user details to All_Users/Biography/Uid\n all_users_ref.child(firebase_id).setValue(klinuser);\n loadBioData_online(firebase_id);\n }\n\n\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String fullname = dataSnapshot.child(\"fullname\").getValue(String.class);\n String username = dataSnapshot.child(\"username\").getValue(String.class);\n String password = dataSnapshot.child(\"password\").getValue(String.class);\n point = dataSnapshot.child(\"point\").getValue(int.class);\n txtPoint.setText(\"Yout point: \"+point);\n user = new User(username, fullname, password, point);\n }",
"@Override\n public void onDataChange(@NonNull DataSnapshot snapshot) {\n for(DataSnapshot user: snapshot.getChildren()) {\n if((user.child(\"username\").getValue().equals(username)))\n {\n isValidUser = true;\n if((user.child(\"password\").getValue().equals(password)))\n {\n if((boolean)user.child(\"principal\").getValue()) {\n activity.changeView(new PrincipalView(activity));\n }\n else {\n isValidPassword = true;\n activity.setThisUser(new User(username, password, activity.getDeviceID(), true));\n activity.getDatabase().getReference(\"Users\").child(username).setValue(new User(username, password, activity.getDeviceID(), true));\n activity.changeView(new TeacherPortal(activity));\n break;\n }\n }\n }\n }\n if(!isValidUser) {\n enterUsername.setError(\"Please enter a valid username!\");\n }\n if(!isValidPassword) {\n enterPassword.setError(\"Please enter a valid password!\");\n }\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n String dvalue = dataSnapshot.getValue(String.class);\n\n FirebaseDatabase database = FirebaseDatabase.getInstance();\n DatabaseReference upd = database.getReference(\"Info\").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).child(\"olddate\");\n upd.setValue(dvalue);\n\n }",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n UserProfile userProfile = dataSnapshot.getValue(UserProfile.class);\n profileName.setText(userProfile.getname());\n profileEmail.setText(userProfile.getemail());\n profilePhone.setText(userProfile.getphone());\n /* profileName.setText(fname);\n profileEmail.setText(cemail);\n profilePhone.setText(cphone);*/\n\n\n\n }",
"private void updateUser() {\n if (\"\".equals(txtFirstname.getText()) || \"\".equals(txtLastname.getText()) || \"\".equals(txtEmail.getText())) {\n JOptionPane.showMessageDialog(null, \"Select a user to update\");\n } else {\n try {\n //Updates record of selected user\n System.out.println(User);\n String sql = \"UPDATE Accounts SET Firstname = '\" + txtFirstname.getText() + \"', Lastname = '\" + txtLastname.getText() + \"', Email = '\" + txtEmail.getText() + \"' WHERE Username = '\" + User + \"'\";\n\n ps = con.prepareStatement(sql);\n ps.executeUpdate();\n showUserData();\n JOptionPane.showMessageDialog(null, User + \" Your information has been updated\");\n\n } catch (SQLException ex) {\n System.out.println(\"Error: \" + ex);\n Logger.getLogger(myAccount.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"public void update() {\n Log.d(TAG, \"Updating database\");\n databaseRef.child(TAG).setValue(events);\n Log.d(TAG, \"Database update complete\");\n }",
"public void readUsername(String id){\n databaseReference = FirebaseDatabase.getInstance().getReference(\"Users/\"+ id +\"/username\");\n databaseReference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n String database_username = dataSnapshot.getValue().toString();\n username.setText(database_username);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n Toast.makeText(getActivity(), \"Unable to retrieve username\", Toast.LENGTH_SHORT);\n }\n });\n }",
"@Override\n public void onClick(View v) {\n if(editName.getText().toString().isEmpty() || editEmail.getText().toString().isEmpty() || editStudentID.getText().toString().isEmpty() || editAddress.getText().toString().isEmpty() || editStudentID.getText().toString().isEmpty() || editProfession.getText().toString().isEmpty()){\n Toast.makeText(EditProfile.this, \"Fields not valid\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n //update users registered email\n String email = editEmail.getText().toString();\n user.updateEmail(email).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n //update the users information\n public void onSuccess(Void aVoid) {\n DocumentReference ref = fStore.collection(\"users\").document(user.getUid());\n Map<String,Object> edited = new HashMap<>();\n edited.put(\"Address\",editAddress.getText().toString());\n edited.put(\"Email\",editEmail.getText().toString());\n edited.put(\"FullName\",editName.getText().toString());\n edited.put(\"Profession\",editProfession.getText().toString());\n edited.put(\"UTAid\",editStudentID.getText().toString());\n ref.update(edited).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(EditProfile.this, \"Profile Updated\", Toast.LENGTH_SHORT).show();\n startActivity(new Intent(getApplicationContext(), Profile.class));\n finish();\n }\n });\n Toast.makeText(EditProfile.this, \"Email is Updated\", Toast.LENGTH_SHORT).show();\n startActivity(new Intent(getApplicationContext(), Profile.class));\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(EditProfile.this, e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n });\n }",
"private void addMember(String firstName, String lastName, String emailId) {\n Log.e(\"AddMember\", \"Fn \" + firstName + \", Ln \" + lastName + \"eid \" + emailId);\n\n\n// myRef.setValue(\"Hello, World!\");\n String key = myRef.push().getKey();\n Log.e(\"AddMember\", \"key \" + key);\n\n CoreMember member = new CoreMember(firstName, lastName, emailId);\n myRef.child(key).setValue(member, new DatabaseReference.CompletionListener() {\n @Override\n public void onComplete(DatabaseError databaseError, DatabaseReference databaseReference) {\n if (databaseError != null) {\n System.out.println(\"Data could not be saved \" + databaseError.getMessage());\n } else {\n System.out.println(\"Data saved successfully.\" + databaseReference.toString());\n memberKey = databaseReference.getKey();\n hideInputForm(true);\n\n }\n }\n });\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n Users user = new Users();\n user.setEmail(inputEmail.getText().toString());\n user.setName(inputName.getText().toString());\n user.setPhone(inputPhoneNumber.getText().toString());\n user.setPassword(inputPassword.getText().toString());\n\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Snackbar.make(relativeLayoutsignup,\"SignUp Successfully\",Snackbar.LENGTH_SHORT)\n .show();\n\n startActivity(new Intent(SignUpActivity.this,SignInActivity.class));\n finish();\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(relativeLayoutsignup,\"Failed\"+e.getMessage(),Snackbar.LENGTH_SHORT)\n .show();\n }\n });\n }",
"void updateUserById(String username, User userData);",
"public static boolean FireBaseAddWord(String source,String target,String userId){\n\r\n FirebaseDatabase firebaseDatabase = FirebaseDatabase.getInstance();\r\n DatabaseReference root = firebaseDatabase.getReference(\"words\").child(userId); // Firebase database table path.\r\n\r\n Map wordMap = new HashMap(); // Set word information in map\r\n\r\n wordMap.put(\"source\",source);\r\n wordMap.put(\"target\",target);\r\n wordMap.put(\"time\",ServerValue.TIMESTAMP);\r\n\r\n root.push().updateChildren(wordMap).addOnCompleteListener(new OnCompleteListener() {\r\n @Override\r\n public void onComplete(@NonNull Task task) { // Update Database\r\n if(task.isSuccessful()){\r\n setAddWordIsSuccessful(true);\r\n }else {\r\n setAddWordIsSuccessful(false);\r\n }\r\n }\r\n });\r\n\r\n\r\n return addWordIsSuccessful;\r\n\r\n\r\n }",
"private void updateUserDoc(){\n FirebaseFirestore db = FirebaseFirestore.getInstance();\n\n Map<String, Object> userData = new HashMap<>();\n userData.put(\"name\", FieldValue.delete());\n userData.put(\"updated\", new Timestamp(new Date()));\n\n db.collection(\"users\")\n .document(mUser.getUid())\n .set(userData, SetOptions.merge())\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(LOG_TAG, \"Document successfully written.\");\n\n // Proceed to the main activity\n Intent intent = new Intent(LoginActivity.this, MainActivity.class);\n startActivity(intent);\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.e(LOG_TAG, \"Error writing document.\", e);\n Toast.makeText(LoginActivity.this, \"Database Error\", Toast.LENGTH_SHORT)\n .show();\n\n setVisibleView(SignInView.SIGN_IN); // Show the Sign In Button\n }\n });\n }",
"private void addUserChangeListener() {\n // User data change listener\n mFirebaseDatabase.child(bookId).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n Book book = dataSnapshot.getValue(Book.class);\n\n // Check for null\n if (book== null) {\n Log.e(TAG, \"User data is null!\");\n return;\n }\n\n Log.e(TAG, \"User data is changed!\" + book.book_email );\n\n\n\n Book_email.setText(\"\");\nBook_phone.setText(\"\");\n Book_title.setText(\"\");\n toggleButton();\n }\n\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.e(TAG, \"Failed to read user\", error.toException());\n }\n });\n }",
"public void updateUser() {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"update users set first_name='\" + firstName + \"', \";\n query += \"last_name='\" + lastName + \"', \";\n query += \"phone_number='\" + phoneNumber + \"', \";\n query += \"email='\" + email + \"', \";\n query += \"address='\" + address + \"', \";\n query += \"id_city='\" + idCity + \"' \";\n query += \"where id_user = \" + id;\n stmt.executeUpdate(query);\n\n User updatedUser = findUser(id);\n updatedUser.setFirstName(firstName);\n updatedUser.setLastName(lastName);\n updatedUser.setPhoneNumber(phoneNumber);\n updatedUser.setEmail(email);\n updatedUser.setIdCity(idCity);\n updatedUser.setAddress(address);\n\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n User user = new User();\n user.setEmail(edtMail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n user.setName(edtName.getText().toString());\n user.setPhone(edtPhone.getText().toString());\n Log.d(\"RRR\", \"OKET\" + user);\n\n users.child(FirebaseAuth.getInstance().getCurrentUser().getUid())\n .setValue(user)\n .addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void unused) {\n Snackbar.make(rootLayout, \"Register success\", Snackbar.LENGTH_SHORT)\n .show();\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Snackbar.make(rootLayout, \"Failed\" + e.getMessage(), Snackbar.LENGTH_SHORT)\n .show();\n }\n });\n }",
"private void writeNewUser(String userId, String name, String email) {\n User user = new User(name, email);\n\n mDatabase.child(\"users\")\n .child(userId)\n .child(\"Name\").setValue(name);\n\n mDatabase.child(\"users\")\n .child(userId)\n .child(\"Email\").setValue(email);\n\n\n }",
"public void updateUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk updateUser\");\r\n\t}",
"private void updateUser(final String preemail, final String name, final String email, final String mobile, final String premobile) {\n String tag_string_req = \"req_update\";\n\n pDialog.setMessage(\"Updating ...\");\n showDialog();\n\n StringRequest strReq = new StringRequest(Request.Method.POST,\n AppConfig.URL_Update, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n Log.d(TAG, \"Register Response: \" + response);\n hideDialog();\n\n try {\n JSONObject jObj = new JSONObject(response);\n boolean error = jObj.getBoolean(\"error\");\n if (!error) {\n // User successfully stored in MySQL\n // Now store the user in sqlite\n String uid = jObj.getString(\"uid\");\n\n JSONObject user = jObj.getJSONObject(\"user\");\n String name = user.getString(\"name\");\n String email = user.getString(\"email\");\n String created_at = user\n .getString(\"created_at\");\n String mobile =user.getString(\"mobile\");\n\n // Inserting row in users table\n\n if(db.addUser(name, email, mobile, uid, created_at)) {\n Toast.makeText(getActivity().getApplicationContext(), \"successfully Updated Thank YOu!\", Toast.LENGTH_LONG).show();\n }\n if(!preemail.equals(email) || !premobile.equals(mobile)){\n Toast.makeText(getActivity().getApplicationContext(), \"Login again\", Toast.LENGTH_LONG).show();\n db.deleteUsers();\n HomeFragment.session(false);\n Intent i = new Intent(getActivity().getApplicationContext(),\n LoginActivity.class);\n startActivity(i);\n getActivity().finish();\n }\n\n } else {\n\n // Error occurred in registration. Get the error\n // message\n String errorMsg = jObj.getString(\"error_msg\");\n Toast.makeText(getActivity().getApplicationContext(),\n errorMsg, Toast.LENGTH_LONG).show();\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.e(TAG, \"Registration Error: \" + error.getMessage());\n Toast.makeText(getActivity().getApplicationContext(),\n error.getMessage(), Toast.LENGTH_LONG).show();\n hideDialog();\n }\n }) {\n\n @Override\n protected Map<String, String> getParams() {\n // Posting params to register url\n Map<String, String> params = new HashMap<>();\n params.put(\"preemail\",preemail);\n params.put(\"name\", name);\n params.put(\"email\", email);\n params.put(\"mobile\", mobile);\n return params;\n }\n\n };\n\n // Adding request to request queue\n AppController.getInstance().addToRequestQueue(strReq, tag_string_req);\n }",
"public void status(String status)\r\n {\r\n reference=FirebaseDatabase.getInstance().getReference(\"Users\").child(firebaseUser.getUid());\r\n HashMap<String,Object>hashMap=new HashMap<>() ;\r\n hashMap.put(\"status\",status) ;\r\n reference.updateChildren(hashMap);\r\n }",
"public void updateUser(User oldUser, User newUser) ;",
"public void mySaveInfo(View view){\n\n String fname = fName.getText().toString();\n String lname = lName.getText().toString();\n String my_address = address.getText().toString();\n\n // Checks field for empty or not\n if(isEmptyField(fName))return;\n if(isEmptyField(lName))return;\n if(isEmptyField(address))return;\n\n Map<String,Object> myMap = new HashMap<String,Object>();\n myMap.put(KEY_FNAME,fname);\n myMap.put(KEY_LNAME,lname);\n myMap.put(KEY_ADDRESS, my_address);\n myMap.put(\"role\", \"user\");\n\n /*\n By geting rid of the document, Firestore will generate a new Id each time a\n new user is created.\n */\n db.collection(\"users\").document(RegisteredUserID)\n .set(myMap).addOnSuccessListener(new OnSuccessListener<Void>() {\n @Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(UserSignUp.this, \"User Saved\", Toast.LENGTH_SHORT).show();\n // This should go to the home screen if the user is succesfully entered\n startActivity(new Intent(UserSignUp.this,MainActivity.class));\n }\n }).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(UserSignUp.this, \"Error!\", Toast.LENGTH_SHORT).show();\n Log.d(TAG, e.toString());\n }\n });\n }",
"public void onAccountCreate()\n {\n //Object ne=new Object();\n Log.d(\"stupid\", \"onAccountCreate: \");\n fName=firstName.getText().toString();\n lName=lastName.getText().toString();\n con=contact.getText().toString();\n addr=address.getText().toString();\n bGrp=bloodGroup.getText().toString();\n\n mRef2 = FirebaseDatabase.getInstance().getReference().child(\"donordata\").getRef();\n\n Map<String,Object> donorMap=new HashMap<String, Object>();\n Map<String,Object> x= new HashMap<String, Object>();\n\n\n String id= mRef2.push().getKey();\n Log.d(\"keyTAG\", \"onAccountCreate: \"+mRef2.push().getKey());\n x.put(\"id\",id);\n x.put(\"firstname\", fName);\n x.put(\"lastname\", lName);\n x.put(\"address\", addr);\n x.put(\"bloodgroup\", bGrp);\n x.put(\"contact\", con);\n\n\n\n donorMap.put(fName,x);\n\n mRef2.updateChildren(donorMap);\n Toast.makeText(BloodDonorsActivity.this,\"Your account has been successfully created. Thank you!\",Toast.LENGTH_LONG).show();\n Intent backToLogin=new Intent(BloodDonorsActivity.this,LoginActivity.class);\n startActivity(backToLogin);\n\n\n //mRef2.setValue(donorMap);\n\n\n\n //Toast.makeText(BloodDonorsActivity.this, \"Your details are not valid!\", Toast.LENGTH_LONG).show();\n\n\n\n }",
"public static void update() {\n\t\t// TODO Auto-generated method stub\n\t\t\tString jdbcURL = \"jdbc:mysql://localhost:3306/sampldb\";\n\t String dbUsername=\"root\";\n\t String dbPassword=\"password\";\n\t \n\t \n\t \n\t System.out.println(\"Database Connected Successfully\");\n\t\t \n\t\t \n\t\t/* System.out.println(\"Which operation you want to execute \\n 1.Insert into table.\\n 2.Update table \\n 3.Delete data from table \\n 4.Show the data\");\n\t */\n\t Scanner in=new Scanner(System.in);\n\t \n\t System.out.println(\"Enter New password\");\n\t String password=in.nextLine();\n\t System.out.println(\"Enter fullname\");\n\t String fullname=in.nextLine();\n\t System.out.println(\"Enter email\");\n\t String email=in.nextLine();\n\t System.out.println(\"user name\");\n\t String username=in.nextLine();\n\t \n\t {\n\t \t \n\t \n\t try {\n\t Connection connection = DriverManager.getConnection(jdbcURL,dbUsername,dbPassword);\n\t \n\t String sql=\"UPDATE users SET password=?,fullname=?,email=? WHERE username=?\";\n\t \t PreparedStatement statement=connection.prepareStatement(sql);\n\t \t \n\t \t statement.setString(1, password);\n\t \t statement.setString(2, fullname);\n\t \t statement.setString(3, email);\n\t \t statement.setString(4, username);\n\t \t \n\t \t \n\t \t int rows=statement.executeUpdate();\n\t \t \n\t \t if(rows>0) {\n\t \t\t System.out.println(\"Updated succssfully\");\n\t \t }\n\t \t \n\t \t \n\t \t connection.close();\n\t \t \n\t }\n\t \n\t catch(SQLException ex) {\n\t \tex.printStackTrace();\n\t }\n\t\t\t\n\t\t}\n\n\t}",
"public void updateContact(View v){\n\n String uid = appState.firebaseReference.push().getKey();\n String businessID = ubidField.getText().toString();\n String name = unameField.getText().toString();\n String location = ulocationField.getText().toString();\n String primaryBiz = uprimaryBizField.getText().toString();\n String address = uaddressField.getText().toString();\n\n Map<String, Object> businessUpdate = receivedPersonInfo.toMap();\n businessUpdate.put(\"uid\", uid);\n businessUpdate.put(\"bid\", businessID);\n businessUpdate.put(\"name\", name);\n businessUpdate.put(\"primaryBiz\", primaryBiz);\n businessUpdate.put(\"address\", address);\n businessUpdate.put(\"location\", location);\n\n appState.firebaseReference.child(receivedPersonInfo.uid).setValue(businessUpdate);\n finish();\n Intent intent=new Intent(this, MainActivity.class);\n startActivity(intent);\n }",
"private void updateUserList() {\n\t\tUser u = jdbc.get_user(lastClickedUser);\n\t\tString s = String.format(\"%s, %s [%s]\", u.get_lastname(), u.get_firstname(), u.get_username());\n\t\tuserList.setElementAt(s, lastClickedIndex);\n\t}",
"@Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n if (dataSnapshot.child(edtPhone.getText().toString()).exists()) {\n\n mDialog.dismiss();\n\n Toast.makeText(SignUp.this, \"Phone number already register as a User\", Toast.LENGTH_SHORT).show();\n } else {\n mDialog.dismiss();\n\n User user = new User(edtName.getText().toString(), edtPassword.getText().toString(),\"false\");\n table_user.child(code.getText().toString() + \"\" + edtPhone.getText().toString()).setValue(user);\n//\n Toast.makeText(SignUp.this, \"Sign Up successfully!!\", Toast.LENGTH_SHORT).show();\n// finish();\n }\n }",
"private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }",
"private void addTitle() {\n\n if (!TextUtils.isEmpty(nameInput.getText().toString())) {\n\n String id = myRef.push().getKey();\n\n User user = new User(name.getText().toString(), nameInput.getText().toString().trim(), id);\n myRef.child(id).setValue(user);\n\n Toast.makeText(this, \"Job Role updated\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(this, \"Type job role\", Toast.LENGTH_LONG).show();\n ;\n }\n\n tittle.setText(nameInput.getText().toString());\n\n nameInput.setText(\"\");\n }",
"public void Update_Person(final String name, final String new_name){\n realm.executeTransactionAsync(new Realm.Transaction() {\n @Override\n public void execute(Realm bgRealm) {\n\n Person user = bgRealm.where(Person.class).equalTo(\"name\", name).findFirst();\n\n user.setName(new_name);\n }\n }, new Realm.Transaction.OnSuccess() {\n @Override\n public void onSuccess() {\n // Original queries and Realm objects are automatically updated.\n //puppies.size(); // => 0 because there are no more puppies younger than 2 years old\n //managedDog.getAge(); // => 3 the dogs age is updated\n }\n });\n }"
] | [
"0.77359",
"0.7319283",
"0.7124128",
"0.71096796",
"0.7047744",
"0.70388687",
"0.7030874",
"0.67454714",
"0.6734476",
"0.66731566",
"0.65902233",
"0.6590175",
"0.6572434",
"0.65494734",
"0.6545922",
"0.65298253",
"0.65106994",
"0.647168",
"0.64594895",
"0.64121836",
"0.64014274",
"0.6379894",
"0.63666534",
"0.6346513",
"0.63278204",
"0.63175744",
"0.63011694",
"0.629212",
"0.6288658",
"0.6255938",
"0.6230214",
"0.6217809",
"0.62128174",
"0.6193802",
"0.61783963",
"0.6168678",
"0.6168546",
"0.6155709",
"0.6154863",
"0.61541396",
"0.61464113",
"0.6142915",
"0.6141963",
"0.6128562",
"0.6110082",
"0.61093795",
"0.61075443",
"0.6103268",
"0.61000675",
"0.60980994",
"0.60770583",
"0.60740405",
"0.6049559",
"0.6035868",
"0.603564",
"0.6024262",
"0.6018528",
"0.6013312",
"0.6013233",
"0.60126704",
"0.6001259",
"0.59964",
"0.59955186",
"0.5992538",
"0.5990741",
"0.59897244",
"0.5986949",
"0.5977434",
"0.59683424",
"0.5962868",
"0.59594685",
"0.5956149",
"0.5946005",
"0.59412885",
"0.59408736",
"0.5938962",
"0.59305423",
"0.59303236",
"0.5925838",
"0.59238136",
"0.5921072",
"0.591538",
"0.590265",
"0.5897527",
"0.589304",
"0.58885247",
"0.5886673",
"0.58826375",
"0.58822453",
"0.5878647",
"0.5870647",
"0.58528227",
"0.58498055",
"0.58483434",
"0.5848229",
"0.5841415",
"0.58404154",
"0.583962",
"0.5839103",
"0.58332247"
] | 0.6888568 | 7 |
Export des factures clients | @Retryable(
maxAttempts = Application.retry_max_attempt,
backoff = @Backoff(delay = 5000))
@ResponseBody
@ApiOperation(value = "Export des factures clients (quelque soit le lient si admin connecté, ses propres factures si client connecté)")
@ApiResponses(value = {
@ApiResponse(code = 401, message = "Vous devez être identifié pour effectuer cette opération"),
@ApiResponse(code = 403, message = "Vous n'êtes pas autorisé à effectuer cette action (reservés aux admins ou opérateurs ayant droits, ou aux clients pour leurs propres factures)"),
@ApiResponse(code = 200, message = "CSV des factures clients")
})
@RequestMapping(
produces = "application/json",
value = "/factures/client/export",
method = RequestMethod.GET)
@CrossOrigin
public ResponseEntity<byte[]> export(
@ApiParam(value = "Date de début", required = true) @RequestParam("date_debut") String date_debut,
@ApiParam(value = "Date de fin", required = true) @RequestParam("date_fin") String date_fin,
@ApiParam(value = "Jeton JWT pour autentification", required = true) @RequestParam("Token") String token) throws Exception {
// vérifie que le jeton est valide et que les droits lui permettent de consulter les admin katmars
if (!jwtProvider.isValidJWT(token)) {
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Jeton invalide, veuillez vous reconnecter.");
}
if (!SecurityUtils.admin(jwtProvider, token) && !SecurityUtils.client(jwtProvider, token) && !SecurityUtils.client_personnelWithDroit(jwtProvider, token, ClientPersonnelListeDeDroits.VOIR_FACTURES)) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Vous n'avez pas le droit d'effectuer cette opération.");
}
Date dateDebut = new SimpleDateFormat("yyyy-MM-dd").parse(date_debut);
Date dateFin = new SimpleDateFormat("yyyy-MM-dd").parse(date_fin);
Calendar dateMin = new GregorianCalendar();
dateMin.setTime(dateDebut);
dateMin.set(Calendar.HOUR_OF_DAY, 0);
dateMin.set(Calendar.MINUTE, 0);
dateMin.set(Calendar.SECOND, 0);
Calendar dateMax = new GregorianCalendar();
dateMax.setTime(dateFin);
dateMax.set(Calendar.HOUR_OF_DAY, 23);
dateMax.set(Calendar.MINUTE, 59);
dateMax.set(Calendar.SECOND, 59);
String order_column_bdd = "createdOn";
String sort_bdd = "asc";
Integer numero_page = 0;
Integer length = 999999;
// filtrage par date
Specification spec = new Specification<ActionAudit>() {
public Predicate toPredicate(Root<ActionAudit> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.greaterThanOrEqualTo(root.get(order_column_bdd), dateMin.getTime()));
predicates.add(builder.lessThanOrEqualTo(root.get(order_column_bdd), dateMax.getTime()));
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
};
// filtre par client si c'est demandé par un client
if (SecurityUtils.client(jwtProvider, token)) {
Client client = clientService.getByUUID(jwtProvider.getClaimsValue("uuid_client", token), jwtProvider.getCodePays(token));
if (client != null) {
Specification spec2 = new Specification<ActionAudit>() {
public Predicate toPredicate(Root<ActionAudit> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.equal(root.get("client"), client));
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
};
spec = spec.and(spec2);
}
}
// préparation les deux requêtes (résultat et comptage)
Page<FactureClient> leads = factureClientService.getAllPagined(order_column_bdd, sort_bdd, numero_page, length, spec);
// convertion liste en excel
byte[] bytesArray = null;
// convertion en facture minimal (pour éviter d'avoir tous les attributs) si client
if (SecurityUtils.client(jwtProvider, token)) {
List<FactureClientMinimal> factures_clents_minimal = new ArrayList<FactureClientMinimal>();
for (FactureClient facture_client : leads.getContent()) {
factures_clents_minimal.add(new FactureClientMinimal(facture_client));
}
Map<String, String> entetes_a_remplacer = new HashMap<String, String>();
entetes_a_remplacer.put("/dateFacture", "Date de Facturation");
entetes_a_remplacer.put("/numeroFacture", "Numéro de Facture");
entetes_a_remplacer.put("/listeOperations", "Liste des opérations");
entetes_a_remplacer.put("/montantHT", "Montant HT");
entetes_a_remplacer.put("/remisePourcentage", "Remise (%)");
entetes_a_remplacer.put("/montantTVA", "Montant TVA");
entetes_a_remplacer.put("/montantTTC", "Montant TTC");
entetes_a_remplacer.put("/netAPayer", "Net à payer");
bytesArray = exportExcelService.export(new PageImpl<>(factures_clents_minimal), entetes_a_remplacer);
} else {
bytesArray = exportExcelService.export(leads, null);
}
// audit
actionAuditService.exportFacturesClient(token);
return ResponseEntity.ok()
//.headers(headers) // add headers if any
.contentLength(bytesArray.length)
.contentType(MediaType.parseMediaType("application/vnd.ms-excel"))
.body(bytesArray);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface CatalogueClient {\n\n\tList<Exoplanet> getCatalogue();\n\n}",
"public interface InterfaceServeurClient extends Remote {\n\n\tpublic void setServeur(InterfaceServeurClient serveur) throws RemoteException;\n\tpublic void setListeClient(ArrayList<InterfaceServeurClient> client) throws RemoteException;\n\tpublic Partie getPartie() throws RemoteException;\n\tpublic void ajouterClient(InterfaceServeurClient client) throws RemoteException;\n\tpublic boolean retirerClient(InterfaceServeurClient client) throws RemoteException;\n\tpublic InterfaceServeurClient getServeur() throws RemoteException;\n\tpublic String getNamespace() throws RemoteException;\n\tpublic String getNomJoueur() throws RemoteException;\n\tpublic int getIdObjetPartie() throws RemoteException;\n\tpublic void setIdObjetPartie(int idObjetPartie) throws RemoteException;\n\tpublic ArrayList<Dynastie> getListeDynastie() throws RemoteException;\n\tpublic void setListeDynastie(ArrayList<Dynastie> liste) throws RemoteException;\n\tpublic ArrayList<Dynastie> getListeDynastieDispo() throws RemoteException;\n\tpublic void setJoueur(Joueur j) throws RemoteException;\n\n\tpublic boolean deconnecter() throws RemoteException;\n\n\tpublic void notifierChangement(ArrayList<Object> args) throws RemoteException;\n\tpublic void addListener(ChangeListener listener) throws RemoteException;\n\tpublic void removeListener(ChangeListener listener) throws RemoteException;\n\tpublic void clearListeners() throws RemoteException;\n\tpublic Joueur getJoueur() throws RemoteException;\n\tpublic void setPartieCourante(Partie partie) throws RemoteException;\n\tpublic ArrayList<InterfaceServeurClient> getClients() throws RemoteException;\n\tpublic boolean send(Action action, int idClient) throws RemoteException;\n\tpublic void passerTour() throws RemoteException;\n\n\tpublic void switchJoueurEstPret(InterfaceServeurClient client) throws RemoteException;\n\tpublic void switchJoueurPret() throws RemoteException;\n\tpublic boolean setDynastieOfClient(InterfaceServeurClient client, Dynastie dynastie) throws RemoteException;\n\tpublic void setDynastie(Dynastie d) throws RemoteException;\n\tpublic void libererDynastie(Dynastie d) throws RemoteException;\n\tpublic int getUniqueId() throws RemoteException;\n\n\tpublic void envoyerNouveauConflit(Conflits conflit, int idClient) throws RemoteException;\n\tpublic void envoyerRenforts(ArrayList<TuileCivilisation> renforts, Joueur joueur) throws RemoteException;\n\tpublic boolean piocherCartesManquantes(Joueur j) throws RemoteException;\n\tpublic void finirPartie() throws RemoteException;\n\tpublic void envoyerPointsAttribues(Joueur joueur) throws RemoteException;\n\tpublic ArrayList<Joueur> recupererListeJoueurPartie() throws RemoteException;\n\tpublic void chargerPartie() throws RemoteException;\n}",
"public ClientsSpeicher() {\n mDb = new MyArrowDB().getInstance();\n }",
"private ExportUsers() {}",
"public interface InterfaceClient extends Remote {\n\n double seConnecter(Client client) throws RemoteException;\n\n \n\n boolean peutReserver(Reservation rv) throws RemoteException;\n\n void visualiser(Vehicule voiture) throws RemoteException;\n\n \n \n \n void deconnexion() throws RemoteException;\n\n boolean sinscrire(Client client) throws RemoteException;\n\n void inscriptionReussite(Client client) throws RemoteException;\n}",
"@Override\n\tpublic void createClient() {\n\t\t\n\t}",
"private RepositorioOrdemServicoHBM() {\n\n\t}",
"public interface SupplierIndexService {\n\n /**\n * 供应商全量脚本\n */\n @Export\n Response<Boolean> fullDump();\n\n /**\n * 供应商增量脚本\n * @param interval 时间间隔,单位分钟,一般为15分钟\n */\n @Export(paramNames = {\"interval\"})\n Response<Boolean> deltaDump(int interval);\n\n /**\n *\n * @param ids 供应商id列表\n * @param status 供应商状态\n */\n Response<Boolean> realTimeIndex(List<Long> ids, User.SearchStatus status);\n}",
"public interface ClientsInterface {\r\n\t/**\r\n\t * Gibt die Anzahl an Kunden in der Warteschlange an.\r\n\t * @return\tAnzahl an Kunden in der Warteschlange\r\n\t */\r\n\tint count();\r\n\r\n\t/**\r\n\t * Legt fest, dass ein bestimmter Kunde für den Weitertransport freigegeben werden soll.\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t */\r\n\tvoid release(final int index);\r\n\r\n\t/**\r\n\t * Liefert den Namen eines Kunden\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return\tName des Kunden\r\n\t */\r\n\tString clientTypeName(final int index);\r\n\r\n\t/**\r\n\t * Liefert die ID der Station, an der der aktuelle Kunde erzeugt wurde oder an der ihm sein aktueller Typ zugewiesen wurde.\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return\tID der Station\r\n\t */\r\n\tint clientSourceStationID(final int index);\r\n\r\n\t/**\r\n\t * Liefert ein Client-Daten-Element eines Kunden\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param data\tIndex des Datenelements\r\n\t * @return\tDaten-Element des Kunden\r\n\t */\r\n\tdouble clientData(final int index, final int data);\r\n\r\n\t/**\r\n\t * Stellt ein Client-Daten-Element eines Kunden ein\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param data\tIndex des Datenelements\r\n\t * @param value\tNeuer Wert\r\n\t */\r\n\tvoid clientData(final int index, final int data, final double value);\r\n\r\n\t/**\r\n\t * Liefert ein Client-Textdaten-Element eins Kunden\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param key\tSchlüssel des Datenelements\r\n\t * @return\tDaten-Element des Kunden\r\n\t */\r\n\tString clientTextData(final int index, final String key);\r\n\r\n\t/**\r\n\t * Stellt ein Client-Textdaten-Element eines Kunden ein\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param key\tSchlüssel des Datenelements\r\n\t * @param value\tNeuer Wert\r\n\t */\r\n\tvoid clientTextData(final int index, final String key, final String value);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Wartezeit eines Kunden in Sekunden als Zahlenwert\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Wartezeit des Kunden\r\n\t * @see ClientsInterface#clientWaitingTime(int)\r\n\t */\r\n\tdouble clientWaitingSeconds(final int index);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Wartezeit eines Kunden in formatierter Form als Zeichenkette\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Wartezeit des Kunden\r\n\t * @see ClientsInterface#clientWaitingSeconds(int)\r\n\t */\r\n\tString clientWaitingTime(final int index);\r\n\r\n\t/**\r\n\t * Stellt die Wartezeit des Kunden ein.\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param time\tWartezeit des Kunden (in Sekunden)\r\n\t * @see ClientsInterface#clientWaitingSeconds(int)\r\n\t */\r\n\tvoid clientWaitingSecondsSet(final int index, final double time);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Transferzeit eines Kunden in Sekunden als Zahlenwert\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Transferzeit des Kunden\r\n\t * @see ClientsInterface#clientTransferTime(int)\r\n\t */\r\n\tdouble clientTransferSeconds(final int index);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Transferzeit eines Kunden in formatierter Form als Zeichenkette\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Transferzeit des Kunden\r\n\t * @see ClientsInterface#clientTransferSeconds(int)\r\n\t */\r\n\tString clientTransferTime(final int index);\r\n\r\n\t/**\r\n\t * Stellt die Transferzeit des Kunden ein.\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param time\tTransferzeit des Kunden (in Sekunden)\r\n\t * @see ClientsInterface#clientTransferSeconds(int)\r\n\t */\r\n\tvoid clientTransferSecondsSet(final int index, final double time);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Bedienzeit eines Kunden in Sekunden als Zahlenwert\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Bedienzeit des Kunden\r\n\t * @see ClientsInterface#clientProcessTime(int)\r\n\t */\r\n\tdouble clientProcessSeconds(final int index);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Bedienzeit eines Kunden in formatierter Form als Zeichenkette\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Bedienzeit des Kunden\r\n\t * @see ClientsInterface#clientProcessSeconds(int)\r\n\t */\r\n\tString clientProcessTime(final int index);\r\n\r\n\t/**\r\n\t * Stellt die Bedienzeit des Kunden ein.\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param time\tBedienzeit des Kunden (in Sekunden)\r\n\t * @see ClientsInterface#clientProcessSeconds(int)\r\n\t */\r\n\tvoid clientProcessSecondsSet(final int index, final double time);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Verweilzeit eines Kunden in Sekunden als Zahlenwert\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Verweilzeit des Kunden\r\n\t * @see ClientsInterface#clientResidenceTime(int)\r\n\t */\r\n\tdouble clientResidenceSeconds(final int index);\r\n\r\n\t/**\r\n\t * Liefert die bisherige Verweilzeit eines Kunden in formatierter Form als Zeichenkette\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @return Bisherige Verweilzeit des Kunden\r\n\t * @see ClientsInterface#clientResidenceSeconds(int)\r\n\t */\r\n\tString clientResidenceTime(final int index);\r\n\r\n\t/**\r\n\t * Stellt die Verweilzeit des Kunden ein.\r\n\t * @param index\t0-basierender Index des Kunden\r\n\t * @param time\tVerweilzeit des Kunden (in Sekunden)\r\n\t * @see ClientsInterface#clientResidenceSeconds(int)\r\n\t */\r\n\tvoid clientResidenceSecondsSet(final int index, final double time);\r\n}",
"@Override\n\tpublic void createClient(Client clt) {\n\t\t\n\t}",
"public ServeurGestion(int portClient){\r\n try {\r\n ecoute=new ServerSocket(portClient);\r\n appels=new Vector<>();\r\n } catch (IOException ex) {\r\n Logger.getLogger(ServeurGestion.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"public interface ExportableServiceConduit\r\n{\r\n /**\r\n * Register a service as added.\r\n * \r\n * @param serviceID an identifier for the service which should be unique within the meem server.\r\n * @param service the object providing the service.\r\n * @param itemList a list of Jini Entry objects.\r\n */\r\n public void serviceAdded(String serviceID, Remote service, List<?> itemList);\r\n\r\n /**\r\n * Register a service as removed.\r\n * \r\n * @param serviceID an identifier for the service which should be unique within the meem server.\r\n */\r\n public void serviceRemoved(String serviceID);\r\n}",
"@Override\n\tpublic SACliente generarSACliente() {\n\t\treturn new SAClienteImp();\n\t}",
"private static void runClient() {\n long clientStartTime = System.currentTimeMillis();\n \n // Pick a random entry point\n int entryPointId = random.nextInt(entryPointAddresses.size());\n String[] ep = entryPointAddresses.get(entryPointId);\n String entryPointCode = ep[0];\n String entryPointAddress = ep[1];\n \n // User number and id\n int userCount = COUNT.incrementAndGet();\n String userToken = (clientLocation + userCount + \"-\" + Math.abs(random.nextInt(1000)));\n User u = USER_RESOLVER.resolve(userToken);\n \n // Point the client to the entry point\n WebTarget webTarget = entryPointTarget(entryPointAddress, userToken);\n EntryPointResponse response = new EntryPointResponse(null, null);\n try {\n String responseJson = webTarget.request(MediaType.APPLICATION_JSON).get(String.class);\n response = Jsons.fromJson(responseJson, EntryPointResponse.class);\n } catch (Exception e) {\n LOG.log(Level.SEVERE, String.format(\"Could not load responses from entry point %s: %s\", ep[0], ep[1]));\n LOG.log(Level.SEVERE, \"Attempted to connect with: \" + webTarget.getUri().toString());\n }\n \n // current time after the response\n long clientEndTime = System.currentTimeMillis(); \n \n Double latency = null;\n if (response.getRedirectAddress() != null) {\n latency = latencies.get(response.getRedirectAddress());\n }\n \n writer.writeCsv(LOG_LENS, \n sdf.format(new Date()),\n clientStartTime - Main.clientStartTime,\n userCount,\n Main.clientLocation,\n entryPointCode,\n response.getSelectedCloudSiteCode(),\n clientEndTime - clientStartTime,\n latency == null ? \"null\" : String.format(\"%.2f\", latency),\n userToken,\n Arrays.toString(u.getCitizenships().toArray()),\n Arrays.toString(u.getTags().toArray()),\n response.getDefinition() == null ? \"null\" : response.getDefinition().getProviderCode(),\n response.getDefinition() == null ? \"null\" : response.getDefinition().getLocationCode(),\n response.getDefinition() == null ? \"null\" : Arrays.toString(response.getDefinition().getTags().toArray()),\n response.getDefinition() == null ? \"null\" : response.getDefinition().getCost()\n );\n //writer.flush();\n }",
"private void generate15Client(boolean isJsr109Platform, ProgressHandle handle) throws IOException {\n JAXWSClientSupport jaxWsClientSupport=null;\n if(project != null) {\n jaxWsClientSupport = JAXWSClientSupport.getJaxWsClientSupport(project.getProjectDirectory());\n }\n if(jaxWsClientSupport == null) {\n // notify no client support\n//\t\t\tString mes = MessageFormat.format (\n//\t\t\t\tNbBundle.getMessage (WebServiceClientWizardIterator.class, \"ERR_WebServiceClientSupportNotFound\"),\n//\t\t\t\tnew Object [] {\"Servlet Listener\"}); //NOI18N\n String mes = NbBundle.getMessage(WebServiceClientWizardIterator.class, \"ERR_NoWebServiceClientSupport\"); // NOI18N\n NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);\n DialogDisplayer.getDefault().notify(desc);\n handle.finish();\n return;\n }\n \n String wsdlUrl = (String)wiz.getProperty(ClientWizardProperties.WSDL_DOWNLOAD_URL);\n String filePath = (String)wiz.getProperty(ClientWizardProperties.WSDL_FILE_PATH);\n Boolean useDispatch = (Boolean) wiz.getProperty(ClientWizardProperties.USEDISPATCH);\n //if (wsdlUrl==null) wsdlUrl = \"file:\"+(filePath.startsWith(\"/\")?filePath:\"/\"+filePath); //NOI18N\n if(wsdlUrl == null){\n wsdlUrl = FileUtil.toFileObject(FileUtil.normalizeFile(new File(filePath))).toURL().toExternalForm();\n }\n String packageName = (String)wiz.getProperty(ClientWizardProperties.WSDL_PACKAGE_NAME);\n if (packageName!=null && packageName.length()==0) packageName=null;\n String clientName = jaxWsClientSupport.addServiceClient(getWsdlName(wsdlUrl),wsdlUrl,packageName, isJsr109Platform); \n if (useDispatch) {\n List clients = jaxWsClientSupport.getServiceClients();\n for (Object c : clients) {\n if (((Client)c).getName().equals(clientName)) {\n ((Client)c).setUseDispatch(useDispatch);\n }\n }\n JaxWsModel jaxWsModel = (JaxWsModel) project.getLookup().lookup(JaxWsModel.class);\n jaxWsModel.write();\n }\n handle.finish();\n }",
"public static void main(String[] args) {\n\t\tCpf cpf = new Cpf(\"10879780410\");\r\n\t\tCliente cliente = new Cliente(cpf,\"Diego\",18,400,0);\r\n\t\tIdentificadorConta id = new IdentificadorConta(100);\r\n\t\t//incluindo um cliente;\r\n\t\tIORepositorios<Cliente> io = new IORepositorios<Cliente>();\r\n\t\tCpf cpf2 = new Cpf(\"07416996481\");\r\n\t\tCliente c2 = new Cliente(cpf2,\"hazinho\",18,45000,0);\r\n\t\t\t//io.incluir(cliente);\r\n\t\t\t//io.alterar(cliente.getCpf().getCpf(), c2, true);\r\n\t\t\t//io.excluir(cliente.getCpf().getCpf(), true);\r\n\t\t\t//io.alterar(cliente.getCpf().getCpf(),(Cliente) c2, true);\r\n\t\t\tSystem.out.println(io.buscar(c2.getCpf().getCpf(), true));\r\n\t}",
"public void recuperarFacturasCliente(){\n String NIF = datosFactura.recuperarFacturaClienteNIF();\n ArrayList<Factura> facturas = almacen.getFacturas(NIF);\n if(facturas != null){\n for(Factura factura : facturas) {\n System.out.println(\"\\n\");\n System.out.print(factura.toString());\n }\n }\n System.out.println(\"\\n\");\n }",
"public static void main(String[] args) {\n\t\tClientService cs = new ClientService();\n\t\t\n\t\t//Utilisation de la classe\n\t\tcs.direBonjour();\n\t\tcs.direAurevoir();\n\t\tcs.jeSuisVip();\n\n\t\t\n\t\t//Declaration de l'interface\n\t\tIClientService s = new ClientService();\n\t\tIVipService vs = new ClientService();\n\t\tIVipService2 vs2 = new ClientService();\n\t\t\n\t\t//Utilisation de l'interface\n\t\tSystem.out.println(\"-----Client normal-----\");\n\t\ts.direBonjour();\n\t\ts.direAurevoir();\n\t\t//s.jeSuisVip();\n\t\tSystem.out.println(\"-----Client VIP-----\");\n\t\tvs.direBonjour();\n\t\tvs.direAurevoir();\n\t\tvs.jeSuisVip();\n\t\tvs2.direBonjour();\n\t\tvs2.direAurevoir();\n\t\tvs2.jeSuisVip();\n\n\t}",
"public interface ExportStrategy {\r\n public String getFileName();\r\n public Collection getCollection();\r\n public Class getClazz();\r\n\r\n}",
"public void printClientList() {\n uiService.underDevelopment();\n }",
"@Remote\npublic interface PasseUneCommande {\n\n public Commande passeUneCommande(Double prixHT,String rendezvous,String cookies);\n\n public List<String> choisirCookies();\n\n public List<Commande> getCommandes();\n\n\n}",
"public Interfaz_RegistroClientes() {\n initComponents();\n limpiar();\n }",
"public EO_ClientsImpl() {\n }",
"public List BestClient();",
"public interface Client {\n\n}",
"public Ctacliente() {\n\t}",
"public static void main(String[] args) {\r\n System.out.println(\"***debut serveur gestion ***\");\r\n new ServeurGestion(50003).fonctionnementService();\r\n \r\n }",
"public static void main(String [ ] args){\n\t\t Fecha Hoy = new Fecha(12,12,2020);\r\n\t\t ArrayList<Cuenta> cuentas = new ArrayList<Cuenta>();\r\n\t\t \r\n\t\t Cuenta c0 = new CtaAhorros(10000,10);\r\n\t\t Cuenta c1 = new CtaCheques(256070,0);\r\n\t\t Cuenta c2 = new CtaCredito(13245,100);\r\n\t\t Cuenta c3 = new CtaCheques(765,20);\r\n\t\t Cuenta c4 = new CtaAhorros(9000,20);\r\n\t\t Cuenta c5 = new CtaAhorros(2300,10);\r\n\t\t Cuenta c6 = new CtaCredito(25000,12);\r\n\t\t \r\n\t\t cuentas.add(c0);\r\n\t\t cuentas.add(c1);\r\n\t\t cuentas.add(c2);\r\n\t\t cuentas.add(c3);\r\n\t\t cuentas.add(c4);\r\n\t\t cuentas.add(c5);\r\n\t\t \r\n\t\t Cliente C1=new Cliente(\"QUIJOTE\",cuentas,\"QX400\");\r\n\t\t Hoy.AvanzarTiempo(11,1,0);\r\n\t\t \r\n\t\t C1.depositar(1,1200, Hoy);\r\n\t\t C1.retirar(2,1100, Hoy);\r\n\t\t System.out.println(\"saldo cuenta 3:\"+C1.consultar(3,Hoy));\r\n\t\t C1.depositar(4,600, Hoy);\r\n\t\t \r\n\t\t //C1.reportarEdosCtas();\r\n\t\t \r\n\t\t }",
"ConjuntoTDA claves();",
"public interface IClient {\n\n public Set<CabResult> getCabList(Double lat, Double lon, BookingMode mode, CabType cabType);\n\n public CabResult getBestCab(Double lat, Double lon, BookingMode mode, CabType cabType);\n}",
"public static void main( String[] args )\n {\n Endpoint.publish(\"http://localhost:9999/ws/saldo\", new SaldoServiceImpl());\n Endpoint.publish(\"http://localhost:9999/ws/chocolate\", new ChocolateServiceImpl());\n Endpoint.publish(\"http://localhost:9999/ws/request\", new RequestServiceImpl());\n Endpoint.publish(\"http://localhost:9999/ws/ingredients\", new IngredientsServiceImpl());\n }",
"private WebServicesFabrica(){}",
"public DmaiClient() {\r\n\t\tthis.mainView = new MainView();\r\n\t\tconnexionServeur();\r\n\r\n\t}",
"public void clientInfo() {\n uiService.underDevelopment();\n }",
"public static void main(String[] args) {\n //create three types of clients\n //the last two will inherit from the first\n //\n //create a type of client by assigning the class to a variable and running the constructor\n TrialClient trial = new TrialClient();\n Client client = new Client();\n PremiumClient premium = new PremiumClient();\n //\n //Create a visual text output of dependencies:\n System.out.println(\"Who bought what with dependencies:\");\n System.out.println(\"**********************************\");\n System.out.println();\n //run the bought method of trial client, this outputs its ownership\n System.out.println(\"The trial client tried:\");\n trial.bought();\n //\n System.out.println();\n System.out.println(\"The standard client bought:\");\n client.bought();\n //\n System.out.println();\n System.out.println(\"The premium client received:\");\n premium.bought();\n\n }",
"DatabaseClient newFinalClient();",
"private void printAllClients() {\n Set<Client> clients = ctrl.getAllClients();\n clients.stream().forEach(System.out::println);\n }",
"public abstract Client getClient();",
"public interface TransportAdapterClient {\r\n \r\n /**\r\n * Initializes instance. Configuration parameters are specific\r\n * to Transport Adapter implementation.\r\n * @param configuration\r\n */\r\n public void init(Map<String, String> configuration);\r\n \r\n /**\r\n * Submits batch to server side.\r\n * @param batch\r\n */\r\n public void submit(Batch batch);\r\n \r\n /**\r\n * Submits batch to server side applying operation filter if specified\r\n * i.e. only those batch units will be submitted which have operation\r\n * equal to provided operation filter.\r\n * \r\n * @param batch\r\n * @param opFilter\r\n */\r\n public void submit(Batch batch, BatchOperation opFilter); \r\n\r\n /**\r\n * Tests specified store alive.\r\n * @param storeName\r\n * @return\r\n */\r\n public boolean isAlive(String storeName);\r\n \r\n \r\n /**\r\n * Returns stream on content specified by content Id from store\r\n * specified by store Name.\r\n * \r\n * FIXME Providing OutputStream here implies that CSPCache must be capable\r\n * to provide either File as a future content placeholder or a OutputStream itself\r\n * \r\n * @param storeName\r\n * @param contentId\r\n * @param target is output stream to which content should be written\r\n */\r\n public void get(String storeName, Long jcrContentId, OutputStream target);\r\n \r\n \r\n}",
"OurIFC createOurIFC();",
"interface myClient {\n}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"public static void main(String[] args) {\n\t\tdeveloping d = new developing();// The return type is developing, so i will get all the methods from developing.\n\n\t\tBankingClient dr = new developing(); //I changed the return type to \"BankingClient\" So now \"dr\" is responsible for calling all the methods in \"BankingClient\". I will not get \"MyExtraMethod\" when\n\t\t//I call methods with \"dr\" object. This is called Runtime polymorphisim.\n\t\t\n\t\tDomainClient ds = new developing();//Client is only interested in DomainClient methods that were implemented in this class which has multiple interfaces implemented. Well\n\t\t//changed the return type to DomainClient and client is able to access only methods dealing with DomainClient\n\t\t\n\t\t// Polymorphisim - you can only call particular methods in a particular interface.\n\t\t\n\t\t//DomainClient ds = d;\n\t\t\n\t\tds.investment();\n\t\tds.noninvesters();\n\t\t\n\n\t}",
"public interface RestClient {\n public List<UserDTO> getContracts(String tariffTitle) throws IOException;\n\n public boolean buildPDF(String tariffTitle) throws IOException;\n}",
"public void exportAllFacturesClient(OutputStream outputStream, long id) throws IOException {\n\n Workbook workbook = new XSSFWorkbook();\n \n // Styles des cellules: \n CellStyle styleGreen = workbook.createCellStyle();\n styleGreen.setFillForegroundColor(IndexedColors.GREEN.getIndex());\n styleGreen.setFillPattern(FillPatternType.SOLID_FOREGROUND); \n \n CellStyle styleBlue = workbook.createCellStyle();\n styleBlue.setFillForegroundColor(IndexedColors.BLUE.getIndex());\n styleBlue.setFillPattern(FillPatternType.SOLID_FOREGROUND); \n \n CellStyle styleYellow = workbook.createCellStyle();\n styleYellow.setFillForegroundColor(IndexedColors.YELLOW.getIndex());\n styleYellow.setFillPattern(FillPatternType.SOLID_FOREGROUND); \n \n Font font = workbook.createFont();\n font.setColor(IndexedColors.WHITE.getIndex());\n styleGreen.setFont(font);\n styleBlue.setFont(font);\n styleYellow.setFont(font);\n \n \n \n List<FactureDto> listAllFacturesAllClient = this.factureService.findAllFactures();\n \n \n for (FactureDto factureDto : listAllFacturesAllClient) {\n\t\t\tif(factureDto.getClient().id == id) {\n\t //SHEET\n\t Sheet sheet = workbook.createSheet(\"Facture\"+factureDto.getId());\n\t Row headerRow = sheet.createRow(0);\n\t //LIBELLES\n\t Cell cellLibelle0 = headerRow.createCell(0);\n\t Cell cellLibelle1 = headerRow.createCell(1);\n\t Cell cellLibelle2 = headerRow.createCell(2);\n\t Cell cellLibelle3 = headerRow.createCell(3);\n\t cellLibelle0.setCellValue(\"Désignation\");\n\t cellLibelle1.setCellValue(\"Quantité\");\n\t cellLibelle2.setCellValue(\"Prix Unitaire\");\n\t cellLibelle3.setCellValue(\"Prix ligne\");\n\t cellLibelle0.setCellStyle(styleGreen);\n\t cellLibelle1.setCellStyle(styleBlue);\n\t cellLibelle2.setCellStyle(styleYellow);\n\t cellLibelle3.setCellStyle(styleGreen);\n\n\t for (int i =0; i<factureDto.getLigneFactures().size(); i++) {\n\t \t\t \t\n\t Row newRow = sheet.createRow(i+1);\n\t \n\t Cell firstCell = newRow.createCell(0);\n\t firstCell.setCellStyle(styleGreen);\n\t firstCell.setCellValue(factureDto.getLigneFactures().get(i).getArticle().getLibelle());\n\t \n\t Cell secondCell =newRow.createCell(1);\n\t secondCell.setCellValue(factureDto.getLigneFactures().get(i).getQuantite());\n\t secondCell.setCellStyle(styleBlue);\n\t \n\t Cell thirdCell =newRow.createCell(3);\n\t thirdCell.setCellValue(factureDto.getLigneFactures().get(i).getArticle().getPrix());\n\t thirdCell.setCellStyle(styleYellow);\n\t \n\t Cell fourthCell =newRow.createCell(3);\n\t fourthCell.setCellValue(\n\t \t\t(factureDto.getLigneFactures().get(i).getArticle().getPrix())*(factureDto.getLigneFactures().get(i).getQuantite())\n\t \t\t);\n\t fourthCell.setCellStyle(styleGreen);\n\t \t\t}\n\t\t\t}\n\t\t}\n\n workbook.write(outputStream);\n workbook.close();\n }",
"public static void main(String[] args) throws IOException, ClassNotFoundException {\n\t\tCliente clienteWriter = new Cliente();\n\t\tclienteWriter.setNome(\"Mateus Medeiros\");\n\t\tclienteWriter.setProfissao(\"Dev Full Stack\");\n\t\tclienteWriter.setCpf(\"0901231231\");\n\n\t\t// CRIANDO UM ARQUIVO\n\t\t// Usando o serializable é criado um aquivo com os dados da Classe Cliente, nesse caso do formato .bin\n\t\t// Nele é salvo o ID que está versionado na Classe cliente, e os dados em linguagem de máquina\n\t\tObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(\"cliente.bin\"));\n\t\toos.writeObject(clienteWriter);\n\t\toos.close();\n\t\t\n\t\t\n\t\t//Lendo o arquivo .bin e transformando a linguagem de máquina em objeto Java.\n\t\t//OBS: é verificado o serialUID caso diferente lança excecao e não lê o arquivo.\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"cliente.bin\"));\n\t\tCliente clienteReader = (Cliente) ois.readObject();\n\t\tois.close();\n\t\t//Exibindo o arquivo no console.\n\t\tSystem.out.println(clienteReader.getNome());\n\t\tSystem.out.println(clienteReader.getCpf());\n\t\tSystem.out.println(clienteReader.getProfissao());\n\t\t\n\n\t}",
"Cliente(){}",
"private MockClientFacade() {\n\t\t//this.c = Client.getInstance();\n\t}",
"@Override\n\tpublic void exportExwarehouse(String ckdh) throws Exception {\n\t\t\n\t}",
"public static void main(String[] args) {\n Client clientIP = new IndividualEntrepreneur(100000);\n System.out.println(clientIP);\n// client.deposit(555);\n// System.out.println(client);\n// client.deposit(1234);\n// System.out.println(client);\n// client.withdraw(1498);\n// System.out.println(client);\n\n Client clientOOO= new legalEntity(200000);\n System.out.println(clientOOO);\n// client1.deposit(1234);\n// System.out.println(client1);\n// client1.withdraw(10000);\n// System.out.println(client1);\n clientOOO.send(clientIP,2000);\n System.out.println(clientIP);\n System.out.println(clientOOO);\n clientIP.getInformation();\n clientOOO.getInformation();\n\n System.out.println(\"Hah Set \" + clientIP.getClientSet());\n System.out.println(clientIP.getClientSet());\n clientIP.getClientSet().clear();\n System.out.println(clientIP.getClientSet());\n Client clientInd = new Individual(50000);\n System.out.println(clientIP.getClientSet());\n clientIP.getClientSet().add(clientInd);\n clientIP.getClientSet().add(clientInd);\n System.out.println(clientIP.getClientSet());\n\n }",
"@RemoteServiceRelativePath(\"service\")\npublic interface DekorTradeService extends RemoteService {\n\n\tUserSer getUser(String user, String password)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer, LoginExceptionSer;\n\n\tvoid setPassword(String user, String password)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<FelhasznaloSer> getFelhasznalo() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tFelhasznaloSer addFelhasznalo(FelhasznaloSer felhasznaloSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tFelhasznaloSer updateFelhasznalo(FelhasznaloSer felhasznaloSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString setFelhasznaloJelszo(String rovidnev)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tFelhasznaloSer removeFelhasznalo(FelhasznaloSer felhasznaloSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tJogSer updateJog(String rovidnev, JogSer jogSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<JogSer> getJog(String rovidnev) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<GyartoSer> getGyarto() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tGyartoSer addGyarto(GyartoSer szallitoSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tGyartoSer updateGyarto(GyartoSer szallitoSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tGyartoSer removeGyarto(GyartoSer szallitoSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tVevoSer addVevo(VevoSer vevoSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tVevoSer updateVevo(VevoSer vevoSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tString setVevoJelszo(String rovidnev) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tVevoSer removeVevo(VevoSer vevoSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<VevoSer> getVevo() throws Exception, SQLExceptionSer;\n\n\tList<CikkSer> getCikk(int page, String fotipus, String altipus,\n\t\t\tString cikkszam) throws IllegalArgumentException, SQLExceptionSer;\n\n\tCikkSer addCikk(CikkSer cikkSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tCikkSer updateCikk(CikkSer cikkSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tCikkSer removeCikk(CikkSer ctorzsSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<RendeltSer> getRendelt(String vevo) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<RendeltcikkSer> getRendeltcikk(String rovidnev, String rendeles)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tSzinkronSer szinkron() throws IllegalArgumentException, SQLExceptionSer;\n\n\tString teljesszinkron() throws IllegalArgumentException, SQLExceptionSer;\n\n\tString initUploadFileStatus() throws IllegalArgumentException;\n\n\tUploadSer getUploadFileStatus() throws IllegalArgumentException;\n\n\tList<String> getKep(String cikkszam, String szinkod)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString removeKep(String cikkszam, String szinkod, String rorszam)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<CikkfotipusSer> getCikkfotipus() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tCikkfotipusSer addCikkfotipus(CikkfotipusSer rcikkfotipusSe)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tCikkfotipusSer updateCikkfotipus(CikkfotipusSer cikkfotipusSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<CikkaltipusSer> getCikkaltipus(String fokod)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tCikkaltipusSer addCikkaltipus(CikkaltipusSer cikktipusSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tCikkaltipusSer updateCikkaltipus(CikkaltipusSer cikktipusSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tCikkSelectsSer getCikkSelects() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<KosarSer> getKosarCikk(String elado, String vevo, String menu)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tVevoKosarSer getVevoKosar(String elado, String menu)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString addKosar(String elado, String vevo, String menu, String cedula)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString removeKosar(String elado, String vevo, String menu, String cedula)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tKosarSer addKosarCikk(KosarSer kosarSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tKosarSer removeKosarCikk(KosarSer kosarSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString importInternet(String elado, String vevo, String rendeles)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString createCedula(String elado, String vevo, String menu)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<CedulaSer> getCedula(String vevo, String menu, String tipus)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<CedulacikkSer> getCedulacikk(String cedula, String tipus)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString cedulaToKosar(String elado, String vevo, String menu, String tipus, String cedula)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tString kosarToCedula(String elado, String vevo, String menu, String tipus, String ujtipus, String cedula,\n\t\t\tDouble befizet, Double befizeteur, Double befizetusd)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<FizetesSer> getFizetes() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tZarasEgyenlegSer getElozoZaras() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tString createZaras(String penztaros, Double egyenleghuf, Double egyenlegeur,\n\t\t\tDouble egyenlegusd, Double kivethuf, Double kiveteur, Double kivetusd)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<FizetesSer> getZarasFizetes(String zaras)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<ZarasSer> getZaras() throws IllegalArgumentException, SQLExceptionSer;\n\n\tString createTorlesztes(String penztaros, String vevo, Double torleszthuf,\n\t\t\tDouble torleszteur, Double torlesztusd)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<FizetesSer> getTorlesztesek() throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<FizetesSer> getTorlesztes(String cedula)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<FizetesSer> getHazi() throws IllegalArgumentException, SQLExceptionSer;\n\n\tFizetesSer addHazi(FizetesSer fizetesSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<RendeltcikkSer> getRendelesSzamolt(String status)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<RendeltcikkSer> getRendeles(String status, String cikkszam,\n\t\t\tString szinkod) throws IllegalArgumentException, SQLExceptionSer;\n\n\tList<RendeltcikkSer> getMegrendelt(String status, String cikkszam,\n\t\t\tString szinkod) throws IllegalArgumentException, SQLExceptionSer;\n\n\tRendeltcikkSer updateRendeltcikk(RendeltcikkSer rendeltcikkSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tRendeltcikkSer megrendeles(RendeltcikkSer rendeltcikkSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<BeszallitottcikkSer> getBeszallitottcikk(String cikkszam,\n\t\t\tString szinkod) throws IllegalArgumentException, SQLExceptionSer;\n\n\tBeszallitottcikkSer addBeszallitottcikk(\n\t\t\tBeszallitottcikkSer beszallitottcikkSer)\n\t\t\tthrows IllegalArgumentException, SQLExceptionSer;\n\n\tList<RaktarSer> getRaktar(int page, String fotipus, String altipus,\n\t\t\tString cikkszam) throws IllegalArgumentException, SQLExceptionSer;\n\n\tRaktarSer updateRaktar(String rovancs,String userId,RaktarSer raktarSer) throws IllegalArgumentException,\n\t\t\tSQLExceptionSer;\n\n\tList<RendeltcikkSer> getRendeles(String vevo) throws IllegalArgumentException, SQLExceptionSer;\n\n\tList<EladasSer> getEladas(String cikkszam, String sznikod) throws IllegalArgumentException, SQLExceptionSer;\n\n\tRendeltcikkSer removeRendeles(RendeltcikkSer rendeltcikkSer) throws IllegalArgumentException, SQLExceptionSer;\n\n}",
"Client getPrefDentist();",
"public interface PluginClient {\n\n /**\n * Retrieves all automator types readable by the user. If no automator types exist, returns an empty list.\n *\n * @return List of {@link co.cask.coopr.spec.plugin.AutomatorType} objects\n * @throws IOException in case of a problem or the connection was aborted\n */\n List<AutomatorType> getAllAutomatorTypes() throws IOException;\n\n /**\n * Retrieves a specific automator type if readable by the user.\n *\n * @return {@link co.cask.coopr.spec.plugin.AutomatorType} object\n * @throws IOException in case of a problem or the connection was aborted\n */\n AutomatorType getAutomatorType(String id) throws IOException;\n\n /**\n * Retrieves all provider types readable by the user. If no provider types exist, returns an empty list.\n *\n * @return List of {@link co.cask.coopr.spec.plugin.ProviderType} objects\n * @throws IOException in case of a problem or the connection was aborted\n */\n List<ProviderType> getAllProviderTypes() throws IOException;\n\n /**\n * Retrieves a specific provider type if readable by the user.\n *\n * @return {@link co.cask.coopr.spec.plugin.ProviderType} object\n * @throws IOException in case of a problem or the connection was aborted\n */\n ProviderType getProviderType(String id) throws IOException;\n\n /**\n * Retrieves a list of all versions of the given resource of the given type for the given automator type.\n * Method can optionally contain a 'status' parameter, whose value is one of 'active', 'inactive', 'staged', or\n * 'recalled' to filter the results to only contain resource that have the given status.\n *\n * @param id Id of the automator type that has the resources\n * @param resourceType Type of resource to get\n * @param status Status of the resources to get {@link co.cask.coopr.provisioner.plugin.ResourceStatus}.\n * Or null, for resources of any status are returned\n * @return Immutable map of resource name to resource metadata\n * @throws IOException in case of a problem or the connection was aborted\n */\n Map<String, Set<ResourceMeta>> getAutomatorTypeResources(String id, String resourceType, ResourceStatus status)\n throws IOException;\n\n /**\n * Retrieves a mapping of all resources of the given type for the given provider type.\n * Method can optionally contain a 'status' parameter, whose value is one of 'active', 'inactive', 'staged', or\n * 'recalled' to filter the results to only contain resource that have the given status.\n *\n * @param id Id of the provider type that has the resources\n * @param resourceType Type of resource to get\n * @param status Status of the resources to get {@link co.cask.coopr.provisioner.plugin.ResourceStatus}.\n * Or null, for resources of any status are returned\n * @return Immutable map of resource name to resource metadata\n * @throws IOException in case of a problem or the connection was aborted\n */\n Map<String, Set<ResourceMeta>> getProviderTypeResources(String id, String resourceType, ResourceStatus status)\n throws IOException;\n\n /**\n * Stage a particular resource version, which means that version of the resource will get pushed to provisioners\n * on the next sync call. Staging one version recalls other versions of the resource.\n *\n * @param id Id of the automator type that has the resources\n * @param resourceType Type of resource to stage\n * @param resourceName Name of the resource to stage\n * @param version Version of the resource to stage\n * @throws IOException in case of a problem or the connection was aborted\n */\n void stageAutomatorTypeResource(String id, String resourceType, String resourceName, String version)\n throws IOException;\n\n /**\n * Stage a particular resource version, which means that version of the resource will get pushed to provisioners\n * on the next sync call. Staging one version recalls other versions of the resource.\n *\n * @param id Id of the provider type that has the resources\n * @param resourceType Type of resource to stage\n * @param resourceName Name of the resource to stage\n * @param version Version of the resource to stage\n * @throws IOException in case of a problem or the connection was aborted\n */\n void stageProviderTypeResource(String id, String resourceType, String resourceName, String version)\n throws IOException;\n\n /**\n * Recall a particular resource version, which means that version of the resource will get removed from provisioners\n * on the next sync call.\n *\n * @param id Id of the automator type that has the resources\n * @param resourceType Type of resource to recall\n * @param resourceName Name of the resource to recall\n * @param version Version of the resource to recall\n * @throws IOException in case of a problem or the connection was aborted\n */\n void recallAutomatorTypeResource(String id, String resourceType, String resourceName, String version)\n throws IOException;\n\n /**\n * Recall a particular resource version, which means that version of the resource will get removed from provisioners\n * on the next sync call.\n *\n * @param id Id of the provider type that has the resources\n * @param resourceType Type of resource to recall\n * @param resourceName Name of the resource to recall\n * @param version Version of the resource to recall\n * @throws IOException in case of a problem or the connection was aborted\n */\n void recallProviderTypeResource(String id, String resourceType, String resourceName, String version)\n throws IOException;\n\n /**\n * Delete a specific version of the given resource.\n *\n * @param id Id of the automator type that has the resources\n * @param resourceType Type of resource to delete\n * @param resourceName Name of the resource to delete\n * @param version Version of the resource to delete\n * @throws IOException in case of a problem or the connection was aborted\n */\n void deleteAutomatorTypeResourceVersion(String id, String resourceType, String resourceName, String version)\n throws IOException;\n\n /**\n * Delete a specific version of the given resource.\n *\n * @param id Id of the provider type that has the resources\n * @param resourceType Type of resource to delete\n * @param resourceName Name of the resource to delete\n * @param version Version of the resource to delete\n * @throws IOException in case of a problem or the connection was aborted\n */\n void deleteProviderTypeResourceVersion(String id, String resourceType, String resourceName, String version)\n throws IOException;\n\n /**\n * Push staged resources to the provisioners, and remove recalled resources from the provisioners.\n *\n * @throws IOException in case of a problem or the connection was aborted\n */\n void syncPlugins() throws IOException;\n}",
"public static void main(String[] args) {\n\t\tCliente cl1 = new Cliente();\n\t\tCliente cl2 = new Cliente();\n\t\t\n\t\tcl1.setCpf(\"000-000-000-00\");\n\t\tcl1.setNome(\"Vitor\");\n\t\t\n\t\tcl2.setCpf(\"111-111-111-11\");\n\t\tcl2.setNome(\"Paula\");\n\t\t\n\t\tSystem.out.println(cl1); //e- o hashCode, ou seja a referencia do espaco de memoria convertida em um inteiro.\n\t\tSystem.out.println(cl1.getNome() + \" - \" + cl1.getCpf());//ira mostra o que esta na referencia de Cliente e na referencia nome\n\t\t\n\t\tConta ct1 = new Conta();\n\t\tConta ct2 = new Conta();\n\t\t\n\t\tct1.setNumero(\"7777777-7\");\n\t\tct1.setSaldoDaConta(300.00);\n\t\t//ct1.cliente = cl1;\n\t\t//cl1.setCpf(\"987\");\n\t\t\n\t\tct2.setNumero(\"3333333-3\");\n\t\tct2.setSaldoDaConta(200.00);\n\t\t\n\t\tSystem.out.println(ct1);\n\t\tSystem.out.println(ct1.getNumero() + \" - \" + ct1.getSaldoDaConta());\n\t\t//System.out.println(ct1.cliente.getNome());\n\t\t//System.out.println(ct1.cliente.getCpf());\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\n\t\t\n\t\tClientesDao clienteDao = DaoFactory.createClientesDao();\n\t\t\n\t \n\t\t\n\t\tSystem.out.println(obj);\n\t\tSystem.out.println(clientes);\n\t\t\n\n\t}",
"public Cliente() {\n\t\tsuper();\n\t}",
"public interface GestionAsintomaticosInt extends Remote\n{\n \n public boolean registrarAsintomatico(PacienteCllbckInt objPaciente, int idPaciente) throws RemoteException;\n public boolean enviarIndicador(int id, float ToC) throws RemoteException;\n}",
"public static void convoExport() throws ClassNotFoundException, SQLException, IOException{\n\t\t\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\tConvoGraph rt = new ConvoGraph(conn, \"HISenOG\", \"/Users/Brian/Desktop/\");\n\t\trt.createNodesRT();\n\t\trt.createRT();\n\t\trt.nodeWrite(\"RT\");\n\t\tConvoGraph rp = new ConvoGraph(conn, \"HISenOG\", \"/Users/Brian/Desktop/\");\n\t\trp.createNodesRP();\n\t\trp.createReply();\n\t\trp.nodeWrite(\"RP\");\n\t}",
"public static void main(String[] args) throws Exception {\n\t\texport();\r\n\t}",
"private ClientExecutorEngine() {\n ClientConfigReader.readConfig();\n DrillConnector.initConnection();\n HzConfigReader.readConfig();\n }",
"public static void main(String[] argv)\r\n {\r\n //Fazer isto depois para múltiplos web services\r\n InsulinDoseCalculator service = null;\r\n try {\r\n //service = new InsulinDoseCalculatorService(new URL(\"http://liis-lab.dei.uc.pt:8080/Server?wsdl\")).getInsulinDoseCalculatorPort();\r\n //service = new InsulinDoseCalculatorService(new URL(\"http://qcs12.dei.uc.pt:8080/insulin?wsdl\")).getInsulinDoseCalculatorPort();\r\n //service = new InsulinDoseCalculatorService(new URL(\"http://qcs18.dei.uc.pt:8080/insulin?wsdl\")).getInsulinDoseCalculatorPort();14\r\n service = new InsulinDoseCalculatorService(new URL(\"http://localhost:9000/InsulinDoseCalculator?wsdl\")).getInsulinDoseCalculatorPort();\r\n //service = new InsulinDoseCalculatorService(new URL(\"http://vm-sgd17.dei.uc.pt:80/InsulinDoseCalculator?wsdl\")).getInsulinDoseCalculatorPort();\r\n } catch (MalformedURLException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n //InsulinDoseCalculator service = new InsulinDoseCalculatorService().getInsulinDoseCalculatorPort();\r\n menu(service);\r\n }",
"PartyType getExporterParty();",
"private MatterAgentClient() {}",
"public void consulterCatalog() {\n\t\t\n\t}",
"public interface Client {\n \n /**\n * Get the unique id of current client.\n *\n * @return id of client\n */\n String getClientId();\n \n /**\n * Whether is ephemeral of current client.\n *\n * @return true if client is ephemeral, otherwise false\n */\n boolean isEphemeral();\n \n /**\n * Set the last time for updating current client as current time.\n */\n void setLastUpdatedTime();\n \n /**\n * Get the last time for updating current client.\n *\n * @return last time for updating\n */\n long getLastUpdatedTime();\n \n /**\n * Add a new instance for service for current client.\n *\n * @param service publish service\n * @param instancePublishInfo instance\n * @return true if add successfully, otherwise false\n */\n boolean addServiceInstance(Service service, InstancePublishInfo instancePublishInfo);\n \n /**\n * Remove service instance from client.\n *\n * @param service service of instance\n * @return instance info if exist, otherwise {@code null}\n */\n InstancePublishInfo removeServiceInstance(Service service);\n \n /**\n * Get instance info of service from client.\n *\n * @param service service of instance\n * @return instance info\n */\n InstancePublishInfo getInstancePublishInfo(Service service);\n \n /**\n * Get all published service of current client.\n *\n * @return published services\n */\n Collection<Service> getAllPublishedService();\n \n /**\n * Add a new subscriber for target service.\n *\n * @param service subscribe service\n * @param subscriber subscriber\n * @return true if add successfully, otherwise false\n */\n boolean addServiceSubscriber(Service service, Subscriber subscriber);\n \n /**\n * Remove subscriber for service.\n *\n * @param service service of subscriber\n * @return true if remove successfully, otherwise false\n */\n boolean removeServiceSubscriber(Service service);\n \n /**\n * Get subscriber of service from client.\n *\n * @param service service of subscriber\n * @return subscriber\n */\n Subscriber getSubscriber(Service service);\n \n /**\n * Get all subscribe service of current client.\n *\n * @return subscribe services\n */\n Collection<Service> getAllSubscribeService();\n \n /**\n * Generate sync data.\n *\n * @return sync data\n */\n ClientSyncData generateSyncData();\n \n /**\n * Whether current client is expired.\n *\n * @param currentTime unified current timestamp\n * @return true if client has expired, otherwise false\n */\n boolean isExpire(long currentTime);\n \n /**\n * Release current client and release resources if neccessary.\n */\n void release();\n \n /**\n * Recalculate client revision and get its value.\n * @return recalculated revision value\n */\n long recalculateRevision();\n \n /**\n * Get client revision.\n * @return current revision without recalculation\n */\n long getRevision();\n \n /**\n * Set client revision.\n * @param revision revision of this client to update\n */\n void setRevision(long revision);\n \n}",
"void exportGame();",
"@Override\n\tpublic void exportarData() {\n\t\tDate date=new Date();\n\t\tString nameFile=\"client-\"+date.getTime()+\".xls\";\n\t\tTableToExcel.save(grid,nameFile);\n\t}",
"public AbaloneClient() {\n server = new AbaloneServer();\n clientTUI = new AbaloneClientTUI();\n }",
"@Remote\npublic interface IRClienteWSAXIS {\n\n /**\n * Realiza la invocacion con el WebService para realizar la registrar la financiacion y obtener el id del convenio\n * \n * @param financiacion\n * datos de la financiacion\n * @return Financiacion con el Numero de axis para Wla financiacion\n * @author julio.pinzon(2016-08-12)\n * @throws CirculemosNegocioException\n */\n public FinanciacionDTO registrarFinanciacion(FinanciacionDTO financiacion) throws CirculemosNegocioException;\n\n /**\n * Realiza la invocacion con el WebService para anular la financiacion\n * \n * @param numeroFinanciacion\n * numero del convenio\n * @author julio.pinzon(2016-08-17)\n * @throws CirculemosNegocioException\n */\n public void anularFinanciacion(String numeroFinanciacion) throws CirculemosNegocioException;\n\n /**\n * Realiza la invocacion con el WebService para realizar la impugnacion de un comparendo\n * \n * @param comparendo\n * datos del comparendo\n * @param impugnacion\n * datos de la impugnacion\n * @author julio.pinzon(2016-08-17)\n * @throws CirculemosNegocioException\n */\n public void impugnarComparendo(ComparendoDTO comparendo, ProcesoDTO impugnacion) throws CirculemosNegocioException;\n\n /**\n * Realiza la invocacion con el WebService para realizar el registro del fallo sobre la impugnacion previa\n * \n * @param fallo\n * datos del fallo\n * @return Nuevo numero de factura\n * @author julio.pinzon(2016-08-17)\n * @param idProceso\n * @param comparendoDTO\n * @throws CirculemosNegocioException\n */\n public Long registrarFalloImpugnacion(FalloImpugnacionDTO fallo, ComparendoDTO comparendoDTO, Long idProceso)\n throws CirculemosNegocioException;\n\n /**\n * Realiza la invocacion con el WebService para realizar el registro del numero de coactivo de axis\n * \n * @param coactivoDTO\n * @return CoactivoDTO\n * @throws CirculemosNegocioException\n * @author Jeison.Rodriguez (2016-09-21)\n */\n public CoactivoDTO registarCoactivo(CoactivoDTO coactivoDTO) throws CirculemosNegocioException;\n}",
"public interface IClient extends Remote, Serializable {\n /**\n * @param auction\n * @throws RemoteException\n */\n void newAuction(AuctionBean auction) throws RemoteException;\n\n /**\n * @param auction\n * @throws RemoteException\n */\n void submit(AuctionBean auction) throws RemoteException;\n\n /**\n * @param buyer\n * @throws RemoteException\n */\n void bidSold(IClient buyer) throws RemoteException;\n\n /**\n * @param auctionID\n * @param price\n * @throws RemoteException\n */\n void newPrice(UUID auctionID, int price) throws RemoteException;\n\n /**\n * @return\n * @throws RemoteException\n */\n String getName() throws RemoteException;\n\n ClientState getState() throws RemoteException;\n\n void setState(ClientState newState) throws RemoteException;\n}",
"public interface CarsExport {\n\n void export(List<Car> cars);\n\n}",
"public static File generateFicheFacture(models.beans.Facture facture ){\n\t\tFile model = utils.FilesAndLaunchUtils.createFileFromResource(\"/ressources/reports/facture.xml\", \"ficheFacture.xml\");\n\t\tString sqlQuery = GUIReportEditor.getSQLQueryFromModel(model);\n\t\t\n\t\tMap<Object, Object> parameters = new HashMap<Object, Object>();\n\t\tmodels.beans.Client client = facture.getClient();\n\t\tparameters.put(\"numFacture\", \"Facutre N° : \"+facture.getId());\n\t\tparameters.put(\"Nom\", client.getNom());\n\t\tparameters.put(\"Prenom\", client.getPrenom());\n\t\tparameters.put(\"Montant\", facture.getMontant());\n\t\tparameters.put(\"Date\", utils.StringUtils.formatDateFromMySQL(facture.getDateFacture().toString()));\n\t\t\n\t\tList<models.beans.ClientConsommeService> listServices = DAOClientConsommeService.getListInstances(\"where idClient = '\"+client.getId()+\"'\");\n\n\t\tList<Object> dataServices = new ArrayList<Object>();\n\t\t\n\t\tint num = 1;\n\t\tfor (models.beans.ClientConsommeService ccs : listServices){\n\t\t\tMap<String, String> map = new HashMap<String, String>();\n\t\t\t\n\t\t\tmap.put(\"num\", num+\"\");\n\t\t\tmap.put(\"consommation\", ccs.getService().getDesignation());\n\t\t\tmap.put(\"prix\", utils.StringUtils.formatMonetaire(ccs.getPrixService()));\n\t\t\t\n\t\t\tdataServices.add(map);\n\t\t}\n\t\t\n\t\tparameters.put(\"extraParams-1\", utils.FilesAndLaunchUtils.getHexFromObject((Serializable)dataServices));\n\t\t\n\t\tFile file = GUIReportEditor.generateReportFileFromServer(model, sqlQuery, parameters);\n\t\t\n\t\treturn file;\n\t}",
"public interface IDataExportService {\n\n /**\n * Exports data for a single user to a temporary file.\n *\n * @param query the query that selects the data to export.\n * @return a unique token for downloading the exported file.\n *\n * @throws ApplicationException if the query execution or file creation fails.\n */\n String export(UserDataExportQuery query) throws ApplicationException;\n\n /**\n * Exports data for a single utility to a file. Any exported data file is replaced.\n *\n * @param query the query that selects the data to export.\n *\n * @throws ApplicationException if the query execution or file creation fails.\n */\n void export(UtilityDataExportQuery query) throws ApplicationException;\n\n}",
"public static void main(String[] args) {\n//\t\tnew CluelessClient();\n\t}",
"public WebService_Detalle_alquiler_factura() {\n }",
"public interface ClientService {\r\n\r\n String fpkj(String wsdlUrl);\r\n}",
"public BrowseOffenceAMClient() {\r\n }",
"private CorrelationClient() { }",
"public TurnoVOClient() {\r\n }",
"@Override\n public String toString() {\n return \"Client{\" +\n \"nom='\" + nom + '\\'' +\n \", prenom='\" + prenom + '\\'' +\n \", adresse='\" + adresse + '\\'' +\n \", methode tarif=\" + calculerTarif.toString() +\n \", pointsDeFidelite=\" + pointsDeFidelite +\n \", listeVehicule=\" + listeVehicule +\n + '}';\n }",
"public void exportAllLists(){\n }",
"public static void main(String[] args) {\n\t\t\t\tList listClient = new ArrayList();\r\n\t\t\t\t\r\n\t\t\t\tClient client = new Client();\r\n\t\t\t\tclient.setFirstName(\"Eduardo\");\r\n\t\t\t\tclient.setSecondName(\"Mendoza\");\r\n\t\t\t\t\r\n\t\t\t\tlistClient.add(client);\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\tClient newClient = new Client();\r\n\t\t\t\tnewClient.setFirstName(\"Carlos\");\r\n\t\t\t\tnewClient.setSecondName(\"Fuentealba\");\r\n\t\t\t\t\t\t\r\n\t\t\t\tlistClient.add(newClient);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tclient = new Client();\r\n\t\t\t\tclient.setFirstName(\"Pablo\");\r\n\t\t\t\tclient.setSecondName(\"Mondaca\");\r\n\t\t\t\t\r\n\t\t\t\tlistClient.add(client);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"listClient:\"+listClient);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// Mostar los elementos de la lista\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tIterator it = listClient.listIterator();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Detectar que tipo de objeto tiene la lista\r\n\t\t\t\t/*Object obj = null;\r\n\t\t\t\t\r\n\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Casting JAVA\r\n\t\t\t\t\tobj = (Object) it.next();\r\n\t\t\t\t\tSystem.out.println(\"obj:\"+obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}*/\r\n\t\t\t\t\r\n\t\t\t\tClient nclient = null;\r\n\t\t\t\t\r\n\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Casting JAVA\r\n\t\t\t\t\tnclient = (Client) it.next();\r\n\t\t\t\t\tSystem.out.println(\"nclient:\"+nclient);\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"firstName:\"+nclient.getFirstName());\r\n\t\t\t\t\tSystem.out.println(\"secondName:\"+nclient.getSecondName());\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t}",
"protected void setup() {\n\t\tDFAgentDescription dfd = new DFAgentDescription();\n\t\tdfd.setName(getAID());\n\t\tServiceDescription sd = new ServiceDescription();\n\t\tsd.setType(\"paciente\");\n\t\tsd.setName(getName());\n\t\tdfd.addServices(sd);\n\t\ttry {\n\t\t\tDFService.register(this, dfd);\n\t\t} catch (FIPAException fe) {\n\t\t\tfe.printStackTrace();\n\t\t}\n\t\t\n\t\t// atualiza lista de monitores e atuadores\n\t\taddBehaviour(new UpdateAgentsTempBehaviour(this, INTERVALO_AGENTES));\n\t\t\n\t\t// ouve requisicoes dos atuadores e monitores\n\t\taddBehaviour(new ListenBehaviour());\n\t\t\n\t\t// adiciona comportamento de mudanca de temperatura\n\t\taddBehaviour(new UpdateTemperatureBehaviour(this, INTERVALO_ATUALIZACAO));\n\t\t\n\t\t// adiciona comportamento de mudanca de hemoglobina\t\t\n\t\taddBehaviour(new UpdateHemoglobinaBehaviour(this, INTERVALO_ATUALIZACAO));\n\t\t\n\t\t// adiciona comportamento de mudanca de bilirrubina\n\t\taddBehaviour(new UpdateBilirrubinaBehaviour(this, INTERVALO_ATUALIZACAO));\n\n\t\t// adiciona comportamento de mudanca de pressao\t\t\n\t\taddBehaviour(new UpdatePressaoBehaviour(this, INTERVALO_ATUALIZACAO));\n\t\t\n\t}",
"@DSSafe(DSCat.SAFE_OTHERS)\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2014-02-25 10:38:11.372 -0500\", hash_original_method = \"137F9E248231F2FA54CF674E7086700C\", hash_generated_method = \"37B44EAC1C6E84FF6770EF17014684A2\")\n \npublic RLoginClient()\n {\n setDefaultPort(DEFAULT_PORT);\n }",
"public Cliente() {\r\n\t\tSystem.out.println(\"El cliente es: Diego Juarez \"+\"\\n\");\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t}",
"public interface ICordysGatewayClientFactory\r\n{\r\n /**\r\n * Return a client (the factory is also responsable for creating the gateway).\r\n *\r\n * @return A cordys gateway client.\r\n */\r\n ICordysGatewayClient getGatewayClientInstance();\r\n}",
"public static void generatereports(){\r\n\t\t\r\n\t\tAccount a = (Account) Cache.get(\"authUser\");\r\n\t\t\r\n\t\tDealer d = Dealer.find(\"byDealershipId\", a.uniquenumber).first();\r\n\t\tif(a!= null)\r\n\t\t{\r\n\t\t\t/*\r\n\t\t\t * Get the list of orders placed for this dealer\r\n\t\t\t *Classify it as Total Confirmed \r\n\t\t\t *Total Delivered and so on \r\n\t\t\t *\r\n\t\t\t */\r\n\t\t\tList<OrderCylinder> totalorders = OrderCylinder.find(\"byDealerId\",d).fetch();\r\n\t\t\t//List<OrderCylinder> confirmorders = OrderCylinder.f\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tDealerControllerMap.pleaselogin();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"private DataService() {\n\t\tusers = new LinkedHashSet<>();\n\t\tlists = new LinkedHashSet<>();\n\t\ttasks = new LinkedHashMap<>();\n\t\tdbManager = DBManager.getInstance();\n\t\tdbManager.initialize();\n\t\tusers = dbManager.getUsers();\n\n\t\toutputFile = System.getProperty(\"user.dir\")+\"/output/\"+Calendar.getInstance().getTimeInMillis()+\"_Output.txt\";\n\t}",
"public interface IXoClientHost {\n\n public ScheduledExecutorService getBackgroundExecutor();\n public ScheduledExecutorService getIncomingBackgroundExecutor();\n public IXoClientDatabaseBackend getDatabaseBackend();\n public KeyStore getKeyStore();\n public Thread.UncaughtExceptionHandler getUncaughtExceptionHandler();\n public InputStream openInputStreamForUrl(String url) throws IOException;\n\n public String getClientName();\n public String getClientLanguage();\n public String getClientVersionName();\n public int getClientVersionCode();\n public String getClientBuildVariant();\n public Date getClientTime();\n\n public String getDeviceModel();\n\n public String getSystemName();\n public String getSystemLanguage();\n public String getSystemVersion();\n}",
"private ClientLoader() {\r\n }",
"public interface MeteringClient {\n\n void consume(Collection<ResourceSnapshot> resources);\n\n MeteringInfo getResourceSnapshots(TenantName tenantName, ApplicationName applicationName);\n\n}",
"private void createClient() {\n tc = new TestClient();\n }",
"public void buscarGestor(){\r\n\t\t\r\n\t}",
"@Override\r\n\tpublic void exportThis()\r\n\t{\n\t\tsuper.exportThis();\r\n\t}",
"public GerenciarCliente() {\n initComponents();\n }",
"public void ventilationServices() {\n\t\tSystem.out.println(\"FH----overridden method from hospital management--parent class of fortis hospital\");\n\t}",
"public interface ImportExport {\n public String exportUserDataAsString(Users users) throws Exception;\n public File exportUserDataAsFile(Users users)throws Exception;\n public Users importUserData() throws Exception;\n}",
"public clientesBean() {\n this.clie = new Clientes();\n }",
"@Test\r\n\tpublic void client() {\n\t}",
"public ClienteServicio() {\n }"
] | [
"0.6245055",
"0.59037566",
"0.5770427",
"0.5740088",
"0.57279456",
"0.55995804",
"0.5593891",
"0.5593236",
"0.5586776",
"0.55713964",
"0.55461013",
"0.5542856",
"0.5539031",
"0.5513214",
"0.55081856",
"0.5501535",
"0.5482997",
"0.54575336",
"0.5455763",
"0.54509604",
"0.5433609",
"0.543127",
"0.54301727",
"0.5398644",
"0.53968585",
"0.53507185",
"0.5344002",
"0.53434175",
"0.5336194",
"0.53280824",
"0.53263074",
"0.5313528",
"0.5305045",
"0.5302709",
"0.5289651",
"0.5288291",
"0.5256638",
"0.5250967",
"0.5249202",
"0.52457017",
"0.5243929",
"0.5238118",
"0.52293134",
"0.5220963",
"0.5216441",
"0.521469",
"0.5204929",
"0.51989615",
"0.51978064",
"0.5195758",
"0.5191923",
"0.5190555",
"0.51887375",
"0.5185266",
"0.5180042",
"0.51776487",
"0.517343",
"0.51719534",
"0.51688856",
"0.5167171",
"0.51643044",
"0.51611936",
"0.5159416",
"0.5148825",
"0.51466334",
"0.51424414",
"0.51335555",
"0.51046807",
"0.5104079",
"0.50998324",
"0.50997645",
"0.5098952",
"0.50972885",
"0.5094759",
"0.5092883",
"0.50878364",
"0.50839233",
"0.5081124",
"0.5079828",
"0.50697",
"0.50651056",
"0.5050395",
"0.5048839",
"0.50444156",
"0.5043883",
"0.50433177",
"0.50417346",
"0.5038299",
"0.5026946",
"0.50263005",
"0.5024247",
"0.5024167",
"0.5016471",
"0.50157005",
"0.50151366",
"0.5014749",
"0.50147486",
"0.50124866",
"0.5008921",
"0.50071"
] | 0.58972704 | 2 |
Liste des factures clients | @Retryable(
maxAttempts = Application.retry_max_attempt,
backoff = @Backoff(delay = 5000))
@ApiOperation(value = "Liste des factures clients")
@ApiResponses(value = {
@ApiResponse(code = 401, message = "Vous devez être identifié pour effectuer cette opération"),
@ApiResponse(code = 403, message = "Vous n'êtes pas autorisé à effectuer cette action (uniquement les admin ou opérateurs ayant droits)"),
@ApiResponse(code = 200, message = "Liste des actions retournées (au format datatable - contenu dans data, nombre total dans recordsTotal)", response = MapDatatable.class)
})
@ResponseBody
@RequestMapping(
produces = "application/json",
value = "/factures/client",
method = RequestMethod.POST)
@CrossOrigin
public ResponseEntity<Object> get_factures_clients(
@ApiParam(value = "Critères de recherche (tri, filtre, etc) au format Datatable", required = true) @RequestBody MultiValueMap postBody,
@ApiParam(value = "Jeton JWT pour autentification", required = true) @RequestHeader("Token") String token) throws JsonProcessingException {
// vérifie que le jeton est valide et que les droits lui permettent de consulter les admin katmars
if (!jwtProvider.isValidJWT(token)) {
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Jeton invalide, veuillez vous reconnecter.");
}
if (!SecurityUtils.adminOrOperateurWithDroit(jwtProvider, token, OperateurListeDeDroits.CONSULTER_FACTURES_CLIENT) && !SecurityUtils.client(jwtProvider, token) && !SecurityUtils.client_personnelWithDroit(jwtProvider, token, ClientPersonnelListeDeDroits.VOIR_FACTURES)) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Vous n'avez pas le droit d'effectuer cette opération.");
}
// paramètres du datatable
String draw = postBody.getFirst("draw").toString();
Integer length = Integer.valueOf(postBody.getFirst("length").toString());
// tri, sens et numéro de page
String colonneTriDefaut = "numeroFacture";
List<String> colonnesTriAutorise = Arrays.asList("createdOn", "montantHT", "numeroFacture", "montantTTC", "dateFacture");
String order_column_bdd = DatatableUtils.getOrderColonne(colonneTriDefaut, colonnesTriAutorise, postBody);
String sort_bdd = DatatableUtils.getSort(postBody);
Integer numero_page = DatatableUtils.getNumeroPage(postBody, length);
// filtrage
List<String> colonnesFiltrageActive = Arrays.asList("listeOperations", "createdOn", "numeroFacture");
ParentSpecificationsBuilder builder = new OperationSpecificationsBuilder();
Specification spec_general = DatatableUtils.buildFiltres(colonnesFiltrageActive, postBody, builder, null);
if (spec_general == null) {
spec_general = Specification.where(DatatableUtils.buildFiltres(colonnesFiltrageActive, postBody, builder, null));
}
// filtrage par date de création
spec_general = DatatableUtils.fitrageDate(spec_general, postBody, "createdOn", "createdOn");
spec_general = DatatableUtils.fitrageDate(spec_general, postBody, "dateFacture", "dateFacture");
spec_general = DatatableUtils.fitrageEntier(spec_general, postBody, "montantHT", "montantHT");
spec_general = DatatableUtils.fitrageEntier(spec_general, postBody, "montantTTC", "montantTTC");
// filtre par expéditeur dans datatable (si admin ou opérateur)
Map<Integer, String> indexColumn_nomColonne = DatatableUtils.getMapPositionNomColonnes(postBody);
Integer position_colonne = DatatableUtils.getKeyByValue(indexColumn_nomColonne, "client");
if (position_colonne != null) {
String filtre_par_expediteur = postBody.getFirst("columns[" + position_colonne + "][search][value]").toString();
if (filtre_par_expediteur != null && !"".equals(filtre_par_expediteur.trim())) {
Specification spec2 = new Specification<Operation>() {
public Predicate toPredicate(Root<Operation> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
List<Predicate> predicates = new ArrayList<Predicate>();
Client expediteur = clientService.getByUUID(filtre_par_expediteur, jwtProvider.getCodePays(token));
if (expediteur != null) {
predicates.add(builder.equal(root.get("client"), expediteur));
}
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
};
spec_general = spec_general.and(spec2);
}
}
// surcharge du tri
if (postBody.containsKey("sorting") && "desc".equals(postBody.getFirst("sorting").toString())) {
sort_bdd = "desc";
} else if (postBody.containsKey("sorting") && "asc".equals(postBody.getFirst("sorting").toString())) {
sort_bdd = "asc";
}
// filtrage par es factures si c'ets un client
if (SecurityUtils.client(jwtProvider, token)) {
List<Predicate> predicates = new ArrayList<Predicate>();
Specification spec2 = new Specification<Operation>() {
public Predicate toPredicate(Root<Operation> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
Client client = clientService.getByUUID(jwtProvider.getClaimsValue("uuid_client", token), jwtProvider.getCodePays(token));
predicates.add(builder.equal(root.get("client"), client));
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
};
spec_general = spec_general.and(spec2);
}
// filtrage par pays kamtar
Specification spec_pays = new Specification<ActionAudit>() {
public Predicate toPredicate(Root<ActionAudit> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.equal(root.get("codePays"), jwtProvider.getCodePays(token)));
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
};
spec_general = spec_general.and(spec_pays);
// préparation les deux requêtes (résultat et comptage)
Page<FactureClient> leads = factureClientService.getAllPagined(order_column_bdd, sort_bdd, numero_page, length, spec_general);
Long total = factureClientService.countAll(spec_general);
actionAuditService.getFacturesClient(token);
// prépare les résultast
JSONArray jsonArrayOffres = new JSONArray();
if (leads != null) {
jsonArrayOffres.addAll(leads.getContent());
}
Map<String, Object> jsonDataResults = new LinkedHashMap<String, Object>();
jsonDataResults.put("draw", draw);
jsonDataResults.put("recordsTotal", total);
jsonDataResults.put("recordsFiltered", total);
jsonDataResults.put("data", jsonArrayOffres);
return new ResponseEntity<Object>(mapperJSONService.get(token).writeValueAsString(jsonDataResults), HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic List<Client> listeClient() {\n\t\t\treturn null;\n\t\t}",
"public List BestClient();",
"private void listaClient() {\n\t\t\r\n\t\tthis.listaClient.add(cliente);\r\n\t}",
"public List<Clients> getallClients();",
"public void printClientList(){\n for(String client : clientList){\n System.out.println(client);\n }\n System.out.println();\n }",
"protected void listClients() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tsynchronized (processors) {\r\n\t\t\t\tint procCount = processors.count();\r\n\t\t\t\tif (procCount > 0) {\r\n\t\t\t\t\tSimulatorPDUProcessor proc;\r\n\t\t\t\t\tfor (int i = 0; i < procCount; i++) {\r\n\t\t\t\t\t\tproc = (SimulatorPDUProcessor) processors.get(i);\r\n\t\t\t\t\t\tSystem.out.print(proc.getSystemId());\r\n\t\t\t\t\t\tif (!proc.isActive()) {\r\n\t\t\t\t\t\t\tSystem.out.println(\" (inactive)\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"No client connected.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}",
"public List<Client> getAllClient();",
"public void recuperarFacturasCliente(){\n String NIF = datosFactura.recuperarFacturaClienteNIF();\n ArrayList<Factura> facturas = almacen.getFacturas(NIF);\n if(facturas != null){\n for(Factura factura : facturas) {\n System.out.println(\"\\n\");\n System.out.print(factura.toString());\n }\n }\n System.out.println(\"\\n\");\n }",
"public List<T> showAllClients();",
"public ClientList getClients() {\r\n return this.clients;\r\n }",
"private void printAllClients() {\n Set<Client> clients = ctrl.getAllClients();\n clients.stream().forEach(System.out::println);\n }",
"public List<ClientThread> getClients(){\n return clients;\n }",
"@Override\n public KimbleClient[] clientStartInfo() {\n return clients;\n }",
"public void printClientList() {\n uiService.underDevelopment();\n }",
"@Override\n public List<ConsumerMember> listClients() {\n return this.soapClient.listClients(this.getTargetUrl());\n }",
"@Override\n\tpublic String listarClientes() throws MalformedURLException, RemoteException, NotBoundException {\n\t\tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\"+ direccion + \":\" + puerto + \"/almacen\");\n \tString lista = datos.listaClientes();\n \treturn lista;\n \t\n\t}",
"public static ArrayList<Cliente> getClientes()\n {\n return SimulaDB.getInstance().getClientes();\n }",
"public List<Compte> getComptesClient(int numeroClient);",
"public static ArrayList<Client> getClients() {\n return clients;\n }",
"List<User> getAllClients();",
"public ListaCliente() {\n\t\tClienteRepositorio repositorio = FabricaPersistencia.fabricarCliente();\n\t\tList<Cliente> clientes = null;\n\t\ttry {\n\t\t\tclientes = repositorio.getClientes();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tclientes = new ArrayList<Cliente>();\n\t\t}\n\t\tObject[][] grid = new Object[clientes.size()][3];\n\t\tfor (int ct = 0; ct < clientes.size(); ct++) {\n\t\t\tgrid[ct] = new Object[] {clientes.get(ct).getNome(),\n\t\t\t\t\tclientes.get(ct).getEmail()};\n\t\t}\n\t\tJTable table= new JTable(grid, new String[] {\"NOME\", \"EMAIL\"});\n\t\tJScrollPane scroll = new JScrollPane(table);\n\t\tgetContentPane().add(scroll, BorderLayout.CENTER);\n\t\tsetTitle(\"Clientes Cadastrados\");\n\t\tsetSize(600,400);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tsetLocationRelativeTo(null);\n\t}",
"public ArrayList<Cliente> getClientes() {\r\n return clientes;\r\n }",
"Set<Client> getAllClients();",
"public List<Client> getAllClient() {\n \tTypedQuery<Client> query = em.createQuery(\n \"SELECT g FROM Client g ORDER BY g.id\", Client.class);\n \treturn query.getResultList();\n }",
"static void printActiveClients() {\n\t\tint count = 0;\n\t\tfor (ClientThread thread : threads) {\n\t\t\tif (thread != null) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Clients: \" + count);\n\t}",
"@Override\n\tpublic Collection<Client> getAllClients() {\n\t\treturn null;\n\t}",
"public int getClients()\r\n\t{\r\n\t\treturn numberOfClients;\r\n\t}",
"public List<Client> displayClient ()\r\n {\r\n List<Client> clientListe = new ArrayList<Client>();\r\n String sqlrequest = \"SELECT idCLient,nom,prenom,email,nbrSignalisation FROM pi_dev.client ;\";\r\n try {\r\n PreparedStatement ps = MySQLConnection.getInstance().prepareStatement(sqlrequest);\r\n ResultSet resultat = ps.executeQuery(sqlrequest);\r\n while (resultat.next()){\r\n Client client = new Client();\r\n \r\n \r\n client.setEmail(resultat.getString(\"email\"));\r\n client.setIdClient(resultat.getInt(\"idClient\"));\r\n client.setNom(resultat.getString(\"nom\"));\r\n client.setPrenom(resultat.getString(\"prenom\"));\r\n client.setNbrSignalisation(resultat.getInt(\"nbrSignalisation\"));\r\n \r\n clientListe.add(client);\r\n \r\n }\r\n \r\n } catch (SQLException ex) {\r\n Logger.getLogger(ClientDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return clientListe;\r\n }",
"public int clientsCount(){\n return clientsList.size();\n }",
"public List<Client> listerTousClients() throws DaoException {\n\t\ttry {\n\t\t\treturn daoClient.findAll();\n\t\t} catch (Exception e) {\n\t\t\tthrow new DaoException(\"ConseillerService.listerTousClients\" + e);\n\t\t}\n\t}",
"public List<Cliente> getListCliente(){//METODO QUE RETORNA LSITA DE CLIENTES DO BANCO\r\n\t\treturn dao.procurarCliente(atributoPesquisaCli, filtroPesquisaCli);\r\n\t}",
"public List<Cliente> mostrarClientes()\n\t{\n\t\tCliente p;\n\t\tif (! clientes.isEmpty())\n\t\t{\n\t\t\t\n\t\t\tSet<String> ll = clientes.keySet();\n\t\t\tList<String> li = new ArrayList<String>(ll);\n\t\t\tCollections.sort(li);\n\t\t\tListIterator<String> it = li.listIterator();\n\t\t\tList<Cliente> cc = new ArrayList<Cliente>();\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\tp = clientes.get(it.next());\n\t\t\t\tcc.add(p);\n\t\t\t\t\n\t\t\t}\n\t\t\t//Collections.sort(cc, new CompararCedulasClientes());\n\t\t\treturn cc;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n\tpublic List<Cliente> listarClientes() {\n\t\treturn clienteDao.findAll();\n\t}",
"public void AfficherListClient() throws Exception{\n laListeClient = Client_Db_Connect.tousLesClients();\n laListeClient.forEach((c) -> {\n modelClient.addRow(new Object[]{ c.getIdent(),\n c.getRaison(),\n c.getTypeSo(),\n c.getDomaine(),\n c.getAdresse(),\n c.getTel(),\n c.getCa(),\n c.getComment(),\n c.getNbrEmp(),\n c.getDateContrat(),\n c.getAdresseMail()});\n });\n }",
"public static void initializeClientList() {\r\n\t\tClient newClient1 = new Client(1, \"Bob Jones\", \"Brokerage\");\r\n\t\tclientList.add(newClient1);\r\n\t\t\r\n\t\tClient newClient2 = new Client(2, \"Sarah Davis\", \"Retirement\");\r\n\t\tclientList.add(newClient2);\r\n\t\t\r\n\t\tClient newClient3 = new Client(3, \"Amy Friendly\", \"Brokerage\");\r\n\t\tclientList.add(newClient3);\r\n\t\t\r\n\t\tClient newClient4 = new Client(4, \"Johnny Smith\", \"Brokerage\");\r\n\t\tclientList.add(newClient4);\r\n\t\t\r\n\t\tClient newClient5 = new Client(5, \"Carol Spears\", \"Retirement\");\r\n\t\tclientList.add(newClient5);\r\n\t}",
"public List<UserModel> getListOfClient() {\n\t\treturn userDao.getListOfClients();\n\t}",
"public static void clientListUpdater() {\r\n\t\tclientList.clear();\r\n\t\tclientList.addAll(serverConnector.getAllClients());\r\n\t}",
"public List<Cliente> consultarClientes();",
"private void filterClients()\n {\n System.out.println(\"filtered Clients (membership of type 'Gold''):\");\n Set<Client> clients = ctrl.filterClientsByMembershipType(\"Gold\");\n clients.stream().forEach(System.out::println);\n }",
"public ArrayList<ClientHandler> getClientList()\n {\n return clientList;\n }",
"public ArrayList<Client> getClients(String nameClient){\n ArrayList<Client> listClients = new ArrayList<Client>();\n \n \n this.serversList.forEach((server) -> {\n server.getClients().stream().filter((client) -> (client.getName().toLowerCase().contains(nameClient.toLowerCase()))).forEachOrdered((client) -> {\n client.setNameServer(server.getNameServer());\n listClients.add(client);\n });\n });\n \n return listClients;\n }",
"public static void main(String[] args) {\n\t\t\t\tList listClient = new ArrayList();\r\n\t\t\t\t\r\n\t\t\t\tClient client = new Client();\r\n\t\t\t\tclient.setFirstName(\"Eduardo\");\r\n\t\t\t\tclient.setSecondName(\"Mendoza\");\r\n\t\t\t\t\r\n\t\t\t\tlistClient.add(client);\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\tClient newClient = new Client();\r\n\t\t\t\tnewClient.setFirstName(\"Carlos\");\r\n\t\t\t\tnewClient.setSecondName(\"Fuentealba\");\r\n\t\t\t\t\t\t\r\n\t\t\t\tlistClient.add(newClient);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tclient = new Client();\r\n\t\t\t\tclient.setFirstName(\"Pablo\");\r\n\t\t\t\tclient.setSecondName(\"Mondaca\");\r\n\t\t\t\t\r\n\t\t\t\tlistClient.add(client);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"listClient:\"+listClient);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// Mostar los elementos de la lista\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tIterator it = listClient.listIterator();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Detectar que tipo de objeto tiene la lista\r\n\t\t\t\t/*Object obj = null;\r\n\t\t\t\t\r\n\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Casting JAVA\r\n\t\t\t\t\tobj = (Object) it.next();\r\n\t\t\t\t\tSystem.out.println(\"obj:\"+obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}*/\r\n\t\t\t\t\r\n\t\t\t\tClient nclient = null;\r\n\t\t\t\t\r\n\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Casting JAVA\r\n\t\t\t\t\tnclient = (Client) it.next();\r\n\t\t\t\t\tSystem.out.println(\"nclient:\"+nclient);\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"firstName:\"+nclient.getFirstName());\r\n\t\t\t\t\tSystem.out.println(\"secondName:\"+nclient.getSecondName());\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t}",
"@Override\n\tpublic int getNbClients() {\n\t\t// TODO Auto-generated method stub\n\t\tint nbClients=0;\n\t\tfor (ArrayList<TC> quantite : salle.values()) {\t\t//On parcours l'ensemble de la liste pour connaître à chaque tour de\n\t\t\tnbClients += quantite.size();\t\t\t\t\t//boucle le nombre de personne prioritaire.\n\t\t}\n\t\treturn nbClients;\n\t\t\n\t\t// on cherche a donner le nombre de clients dans la salle à l'instant T, pour ce faire on fait la somme de la taille de chaque file d'attente \n// int res=0;\n// for(int i=0;i<maxPrio;i++) {\n// res += salle.get(i).size(); // on fait un get sur la salle d'indice i (correspondant a 1 niveau de priorité) ce qui rend l'ArrayList puis on prend la size de ce get. \n// }\n\t}",
"@Override\r\n public List<Cliente> listarClientes() throws Exception {\r\n Query consulta = entity.createNamedQuery(Cliente.CONSULTA_TODOS_CLIENTES);\r\n List<Cliente> listaClientes = consulta.getResultList();//retorna una lista\r\n return listaClientes;\r\n }",
"@Override\n\tpublic List<String> listarFicherosCliente(int idSesionCliente) throws RemoteException, MalformedURLException, NotBoundException {\t\t\n \tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\"+ direccion + \":\" + puerto + \"/almacen\");\n \tInterfaz.imprime(\"La lista de ficheros de la sesion: \" + idSesionCliente + \" ha sido enviada\");\n return datos.listarFicherosCliente(idSesionCliente);\n \n\t}",
"public ArrayList<Client> getClientList() {\n return this.clientList;\n }",
"public ArrayList<Client> clientList() {\n\t\tint counter = 1; // 일딴 보류\n\t\tConnection conn = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\t\tString query = \"select * from client\";\n\t\tArrayList<Client> client = new ArrayList<Client>();\n\t\tClient object = null;\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\tpstmt = conn.prepareStatement(query);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tobject = new Client();\n\t\t\t\tString cId = rs.getString(\"cId\");\n\t\t\t\tString cPhone = rs.getString(\"cPhone\");\n\t\t\t\tString cName = rs.getString(\"cName\");\n\t\t\t\tint point = rs.getInt(\"cPoint\");\n\t\t\t\tint totalPoint = rs.getInt(\"totalPoint\");\n\n\t\t\t\tobject.setcId(cId);\n\t\t\t\tobject.setcPhone(cPhone);\n\t\t\t\tobject.setcName(cName);\n\t\t\t\tobject.setcPoint(point);\n\t\t\t\tobject.setTotalPoint(totalPoint);\n\n\t\t\t\tclient.add(object);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (conn != null) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t\tif (pstmt != null) {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t}\n\t\t\t\tif (rs != null) {\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn client;\n\t}",
"public Set<String> getGameListClients() {\n return this.gameListClients;\n }",
"public void UserClientAcceptor(ArrayList<User> cleints) {\r\n \tuserClient = (ArrayList<User>)cleints.clone();\r\n \t//System.out.println(userClient);\r\n\t\tList.addAll(cleints);\r\n\t\t}",
"public static void viewConnections(){\n\t\tfor(int i=0; i<Server.clients.size();i++){\n\t\t\tServerThread cliente = Server.clients.get(i);\n\t\t\tlogger.logdate(cliente.getConnection().getInetAddress().getHostName());\n\t\t}\n\t}",
"public Map<String, Cliente> getClientes() {\n\t\treturn clientes;\n\t}",
"public List<Cliente> getClientes() {\n\t\ttry {\n\t\t\t\n\t\t\tList<Cliente> clientes = (List<Cliente>) db.findAll();\n\t\t\t\t\t\n\t\t\treturn clientes;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn new ArrayList<Cliente>();\n\n\t\t}\n\t}",
"private void sortClients()\n {\n System.out.println(\"clients items (alphabetically):\");\n Set<Client> clients = ctrl.sortClientsAlphabetically();\n clients.stream().forEach(System.out::println);\n }",
"@Override\r\n\tpublic String[] getClientNames() {\r\n\t\treturn initData.clientNames;\r\n\t}",
"public ArrayList<DataCliente> listarClientes();",
"public HashMap<String, Profile> getClients() {\n\t\treturn clients;\n\t}",
"public ClientInformation(){\n clientList = new ArrayList<>();\n\n }",
"private void LoadClients(boolean Traitement) {\n\n\t\ttry {\n\t\t\tpanelBouton.getBtnCarteClient().setVisible(false);\n\t\t\tint i = 0;\n\t\t\tGetClientTableModel().clear();\n\t\t\tif (Traitement) {\n\t\t\t\tthis.nom = panelRecherche.getEtNom().getText();\n\t\t\t\tthis.prenom = panelRecherche.getEtPrenom().getText();\n\t\t\t\tliste = gestion.getClients(nom, prenom);\n\t\t\t} else {\n\t\t\t\tString numclient = panelRecherche.getEtNumclient().getText().toString();\n\t\t\t\tif (numclient.isEmpty()) {\n\t\t\t\t\ti = 0;\n\t\t\t\t} else {\n\t\t\t\t\tString patternId = \"^[0-9]+$\";\n\t\t\t\t\tboolean checkId = Pattern.matches(patternId, numclient);\n\t\t\t\t\tif (checkId) {\n\t\t\t\t\t\ti = Integer.parseInt(numclient);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Ce champ peut contenir uniquement des valeurs numériques\");\n\t\t\t\t\t\tRunnable clearText = new Runnable() {\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tpanelRecherche.getEtNumclient().setText(\"\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tSwingUtilities.invokeLater(clearText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tliste = gestion.getClient(i);\n\t\t\t}\n\t\t\tif (liste == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (Client client : liste) {\n\t\t\t\tGetClientTableModel().addRow(client);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t\tArrayList<Commande> cdes = null;\n\t\ttry {\n\t\t\tcdes = gestion.getCdes(resultat);\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}",
"public Clientes() {\n\t\tclientes = new Cliente[MAX_CLIENTES];\n\t}",
"List<GroupUser> getConnectedClients();",
"public ArrayList<Cliente> listaDeClientes() {\n\t\t\t ArrayList<Cliente> misClientes = new ArrayList<Cliente>();\n\t\t\t Conexion conex= new Conexion();\n\t\t\t \n\t\t\t try {\n\t\t\t PreparedStatement consulta = conex.getConnection().prepareStatement(\"SELECT * FROM clientes\");\n\t\t\t ResultSet res = consulta.executeQuery();\n\t\t\t while(res.next()){\n\t\t\t \n\t\t\t int cedula_cliente = Integer.parseInt(res.getString(\"cedula_cliente\"));\n\t\t\t String nombre= res.getString(\"nombre_cliente\");\n\t\t\t String direccion = res.getString(\"direccion_cliente\");\n\t\t\t String email = res.getString(\"email_cliente\");\n\t\t\t String telefono = res.getString(\"telefono_cliente\");\n\t\t\t Cliente persona= new Cliente(cedula_cliente, nombre, direccion, email, telefono);\n\t\t\t misClientes.add(persona);\n\t\t\t }\n\t\t\t res.close();\n\t\t\t consulta.close();\n\t\t\t conex.desconectar();\n\t\t\t \n\t\t\t } catch (Exception e) {\n\t\t\t //JOptionPane.showMessageDialog(null, \"no se pudo consultar la Persona\\n\"+e);\n\t\t\t\t System.out.println(\"No se pudo consultar la persona\\n\"+e);\t\n\t\t\t }\n\t\t\t return misClientes; \n\t\t\t }",
"public String[] getClientNames() {\n return clientNames;\n }",
"@Override\n\tpublic ArrayList<ClienteBean> listarClientes() throws Exception {\n\t\treturn null;\n\t}",
"public List<HotspotClient> getHotspotClientsList() {\n List<HotspotClient> clients = new ArrayList<HotspotClient>();\n synchronized (mHotspotClients) {\n for (HotspotClient client : mHotspotClients.values()) {\n clients.add(new HotspotClient(client));\n }\n }\n return clients;\n }",
"public static ArrayList<MqttClient> getAllClients() {\n return clients;\n }",
"@Override\n public List<Client> getAllClients(){\n log.trace(\"getAllClients --- method entered\");\n List<Client> result = clientRepository.findAll();\n log.trace(\"getAllClients: result={}\", result);\n return result;\n }",
"public ArrayList<ServerClient> displayAll() throws SQLException\n\t{\n\t\tString SQL_P = \"SELECT * FROM Clients\";\n\t\tResultSet rs;\n\n\t\tArrayList<ServerClient> array = new ArrayList<>();\n\t\tStatement stmt = con.createStatement();\n\t\ttry\n\t\t{\n\t\t\trs = stmt.executeQuery(SQL_P);\n\t\t\twhile (rs.next())\n\t\t\t{\n\n\t\t\t}\n\t\t\treturn array;\n\t\t} finally\n\t\t{\n\t\t\tif (stmt != null)\n\t\t\t{\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t}\n\t}",
"public void list(String user) {\n\t\tfor (HandleClient c : clients) {\n\t\t\tif (c.getUserName().equals(user)) {\n\t\t\t\tfor (int a = 0; a < clients.size(); a++) {\n\t\t\t\t\tc.sendList(clients.get(a).name, a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void getClientList(ActionEvent e){\r\n new ClientList().Display();\r\n }",
"public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial.\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n Cliente cl = new Cliente();\n cl.setCodigo(rs.getInt(\"codigo\"));\n cl.setNit(rs.getString(\"nit\"));\n cl.setRazonSocial(rs.getString(\"razonsocial\"));\n cl.setCategoria(rs.getString(\"categoria\"));\n cl.setEmail(rs.getString(\"email\"));\n Calendar cal = new GregorianCalendar();\n cal.setTime(rs.getDate(\"fecharegistro\")); \n cl.setFechaRegistro(cal.getTime());\n cl.setIdioma(rs.getString(\"idioma\"));\n cl.setPais(rs.getString(\"pais\"));\n\t\t\tls.add(cl);\n\t\t}\n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n } \n return ls;\n\t}",
"public List<Cliente> getClienteList () {\n\t\t\n\t\tCriteria crit = HibernateUtil.getSession().createCriteria(Cliente.class);\n\t\tList<Cliente> clienteList = crit.list();\n\t\t\n\t\treturn clienteList;\n\t}",
"public List<String> allClients() throws IOException {\n String httpResponse = httpGet(baseUrl.resolve(\"/automation/v2/clients\"));\n return mapper.readValue(httpResponse, new TypeReference<List<String>>() {\n });\n }",
"private static void getClients() throws IOException {\r\n\t\tbidders=new ArrayList<Socket>();\r\n\t\tserverSocket=new ServerSocket(portno);\r\n\t\twhile ((bidders.size()<numBidders)&&(auctioneer==null)) {\r\n\t\t\tSocket temp=serverSocket.accept();\r\n\t\t\t//if (this client is a bidder)\r\n\t\t\t\tbidders.add(temp);\r\n\t\t\t//if (this client is the auctioneer)\r\n\t\t\t\tauctioneer=temp;\r\n\t\t}\r\n\t}",
"public Iterator getClients() {\n rrwl_serverclientlist.readLock().lock();\n try {\n return clientList.iterator();\n } finally {\n rrwl_serverclientlist.readLock().unlock();\n }\n }",
"@Override\n\tpublic List<Socket> GetConnectedClients() {\n\t\t\n\t\tArrayList<Socket> list = new ArrayList<Socket>();\n\t\t\n\t\tif(clients == null)return list;\n\t\t\n\t\tfor(Socket s : clients)\n\t\t{\n\t\t\tlist.add(s);\n\t\t}\n\t\t\n\t\treturn list;\n\t}",
"public List<Integer> getAllIDClient(){\n\t\tPreparedStatement ps = null;\n\t\tResultSet resultatRequete =null;\n\t\t\n\t\ttry {\n\t\t\tString requeteSqlGetAll=\"SELECT id_client FROM clients\";\n\t\t\tps = this.connection.prepareStatement(requeteSqlGetAll);\n\t\t\t\n\t\t\tresultatRequete = ps.executeQuery();\n\n\t\t\tClient client = null;\n\t\t\t\n\t\t\tList<Integer> listeIDClient = new ArrayList <>();\n\n\t\t\twhile (resultatRequete.next()) {\n\t\t\t\tint idClient = resultatRequete.getInt(1);\n\t\t\t\t\n\t\t\t\tlisteIDClient.add(idClient);\n\t\t\t\t\n\t\t\t}//end while\n\t\t\treturn listeIDClient;\n\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tif(resultatRequete!= null) resultatRequete.close();\n\t\t\t\tif(ps!= null) ps.close();\n\t\t\t\t\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public List<Cliente> getClientes() {\n List<Cliente> cli = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/archivo.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String nombreCliente = st.nextToken();\n String nombreEmpresa = st.nextToken();\n String ciudad = st.nextToken();\n String deuda = st.nextToken();\n String precioVentaSaco = st.nextToken();\n\n Cliente cliente = new Cliente(\n Integer.parseInt(id),\n nombreCliente,\n nombreEmpresa,\n ciudad,\n Float.parseFloat(deuda),\n Float.parseFloat(precioVentaSaco)\n );\n\n cli.add(cliente);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return cli;\n }",
"@Override\r\n\tpublic List<Client> selectclient() {\n\t\tList<Client> list=this.getSqlSessionTemplate().selectList(changToNameSpace(\"selectclient\"));\r\n\t\treturn list;\r\n\t}",
"public List getClientIDHavingPortal() {\n Session session = ConnectionFactory.getInstance().getSession();\n Query query;\n \n \n try {\n /*\n * Build HQL (Hibernate Query Language) query to retrieve a list\n * of all the items currently stored by Hibernate.\n */\n \n query = session.createQuery(\"select user.id_client from app.user.User user where user.userType = 'client' group by user.id_client order by user.id_client\");\n return query.list();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n }",
"public List<Client> findAll() throws DataAccessLayerException {\n try {\n Subject.doAs(LoginController.getLoginContext().getSubject(), new MyPrivilegedAction(\"CLIENT\", Permission.READ));\n return super.findAll(Client.class);\n } catch (AccessControlException e) {\n e.printStackTrace();\n }\n return new ArrayList<>();\n }",
"public RepositorioClientesArray() {\n\t\tclientes = new Cliente[TAMANHO_CACHE];\n\t\tindice = 0;\n\t}",
"public List<Client> findAllClient() throws SQLException {\n\t\treturn iDaoClient.findAllClient();\n\t}",
"@Override\n public String toString() {\n return \"Client{\" +\n \"nom='\" + nom + '\\'' +\n \", prenom='\" + prenom + '\\'' +\n \", adresse='\" + adresse + '\\'' +\n \", methode tarif=\" + calculerTarif.toString() +\n \", pointsDeFidelite=\" + pointsDeFidelite +\n \", listeVehicule=\" + listeVehicule +\n + '}';\n }",
"public synchronized void sendUserList()\n {\n String userString = \"USERLIST#\" + getUsersToString();\n for (ClientHandler ch : clientList)\n {\n ch.sendUserList(userString);\n }\n }",
"public ArrayList<Project> getClients() {\n try {\n ArrayList<Project> clients = new ArrayList<Project>();\n String selectClients = \"SELECT NAME, CLIENT_ID FROM CLIENTS\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(selectClients);\n ResultSet rs = ps.executeQuery();\n while (rs.next()) {\n String client = rs.getString(\"NAME\");\n String clientId = rs.getString(\"CLIENT_ID\");\n Project p = new Project(client, clientId);\n clients.add(p);\n }\n rs.close();\n ps.close();\n return clients;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }",
"public List getUserListShowToClient() {\n /*\n * Use the ConnectionFactory to retrieve an open\n * Hibernate Session.\n *\n */\n Session session = ConnectionFactory.getInstance().getSession();\n Query query;\n\n try {\n /*\n * Build HQL (Hibernate Query Language) query to retrieve a list\n * of all the items currently stored by Hibernate.\n */\n query = session.createQuery(\"select user from app.user.User user where user.currentEmployee = 'true' and user.clientShow = 'TRUE' order by user.lastName, user.firstName\");\n return query.list();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n }",
"private void getClientList(String loginUserId) {\n if (!TextUtils.isEmpty(loginUserId) && NetworkUtil.isOnline(this)){\n initGetInvoiceAPIResources(loginUserId);\n\n }else {\n // Snack Bar to show success message that record is wrong\n Snackbar.make(mainLayout, \"Please Check Internet Connection\", Snackbar.LENGTH_LONG).show();\n }\n }",
"public ClienteConsultas() {\n listadeClientes = new ArrayList<>();\n clienteSeleccionado = new ArrayList<>();\n }",
"@Override\n\tpublic List<Clientes> findAllClientes() throws Exception {\n\t\treturn clienteLogic.findAll();\n\t}",
"public List<String> getListOfClientNames() throws Exception {\n if (isNotAt()) {\n goTo();\n }\n return getTableDataByColumn(clientsTable, 0);\n }",
"@Override\r\n\tpublic List<Client> consulterClients(String mc) {\n\t\treturn dao.consulterClients(mc);\r\n\t}",
"@Override\n\tpublic List<Cliente> readAll() {\n\t\treturn clientedao.readAll();\n\t}",
"@Generated\n public List<Clientes> getClientes() {\n if (clientes == null) {\n __throwIfDetached();\n ClientesDao targetDao = daoSession.getClientesDao();\n List<Clientes> clientesNew = targetDao._queryUsuarios_Clientes(id);\n synchronized (this) {\n if(clientes == null) {\n clientes = clientesNew;\n }\n }\n }\n return clientes;\n }",
"public String LIST(){\n String nameList = \"\";\n Enumeration keys = this.clientData.keys();\n while(keys.hasMoreElements()){\n nameList += keys.nextElement() + \" \";\n }\n return \"OK \" + nameList;\n }",
"public void getClients(AsyncCallback<List<Client>> cb);",
"public Interfaz_RegistroClientes() {\n initComponents();\n limpiar();\n }",
"@Override\n\tpublic List<Cliente> getAll() {\n\t\treturn null;\n\t}",
"public Client[] getClients() {\r\n // Get all the contents from the table clients with columns as keys mapped\r\n // to an ArrayList of\r\n // ordered row values\r\n HashMap<String, ArrayList<String>> clientInfo = getAllTableContents(\"clients\");\r\n // Parse the clients into an ArrayList of Client objects\r\n ArrayList<Client> clients = parseClients(clientInfo);\r\n // Cast to an array of Client and return\r\n Client[] temp = new Client[clients.size()];\r\n return clients.toArray(temp);\r\n }",
"@Override\n\tpublic void cargarClienteSinCobrador() {\n\t\tpopup.showPopup();\n\t\tif(UIHomeSesion.usuario!=null){\n\t\tlista = new ArrayList<ClienteProxy>();\n\t\tFACTORY.initialize(EVENTBUS);\n\t\tContextGestionCobranza context = FACTORY.contextGestionCobranza();\n\t\tRequest<List<ClienteProxy>> request = context.listarClienteSinCobrador(UIHomeSesion.usuario.getIdUsuario()).with(\"beanUsuario\");\n\t\trequest.fire(new Receiver<List<ClienteProxy>>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<ClienteProxy> response) {\n\t\t\t\tlista.addAll(response);\t\t\t\t\n\t\t\t\tgrid.setData(lista);\t\t\t\t\n\t\t\t\tgrid.getSelectionModel().clear();\n\t\t\t\tpopup.hidePopup();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n public void onFailure(ServerFailure error) {\n popup.hidePopup();\n //Window.alert(error.getMessage());\n Notification not=new Notification(Notification.WARNING,error.getMessage());\n not.showPopup();\n }\n\t\t\t\n\t\t});\n\t\t}\n\t}",
"@Override\n\tpublic List<Cliente> getByIdCliente(long id) {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Cliente> clients =getCurrentSession().createQuery(\"from Cliente c join fetch c.grupos grupos join fetch grupos.clientes where c.id='\"+id+\"' and c.activo=1\" ).list();\n return clients;\n\t}",
"@GetMapping(\"/clients/{idClient}/comptes\")\n public Iterable<Long> getComptesClient(@PathVariable(\"idClient\") Client c) {\n Iterable<Long> comptes = serviceCollaborateur.getListeIdComptes(c.getId());\n return comptes;\n }"
] | [
"0.7558732",
"0.75542516",
"0.7386437",
"0.73738164",
"0.73117393",
"0.72515625",
"0.7198686",
"0.7176428",
"0.71606714",
"0.7120051",
"0.71196026",
"0.7098093",
"0.7092957",
"0.70228404",
"0.69810677",
"0.69576395",
"0.6932318",
"0.68726504",
"0.6853204",
"0.68416375",
"0.6805783",
"0.67882586",
"0.67832506",
"0.6745917",
"0.6744247",
"0.6744163",
"0.67238814",
"0.6719444",
"0.6709819",
"0.66659343",
"0.6655575",
"0.665402",
"0.66519034",
"0.6628194",
"0.6623557",
"0.66205454",
"0.66187125",
"0.66095096",
"0.6604294",
"0.66037375",
"0.65999246",
"0.6591275",
"0.6568575",
"0.65640223",
"0.6561607",
"0.65563595",
"0.65406424",
"0.65284175",
"0.6514122",
"0.65002906",
"0.65001416",
"0.6484011",
"0.64820474",
"0.64769083",
"0.6476277",
"0.6465567",
"0.6456717",
"0.644204",
"0.6441614",
"0.64348495",
"0.6426347",
"0.6424439",
"0.6407489",
"0.64005613",
"0.63988703",
"0.63973",
"0.638985",
"0.6373299",
"0.6367209",
"0.6357737",
"0.6357701",
"0.6341683",
"0.6341597",
"0.6332654",
"0.63272744",
"0.63223386",
"0.63206",
"0.6317298",
"0.62908417",
"0.6286876",
"0.6281277",
"0.6276298",
"0.627558",
"0.6270722",
"0.6269688",
"0.6257623",
"0.625269",
"0.6210937",
"0.6210502",
"0.62103754",
"0.6190329",
"0.6175687",
"0.61697507",
"0.6159054",
"0.6154155",
"0.6146719",
"0.61336994",
"0.61234045",
"0.61228406",
"0.61056334",
"0.60978365"
] | 0.0 | -1 |
Liste des factures clients | @Retryable(
maxAttempts = Application.retry_max_attempt,
backoff = @Backoff(delay = 5000))
@ApiOperation(value = "Liste des factures clients")
@ApiResponses(value = {
@ApiResponse(code = 401, message = "Vous devez être identifié pour effectuer cette opération"),
@ApiResponse(code = 403, message = "Vous n'êtes pas autorisé à effectuer cette action (uniquement les admin ou opérateurs ayant droits)"),
@ApiResponse(code = 200, message = "Liste des actions retournées (au format datatable - contenu dans data, nombre total dans recordsTotal)", response = MapDatatable.class)
})
@ResponseBody
@RequestMapping(
produces = "application/json",
value = "/factures/client/liste",
method = RequestMethod.POST)
@CrossOrigin
public ResponseEntity<Object> get_liste_facures(
@ApiParam(value = "Est ce qu'il faut charger les operations ?", required = false) @RequestParam(value = "operations", required=false) String load_operations,
@ApiParam(value = "Jeton JWT pour autentification", required = true) @RequestHeader("Token") String token) throws JsonProcessingException {
// vérifie que le jeton est valide et que les droits lui permettent de consulter les admin katmars
if (!jwtProvider.isValidJWT(token)) {
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Jeton invalide, veuillez vous reconnecter.");
}
if (!SecurityUtils.adminOrOperateurWithDroit(jwtProvider, token, OperateurListeDeDroits.CONSULTER_FACTURES_CLIENT) && !SecurityUtils.client(jwtProvider, token) && !SecurityUtils.client_personnelWithDroit(jwtProvider, token, ClientPersonnelListeDeDroits.VOIR_FACTURES)) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Vous n'avez pas le droit d'effectuer cette opération.");
}
String code_pays = jwtProvider.getCodePays(token);
// tri, sens et numéro de page
String order_column_bdd = "numeroFacture";
String sort_bdd = "asc";
// filtrage
ParentSpecificationsBuilder builder = new OperationSpecificationsBuilder();
Specification spec_general = DatatableUtils.buildFiltres(null, null, builder, null);
if (spec_general == null) {
spec_general = Specification.where(DatatableUtils.buildFiltres(null, null, builder, null));
}
// filtrage par pays kamtar
Specification spec_pays = new Specification<ActionAudit>() {
public Predicate toPredicate(Root<ActionAudit> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
List<Predicate> predicates = new ArrayList<Predicate>();
predicates.add(builder.equal(root.get("codePays"), code_pays));
return builder.and(predicates.toArray(new Predicate[predicates.size()]));
}
};
spec_general = spec_general.and(spec_pays);
// préparation les deux requêtes (résultat et comptage)
List<FactureClient> leads = factureClientService.getAllPagined(order_column_bdd, sort_bdd, 0, 999999, spec_general).getContent();
if (load_operations != null && "1".equals(load_operations)) {
// chargement des opérations
List<FactureClient> leads_operations = new ArrayList<FactureClient>();
for (FactureClient facture : leads) {
String[] code_operations = facture.getListeOperations().split("@");
Long[] code_long_operations = new Long[code_operations.length];
int i = 0;
for (String code_operation: code_operations) {
try {
code_long_operations[i] = Long.valueOf(code_operation);
i++;
} catch (NumberFormatException e ) {
// erreur silencieuse
}
}
List<Operation> operations = operationService.getByCodes(code_long_operations, code_pays);
facture.setOperations(operations);
leads_operations.add(facture);
}
leads = leads_operations;
}
actionAuditService.getFacturesClient(token);
return new ResponseEntity<Object>(mapperJSONService.get(token).writeValueAsString(leads), HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\tpublic List<Client> listeClient() {\n\t\t\treturn null;\n\t\t}",
"public List BestClient();",
"private void listaClient() {\n\t\t\r\n\t\tthis.listaClient.add(cliente);\r\n\t}",
"public List<Clients> getallClients();",
"public void printClientList(){\n for(String client : clientList){\n System.out.println(client);\n }\n System.out.println();\n }",
"protected void listClients() {\r\n\t\tif (smscListener != null) {\r\n\t\t\tsynchronized (processors) {\r\n\t\t\t\tint procCount = processors.count();\r\n\t\t\t\tif (procCount > 0) {\r\n\t\t\t\t\tSimulatorPDUProcessor proc;\r\n\t\t\t\t\tfor (int i = 0; i < procCount; i++) {\r\n\t\t\t\t\t\tproc = (SimulatorPDUProcessor) processors.get(i);\r\n\t\t\t\t\t\tSystem.out.print(proc.getSystemId());\r\n\t\t\t\t\t\tif (!proc.isActive()) {\r\n\t\t\t\t\t\t\tSystem.out.println(\" (inactive)\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.println(\"No client connected.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"You must start listener first.\");\r\n\t\t}\r\n\t}",
"public List<Client> getAllClient();",
"public void recuperarFacturasCliente(){\n String NIF = datosFactura.recuperarFacturaClienteNIF();\n ArrayList<Factura> facturas = almacen.getFacturas(NIF);\n if(facturas != null){\n for(Factura factura : facturas) {\n System.out.println(\"\\n\");\n System.out.print(factura.toString());\n }\n }\n System.out.println(\"\\n\");\n }",
"public List<T> showAllClients();",
"public ClientList getClients() {\r\n return this.clients;\r\n }",
"private void printAllClients() {\n Set<Client> clients = ctrl.getAllClients();\n clients.stream().forEach(System.out::println);\n }",
"public List<ClientThread> getClients(){\n return clients;\n }",
"@Override\n public KimbleClient[] clientStartInfo() {\n return clients;\n }",
"public void printClientList() {\n uiService.underDevelopment();\n }",
"@Override\n public List<ConsumerMember> listClients() {\n return this.soapClient.listClients(this.getTargetUrl());\n }",
"@Override\n\tpublic String listarClientes() throws MalformedURLException, RemoteException, NotBoundException {\n\t\tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\"+ direccion + \":\" + puerto + \"/almacen\");\n \tString lista = datos.listaClientes();\n \treturn lista;\n \t\n\t}",
"public static ArrayList<Cliente> getClientes()\n {\n return SimulaDB.getInstance().getClientes();\n }",
"public List<Compte> getComptesClient(int numeroClient);",
"public static ArrayList<Client> getClients() {\n return clients;\n }",
"List<User> getAllClients();",
"public ListaCliente() {\n\t\tClienteRepositorio repositorio = FabricaPersistencia.fabricarCliente();\n\t\tList<Cliente> clientes = null;\n\t\ttry {\n\t\t\tclientes = repositorio.getClientes();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tclientes = new ArrayList<Cliente>();\n\t\t}\n\t\tObject[][] grid = new Object[clientes.size()][3];\n\t\tfor (int ct = 0; ct < clientes.size(); ct++) {\n\t\t\tgrid[ct] = new Object[] {clientes.get(ct).getNome(),\n\t\t\t\t\tclientes.get(ct).getEmail()};\n\t\t}\n\t\tJTable table= new JTable(grid, new String[] {\"NOME\", \"EMAIL\"});\n\t\tJScrollPane scroll = new JScrollPane(table);\n\t\tgetContentPane().add(scroll, BorderLayout.CENTER);\n\t\tsetTitle(\"Clientes Cadastrados\");\n\t\tsetSize(600,400);\n\t\tsetDefaultCloseOperation(DISPOSE_ON_CLOSE);\n\t\tsetLocationRelativeTo(null);\n\t}",
"public ArrayList<Cliente> getClientes() {\r\n return clientes;\r\n }",
"Set<Client> getAllClients();",
"public List<Client> getAllClient() {\n \tTypedQuery<Client> query = em.createQuery(\n \"SELECT g FROM Client g ORDER BY g.id\", Client.class);\n \treturn query.getResultList();\n }",
"static void printActiveClients() {\n\t\tint count = 0;\n\t\tfor (ClientThread thread : threads) {\n\t\t\tif (thread != null) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Clients: \" + count);\n\t}",
"@Override\n\tpublic Collection<Client> getAllClients() {\n\t\treturn null;\n\t}",
"public int getClients()\r\n\t{\r\n\t\treturn numberOfClients;\r\n\t}",
"public List<Client> displayClient ()\r\n {\r\n List<Client> clientListe = new ArrayList<Client>();\r\n String sqlrequest = \"SELECT idCLient,nom,prenom,email,nbrSignalisation FROM pi_dev.client ;\";\r\n try {\r\n PreparedStatement ps = MySQLConnection.getInstance().prepareStatement(sqlrequest);\r\n ResultSet resultat = ps.executeQuery(sqlrequest);\r\n while (resultat.next()){\r\n Client client = new Client();\r\n \r\n \r\n client.setEmail(resultat.getString(\"email\"));\r\n client.setIdClient(resultat.getInt(\"idClient\"));\r\n client.setNom(resultat.getString(\"nom\"));\r\n client.setPrenom(resultat.getString(\"prenom\"));\r\n client.setNbrSignalisation(resultat.getInt(\"nbrSignalisation\"));\r\n \r\n clientListe.add(client);\r\n \r\n }\r\n \r\n } catch (SQLException ex) {\r\n Logger.getLogger(ClientDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return clientListe;\r\n }",
"public int clientsCount(){\n return clientsList.size();\n }",
"public List<Client> listerTousClients() throws DaoException {\n\t\ttry {\n\t\t\treturn daoClient.findAll();\n\t\t} catch (Exception e) {\n\t\t\tthrow new DaoException(\"ConseillerService.listerTousClients\" + e);\n\t\t}\n\t}",
"public List<Cliente> getListCliente(){//METODO QUE RETORNA LSITA DE CLIENTES DO BANCO\r\n\t\treturn dao.procurarCliente(atributoPesquisaCli, filtroPesquisaCli);\r\n\t}",
"public List<Cliente> mostrarClientes()\n\t{\n\t\tCliente p;\n\t\tif (! clientes.isEmpty())\n\t\t{\n\t\t\t\n\t\t\tSet<String> ll = clientes.keySet();\n\t\t\tList<String> li = new ArrayList<String>(ll);\n\t\t\tCollections.sort(li);\n\t\t\tListIterator<String> it = li.listIterator();\n\t\t\tList<Cliente> cc = new ArrayList<Cliente>();\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\tp = clientes.get(it.next());\n\t\t\t\tcc.add(p);\n\t\t\t\t\n\t\t\t}\n\t\t\t//Collections.sort(cc, new CompararCedulasClientes());\n\t\t\treturn cc;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n\tpublic List<Cliente> listarClientes() {\n\t\treturn clienteDao.findAll();\n\t}",
"public void AfficherListClient() throws Exception{\n laListeClient = Client_Db_Connect.tousLesClients();\n laListeClient.forEach((c) -> {\n modelClient.addRow(new Object[]{ c.getIdent(),\n c.getRaison(),\n c.getTypeSo(),\n c.getDomaine(),\n c.getAdresse(),\n c.getTel(),\n c.getCa(),\n c.getComment(),\n c.getNbrEmp(),\n c.getDateContrat(),\n c.getAdresseMail()});\n });\n }",
"public static void initializeClientList() {\r\n\t\tClient newClient1 = new Client(1, \"Bob Jones\", \"Brokerage\");\r\n\t\tclientList.add(newClient1);\r\n\t\t\r\n\t\tClient newClient2 = new Client(2, \"Sarah Davis\", \"Retirement\");\r\n\t\tclientList.add(newClient2);\r\n\t\t\r\n\t\tClient newClient3 = new Client(3, \"Amy Friendly\", \"Brokerage\");\r\n\t\tclientList.add(newClient3);\r\n\t\t\r\n\t\tClient newClient4 = new Client(4, \"Johnny Smith\", \"Brokerage\");\r\n\t\tclientList.add(newClient4);\r\n\t\t\r\n\t\tClient newClient5 = new Client(5, \"Carol Spears\", \"Retirement\");\r\n\t\tclientList.add(newClient5);\r\n\t}",
"public List<UserModel> getListOfClient() {\n\t\treturn userDao.getListOfClients();\n\t}",
"public static void clientListUpdater() {\r\n\t\tclientList.clear();\r\n\t\tclientList.addAll(serverConnector.getAllClients());\r\n\t}",
"public List<Cliente> consultarClientes();",
"private void filterClients()\n {\n System.out.println(\"filtered Clients (membership of type 'Gold''):\");\n Set<Client> clients = ctrl.filterClientsByMembershipType(\"Gold\");\n clients.stream().forEach(System.out::println);\n }",
"public ArrayList<ClientHandler> getClientList()\n {\n return clientList;\n }",
"public ArrayList<Client> getClients(String nameClient){\n ArrayList<Client> listClients = new ArrayList<Client>();\n \n \n this.serversList.forEach((server) -> {\n server.getClients().stream().filter((client) -> (client.getName().toLowerCase().contains(nameClient.toLowerCase()))).forEachOrdered((client) -> {\n client.setNameServer(server.getNameServer());\n listClients.add(client);\n });\n });\n \n return listClients;\n }",
"public static void main(String[] args) {\n\t\t\t\tList listClient = new ArrayList();\r\n\t\t\t\t\r\n\t\t\t\tClient client = new Client();\r\n\t\t\t\tclient.setFirstName(\"Eduardo\");\r\n\t\t\t\tclient.setSecondName(\"Mendoza\");\r\n\t\t\t\t\r\n\t\t\t\tlistClient.add(client);\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\tClient newClient = new Client();\r\n\t\t\t\tnewClient.setFirstName(\"Carlos\");\r\n\t\t\t\tnewClient.setSecondName(\"Fuentealba\");\r\n\t\t\t\t\t\t\r\n\t\t\t\tlistClient.add(newClient);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tclient = new Client();\r\n\t\t\t\tclient.setFirstName(\"Pablo\");\r\n\t\t\t\tclient.setSecondName(\"Mondaca\");\r\n\t\t\t\t\r\n\t\t\t\tlistClient.add(client);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tSystem.out.println(\"listClient:\"+listClient);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// Mostar los elementos de la lista\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tIterator it = listClient.listIterator();\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//Detectar que tipo de objeto tiene la lista\r\n\t\t\t\t/*Object obj = null;\r\n\t\t\t\t\r\n\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Casting JAVA\r\n\t\t\t\t\tobj = (Object) it.next();\r\n\t\t\t\t\tSystem.out.println(\"obj:\"+obj);\r\n\t\t\t\t\t\r\n\t\t\t\t}*/\r\n\t\t\t\t\r\n\t\t\t\tClient nclient = null;\r\n\t\t\t\t\r\n\t\t\t\twhile (it.hasNext()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Casting JAVA\r\n\t\t\t\t\tnclient = (Client) it.next();\r\n\t\t\t\t\tSystem.out.println(\"nclient:\"+nclient);\r\n\t\t\t\t\t\r\n\t\t\t\t\tSystem.out.println(\"firstName:\"+nclient.getFirstName());\r\n\t\t\t\t\tSystem.out.println(\"secondName:\"+nclient.getSecondName());\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t}",
"@Override\n\tpublic int getNbClients() {\n\t\t// TODO Auto-generated method stub\n\t\tint nbClients=0;\n\t\tfor (ArrayList<TC> quantite : salle.values()) {\t\t//On parcours l'ensemble de la liste pour connaître à chaque tour de\n\t\t\tnbClients += quantite.size();\t\t\t\t\t//boucle le nombre de personne prioritaire.\n\t\t}\n\t\treturn nbClients;\n\t\t\n\t\t// on cherche a donner le nombre de clients dans la salle à l'instant T, pour ce faire on fait la somme de la taille de chaque file d'attente \n// int res=0;\n// for(int i=0;i<maxPrio;i++) {\n// res += salle.get(i).size(); // on fait un get sur la salle d'indice i (correspondant a 1 niveau de priorité) ce qui rend l'ArrayList puis on prend la size de ce get. \n// }\n\t}",
"@Override\r\n public List<Cliente> listarClientes() throws Exception {\r\n Query consulta = entity.createNamedQuery(Cliente.CONSULTA_TODOS_CLIENTES);\r\n List<Cliente> listaClientes = consulta.getResultList();//retorna una lista\r\n return listaClientes;\r\n }",
"@Override\n\tpublic List<String> listarFicherosCliente(int idSesionCliente) throws RemoteException, MalformedURLException, NotBoundException {\t\t\n \tdatos = (ServicioDatosInterface) Naming.lookup(\"rmi://\"+ direccion + \":\" + puerto + \"/almacen\");\n \tInterfaz.imprime(\"La lista de ficheros de la sesion: \" + idSesionCliente + \" ha sido enviada\");\n return datos.listarFicherosCliente(idSesionCliente);\n \n\t}",
"public ArrayList<Client> getClientList() {\n return this.clientList;\n }",
"public ArrayList<Client> clientList() {\n\t\tint counter = 1; // 일딴 보류\n\t\tConnection conn = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\t\tString query = \"select * from client\";\n\t\tArrayList<Client> client = new ArrayList<Client>();\n\t\tClient object = null;\n\t\ttry {\n\t\t\tconn = getConnection();\n\t\t\tpstmt = conn.prepareStatement(query);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tobject = new Client();\n\t\t\t\tString cId = rs.getString(\"cId\");\n\t\t\t\tString cPhone = rs.getString(\"cPhone\");\n\t\t\t\tString cName = rs.getString(\"cName\");\n\t\t\t\tint point = rs.getInt(\"cPoint\");\n\t\t\t\tint totalPoint = rs.getInt(\"totalPoint\");\n\n\t\t\t\tobject.setcId(cId);\n\t\t\t\tobject.setcPhone(cPhone);\n\t\t\t\tobject.setcName(cName);\n\t\t\t\tobject.setcPoint(point);\n\t\t\t\tobject.setTotalPoint(totalPoint);\n\n\t\t\t\tclient.add(object);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (conn != null) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t\tif (pstmt != null) {\n\t\t\t\t\tpstmt.close();\n\t\t\t\t}\n\t\t\t\tif (rs != null) {\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn client;\n\t}",
"public Set<String> getGameListClients() {\n return this.gameListClients;\n }",
"public void UserClientAcceptor(ArrayList<User> cleints) {\r\n \tuserClient = (ArrayList<User>)cleints.clone();\r\n \t//System.out.println(userClient);\r\n\t\tList.addAll(cleints);\r\n\t\t}",
"public static void viewConnections(){\n\t\tfor(int i=0; i<Server.clients.size();i++){\n\t\t\tServerThread cliente = Server.clients.get(i);\n\t\t\tlogger.logdate(cliente.getConnection().getInetAddress().getHostName());\n\t\t}\n\t}",
"public Map<String, Cliente> getClientes() {\n\t\treturn clientes;\n\t}",
"public List<Cliente> getClientes() {\n\t\ttry {\n\t\t\t\n\t\t\tList<Cliente> clientes = (List<Cliente>) db.findAll();\n\t\t\t\t\t\n\t\t\treturn clientes;\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn new ArrayList<Cliente>();\n\n\t\t}\n\t}",
"private void sortClients()\n {\n System.out.println(\"clients items (alphabetically):\");\n Set<Client> clients = ctrl.sortClientsAlphabetically();\n clients.stream().forEach(System.out::println);\n }",
"@Override\r\n\tpublic String[] getClientNames() {\r\n\t\treturn initData.clientNames;\r\n\t}",
"public ArrayList<DataCliente> listarClientes();",
"public HashMap<String, Profile> getClients() {\n\t\treturn clients;\n\t}",
"public ClientInformation(){\n clientList = new ArrayList<>();\n\n }",
"private void LoadClients(boolean Traitement) {\n\n\t\ttry {\n\t\t\tpanelBouton.getBtnCarteClient().setVisible(false);\n\t\t\tint i = 0;\n\t\t\tGetClientTableModel().clear();\n\t\t\tif (Traitement) {\n\t\t\t\tthis.nom = panelRecherche.getEtNom().getText();\n\t\t\t\tthis.prenom = panelRecherche.getEtPrenom().getText();\n\t\t\t\tliste = gestion.getClients(nom, prenom);\n\t\t\t} else {\n\t\t\t\tString numclient = panelRecherche.getEtNumclient().getText().toString();\n\t\t\t\tif (numclient.isEmpty()) {\n\t\t\t\t\ti = 0;\n\t\t\t\t} else {\n\t\t\t\t\tString patternId = \"^[0-9]+$\";\n\t\t\t\t\tboolean checkId = Pattern.matches(patternId, numclient);\n\t\t\t\t\tif (checkId) {\n\t\t\t\t\t\ti = Integer.parseInt(numclient);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjavax.swing.JOptionPane.showMessageDialog(null,\n\t\t\t\t\t\t\t\t\"Ce champ peut contenir uniquement des valeurs numériques\");\n\t\t\t\t\t\tRunnable clearText = new Runnable() {\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\tpanelRecherche.getEtNumclient().setText(\"\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tSwingUtilities.invokeLater(clearText);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tliste = gestion.getClient(i);\n\t\t\t}\n\t\t\tif (liste == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (Client client : liste) {\n\t\t\t\tGetClientTableModel().addRow(client);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\n\t\t}\n\n\t\tArrayList<Commande> cdes = null;\n\t\ttry {\n\t\t\tcdes = gestion.getCdes(resultat);\n\t\t} catch (Exception e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\n\t}",
"public Clientes() {\n\t\tclientes = new Cliente[MAX_CLIENTES];\n\t}",
"List<GroupUser> getConnectedClients();",
"public ArrayList<Cliente> listaDeClientes() {\n\t\t\t ArrayList<Cliente> misClientes = new ArrayList<Cliente>();\n\t\t\t Conexion conex= new Conexion();\n\t\t\t \n\t\t\t try {\n\t\t\t PreparedStatement consulta = conex.getConnection().prepareStatement(\"SELECT * FROM clientes\");\n\t\t\t ResultSet res = consulta.executeQuery();\n\t\t\t while(res.next()){\n\t\t\t \n\t\t\t int cedula_cliente = Integer.parseInt(res.getString(\"cedula_cliente\"));\n\t\t\t String nombre= res.getString(\"nombre_cliente\");\n\t\t\t String direccion = res.getString(\"direccion_cliente\");\n\t\t\t String email = res.getString(\"email_cliente\");\n\t\t\t String telefono = res.getString(\"telefono_cliente\");\n\t\t\t Cliente persona= new Cliente(cedula_cliente, nombre, direccion, email, telefono);\n\t\t\t misClientes.add(persona);\n\t\t\t }\n\t\t\t res.close();\n\t\t\t consulta.close();\n\t\t\t conex.desconectar();\n\t\t\t \n\t\t\t } catch (Exception e) {\n\t\t\t //JOptionPane.showMessageDialog(null, \"no se pudo consultar la Persona\\n\"+e);\n\t\t\t\t System.out.println(\"No se pudo consultar la persona\\n\"+e);\t\n\t\t\t }\n\t\t\t return misClientes; \n\t\t\t }",
"public String[] getClientNames() {\n return clientNames;\n }",
"@Override\n\tpublic ArrayList<ClienteBean> listarClientes() throws Exception {\n\t\treturn null;\n\t}",
"public List<HotspotClient> getHotspotClientsList() {\n List<HotspotClient> clients = new ArrayList<HotspotClient>();\n synchronized (mHotspotClients) {\n for (HotspotClient client : mHotspotClients.values()) {\n clients.add(new HotspotClient(client));\n }\n }\n return clients;\n }",
"public static ArrayList<MqttClient> getAllClients() {\n return clients;\n }",
"@Override\n public List<Client> getAllClients(){\n log.trace(\"getAllClients --- method entered\");\n List<Client> result = clientRepository.findAll();\n log.trace(\"getAllClients: result={}\", result);\n return result;\n }",
"public ArrayList<ServerClient> displayAll() throws SQLException\n\t{\n\t\tString SQL_P = \"SELECT * FROM Clients\";\n\t\tResultSet rs;\n\n\t\tArrayList<ServerClient> array = new ArrayList<>();\n\t\tStatement stmt = con.createStatement();\n\t\ttry\n\t\t{\n\t\t\trs = stmt.executeQuery(SQL_P);\n\t\t\twhile (rs.next())\n\t\t\t{\n\n\t\t\t}\n\t\t\treturn array;\n\t\t} finally\n\t\t{\n\t\t\tif (stmt != null)\n\t\t\t{\n\t\t\t\tstmt.close();\n\t\t\t}\n\t\t}\n\t}",
"public void list(String user) {\n\t\tfor (HandleClient c : clients) {\n\t\t\tif (c.getUserName().equals(user)) {\n\t\t\t\tfor (int a = 0; a < clients.size(); a++) {\n\t\t\t\t\tc.sendList(clients.get(a).name, a);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private void getClientList(ActionEvent e){\r\n new ClientList().Display();\r\n }",
"public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial.\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n Cliente cl = new Cliente();\n cl.setCodigo(rs.getInt(\"codigo\"));\n cl.setNit(rs.getString(\"nit\"));\n cl.setRazonSocial(rs.getString(\"razonsocial\"));\n cl.setCategoria(rs.getString(\"categoria\"));\n cl.setEmail(rs.getString(\"email\"));\n Calendar cal = new GregorianCalendar();\n cal.setTime(rs.getDate(\"fecharegistro\")); \n cl.setFechaRegistro(cal.getTime());\n cl.setIdioma(rs.getString(\"idioma\"));\n cl.setPais(rs.getString(\"pais\"));\n\t\t\tls.add(cl);\n\t\t}\n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n } \n return ls;\n\t}",
"public List<Cliente> getClienteList () {\n\t\t\n\t\tCriteria crit = HibernateUtil.getSession().createCriteria(Cliente.class);\n\t\tList<Cliente> clienteList = crit.list();\n\t\t\n\t\treturn clienteList;\n\t}",
"public List<String> allClients() throws IOException {\n String httpResponse = httpGet(baseUrl.resolve(\"/automation/v2/clients\"));\n return mapper.readValue(httpResponse, new TypeReference<List<String>>() {\n });\n }",
"private static void getClients() throws IOException {\r\n\t\tbidders=new ArrayList<Socket>();\r\n\t\tserverSocket=new ServerSocket(portno);\r\n\t\twhile ((bidders.size()<numBidders)&&(auctioneer==null)) {\r\n\t\t\tSocket temp=serverSocket.accept();\r\n\t\t\t//if (this client is a bidder)\r\n\t\t\t\tbidders.add(temp);\r\n\t\t\t//if (this client is the auctioneer)\r\n\t\t\t\tauctioneer=temp;\r\n\t\t}\r\n\t}",
"public Iterator getClients() {\n rrwl_serverclientlist.readLock().lock();\n try {\n return clientList.iterator();\n } finally {\n rrwl_serverclientlist.readLock().unlock();\n }\n }",
"@Override\n\tpublic List<Socket> GetConnectedClients() {\n\t\t\n\t\tArrayList<Socket> list = new ArrayList<Socket>();\n\t\t\n\t\tif(clients == null)return list;\n\t\t\n\t\tfor(Socket s : clients)\n\t\t{\n\t\t\tlist.add(s);\n\t\t}\n\t\t\n\t\treturn list;\n\t}",
"public List<Integer> getAllIDClient(){\n\t\tPreparedStatement ps = null;\n\t\tResultSet resultatRequete =null;\n\t\t\n\t\ttry {\n\t\t\tString requeteSqlGetAll=\"SELECT id_client FROM clients\";\n\t\t\tps = this.connection.prepareStatement(requeteSqlGetAll);\n\t\t\t\n\t\t\tresultatRequete = ps.executeQuery();\n\n\t\t\tClient client = null;\n\t\t\t\n\t\t\tList<Integer> listeIDClient = new ArrayList <>();\n\n\t\t\twhile (resultatRequete.next()) {\n\t\t\t\tint idClient = resultatRequete.getInt(1);\n\t\t\t\t\n\t\t\t\tlisteIDClient.add(idClient);\n\t\t\t\t\n\t\t\t}//end while\n\t\t\treturn listeIDClient;\n\t\t\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tif(resultatRequete!= null) resultatRequete.close();\n\t\t\t\tif(ps!= null) ps.close();\n\t\t\t\t\n\t\t\t} catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public List<Cliente> getClientes() {\n List<Cliente> cli = new ArrayList<>();\n\n try {\n BufferedReader br = new BufferedReader(new FileReader(\"src/Archivo/archivo.txt\"));\n String record;\n\n while ((record = br.readLine()) != null) {\n\n StringTokenizer st = new StringTokenizer(record, \",\");\n \n String id = st.nextToken();\n String nombreCliente = st.nextToken();\n String nombreEmpresa = st.nextToken();\n String ciudad = st.nextToken();\n String deuda = st.nextToken();\n String precioVentaSaco = st.nextToken();\n\n Cliente cliente = new Cliente(\n Integer.parseInt(id),\n nombreCliente,\n nombreEmpresa,\n ciudad,\n Float.parseFloat(deuda),\n Float.parseFloat(precioVentaSaco)\n );\n\n cli.add(cliente);\n }\n\n br.close();\n } catch (Exception e) {\n System.err.println(e);\n }\n\n return cli;\n }",
"@Override\r\n\tpublic List<Client> selectclient() {\n\t\tList<Client> list=this.getSqlSessionTemplate().selectList(changToNameSpace(\"selectclient\"));\r\n\t\treturn list;\r\n\t}",
"public List getClientIDHavingPortal() {\n Session session = ConnectionFactory.getInstance().getSession();\n Query query;\n \n \n try {\n /*\n * Build HQL (Hibernate Query Language) query to retrieve a list\n * of all the items currently stored by Hibernate.\n */\n \n query = session.createQuery(\"select user.id_client from app.user.User user where user.userType = 'client' group by user.id_client order by user.id_client\");\n return query.list();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n }",
"public List<Client> findAll() throws DataAccessLayerException {\n try {\n Subject.doAs(LoginController.getLoginContext().getSubject(), new MyPrivilegedAction(\"CLIENT\", Permission.READ));\n return super.findAll(Client.class);\n } catch (AccessControlException e) {\n e.printStackTrace();\n }\n return new ArrayList<>();\n }",
"public RepositorioClientesArray() {\n\t\tclientes = new Cliente[TAMANHO_CACHE];\n\t\tindice = 0;\n\t}",
"public List<Client> findAllClient() throws SQLException {\n\t\treturn iDaoClient.findAllClient();\n\t}",
"@Override\n public String toString() {\n return \"Client{\" +\n \"nom='\" + nom + '\\'' +\n \", prenom='\" + prenom + '\\'' +\n \", adresse='\" + adresse + '\\'' +\n \", methode tarif=\" + calculerTarif.toString() +\n \", pointsDeFidelite=\" + pointsDeFidelite +\n \", listeVehicule=\" + listeVehicule +\n + '}';\n }",
"public synchronized void sendUserList()\n {\n String userString = \"USERLIST#\" + getUsersToString();\n for (ClientHandler ch : clientList)\n {\n ch.sendUserList(userString);\n }\n }",
"public ArrayList<Project> getClients() {\n try {\n ArrayList<Project> clients = new ArrayList<Project>();\n String selectClients = \"SELECT NAME, CLIENT_ID FROM CLIENTS\";\n connection = ConnectionManager.getConnection();\n PreparedStatement ps = connection.prepareStatement(selectClients);\n ResultSet rs = ps.executeQuery();\n while (rs.next()) {\n String client = rs.getString(\"NAME\");\n String clientId = rs.getString(\"CLIENT_ID\");\n Project p = new Project(client, clientId);\n clients.add(p);\n }\n rs.close();\n ps.close();\n return clients;\n } catch (SQLException sqle) {\n sqle.printStackTrace(); // for debugging\n return null;\n }\n }",
"public List getUserListShowToClient() {\n /*\n * Use the ConnectionFactory to retrieve an open\n * Hibernate Session.\n *\n */\n Session session = ConnectionFactory.getInstance().getSession();\n Query query;\n\n try {\n /*\n * Build HQL (Hibernate Query Language) query to retrieve a list\n * of all the items currently stored by Hibernate.\n */\n query = session.createQuery(\"select user from app.user.User user where user.currentEmployee = 'true' and user.clientShow = 'TRUE' order by user.lastName, user.firstName\");\n return query.list();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n }",
"private void getClientList(String loginUserId) {\n if (!TextUtils.isEmpty(loginUserId) && NetworkUtil.isOnline(this)){\n initGetInvoiceAPIResources(loginUserId);\n\n }else {\n // Snack Bar to show success message that record is wrong\n Snackbar.make(mainLayout, \"Please Check Internet Connection\", Snackbar.LENGTH_LONG).show();\n }\n }",
"public ClienteConsultas() {\n listadeClientes = new ArrayList<>();\n clienteSeleccionado = new ArrayList<>();\n }",
"@Override\n\tpublic List<Clientes> findAllClientes() throws Exception {\n\t\treturn clienteLogic.findAll();\n\t}",
"public List<String> getListOfClientNames() throws Exception {\n if (isNotAt()) {\n goTo();\n }\n return getTableDataByColumn(clientsTable, 0);\n }",
"@Override\r\n\tpublic List<Client> consulterClients(String mc) {\n\t\treturn dao.consulterClients(mc);\r\n\t}",
"@Override\n\tpublic List<Cliente> readAll() {\n\t\treturn clientedao.readAll();\n\t}",
"@Generated\n public List<Clientes> getClientes() {\n if (clientes == null) {\n __throwIfDetached();\n ClientesDao targetDao = daoSession.getClientesDao();\n List<Clientes> clientesNew = targetDao._queryUsuarios_Clientes(id);\n synchronized (this) {\n if(clientes == null) {\n clientes = clientesNew;\n }\n }\n }\n return clientes;\n }",
"public String LIST(){\n String nameList = \"\";\n Enumeration keys = this.clientData.keys();\n while(keys.hasMoreElements()){\n nameList += keys.nextElement() + \" \";\n }\n return \"OK \" + nameList;\n }",
"public void getClients(AsyncCallback<List<Client>> cb);",
"public Interfaz_RegistroClientes() {\n initComponents();\n limpiar();\n }",
"@Override\n\tpublic List<Cliente> getAll() {\n\t\treturn null;\n\t}",
"public Client[] getClients() {\r\n // Get all the contents from the table clients with columns as keys mapped\r\n // to an ArrayList of\r\n // ordered row values\r\n HashMap<String, ArrayList<String>> clientInfo = getAllTableContents(\"clients\");\r\n // Parse the clients into an ArrayList of Client objects\r\n ArrayList<Client> clients = parseClients(clientInfo);\r\n // Cast to an array of Client and return\r\n Client[] temp = new Client[clients.size()];\r\n return clients.toArray(temp);\r\n }",
"@Override\n\tpublic void cargarClienteSinCobrador() {\n\t\tpopup.showPopup();\n\t\tif(UIHomeSesion.usuario!=null){\n\t\tlista = new ArrayList<ClienteProxy>();\n\t\tFACTORY.initialize(EVENTBUS);\n\t\tContextGestionCobranza context = FACTORY.contextGestionCobranza();\n\t\tRequest<List<ClienteProxy>> request = context.listarClienteSinCobrador(UIHomeSesion.usuario.getIdUsuario()).with(\"beanUsuario\");\n\t\trequest.fire(new Receiver<List<ClienteProxy>>() {\n\t\t\t@Override\n\t\t\tpublic void onSuccess(List<ClienteProxy> response) {\n\t\t\t\tlista.addAll(response);\t\t\t\t\n\t\t\t\tgrid.setData(lista);\t\t\t\t\n\t\t\t\tgrid.getSelectionModel().clear();\n\t\t\t\tpopup.hidePopup();\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n public void onFailure(ServerFailure error) {\n popup.hidePopup();\n //Window.alert(error.getMessage());\n Notification not=new Notification(Notification.WARNING,error.getMessage());\n not.showPopup();\n }\n\t\t\t\n\t\t});\n\t\t}\n\t}",
"@Override\n\tpublic List<Cliente> getByIdCliente(long id) {\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList<Cliente> clients =getCurrentSession().createQuery(\"from Cliente c join fetch c.grupos grupos join fetch grupos.clientes where c.id='\"+id+\"' and c.activo=1\" ).list();\n return clients;\n\t}",
"@GetMapping(\"/clients/{idClient}/comptes\")\n public Iterable<Long> getComptesClient(@PathVariable(\"idClient\") Client c) {\n Iterable<Long> comptes = serviceCollaborateur.getListeIdComptes(c.getId());\n return comptes;\n }"
] | [
"0.7558732",
"0.75542516",
"0.7386437",
"0.73738164",
"0.73117393",
"0.72515625",
"0.7198686",
"0.7176428",
"0.71606714",
"0.7120051",
"0.71196026",
"0.7098093",
"0.7092957",
"0.70228404",
"0.69810677",
"0.69576395",
"0.6932318",
"0.68726504",
"0.6853204",
"0.68416375",
"0.6805783",
"0.67882586",
"0.67832506",
"0.6745917",
"0.6744247",
"0.6744163",
"0.67238814",
"0.6719444",
"0.6709819",
"0.66659343",
"0.6655575",
"0.665402",
"0.66519034",
"0.6628194",
"0.6623557",
"0.66205454",
"0.66187125",
"0.66095096",
"0.6604294",
"0.66037375",
"0.65999246",
"0.6591275",
"0.6568575",
"0.65640223",
"0.6561607",
"0.65563595",
"0.65406424",
"0.65284175",
"0.6514122",
"0.65002906",
"0.65001416",
"0.6484011",
"0.64820474",
"0.64769083",
"0.6476277",
"0.6465567",
"0.6456717",
"0.644204",
"0.6441614",
"0.64348495",
"0.6426347",
"0.6424439",
"0.6407489",
"0.64005613",
"0.63988703",
"0.63973",
"0.638985",
"0.6373299",
"0.6367209",
"0.6357737",
"0.6357701",
"0.6341683",
"0.6341597",
"0.6332654",
"0.63272744",
"0.63223386",
"0.63206",
"0.6317298",
"0.62908417",
"0.6286876",
"0.6281277",
"0.6276298",
"0.627558",
"0.6270722",
"0.6269688",
"0.6257623",
"0.625269",
"0.6210937",
"0.6210502",
"0.62103754",
"0.6190329",
"0.6175687",
"0.61697507",
"0.6159054",
"0.6154155",
"0.6146719",
"0.61336994",
"0.61234045",
"0.61228406",
"0.61056334",
"0.60978365"
] | 0.0 | -1 |
Suppression d'une facture client | @Retryable(
maxAttempts = Application.retry_max_attempt,
backoff = @Backoff(delay = 5000))
@ResponseBody
@ApiOperation(value = "Suppression d'une facture client")
@ApiResponses(value = {
@ApiResponse(code = 401, message = "Vous devez être identifié pour effectuer cette opération"),
@ApiResponse(code = 403, message = "Vous n'êtes pas autorisé à effectuer cette action (admin, ou opérateur ayant le droit)"),
@ApiResponse(code = 404, message = "Impossible de trouver la facture"),
@ApiResponse(code = 200, message = "Operation supprimée", response = Boolean.class)
})
@RequestMapping(
produces = "application/json",
consumes = "application/json",
value = "/facture/client",
method = RequestMethod.DELETE)
@CrossOrigin(origins="*")
public ResponseEntity supprimer(
@ApiParam(value = "Paramètres d'entrée", required = true) @Valid @RequestBody DeleteFactureClientParams postBody,
@ApiParam(value = "Jeton JWT pour autentification", required = true) @RequestHeader("Token") String token) {
// vérifie que le jeton est valide et que les droits lui permettent de modifier un opérateur kmatar
if (!jwtProvider.isValidJWT(token)) {
throw new ResponseStatusException(HttpStatus.UNAUTHORIZED, "Jeton invalide, veuillez vous reconnecter.");
}
// vérifie que les droits lui permettent de gérer une operation
if (!SecurityUtils.adminOrOperateurWithDroit(jwtProvider, token, OperateurListeDeDroits.DECLENCHER_FACTURATION_CLIENT) || !SecurityUtils.adminOrOperateurWithDroit(jwtProvider, token, OperateurListeDeDroits.SUPPRESSION_FACTURATION_CLIENT)) {
throw new ResponseStatusException(HttpStatus.FORBIDDEN, "Vous n'avez pas le droit d'effectuer cette opération.");
}
// chargement
FactureClient facture_client = factureClientService.getByUUID(postBody.getId(), jwtProvider.getCodePays(token));
if (facture_client == null) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Impossible de trouver la facture.");
}
String numeroFacture = facture_client.getNumeroFacture();
// supression dela facture
factureClientService.delete(facture_client);
// suppression de la référence à la facture dans les opérations
operationService.setNullOperationsNumeroFactureClient(numeroFacture, jwtProvider.getCodePays(token));
actionAuditService.supprimerFacture(numeroFacture, token);
return new ResponseEntity<>(true, HttpStatus.OK);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void makeClientMissed() {\n\t\tArrayList<String> key = new ArrayList<String>();\r\n\r\n\t\tkey.add(\"id\");\r\n\r\n\t\tArrayList<String> value = new ArrayList<String>();\r\n\r\n\t\tvalue.add(GlobalVariable.TrainerSessionId);\r\n\r\n\t\tSystem.out.println(\"se\" + GlobalVariable.TrainerSessionId);\r\n\r\n\t\td.showCustomSpinProgress(TrainerHomeActivity.this);\r\n\r\n\t\tString url = Constants.WEBSERVICE_URL+\"/webservice/missed\";\r\n\r\n\t\tcallWebService = new AsyncTaskCall(\r\n\t\t\t\tTrainerHomeActivity.this,\r\n\t\t\t\tTrainerHomeActivity.this,\r\n\t\t\t\t1,\r\n\t\t\t\turl,\r\n\t\t\t\tkey, value);\r\n\t\tcallWebService.execute();\r\n\r\n\t\tDialogView.customSpinProgress\r\n\t\t\t\t.setOnCancelListener(new OnCancelListener() {\r\n\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\r\n\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\tcallWebService.cancel(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t}",
"private void startEliminateExpiredClient() {\n this.expiredExecutorService.scheduleAtFixedRate(() -> {\n long currentTime = System.currentTimeMillis();\n List<ClientInformation> clients = ClientManager.getAllClient();\n if (clients != null && clients.size() > 0) {\n clients.stream().forEach(client -> {\n String clientId = ClientManager.getClientId(client.getAddress(), client.getPort());\n long intervalSeconds = (currentTime - client.getLastReportTime()) / 1000;\n if (intervalSeconds > configuration.getExpiredExcludeThresholdSeconds()\n && ClientStatus.ON_LINE.equals(client.getStatus())) {\n client.setStatus(ClientStatus.OFF_LINE);\n ClientManager.updateClientInformation(client);\n log.info(\"MessagePipe Client:{},status updated to offline.\", clientId);\n } else if (intervalSeconds <= configuration.getExpiredExcludeThresholdSeconds()\n && ClientStatus.OFF_LINE.equals(client.getStatus())) {\n client.setStatus(ClientStatus.ON_LINE);\n ClientManager.updateClientInformation(client);\n log.info(\"MessagePipe Client:{},status updated to online.\", clientId);\n }\n });\n }\n }, 5, configuration.getCheckClientExpiredIntervalSeconds(), TimeUnit.SECONDS);\n }",
"@Override\n\tpublic void suppress() {\n\n\t}",
"private void gestioneDisconnessione(Exception e) {\n\t\tLOG.info(\"Client disconnesso\");\n\t\tthis.completeWithError(e);\n\t\tthis.running=false;\n\t}",
"public void Pedircarnet() {\n\t\tSystem.out.println(\"solicitar carnet para verificar si es cliente de ese consultorio\");\r\n\t}",
"public void disableClient(){\r\n try{\r\n oos.writeObject(new DataWrapper(DataWrapper.CTCODE, new ControlToken(ControlToken.DISABLECODE)));\r\n oos.flush();\r\n } catch(IOException ioe) {\r\n ioe.printStackTrace();\r\n }\r\n }",
"public void videListeClient(){\n couleurs.clear();\n }",
"@Override\n\tpublic void deleteClient() {\n\t\t\n\t}",
"public void clearSupportsNakedCredit() {\n genClient.clear(CacheKey.supportsNakedCredit);\n }",
"public void disconnetti() {\n\t\tconnesso = false;\n\t}",
"public void suppress() {\r\n\t\tsuppressed = true;\r\n\t}",
"public void suppress() {\r\n\t\tsuppressed = true;\r\n\t}",
"@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}",
"@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}",
"@Override\n\tpublic void suppress() {\n\t\tsuppressed = true;\n\t}",
"@Override\n\tprotected void doRemoveClient(Client c) {\n\t\tlog.warn(\"doRemoveClient is not implemented\");\n\t}",
"public void clearClient()\n // -end- 33FFE57B03B3 remove_all_head327A646F00E6 \"Dependency::clearClient\"\n ;",
"private void handleWhiteboardCleared() {\n for (SocketConnection tobeNotified : SocketManager.getInstance()\n .getNotManagerConnectionList()) {\n tobeNotified.send(this.message);\n }\n }",
"Boolean deleteClient(Client client){\n return true;\n }",
"private void clearSeenAToServer() {\n if (reqCase_ == 15) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"public void cancelAllClients(){\n clientsPool.shutdownNow();\n }",
"private void removeClient () {\n AutomatedClient c = clients.pollFirstEntry().getValue();\n Nnow--;\n\n c.signalToLeave();\n System.out.println(\"O cliente \" + c.getUsername() + \" foi sinalizado para sair\");\n }",
"private void filterClients()\n {\n System.out.println(\"filtered Clients (membership of type 'Gold''):\");\n Set<Client> clients = ctrl.filterClientsByMembershipType(\"Gold\");\n clients.stream().forEach(System.out::println);\n }",
"@SubscribeEvent\n public void onFMLNetworkClientDisconnectionFromServer(ClientDisconnectionFromServerEvent event) {\n hypixel = false;\n bedwars = false;\n }",
"public void noFlights();",
"private void removeClient(PrintWriter out) {\n\t\tsynchronized (clients) {\n\t\t\tclients.remove(out);\n\t\t}\n\t}",
"public void supprimerClient(String nom, String prenom) {\n\t\tIterator<Client> it = clients.iterator();\n\t\tboolean existant = true;\n\t\twhile (it.hasNext()) {\n\t\t\tClient client = it.next();\n\t\t\tif (nom == client.getNom() && prenom == client.getPrenom()) {\n\t\t\t\tit.remove();\n\t\t\t\tSystem.out.println(\"Le client \" + client.getNom() + \" \" + client.getPrenom() + \" a bien ´┐Żt´┐Ż supprim´┐Ż dans la base de donn´┐Żes\");\n\t\t\t\texistant = false;\n\t\t\t\tSystem.out.println(clients.size());\n\t\t\t}\n\t\t}\n\t\tif (existant == true) {\n\t\t\tSystem.out.println(\"Action impossible, ce client n'existe pas\");\n\t\t}\n\t}",
"@Override\n public void onDisconnect(BinaryLogClient client) {\n }",
"@Override\n public void clientDisconnectedFromHost(PiClient piClient) {\n activity.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(activity, \"Disconnected\", Toast.LENGTH_SHORT).show();\n }\n });\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tserveurConnect.add(client.getNomClient() + \" / \" + client.getClientSocket().getRemoteSocketAddress()\n\t\t\t\t\t\t+ \" déconnecté\");\n\n\t\t\t\tCompte c = new Compte(client.getNomClient(), client.getPassClient());\n\t\t\t\tComptes.remove(c);\n\n\t\t\t\tclients.remove(clientThreads.indexOf(client));\n\t\t\t\tSystem.out.println(\"erreur\" + clientThreads.indexOf(client));\n\t\t\t\tclientThreads.remove(clientThreads.indexOf(client));\n\t\t\t}",
"void discardIrrelevantResponse(CruiseControlParameters parameters);",
"@Override\r\n\t\t\t\tpublic void onClientDisconnect(ServerConnection sc) {\n\t\t\t\t\tSystem.out.println(\"CLIENT DISCONNECTED FROM SERVER.\");\r\n\t\t\t\t}",
"@Override\n\tpublic boolean estVide() {\n\t\treturn getNbClients()==0;\n\t}",
"private void clearDeleteFriendAToServer() {\n if (reqCase_ == 14) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"@FXML\n\tpublic void disableClient(ActionEvent event) {\n\t\tif (!txtIdDisableClient.getText().equals(\"\")) {\n\t\t\tClient client = restaurant.returnClientId(txtIdDisableClient.getText());\n\n\t\t\tif (client != null) {\n\n\t\t\t\ttry {\n\t\t\t\t\tclient.setCondition(Condition.INACTIVE);\n\t\t\t\t\trestaurant.saveClientsData();\n\t\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\t\tdialog.setContentText(\"El cliente ha sido deshabilitado\");\n\t\t\t\t\tdialog.setTitle(\"Cliente Deshabilitado\");\n\t\t\t\t\tdialog.show();\n\t\t\t\t\ttxtIdDisableClient.setText(\"\");\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\t\tdialog.setContentText(\"No se ha podido guardar el nuevo estado del Cliente\");\n\t\t\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\t\t\tdialog.show();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tDialog<String> dialog = createDialog();\n\t\t\t\tdialog.setContentText(\"Este cliente no existe\");\n\t\t\t\tdialog.setTitle(\"Error, objeto no existente\");\n\t\t\t\tdialog.show();\n\t\t\t}\n\n\t\t} else {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setContentText(\"Todos los campos deben de ser llenados\");\n\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\tdialog.show();\n\t\t}\n\n\t}",
"@Override\n\tpublic void covidProtection() {\n\t\tSystem.out.println(\"FH---covid protection\");\n\t}",
"@Override\r\n\t\t\t\tpublic void onClientDisconnect(ServerConnection sc) {\n\t\t\t\t}",
"public void disconnectConvo() {\n convo = null;\n setConnStatus(false);\n }",
"private CorrelationClient() { }",
"public void clearSupportsPreauthOverage() {\n genClient.clear(CacheKey.supportsPreauthOverage);\n }",
"public void disociarMedidorDeCliente (Cliente c){\r\n\t\t//TODO Implementar metodo\r\n\t}",
"public void showDisconnectedFoeMessage() {\n\t\tsetStatusBar(FOE_DISC_MSG);\n\t}",
"@Override\n\tpublic boolean unConnectNetShowToast() {\n\t\treturn false;\n\t}",
"private void resetClient()\n\t{\n\t\tSystem.out.println(\"\\n---Resetting client...\");\n\t\tSystem.out.println(\"\\n\");\n\t\tinitialize();\n\t}",
"private void clearChatWithServerReq() {\n if (reqCase_ == 3) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"public void disconnect() {\n try {\n Socket socket = new Socket(\"127.0.0.1\",33333);\n ObjectOutputStream outputStream = new ObjectOutputStream(socket.getOutputStream());\n clientMain.clientData[1] = \"no\";\n outputStream.writeObject(clientMain.clientData);\n\n clientMain.showConnectionPage();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"private void clearDeleteFriendServerToB() {\n if (rspCase_ == 18) {\n rspCase_ = 0;\n rsp_ = null;\n }\n }",
"private void msgNoServerConnection() {\r\n\thandler.sendEmptyMessage(1); // enviar error al cargar\r\n }",
"private void deleteClient()\n {\n System.out.println(\"Delete client with the ID: \");\n\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n ctrl.deleteClient(id);\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n }",
"protected void processDisconnection(){}",
"void unsetComplianceCheckResult();",
"public void setExempt(boolean exempt);",
"@Generated\n public synchronized void resetClientes() {\n clientes = null;\n }",
"public void quitter() {\n\t\ttry {\n\t\t\tthis.clientSocket.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"erreur lors de la déconnexion R\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"@Override\n public void onDelectComfireInfo(ServResrouce info)\n {\n }",
"@Override\n\t\t\tpublic void onError(Throwable t) {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Got Error in writing the ticket\");\n\t\t\t\tconnected_clients.remove(responseObserver);\n\t\t\t}",
"void clientDisconnected(Client client, DisconnectInfo info);",
"public void putSilentOn() {\n StartupService.mode.setRingerMode(AudioManager.RINGER_MODE_SILENT);\n }",
"void unsetNcbieaa();",
"public void onNetDisConnect() {\n\n\t}",
"public void cancel() {\r\n try {\r\n btSocket.close();\r\n isConnected = false;\r\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);\r\n SharedPreferences.Editor edit = preferences.edit();\r\n edit.putBoolean(\"Connection\", isConnected);\r\n edit.apply();\r\n } catch (IOException e) {\r\n Log.d(\"TAG\", \"Could not close the client socket\");\r\n }\r\n }",
"public void cancelarFactura(){\n this.cliente = new Cliente();\n this.factura = new Factura();\n this.listDetalle = new ArrayList<>();\n this.numeroFactura = null;\n }",
"boolean disableMonitoring();",
"private void clearAddFriendAToServer() {\n if (reqCase_ == 1) {\n reqCase_ = 0;\n req_ = null;\n }\n }",
"public void suppress() {\n\t\tstop = true;\n\t}",
"void cleanse() {\n\t\t\tSystem.out.println(\"liver cleansing\");\n\t\t\tSystem.out.println(\"age is: \" + age);\n\t\t\tSystem.out.println(\"weight is: \" + weight);\n\t\t\tSystem.out.println(\"id is: \" + id);\n\t\t\t\n\t\t}",
"@Override\r\n public void knife() {\n System.out.println(\"검이 없습니다\");\r\n }",
"public void mo33395e() {\n if (XGPushConfig.enableDebug) {\n StringBuilder sb = new StringBuilder();\n sb.append(\"Action -> checkAndSetupClient( tpnsClient = \");\n sb.append(this.f23297x);\n sb.append(\", isClientCreating = \");\n sb.append(this.f23298y);\n sb.append(\")\");\n C6864a.m29286a(\"TpnsChannel\", sb.toString());\n }\n synchronized (this) {\n if (this.f23297x == null && !this.f23298y) {\n this.f23298y = true;\n try {\n C6938d.m29638a().mo33180a(this.f23288H);\n } catch (Exception e) {\n C6864a.m29302d(\"TpnsChannel\", \"createOptimalSocketChannel error\", e);\n }\n } else if (!this.f23298y && this.f23297x != null && !this.f23297x.mo33374d()) {\n C6864a.m29308i(\"TpnsChannel\", \"The socket Channel is unconnected\");\n try {\n this.f23297x.mo33373c();\n C6938d.m29638a().mo33180a(this.f23288H);\n } catch (Exception e2) {\n C6864a.m29302d(Constants.ServiceLogTag, \"createOptimalSocketChannel error\", e2);\n }\n }\n }\n }",
"public void lance() {\n\t\tthis.laRequete.ecrireMessage(\"202\",\" Commande Non implementee\"); //502 ou 202?\n\t\tthis.laRequete.ecrireLog(\"Commande Non implementee\");\n\t}",
"public void securityOff()\n {\n m_bSecurity = false;\n }",
"public void doorOpen(){\n super.suppress();\n }",
"@Override\n public boolean hasClientinfo() {\n return clientinfo_ != null;\n }",
"public void disconnected(String reason) {}",
"private void disconnectHandler(Void v) {\n\n LOG.info(\"DISCONNECT from MQTT client {}\", this.mqttEndpoint.clientIdentifier());\n this.detachForced = false;\n }",
"private void supprAffichage() {\n switch (afficheChoix) {\n case AFFICHE_SPOOL :\n ecranSpool.deleteContents();\n break;\n case AFFICHE_USER :\n ecranUser.deleteContents();\n break;\n case AFFICHE_CONFIG :\n ecranConfig.deleteContents();\n break;\n default: break;\n }\n afficheChoix = AFFICHE_RIEN;\n }",
"public void requestcanceled() {\n\n requestcancelcheck = true;\n\n String diatitle = \"Request cancelled.\";\n String msg = \"Request cancelled by Rider.\";\n\n marker.setEnabled(false);\n // mGoogleMap.clear();\n fullbutton.setVisibility(View.GONE);\n usercheck = false;\n touch.setVisibility(View.GONE);\n marker.setVisibility(View.INVISIBLE);\n checkonclick = false;\n timercheck = true;\n whilecheck = true;\n accheck = true;\n receivecheck = true;\n\n acc1 = acc;\n\n registerReceiver(mHandleMessageReceiver, new IntentFilter(Config.DISPLAY_MESSAGE_ACTION));\n dialogshow(diatitle, msg);\n\n }",
"void unsetSchufaResponseData();",
"private void deleteUnwantedFsnAcceptability(Concept c) throws TermServerScriptException {\n\t\tList<Description> fsns = c.getDescriptions(Acceptability.BOTH, DescriptionType.FSN, ActiveState.ACTIVE);\n\t\tif (fsns.size() != 1) {\n\t\t\tString msg = \"Concept has \" + fsns.size() + \" active fsns\";\n\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t} else {\n\t\t\tString msg = \"[\" + fsns.get(0).getDescriptionId() + \"]: \";\n\t\t\tList<LangRefsetEntry> langRefEntries = fsns.get(0).getLangRefsetEntries(ActiveState.BOTH, US_ENG_LANG_REFSET);\n\t\t\tif (langRefEntries.size() != 1) {\n\t\t\t\tif (langRefEntries.size() == 2) {\n\t\t\t\t\tList<LangRefsetEntry> uslangRefEntries = fsns.get(0).getLangRefsetEntries(ActiveState.BOTH, refsets, SCTID_US_MODULE);\n\t\t\t\t\tList<LangRefsetEntry> corelangRefEntries = fsns.get(0).getLangRefsetEntries(ActiveState.BOTH, refsets, SCTID_CORE_MODULE);\n\t\t\t\t\tif (uslangRefEntries.size() > 1 || corelangRefEntries.size() >1) {\n\t\t\t\t\t\tmsg += \"Two acceptabilities in the same module\";\n\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!uslangRefEntries.get(0).isActive() && corelangRefEntries.get(0).isActive() ) {\n\t\t\t\t\t\t\tlong usET = Long.parseLong(uslangRefEntries.get(0).getEffectiveTime());\n\t\t\t\t\t\t\tlong coreET = Long.parseLong(corelangRefEntries.get(0).getEffectiveTime());\n\t\t\t\t\t\t\tmsg += \"US langrefset entry inactivated \" + (usET > coreET ? \"after\":\"before\") + \" core row activated - \" + usET;\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//If the US inactivated AFTER the core activated, then this is the case we need to fix\n\t\t\t\t\t\t\tuslangRefEntries.get(0).delete(deletionEffectiveTime);\n\t\t\t\t\t\t\tString action = \"Deleted US FSN LangRefset entry\";\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.MEDIUM, ReportActionType.DESCRIPTION_CHANGE_MADE, action);\n\t\t\t\t\t\t\tc.setModified();\n\t\t\t\t\t\t} if (uslangRefEntries.get(0).isActive() && corelangRefEntries.get(0).isActive() ) {\n\t\t\t\t\t\t\tmsg += \"Both US and Core module lang refset entries are inactive\";\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.LOW, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmsg += \"Unexpected configuration of us and core lang refset entries\";\n\t\t\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tmsg += \"FSN has \" + langRefEntries.size() + \" US acceptability values.\";\n\t\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t\t}\n\t\t\t} else if (!langRefEntries.get(0).getAcceptabilityId().equals(SCTID_PREFERRED_TERM)) {\n\t\t\t\tmsg += \"FSN has an acceptability that is not Preferred.\";\n\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t} else if (!langRefEntries.get(0).isActive()) {\n\t\t\t\tmsg += \"FSN's US acceptability is inactive.\";\n\t\t\t\treport(c, c.getFSNDescription(), Severity.HIGH, ReportActionType.VALIDATION_CHECK, msg);\n\t\t\t}\n\t\t}\n\t}",
"void unsetNcbistdaa();",
"boolean isBadCommunication();",
"@Override\n protected void onPlusClientRevokeAccess() {\n }",
"@Override\n protected void onPlusClientRevokeAccess() {\n }",
"void disconnect(String reason);",
"public boolean isExempt();",
"void realizarSolicitud(Cliente cliente);",
"boolean no_onport(DiagnosticChain diagnostics, Map<Object, Object> context);",
"@Override\r\n\tpublic void deleteclient(Client cid) {\n\t\t\r\n\t}",
"public void resetClient() {\n map.clear();\n idField.setText( \"\" );\n turnLabel.setText( \"\" );\n }",
"@Override\r\n\tpublic boolean seLanceSurServiteurProprietaire() {\n\t\treturn false;\r\n\t}",
"void showNoAgentsAvailable();",
"void cancelProduction();",
"public void disable()\n {\n openGate = null;\n }",
"public LWTRTPdu disConnectReq() throws IncorrectTransitionException;",
"@Override\n\tpublic void dialogar() {\n\t\tSystem.out.println(\"Ofrece un Discurso \");\n\t\t\n\t}",
"private void disconnect(int ID, boolean status) {\n ServerClient client = null;\n for (int i = 0; i < clients.size(); i++) {\n if (clients.get(i).getID() == ID) {\n client = clients.get(i);\n clients.remove(i);\n break;\n }\n }\n assert client != null;\n if (status) {\n System.out.println(\"Client: \" + client.getName() + \" (\" + client.getID() + \") @ \" + client.getAddress() + \":\" + client.getPort() + \" disconnected.\");\n } else {\n System.out.println(\"Client: \" + client.getName() + \" (\" + client.getID() + \") @ \" + client.getAddress() + \":\" + client.getPort() + \" timed out.\");\n }\n }",
"protected final void setDontShowThisAgain() {\n messageFactory.setDontShowThisAgain(messageId);\n }",
"public void clientInfo() {\n uiService.underDevelopment();\n }",
"void unclaim(@Nonnull Client client);",
"@Override\n\tpublic void excluir(Cliente o) {\n\t\t\n\t}",
"@Override\n\tpublic int vanish() {\n\t\treturn 1;\n\t}"
] | [
"0.6090947",
"0.5846398",
"0.58412826",
"0.58338815",
"0.581639",
"0.5814716",
"0.5810274",
"0.5782852",
"0.577077",
"0.57581764",
"0.57178575",
"0.57178575",
"0.57016885",
"0.57016885",
"0.57016885",
"0.56886494",
"0.56585586",
"0.5627218",
"0.5595479",
"0.5593249",
"0.55783457",
"0.5564897",
"0.55603796",
"0.5550657",
"0.5543887",
"0.5522148",
"0.55125934",
"0.5466217",
"0.5456812",
"0.5443731",
"0.5383353",
"0.5376778",
"0.53654706",
"0.53630054",
"0.5362183",
"0.5351176",
"0.5350745",
"0.5329294",
"0.53265846",
"0.53249574",
"0.5324291",
"0.5314134",
"0.5307915",
"0.52923006",
"0.52874994",
"0.5286656",
"0.52813286",
"0.52641034",
"0.52547646",
"0.5232927",
"0.5205078",
"0.52012116",
"0.51890874",
"0.5185921",
"0.51840156",
"0.5157097",
"0.5151579",
"0.5148373",
"0.51381916",
"0.5135126",
"0.51297826",
"0.51294863",
"0.51232773",
"0.51214683",
"0.51184946",
"0.5111611",
"0.5102009",
"0.5102004",
"0.5101899",
"0.50918347",
"0.5091241",
"0.5083968",
"0.50834304",
"0.5082876",
"0.5081524",
"0.5079788",
"0.5072947",
"0.5070805",
"0.5067841",
"0.5067164",
"0.5065675",
"0.5065675",
"0.5062831",
"0.50627834",
"0.50611067",
"0.50576407",
"0.5056632",
"0.5053514",
"0.5048572",
"0.50452304",
"0.504248",
"0.5038112",
"0.50378054",
"0.50367504",
"0.5036437",
"0.5035526",
"0.50294733",
"0.5028952",
"0.50213766",
"0.5018896"
] | 0.59155947 | 1 |
method to intialize instance data | void setData(int x,int y)
{
a=x;
b=y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void initData() {\n }",
"private void initData() {\n\n }",
"private void initData() {\n\t}",
"public void initData() {\n }",
"public void initData() {\n }",
"private void initData(){\n\n }",
"protected @Override\r\n abstract void initData();",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\n protected void initData() {\n }",
"@Override\n protected void initData() {\n }",
"@Override\n\tpublic void initData() {\n\n\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void initData() {\n\n\t}",
"@Override\n\tpublic void initData() {\n\n\t}",
"@Override\n\tpublic void initData() {\n\n\t}",
"@Override\r\n\tpublic void initData() {\n\t}",
"public InitialData(){}",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"private void InitData() {\n\t}",
"@Override\n\tpublic void initData() {\n\t\t\n\t}",
"@Override\n\tprotected void initData(){\n\t\tsuper.initData();\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tprotected void initdata() {\n\n\t}",
"public void InitData() {\n }",
"void initData(){\n }",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}",
"public void initData(){\r\n \r\n }",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"private TigerData() {\n initFields();\n }",
"abstract void initializeNeededData();",
"void initData() {\r\n\t\tthis.daVinci = new Artist(\"da Vinci\");\r\n\t\tthis.mona = new Painting(daVinci, \"Mona Lisa\");\r\n\t\t//this.lastSupper = new Painting(this.daVinci, \"Last Supper\");\r\n\t}",
"private RandomData() {\n initFields();\n }",
"private void initialData() {\n\n }",
"public mainData() {\n }",
"public Data() {}",
"@SuppressWarnings(\"static-access\")\n\tprivate void initData() {\n\t\tstartDate = startDate.now();\n\t\tendDate = endDate.now();\n\t}",
"public Data() {\n \n }",
"private void initData() {\n requestServerToGetInformation();\n }",
"public Data() {\n }",
"public Data() {\n }",
"public void init(UserData userData) {\n this.userData = userData;\n }",
"private Data initialise() {\n \r\n getRoomsData();\r\n getMeetingTimesData();\r\n setLabMeetingTimes();\r\n getInstructorsData();\r\n getCoursesData();\r\n getDepartmentsData();\r\n getInstructorFixData();\r\n \r\n for (int i=0;i<departments.size(); i++){\r\n numberOfClasses += departments.get(i).getCourses().size();\r\n }\r\n return this;\r\n }",
"private StaticData() {\n\n }",
"@Override\n\t\tpublic void init() {\n\t\t}",
"public void init() {\n \n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@objid (\"4bb3363c-38e1-48f1-9894-6dceea1f8d66\")\n public void init() {\n }",
"private RoleData() {\n initFields();\n }",
"private void Initialized_Data() {\n\t\t\r\n\t}",
"private void initValues() {\n \n }",
"private void init() {\n }",
"public void init() {\n\t\t}",
"public void init() {}",
"public void init() {}",
"protected void initDataFields() {\r\n //this module doesn't require any data fields\r\n }",
"private void init() {\n }",
"private void init() {\n }",
"private void init() {\n }",
"private void init() {\n }",
"@Override\r\n\tpublic void init() {}",
"@Override public void init()\n\t\t{\n\t\t}",
"public void init() {\r\n\r\n\t}",
"public void init() { }",
"public void init() { }",
"public void init() {\r\n\t\t// to override\r\n\t}",
"@SuppressWarnings(\"unused\")\n\tprivate LedgerInitProposalData() {\n\t}",
"public void init(){}",
"@Override\r\n\tprotected void init() {\n\t\tupdateValues();\r\n\t}",
"private void init() {\n\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"private void initData() {\n getCourse();\n// getMessage();\n\n }",
"private void initDataLoader() {\n\t}",
"public void init() {\n\n\t}",
"public void init() {\n\n\t}",
"public void init() {\n\n\t}",
"public void init(){\n \n }",
"public void initData() {\n\t\tnotes = new ArrayList<>();\n\t\t//place to read notes e.g from file\n\t}",
"protected void _init(){}",
"public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}",
"private void init()\n\t{\n\t\tif (_invData == null)\n\t\t\t_invData = new InvestigateStore.MappedStores();\n\t}",
"private void initData() {\n\t\tnamesInfo = new NameSurferDataBase(fileName);\n\n\t}",
"@Override\r\n\tpublic final void init() {\r\n\r\n\t}",
"public void InitData() {\n this.mItemTitleIds = new int[]{R.string.can_rvs_camera, R.string.can_ccaqyxfz};\n this.mItemTypes = new CanScrollCarInfoView.Item[]{CanScrollCarInfoView.Item.POP, CanScrollCarInfoView.Item.SWITCH};\n this.mPopValueIds[0] = new int[]{R.string.can_hjyxfzxt, R.string.can_dccsyxfzxt};\n this.mCarData = new CanDataInfo.LuxgenOd_SetData();\n }",
"private void initData() {\n\t\tpages = new ArrayList<WallpaperPage>();\n\n\t}",
"protected VersionData() {}",
"private RowData() {\n initFields();\n }",
"public static void populateData() {\n\n }",
"CreationData creationData();",
"public void\ninit(SoState state)\n//\n////////////////////////////////////////////////////////////////////////\n{\n data = getDefault().getValue();\n}",
"private void init() {\n FieldWrapper id = new FieldWrapper();\n id.fieldDescription = new HashMap<String, Object>();\n id.fieldDescription.put(\"fullName\", \"Id\");\n id.fieldDescription.put(\"type\", \"Text\");\n\n FieldWrapper name = new FieldWrapper();\n name.fieldDescription = new HashMap<String, Object>();\n name.fieldDescription.put(\"fullName\", \"Name\");\n\n FieldWrapper createdBy = new FieldWrapper();\n createdBy.fieldDescription = new HashMap<String, Object>();\n createdBy.fieldDescription.put(\"fullName\", \"CreatedBy\");\n createdBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper lastModifiedBy = new FieldWrapper();\n lastModifiedBy.fieldDescription = new HashMap<String, Object>();\n lastModifiedBy.fieldDescription.put(\"fullName\", \"LastModifiedBy\");\n lastModifiedBy.fieldDescription.put(\"type\", \"Lookup\");\n\n FieldWrapper owner = new FieldWrapper();\n owner.fieldDescription = new HashMap<String, Object>();\n owner.fieldDescription.put(\"fullName\", \"Owner\");\n owner.fieldDescription.put(\"type\", \"Lookup\");\n\n fieldDescribe = new HashMap<String, FieldWrapper>();\n\n fieldDescribe.put((String) id.fieldDescription.get(\"fullName\"), id);\n fieldDescribe.put((String) name.fieldDescription.get(\"fullName\"), name);\n fieldDescribe.put((String) createdBy.fieldDescription.get(\"fullName\"), createdBy);\n fieldDescribe.put((String) lastModifiedBy.fieldDescription.get(\"fullName\"), lastModifiedBy);\n fieldDescribe.put((String) owner.fieldDescription.get(\"fullName\"), owner);\n }",
"public void init() {\n }",
"public void init() {\n }"
] | [
"0.79230267",
"0.7871803",
"0.78248686",
"0.78073364",
"0.78073364",
"0.77282274",
"0.76850325",
"0.7681026",
"0.7681026",
"0.7681026",
"0.7681026",
"0.7681026",
"0.7681026",
"0.7671599",
"0.7671599",
"0.76305115",
"0.7596214",
"0.7596214",
"0.75909626",
"0.75909626",
"0.75909626",
"0.7574245",
"0.75606835",
"0.75588375",
"0.75566363",
"0.75519764",
"0.742481",
"0.74175215",
"0.7410844",
"0.7403382",
"0.7377162",
"0.73701084",
"0.73701084",
"0.73631287",
"0.73239094",
"0.7276015",
"0.7133808",
"0.70880574",
"0.70660686",
"0.7057504",
"0.6915303",
"0.6905972",
"0.69050163",
"0.6794342",
"0.67519337",
"0.6738408",
"0.6738408",
"0.6720176",
"0.6696112",
"0.66919106",
"0.6683001",
"0.6678387",
"0.66717815",
"0.66202784",
"0.65918297",
"0.6582505",
"0.6580918",
"0.6580842",
"0.65688044",
"0.65669876",
"0.65669876",
"0.65664595",
"0.65528053",
"0.65528053",
"0.65528053",
"0.65528053",
"0.65457207",
"0.6517319",
"0.6512382",
"0.65076774",
"0.65076774",
"0.6504647",
"0.650272",
"0.64934987",
"0.64879614",
"0.64813024",
"0.6479278",
"0.6479278",
"0.6479278",
"0.6479051",
"0.6473905",
"0.64705455",
"0.64705455",
"0.64705455",
"0.6460647",
"0.64604694",
"0.64460796",
"0.6443449",
"0.6440807",
"0.64388",
"0.64377165",
"0.64346427",
"0.642741",
"0.6426909",
"0.64229673",
"0.6422965",
"0.6412941",
"0.64116424",
"0.63967115",
"0.63947713",
"0.63947713"
] | 0.0 | -1 |
write a method to add above two numbers | void SumOfTwoNumbers()
{
System.out.println("sum is"+(a+b));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void addTwoNumbers() {\n\t\t\n\t}",
"public int addTwoNumbers(int a, int b) {\n return a + b;\n }",
"public static int plus(int value1, int value2){\r\n return value1 + value2;\r\n }",
"@Override\r\n\tpublic int add(int a,int b) {\n\t\treturn a+b;\r\n\t}",
"static void AddThemUP() { //defining a method to add 2 numbers\n int a = 4;\n int b = 5;\n\n System.out.println(\"The numbers add up to \" + (a + b));\n }",
"public int add(int a, int b) //add method take two int values and returns the sum\n {\n int sum = a + b;\n return sum;\n }",
"@Override\n\t\t\tpublic Integer apply(Integer num1, Integer num2) {\n\t\t\t\treturn num1+num2;\n\t\t\t}",
"public double add(int a, int b){\r\n return a + b;\r\n }",
"@Override\n\tpublic int add(int a, int b) {\n\t\treturn a+b;\n\t}",
"public int addNum(int a, int b){\n return a+b;\n }",
"@Override\r\n\tpublic int calculate(int a, int b) {\n\t\treturn (a + b) * 2;\r\n\t}",
"@Override\r\n\tprotected Integer add(Integer x1, Integer x2) {\n\t\treturn x2+x1;\r\n\t}",
"@Override\r\n\tpublic int plus(int x, int y) {\n\t\treturn x + y;\r\n\t}",
"@Override\r\n\tpublic int plus(int left, int right) {\n\t\treturn left + right; \r\n\t\t//return 0;\r\n\t}",
"public int addition(int a, int b){\n return a + b;\n }",
"public static Node addStraightNumbersHelper(Node num1,Node num2){\n if(num1 == null){\n return null;\n }\n int carry = 0;\n Node result = addStraightNumbersHelper(num1.next,num2.next);\n if(result!=null) {\n carry = result.value / 10;\n result.value = result.value % 10;\n }\n Node superResult = new Node(num1.value+num2.value+carry);\n superResult.next=result;\n return superResult;\n\n }",
"@Override\n\tpublic double add(double in1, double in2) {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic double add(double a, double b) {\n\t\treturn (a+b);\n\t}",
"public int addition(int a, int b){\r\n\t\treturn a+b;\r\n\t}",
"@Override\r\n\tpublic int addNo(int a, int b) {\n\t\treturn a+b;\r\n\t}",
"BaseNumber add(BaseNumber operand);",
"public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n Stack<Integer> s1 = new Stack<>();\n Stack<Integer> s2 = new Stack<>();\n while (l1 != null) {\n s1.push(l1.val);\n l1 = l1.next;\n }\n while (l2 != null) {\n s2.push(l2.val);\n l2 = l2.next;\n }\n ListNode current = new ListNode(0);\n int overflow = 0;\n while (!s1.empty() || !s2.empty()) {\n int x = (!s1.empty()) ? s1.pop() : 0;\n int y = (!s2.empty()) ? s2.pop() : 0;\n int value = overflow + x + y;\n overflow = value / 10;\n current.val = value % 10;\n ListNode temp = new ListNode(overflow);\n temp.next = current;\n current = temp;\n }\n return current.val == 0 ? current.next : current;\n}",
"@Override\n\tpublic int add(int a, int b) {\n\t\treturn super.add(a, b);\n\t}",
"@Override\r\n\tpublic int add(int a, int b) {\n\t\tSystem.out.println(a+b);\r\n\t\treturn a+b;\r\n\t}",
"public int add(int a, int b) {\n return a + b;\n }",
"public int add(int a, int b) {\n return a + b;\n }",
"public static int telop(int x, int y){\r\n return x + y;\r\n }",
"static void add() {\r\n\t\t\r\n\t\tint a = 500;\r\n\t\tint b = 300;\r\n\t\t\r\n\t\tint s = a +b;\r\n\t\tSystem.out.println(s);\r\n\t}",
"Double add(Double a, Double b);",
"int method01(int a, int b) {\n\n\t\ta = a + b;\n\t\treturn a;\n\t}",
"public static void add(float a,int b){ }",
"long getAndAdd(long delta);",
"@Override\n\tpublic int add(int val1, int val2) {\n\t\tthis.test++;\n\t\tSystem.out.println(this.test);\n\t\treturn val1+val2;\n\t}",
"public static int twoNumbers(int a, int b) {\n if ( a == b) {\n return ((a+2)+(b+2));\n }\n else {\n return ((a+1)+(b+1));\n }\n\n }",
"public Integer add(Integer first, Integer second){\n return first + second;\n }",
"public static int Add(int a, int b){\n\t\t\treturn (a+b);\n\t\t\t\n\t\t}",
"public double add(double num1, double num2) {\n return num1 + num2;\n }",
"public Integer add(Integer a, Integer b) {\n\t\treturn a + b;\n\t}",
"public static NumberP Addition(NumberP first, NumberP second)\n {\n return OperationsManaged.PerformArithmeticOperation\n (\n first, second, ExistingOperations.Addition\n ); \t\n }",
"public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\tListNode dummyHead = new ListNode(0);\n\t\tListNode p = l1, q = l2, curr = dummyHead;\n\t\tint carry = 0;\n\t\twhile (p != null || q != null) {\n\t\t\tint x = (p != null) ? p.val : 0;\n\t\t\tint y = (q != null) ? q.val : 0;\n\t\t\tint sum = carry + x + y;\n\t\t\tcarry = sum / 10;\n\t\t\tcurr.next = new ListNode(sum % 10);\n\t\t\tcurr = curr.next;\n\t\t\tif (p != null)\n\t\t\t\tp = p.next;\n\t\t\tif (q != null)\n\t\t\t\tq = q.next;\n\t\t}\n\t\tif (carry > 0) {\n\t\t\tcurr.next = new ListNode(carry);\n\t\t}\n\t\treturn dummyHead.next;\n\t}",
"public void add (double a , int b) {\n\t\tdouble c=a+b;\r\n\t\tSystem.out.println(\"Sum of numbers is : \" + c);\r\n\t}",
"static int sum(int value1, int value2) {\n return value1 + value2;\n }",
"@Override\n\tpublic int add(int num1, int num2) throws TException {\n\t\treturn num1+num2;\n\t}",
"public static int addInt(int a, int b){\r\n\t\treturn a+b;\r\n\t}",
"ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n ListNode curL1 = l1;\n ListNode curL2 = l2;\n int add = 0;\n while (curL1 != null && curL2 != null) {\n int result = 0;\n int total = curL1.val + curL2.val + add;\n if (total >= 10) {\n result = total % 10;\n add = 1;\n } else {\n result = total;\n add = 0;\n }\n curL1.val = result;\n if (curL2.next != null && curL1.next == null) {\n curL2.next.val += add;\n curL1.next = curL2.next;\n break;\n }\n if (curL1.next != null && curL2.next == null) {\n curL1.next.val += add;\n break;\n }\n if (curL1.next == null && curL2.next == null && add == 1) {\n curL1.next = new ListNode(1);\n break;\n }\n curL1 = curL1.next;\n curL2 = curL2.next;\n }\n if (curL1 != null && curL1.next != null) {\n curL1 = curL1.next;\n }\n while (curL1 != null) {\n if (curL1.val >= 10) {\n curL1.val = curL1.val % 10;\n if (curL1.next == null) {\n curL1.next = new ListNode(1);\n curL1 = curL1.next;\n } else {\n curL1 = curL1.next;\n curL1.val += 1;\n }\n\n } else {\n break;\n }\n }\n return l1;\n }",
"public static int add(int a, int b)\n\t{\n\t\treturn a + b;\n\t}",
"public static double add(double a, double b){\r\n\t\treturn a+b;\r\n\t}",
"@Override\n public Float plus(Float lhs, Float rhs) {\n\t\n\tfloat res = lhs + rhs;\n\treturn res;\t\n }",
"public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n Stack<Integer> stack1 = new Stack<>(), stack2 = new Stack<>();\n if(l1 == null) return l2;\n if(l2 == null) return l1;\n int carry = 0;\n ListNode tmp1 = l1, tmp2 = l2;\n while(tmp1 != null){\n \tstack1.push(tmp1.val);\n \ttmp1 = tmp1.next;\n } \n while(tmp2 != null){\n \tstack2.push(tmp2.val);\n \ttmp2 = tmp2.next;\n }\n int val1 = 0, val2 = 0, sum = 0;\n while(!stack1.isEmpty() || !stack2.isEmpty()){\n \tif(!stack1.isEmpty()){\n \t\tval1 = stack1.pop();\n \t}else{\n \t\tval1 = 0;\n \t}\n \tif(!stack2.isEmpty()){\n \t\tval2 = stack2.pop();\n \t}else{\n \t\tval2 = 0;\n \t}\n \tsum = val1 + val2 + carry;\n \tcarry = sum / 10;\n \ttmp1 = new ListNode(sum % 10);\n \ttmp1.next = tmp2;\n \ttmp2 = tmp1;\n }\n if(carry != 0){\n tmp1 = new ListNode(carry);\n tmp1.next = tmp2;\n tmp2 = tmp1;\n }\n return tmp1;\n }",
"static long add(long a, long b){\n\t\treturn a+b;\n\t}",
"public static int addThem(int x, int y)\n {\n return x + y;\n }",
"public void add (int a , int b) {\n\t\tint c=a+b;\r\n\t\tSystem.out.println(\"Sum of numbers is : \" + c);\r\n\t}",
"public int pickup(int x, int y)\n {\n return (x + y);\n }",
"static int logic(int x,int y){\n int z;\n if(x>y){\n z=x+y;\n }\n else\n {\n z=(x+y)*5;\n }\n return z;\n }",
"public int addition(int a, int b){\r\n int result = a+b;\r\n return result;\r\n }",
"void increase();",
"void increase();",
"public static int addNums(int a, int b) {\n int result = a + b;\n return(result);\n }",
"public void add (int b , double a) {\n\t\tdouble c=a+b;\r\n\t\tSystem.out.println(\"Sum of numbers is : \" + c);\r\n\t}",
"public void Test1(){//we can change the logic\n\t\tint x = 20;\n\t\tint y = 50;\n\t\tSystem.out.println(\"Addition of 2 values are :\" + (x+y));\n\t}",
"public static double add(int left, int right){\n return left + right;\n }",
"ListNode addTwoNumbers2(ListNode l1, ListNode l2) {\n ListNode c1 = l1;\n ListNode c2 = l2;\n ListNode sentinel = new ListNode(0);\n ListNode d = sentinel;\n int sum = 0;\n while (c1 != null || c2 != null) {\n sum /= 10;\n if (c1 != null) {\n sum += c1.val;\n c1 = c1.next;\n }\n if (c2 != null) {\n sum += c2.val;\n c2 = c2.next;\n }\n d.next = new ListNode(sum % 10);\n d = d.next;\n }\n if (sum / 10 == 1) {\n d.next = new ListNode(1);\n }\n return sentinel.next;\n }",
"public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n ListNode iter1=l1,iter2=l2,newHead=new ListNode(0),newTail;\n newTail=newHead;\n int res=0;\n int addition=0;\n while(l1!=null || l2!=null){\n int temp;\n if(l1==null){\n temp=l2.val+addition;\n l2=l2.next;\n }\n else if(l2==null){\n temp=l1.val+addition;\n l1=l1.next;\n }\n else{\n temp=l1.val+l2.val+addition;\n l1=l1.next;\n l2=l2.next;\n }\n addition=temp/10;\n temp=temp%10;\n newTail.next=new ListNode(temp);\n newTail=newTail.next;\n }\n if(addition!=0){\n newTail.next=new ListNode(addition);\n }\n return newHead.next;\n \n }",
"public double add(double firstNumber, double secondNUmber){\n\t\treturn firstNumber + secondNUmber;\n\t}",
"public ListNode addTwoNumbers(ListNode l1, ListNode l2){\r\n\t\tint sum=0,carry=0;\r\n\t\tListNode prebefore=new ListNode(0),run=prebefore;\r\n\t\twhile(!(l1==null && l2 ==null && carry==0)){\r\n\t\t\tsum=(l1==null?0:l1.val)+(l2==null?0:l2.val)+carry;\r\n\t\t\tcarry=sum/10;\r\n\t\t\trun.next=new ListNode(sum%10);\r\n\t\t\trun=run.next;\r\n\t\t\tl1=(l1==null?null:l1.next);\r\n\t\t\tl2=(l2==null?null:l2.next);\r\n\t\t\t\r\n\t\t}\r\n\t\tListNode res=prebefore.next;//and it is better to delete the prebefore node\r\n\t\tprebefore=null;\r\n\t\treturn res;\r\n\t}",
"@Override\n\tpublic int arithmetical(int first, int second) {\n\t\treturn first - second;\n\t}",
"static int soma2(int a, int b) {\n\t\tint s = a + b;\r\n\t\treturn s;\r\n\t}",
"@Override\n public void addNumbers() {\n calculator.add(2, 2);\n }",
"public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n return addTwoNumbersHelper(l1, l2, 0);\n }",
"public void add() {\r\n\t\tint num1=5,num2=3,sum;\r\n\r\n\t\tsum=num1+num2;\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Adding two numbers\" + sum);\r\n\t\r\n\t\t\r\n\t}",
"public static ListAdd.ListNode addTwoNumbers(ListAdd.ListNode l1, ListAdd.ListNode l2) {\n if (l1 == null)\n return l2;\n if (l2 == null)\n return l1;\n ListAdd.ListNode res = null, head = null;\n int total = 0;\n int carry = 0;\n while (l1 != null && l2 != null) {\n if (res == null) {\n total = (l1.val + l2.val);\n carry = total / 10;\n res = new ListAdd.ListNode(total % 10); //13 % 10 = 3\n head = res;\n } else {\n total = (l1.val + l2.val + carry);\n carry = total / 10;\n\n res.next = new ListAdd.ListNode(total % 10);\n res = res.next;\n }\n l1 = l1.next;\n l2 = l2.next;\n }\n while (l1 != null) {\n total = (l1.val + carry);\n carry = total / 10;\n res.next = new ListAdd.ListNode(total % 10);\n res = res.next;\n l1 = l1.next;\n }\n while (l2 != null) {\n total = (l2.val + carry);\n carry = total / 10;\n res.next = new ListAdd.ListNode(total % 10);\n res = res.next;\n l2 = l2.next;\n }\n if (carry > 0) {\n res.next = new ListAdd.ListNode(carry);\n }\n return head;\n }",
"private int getIncrement(int from, int to) {\n if (from < to) {\n return 1;\n } else if (from > to) {\n return -1;\n } else {\n return 0;\n }\n }",
"public int add(int a, int b) {\n int sum = a+b;\n return sum;\n }",
"private long function(long a, long b) {\n if (a == UNIQUE) return b;\n else if (b == UNIQUE) return a;\n\n // return a + b; // sum over a range\n // return (a > b) ? a : b; // maximum value over a range\n return (a < b) ? a : b; // minimum value over a range\n // return a * b; // product over a range (watch out for overflow!)\n }",
"private void addition() throws Exception {\n\t\tif(!(stackBiggerThanTwo())) throw new Exception(\"Stack hat zu wenig einträge mindestens 2 werden gebraucht!!\");\n\t\telse{\n\t\t\tvalue1=stack.pop();\n\t\t\tvalue2=stack.peek();\n\t\t\tstack.push(value2+value1);\n\t\t}\n\t\t\n\t}",
"public static ListNode addTwoNumbers(ListNode l1, ListNode l2) {\r\n\t\tif (l1==null) {\r\n\t\t\treturn l2;\r\n\t\t}\r\n\t\tif (l2==null) {\r\n\t\t\treturn l1;\r\n\t\t}\r\n ListNode pre=new ListNode(0);\r\n ListNode head=pre;\r\n int temp=0;\r\n //temp不等于0就是为了处理进位\r\n while(l1!=null||l2!=null||temp!=0){\r\n \tListNode cur = new ListNode(0);\r\n \tint sum=((l1==null)?0:l1.val)+((l2==null)?0:l2.val)+temp;\r\n \tcur.val=sum%10;\r\n \ttemp=sum/10;\r\n \tpre.next=cur;\r\n \tpre=cur;\r\n \tl1=(l1==null)?l1:l1.next;\r\n \tl2=(l2==null)?l2:l2.next;\r\n }\r\n return head.next;\r\n }",
"public void addPoints(int addP){\n this.points += addP;\n }",
"public ListNode addTwoNumbers(ListNode l1, ListNode l2) {\n\t\t \n\t\t ListNode result = null;\n\t\t \n\t\t ListNode temp = null;\n\t\t \n\t\t int sum = 0;\n\t\t \n\t\t int carryOver = 0;\n\t\t \n\t\t while(l1 != null || l2 != null)\n\t\t {\n\t\t\t int l1Num = 0;\n\t\t\t int l2Num = 0;\n\t\t\t \n\t\t\t if(l1 != null)\n\t\t\t {\n\t\t\t\t l1Num = l1.val;\n\t\t\t\t l1 = l1.next;\n\t\t\t }\n\t\t\t \n\t\t\t if(l2 != null)\n\t\t\t {\n\t\t\t\t l2Num = l2.val;\n\t\t\t\t l2 = l2.next;\n\t\t\t }\n\t\t\t \n\t\t\t sum = carryOver + l1Num + l2Num;\n\t\t\t \n\t\t\t carryOver = sum / 10;\n\t\t\t \n\t\t\t ListNode node = new ListNode(sum % 10);\n\t\t\t \n\t\t\t if(result == null)\n\t\t\t {\n\t\t\t\t result = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t temp.next = node;\n\t\t\t\t temp = node;\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t if(carryOver > 0)\n\t\t {\n\t\t\t ListNode carryNode = new ListNode(carryOver);\n\t\t\t temp.next = carryNode;\n\t\t }\n\t\t // Find out the sum , have a carry over in case \n\t\t \n\t\t // create output links \n\t\t return result;\n\t }",
"public static void add(int a,float b){ }",
"int kelilingPP(int a, int b){\r\n return 2*(a+b);\r\n }",
"protected void add() {\n\t\tfinal float previous = value;\n\t\tvalue = Math.min(max, value + incrementStep);\n\n\t\tif (value != previous) {\n\t\t\tupdateAndAlertListener();\n\t\t}\n\n\t\treturn;\n\t}",
"void add(double p1, double p2){\n this.p1 += p1;\n this.p2 += p2;\n }",
"int sum(int a, int b) {\n return a + b;\n }",
"public static double add(double a, double b)\n\t{\n\t\treturn a + b;\n\t}",
"int increaseScoreThisJump() {\n if (myScoreThisJump == 0) {\n myScoreThisJump++;\n } else {\n myScoreThisJump *= 2;\n }\n return (myScoreThisJump);\n }",
"public void addPoints(int earnedPoints) {score = score + earnedPoints;}",
"@Override\n\tpublic int add(int x, int y) {\n\t\treturn x * y;\n\t}",
"static int sum(int a, int b) {\n return a+b;\r\n }",
"public static void add(int a,int b){ }",
"public void add(int arg0, int arg1, double arg2) {\n\t\tif (Math.max(0, arg1 - hbw_) <= arg0 && arg0 <= arg1)\n\t\t\tmat_[arg0][arg1 - arg0] += arg2;\n\t}",
"public void add(double a, int b)\n\t{\n\t\tdouble sum = a+b;\t\t\t\t\n\t\tSystem.out.println(\"Sum of numbers is \"+sum);\n\t}",
"public double adicao (double numero1, double numero2){\n\t}",
"public void add(int add) {\r\n value += add;\r\n }",
"public static Node addTwoNumbers(Node l1, Node l2) {\n int carry = 0;\n Node dummyHead = new Node(0, null);\n Node current = dummyHead;\n\n while (l1 != null || l2 != null) {\n int x = (l1 != null) ? l1.getData() : 0;\n int y = (l2 != null) ? l2.getData() : 0;\n int sum = x + y + carry;\n carry = sum / 10;\n current.next = new Node(sum % 10, null);\n current = current.next;\n // Next index\n if (l1 != null) {\n l1 = l1.next;\n }\n if (l2 != null) {\n l2 = l2.next;\n }\n }\n if (carry > 0) {\n current.next = new Node(carry, null);\n }\n return dummyHead.next;\n }",
"int moverseY(int a,int b){ \n if(b<a){\n return 0;\n }else{\n return 1;\n }//fin else2\n //fin else\n }",
"public Integer add();",
"void addition(int num1, int num2){\n System.out.println(\"Addition \"+(num1+num2));\n }",
"@Override\n\t\t\t\t\tpublic Integer call(Integer v1, Integer v2) throws Exception {\n\t\t\t\t\t\treturn v1+v2;\n\t\t\t\t\t}",
"Point add (double x, double y, Point result);",
"private void addition()\n {\n\tint tempSum = 0;\n\tint carryBit = 0;\n\tsum = new Stack<String>();\n\tStack<String> longerStack = pickLongerStack(number, otherNumber);\n\twhile(!longerStack.isEmpty())\n\t{\n\t tempSum = digitOf(number) + digitOf(otherNumber) + carryBit; //adding\n\t carryBit = tempSum / 10;\n\t sum.push((tempSum % 10) + \"\"); //store the digit which is not carryBit\n\t}\n\tif(carryBit == 1) sum.push(\"1\"); //the last carry bit need to be add as very first digit of sum if there is carry bit\n }",
"static int add(int a, int b){\n int carry = 0;\n int result = 0;\n int i;\n for(i=0; a>0||b>0; i++){\n int ba = a&1;\n int bb = b&1;\n result = result|((carry^ba^bb)<<i);\n carry = (ba&bb) | (bb&carry) | (carry&ba);\n a = a>>1;\n b = b>>1;\n }\n return result|(carry<<i);\n }"
] | [
"0.69828534",
"0.6780842",
"0.66545874",
"0.6645358",
"0.6584147",
"0.6566832",
"0.65273505",
"0.65237725",
"0.6522501",
"0.6496109",
"0.6475875",
"0.6464335",
"0.64620155",
"0.64494556",
"0.63765544",
"0.63750905",
"0.637372",
"0.6316072",
"0.6291898",
"0.6276023",
"0.62404",
"0.62259483",
"0.621642",
"0.62151486",
"0.6208101",
"0.6208101",
"0.6190667",
"0.6165409",
"0.6165081",
"0.61609215",
"0.6159776",
"0.6156902",
"0.6127131",
"0.6125758",
"0.6120664",
"0.61145335",
"0.61108",
"0.6103696",
"0.6076545",
"0.60611886",
"0.6045357",
"0.60398006",
"0.6035304",
"0.6030543",
"0.6025247",
"0.60237736",
"0.6020816",
"0.6014587",
"0.59942573",
"0.59936243",
"0.5991694",
"0.5987443",
"0.59764",
"0.5974026",
"0.59647435",
"0.5958089",
"0.5958089",
"0.59533244",
"0.595011",
"0.5949118",
"0.59475094",
"0.59467435",
"0.59380335",
"0.5937186",
"0.59302413",
"0.59290636",
"0.5928463",
"0.59172076",
"0.5899511",
"0.5899076",
"0.5894",
"0.5887017",
"0.5886408",
"0.58855903",
"0.5884939",
"0.5880385",
"0.5878051",
"0.5871766",
"0.5867915",
"0.5865281",
"0.58646476",
"0.5862234",
"0.5861035",
"0.58503157",
"0.584545",
"0.58445126",
"0.58344847",
"0.58237493",
"0.58186007",
"0.581358",
"0.5813217",
"0.58090746",
"0.5806517",
"0.58055633",
"0.57995737",
"0.57955754",
"0.57929516",
"0.5786501",
"0.57825613",
"0.5771017",
"0.57659656"
] | 0.0 | -1 |
Insert: If less, go left. If greater, go right. If null, insert the keyvalue pair Cost: Number of compares is equal to 1+depth of Node | public void put(Key key, Value val) //put key-value pair in the table
{
/*
* Tree shape: Many BSTs can correspond to the same set of keys.
* <li>Number of compares for search/insert is equal to 1+depth of node.
* <li>Worst case when keys entered in order
*/
root=put(root,key,val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected Node<K, V> insert(K k, V v) {\n // if the given key is smaller than this key\n if (this.c.compare(k, this.key) < 0) {\n return new Node<K, V>(this.key, \n this.value, \n this.c, \n this.left.insert(k, v), \n this.right,\n this.black).balance();\n }\n // if the given key is equal to this key, set \n // this key's value to the given value\n else if (this.c.compare(k, this.key) == 0) {\n return new Node<K, V>(k, v, \n this.c, \n this.left, \n this.right, \n this.black);\n }\n // if the given key is bigger than this key\n else {\n return new Node<K, V>(this.key, \n this.value, \n this.c, \n this.left, \n this.right.insert(k, v), \n this.black).balance();\n }\n }",
"static TreeNode insert(TreeNode node, int key) \n\t{ \n\t // if tree is empty return new node \n\t if (node == null) \n\t return newNode(key); \n\t \n\t // if key is less then or grater then \n\t // node value then recur down the tree \n\t if (key < node.key) \n\t node.left = insert(node.left, key); \n\t else if (key > node.key) \n\t node.right = insert(node.right, key); \n\t \n\t // return the (unchanged) node pointer \n\t return node; \n\t}",
"private void insertAux2(K key, V val) {\n if(root == null) { //empty tree\n X = new Node(key, val);\n root = X;\n return;\n }\n Node temp = root;\n while(true) {\n int cmp = key.compareTo(temp.key);\n if (cmp < 0 && temp.left != null) { //go left\n comparisons += 1;\n temp = temp.left;\n } else if (cmp < 0 && temp.left == null) { //it goes in the next left\n comparisons += 1;\n X = new Node(key, val);\n temp.left = X;\n X.parent = temp;\n break;\n }\n if (cmp > 0 && temp.right != null) { //go right\n comparisons += 1;\n temp = temp.right;\n } else if (cmp > 0 && temp.right == null) { //it goes in the next right\n comparisons += 1;\n X = new Node(key, val);\n temp.right = X;\n X.parent = temp;\n break;\n }\n if(cmp == 0) { //no doubles, overlap pre-existing node\n comparisons += 1;\n temp.key = key;\n temp.val = val;\n X = temp;\n break;\n }\n }\n }",
"public void InsertNode(int key){\n boolean isRightChild = false;\n boolean isDuplicate = false;\n if(root == null){\n root = new Node(key);\n return;\n }\n Node temp = root;\n while(true){\n if(temp.value == key){\n isDuplicate = true ;\n break;\n }\n if(temp.value > key){\n if(temp.left == null){\n break;\n }\n temp = temp.left ;\n }\n if(temp.value < key){\n if(temp.right == null){\n isRightChild = true;\n break;\n }\n temp = temp.right ;\n }\n }\n if( !isDuplicate && isRightChild)\n temp.right = new Node(key);\n else if(!isDuplicate && !isRightChild)\n temp.left = new Node(key);\n else\n temp.count = temp.count + 1;\n }",
"static void insert(Node nd, int key)\n\t{\n\t\tif (nd == null) {\n\t\t\troot = new Node(key);\n\t\t\treturn;\n\t\t}\n\t\tQueue<Node> q = new LinkedList<Node>();\n\t\tq.add(nd);\n\n\t\t// Do level order traversal until we find an empty place\n\t\twhile (!q.isEmpty()) {\n\t\t\tnd = q.remove();\n\n\t\t\tif (nd.left == null) {\n\t\t\t\tnd.left = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.left);\n\n\t\t\tif (nd.right == null) {\n\t\t\t\tnd.right = new Node(key);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t\tq.add(nd.right);\n\t\t}\n\t}",
"private TreeNode<K, V> put(TreeNode<K, V> node, K key, V value){\r\n \r\n // If the node is null, create a new node with the information\r\n // passed into the function\r\n if(node == null){\r\n return new TreeNode<>(key, value);\r\n }\r\n \r\n // Compare the keys recursively to find the correct spot to insert\r\n // the new node or if the key already exists\r\n if(node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n node.left = put(node.left, key, value);\r\n }\r\n else if(node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n node.right = put(node.right, key, value);\r\n }\r\n else{\r\n // If the keys are equal, only update the value\r\n node.setValue(value);\r\n }\r\n \r\n // Return the updated or newly inserted node\r\n return node;\r\n }",
"private Node putHelper(K key, V value, Node p) {\n if(p == null){\n size++;\n Node node = new Node(key, value);\n return node;\n }\n int cmp = key.compareTo(p.key);\n if(cmp < 0){\n // put int the left\n p.left = putHelper(key, value, p.left);\n }else if(cmp > 0){\n // put in the right\n p.right = putHelper(key, value, p.right);\n }else{\n p.value = value;\n }\n return p;\n }",
"public void insert(Integer key){\r\n\t\tint start=this.root;\r\n\t\tint currentPos=avail;\r\n\t\tint temp=-1;\r\n\t\twhile(increaseCompares() && start!=-1) {\r\n\t\t\ttemp=start;\r\n\t\t\tcompares++;\r\n\t\t\tif(increaseCompares() && key<getKey(start)) {\r\n\t\t\t\tstart=getLeft(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart=getRight(start);\r\n\t\t\t\tcompares++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Tree is empty. New Node is now root of tree\r\n\t\tif(increaseCompares() && temp==-1) {\r\n\t\t\tsetRoot(0);\r\n\t\t\tcompares++;\r\n\t\t\tsetKey(avail, key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\t//Compare values and place newNode either left or right of previous Node\r\n\t\telse if(increaseCompares() && key<getKey(temp)) {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetLeft(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//Set previous (parent) Node of new inserted Node\r\n\t\t\tsetRight(temp, currentPos);\r\n\t\t\tcompares++;\r\n\t\t\t//Initialize line of new Node\r\n\t\t\tsetKey(currentPos,key);\r\n\t\t\tcompares++;\r\n\t\t\tavail=getRight(currentPos);\r\n\t\t\tcompares++;\r\n\t\t\tsetRight(currentPos,-1);\r\n\t\t\tcompares++;\r\n\t\t}\r\n\t}",
"public Node insert(Node node, int key) {\n\t\tif (node == null)\n\t\t\treturn new Node(key);\n\n\t\t/* Otherwise, recur down the tree */\n\t\tif (key < node.data) {\n\t\t\tnode.left = insert(node.left, key);\n\t\t\tnode.left.parent = node;\n\t\t} else if (key > node.data) {\n\t\t\tnode.right = insert(node.right, key);\n\t\t\tnode.right.parent = node;\n\t\t}\n\n\t\t/* return the (unchanged) node pointer */\n\t\treturn node;\n\t}",
"@Override\n\tpublic BSTNode insert(int key, Object value) throws OperationNotPermitted {\n\n\t\tBSTNode p = searchByKey(key);\n\t\tBSTNode n;\n\n\t\tif (p == null) {\n\t\t\t// tree is empty, create new root\n\n\t\t\tn = createNode(key, value);\n\t\t\t_root = n;\n\t\t} else if (p.key == key) {\n\t\t\t// key exists, update payload\n\n\t\t\tn = p;\n\t\t\tn.value = value;\n\t\t} else {\n\t\t\t// key does not exist\n\n\t\t\tn = createNode(key, value);\n\t\t\tn.parent = p;\n\n\t\t\tif (p != null) {\n\t\t\t\tif (key < p.key) {\n\t\t\t\t\tp.left = n;\n\t\t\t\t} else {\n\t\t\t\t\tp.right = n;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tupdateSubtreeSizePath(n.parent);\n\t\t}\n\n\t\treturn n;\n\t}",
"public TreeNode insert(TreeNode root, int key) {\n if (root == null) {\n root = new TreeNode(key);\n return root;\n }\n TreeNode cur = root, par = root;\n while (cur != null) {\n par = cur;\n if (cur.key == key) {\n return root;\n }\n if (key < cur.key) {\n cur = cur.left;\n } else {\n cur = cur.right;\n }\n }\n // this is when cur is null (out of the while)\n if (key < par.key) {\n par.left = new TreeNode(key);\n } else {\n par.right = new TreeNode(key);\n }\n \n return root;\n }",
"private static <K extends Comparable<? super K>, V> Node<K, V> putAndCopy0(\n K key, V value, @Var @Nullable Node<K, V> current) {\n\n if (current == null) {\n return new Node<>(key, value);\n }\n\n int comp = key.compareTo(current.getKey());\n if (comp < 0) {\n // key < current.data\n Node<K, V> newLeft = putAndCopy0(key, value, current.left);\n current = current.withLeftChild(newLeft);\n\n } else if (comp > 0) {\n // key > current.data\n Node<K, V> newRight = putAndCopy0(key, value, current.right);\n current = current.withRightChild(newRight);\n\n } else {\n current = new Node<>(key, value, current.left, current.right, current.getColor());\n }\n\n // restore invariants\n return restoreInvariants(current);\n }",
"static Node insert(Node node, int key) {\n\n // If the tree is empty, return a new node\n if (node == null)\n return newNode(key);\n\n // Otherwise, recur down the tree\n if (key < node.key)\n node.left = insert(node.left, key);\n else\n node.right = insert(node.right, key);\n\n // Return the (unchanged) node pointer\n return node;\n }",
"private AVLTreeNode<E> insert(E value) {\n int cmp = this.getValue().compareTo(value);\n AVLTreeNode<E> result;\n if(cmp == 0){\n result = null;\n } else if(cmp < 0){\n result = this.getRight() != null ? this.getRight().insert(value) : createTreeNode(value);\n if(result != null){\n this.setRight(result);\n }\n } else {\n result = this.getLeft() != null ? this.getLeft().insert(value) : createTreeNode(value);\n if(result != null){\n this.setLeft(result);\n }\n }\n return result == null ? result : balancing(this);\n }",
"public boolean insert(T key, E value) {\r\n\t\t// Creating a Node\r\n\t\tRBNode<T, E> insertedNode = createRBNode(key, value);\r\n\t\t// First Node will be the Root\r\n\t\tif (checkSize(this.size)) {\r\n\t\t\tthis.root = insertedNode;\r\n\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t} else {\r\n\t\t\tRBNode<T, E> parent = nillLeaf;\r\n\t\t\tRBNode<T, E> current = root;\r\n\t\t\twhile (current != nillLeaf) {\r\n\t\t\t\tSystem.out.println(\"Test1\");\r\n\t\t\t\t// add to left\r\n\t\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test2\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.leftChild;\r\n\t\t\t\t}\r\n\t\t\t\t// add to right\r\n\t\t\t\telse if (key.compareTo(current.getUniqueKey()) > 0) {\r\n\t\t\t\t\tSystem.out.println(\"Test3\");\r\n\t\t\t\t\tparent = current;\r\n\t\t\t\t\tcurrent = current.rightChild;\r\n\t\t\t\t} else\r\n\t\t\t\t\tSystem.out.println(\"Test4\");\r\n\t\t\t\t\t// return if the key is a duplicate\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t// Add a node to the root.\r\n\t\t\tif (key.compareTo(current.getUniqueKey()) < 0) {\r\n\t\t\t\tSystem.out.println(\"Test5\");\r\n\t\t\t\tparent.leftChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t} else {\r\n\t\t\t\tparent.rightChild = insertedNode;\r\n\t\t\t\tinsertedNode.parent = parent;\r\n\t\t\t\tinsertedNode.leftChild = nillLeaf;\r\n\t\t\t\tinsertedNode.rightChild = nillLeaf;\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.size++;\r\n\t\treturn true;\r\n\t}",
"static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }",
"public HPTNode<K, V> insert(List<K> key) {\n check(key);\n init();\n int size = key.size();\n HPTNode<K, V> current = root;\n for (int i = 0; i < size; i++) {\n HPTNode<K, V> result = find(current, i, key.get(i), true);\n current.maxDepth = Math.max(current.maxDepth, size - i);\n current = result;\n }\n return current;\n }",
"Node insert(Node Node, int key) {\n if (Node == null) {\n return (new Node(key));\n }\n\n if (key < Node.key) {\n Node.left = insert(Node.left, key);\n } else {\n Node.right = insert(Node.right, key);\n }\n\n /* 2. Update height of this ancestor avl.Node */\n Node.height = max(height(Node.left), height(Node.right)) + 1;\n /* 3. Get the balance factor of this ancestor avl.Node to check whether\n this avl.Node became unbalanced */\n int balance = getBalance(Node);\n\n // If this avl.Node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && key < Node.left.key) {\n return rightRotate(Node);\n }\n\n // Right Right Case\n if (balance < -1 && key > Node.right.key) {\n return leftRotate(Node);\n }\n\n // Left Right Case\n if (balance > 1 && key > Node.left.key) {\n Node.left = leftRotate(Node.left);\n return rightRotate(Node);\n }\n\n // Right Left Case\n if (balance < -1 && key < Node.right.key) {\n Node.right = rightRotate(Node.right);\n return leftRotate(Node);\n }\n\n /* return the (unchanged) avl.Node pointer */\n return Node;\n }",
"Node insert(Node node, int key) \n {\n if (node == null) \n return (new Node(key)); \n \n if (key <= node.key) \n node.left = insert(node.left, key); \n else if (key > node.key) \n node.right = insert(node.right, key); \n \n /* 2. Update height of this ancestor node */\n node.height = 1 + max(height(node.left), \n height(node.right)); \n \n /* 3. Get the balance factor of this ancestor \n node to check whether this node became \n Wunbalanced */\n int balance = getBalance(node); \n \n // If this node becomes unbalanced, then \n // there are 4 cases Left Left Case \n if (balance > 1 && key <= node.left.key) \n return rightRotate(node); \n \n // Right Right Case \n if (balance < -1 && key > node.right.key) \n return leftRotate(node); \n \n // Left Right Case \n if (balance > 1 && key >= node.left.key) \n { \n node.left = leftRotate(node.left); \n return rightRotate(node); \n } \n \n // Right Left Case \n if (balance < -1 && key < node.right.key) \n { \n node.right = rightRotate(node.right); \n return leftRotate(node); \n } \n \n /* return the (unchanged) node pointer */\n return node; \n }",
"public void insert(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null){\n\t\t\tif (currentNode.getKey() == key){\n\t\t\t\tSystem.out.println(\"This value already exists in the tree!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\t// once we reached the bottom of the tree, we insert the new node.\n\t\t// to do that we need to know the leaf node which is stored in the BSTNode parent\n\t\t// by comparing with its value, we know which side to insert the new node.\n\t\tif (key < parent.getKey()){\n\t\t\tparent.setLeft(new BSTNode(key, null, null));\n\t\t}else{\n\t\t\tparent.setRight(new BSTNode(key, null, null));\n\t\t}\n\t\tsize++;\n\t}",
"public Node insert(Key key, Value value) { \r\n // inserting into an empty tree results in a single value leaf node\r\n return new LeafNode(key,value);\r\n }",
"public int insert(int newKey){\n int i=n-1;\n int x =0;\n if (isLeaf){\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i]) \n return -1;//duplicate return withoiut doinganything\n key[i+1] = key[i];\n i--;\n \n }\n if(x>=0){\n n++;\n key[i+1]=newKey;\n }\n }\n else{\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i])\n return -1;// find duplictte return without doing anithing \n \n else\n i--;\n }\n if(x>=0){\n \n int insertChild = i+1; // Subtree where new key must be inserted\n if (c[insertChild].isFull()){\n x++;// one more node.\n // The root of the subtree where new key will be inserted has to be split\n // We promote the mediand of that root to the current node and\n // update keys and references accordingly\n \n //System.out.println(\"This is the full node we're going to break \");// Debugging code\n //c[insertChild].printNodes();\n //System.out.println(\"going to promote \" + c[insertChild].key[T-1]);\n n++;\n c[n]=c[n-1];\n for(int j = n-1;j>insertChild;j--){\n c[j] =c[j-1];\n key[j] = key[j-1];\n }\n key[insertChild]= c[insertChild].key[T-1];\n c[insertChild].n = T-1;\n \n BTreeNode newNode = new BTreeNode(T);\n for(int k=0;k<T-1;k++){\n newNode.c[k] = c[insertChild].c[k+T];\n newNode.key[k] = c[insertChild].key[k+T];\n }\n \n newNode.c[T-1] = c[insertChild].c[2*T-1];\n newNode.n=T-1;\n newNode.isLeaf = c[insertChild].isLeaf;\n c[insertChild+1]=newNode;\n \n //System.out.println(\"This is the left side \");\n //c[insertChild].printNodes(); \n //System.out.println(\"This is the right side \");\n //c[insertChild+1].printNodes();\n //c[insertChild+1].printNodes();\n \n if (newKey <key[insertChild]){\n c[insertChild].insert(newKey); }\n else{\n c[insertChild+1].insert(newKey); }\n }\n else\n c[insertChild].insert(newKey);\n }\n \n \n }\n return x ;\n }",
"public void insert(Integer k, Node curr) {\n\t\ttotalNodes++;\n\t\tif (k > curr.getKey()) {\n\t\t\tif (curr.getRight() == null) {\n\t\t\t\tcurr.setRight(new Node(curr, k));\n\t\t\t}\n\t\t} else if (k < curr.getKey()) {\n\t\t\tif (curr.getLeft() == null) {\n\t\t\t\tcurr.setLeft(new Node(curr, k));\n\t\t\t}\n\t\t}\n\n\t}",
"private BinaryNode<E> _insert(BinaryNode<E> node, E e) {\n\n\t\tif (node == null) {\n\t\t\treturn new BinaryNode<E>(e);\n\t\t} else if (comparator.compare(e, node.getData()) < 0) { // <, so go left\n\t\t\tnode.setLeftChild(_insert(node.getLeftChild(), e));// recursive call\n\t\t} else { // >, so go right\n\t\t\tnode.setRightChild(_insert(node.getRightChild(), e));// recursive call\n\t\t}\n\t\treturn node;\n\t}",
"private Node _insert(Node node, T value) {\n if (node == null) {\n node = new Node(null, null, value);\n }\n /**\n * If the value is less than the current node's value, choose left.\n */\n else if (value.compareTo(node.element) < 0) {\n node.left = _insert(node.left, value);\n }\n /**\n * If the value is greater than the current node's value, choose right.\n */\n else if (value.compareTo(node.element) > 0) {\n node.right = _insert(node.right, value);\n }\n /** \n * A new node is created, or\n * a node with this value already exists in the tree.\n * return this node\n * */\n return node;\n\n }",
"private Node putHelper(Node n, K key, V value) {\n if (n == null) {\n n = new Node(key, value);\n } else if (key.compareTo(n.key) < 0) {\n n.leftChild = putHelper(n.leftChild, key, value);\n } else if (key.compareTo(n.key) > 0) {\n n.rightChild = putHelper(n.rightChild, key, value);\n }\n\n return n;\n }",
"public void insert(T insertValue){\n // insert in left subtree\n if(insertValue.compareTo(data) < 0){\n // insert new TreeNode\n if(leftNode == null)\n leftNode = new TreeNode<T>(insertValue);\n else\n leftNode.insert(insertValue);\n }\n\n // insert in right subtree\n else if (insertValue.compareTo(data) > 0){\n // insert new treeNode\n if(rightNode == null)\n rightNode = new TreeNode<T>(insertValue);\n else // continue traversing right subtree\n rightNode.insert(insertValue);\n }\n }",
"void insert(K key, V value) {\r\n // binary search\r\n int correct_place = Collections.binarySearch(keys, key);\r\n int indexing;\r\n if (correct_place >= 0) {\r\n indexing = correct_place;\r\n } else {\r\n indexing = -correct_place - 1;\r\n }\r\n\r\n if (correct_place >= 0) {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n } else {\r\n keys.add(indexing, key);\r\n values.add(indexing, value);\r\n }\r\n\r\n // to check if the node is overloaded then split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n }",
"void insert(K key, V value) {\r\n\r\n\r\n Node child = getChild(key);\r\n child.insert(key, value);\r\n // to check if the child is overloaded\r\n if (child.isOverflow()) {\r\n Node sibling = child.split();\r\n insertChild(sibling.getFirstLeafKey(), sibling);\r\n }\r\n\r\n // if the node is full then it requires to split\r\n if (root.isOverflow()) {\r\n Node sibling = split();\r\n InternalNode newRoot = new InternalNode();\r\n newRoot.keys.add(sibling.getFirstLeafKey());\r\n newRoot.children.add(this);\r\n newRoot.children.add(sibling);\r\n root = newRoot;\r\n }\r\n\r\n }",
"public static void insert(TreeNode root, int key) {\n\t\tcounter++;\r\n\r\n\t\t// key less than the value of root.\r\n\t\tif (key < root.item) {\r\n\t\t\tif (root.left == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.left = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.left, key);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (root.right == null) {\r\n\t\t\t\tTreeNode node = new TreeNode(null, key, null);\r\n\t\t\t\troot.right = node;\r\n\t\t\t} else {\r\n\t\t\t\tinsert(root.right, key);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void insert (T value) {\n if (left == null) {\n left = new BinaryTreeNode<>(value);\n return;\n }\n\n if (right == null) {\n right = new BinaryTreeNode<>(value);\n return;\n }\n\n if (getHeight(left) <= getHeight(right)) {\n left.insert(value);\n } else {\n right.insert(value);\n }\n }",
"public Node insertNode(K key, V value) {\n\t\tNode newNode = new Node(key, value);// first we need to create the new\n\t\t\t\t\t\t\t\t\t\t\t// node\n\t\tNode currentNode = this.getRoot();// then we move to the root ot the\n\t\t\t\t\t\t\t\t\t\t\t// tree that has called the method\n\t\tNode currentNodeParent = mSentinel;// the parent of the root is of\n\t\t\t\t\t\t\t\t\t\t\t// course sentinel\n\t\twhile (currentNode != mSentinel) {// and while the current node(starting\n\t\t\t\t\t\t\t\t\t\t\t// from the root) is not a sentinel\n\t\t\tcurrentNodeParent = currentNode;// then remember this node as a\n\t\t\t\t\t\t\t\t\t\t\t// parent\n\t\t\tif (key.compareTo(currentNode.getKey()) < 0) {// and appropriate its\n\t\t\t\tcurrentNode = currentNode.getLeftChild();// left\n\t\t\t} else {// or\n\t\t\t\tcurrentNode = currentNode.getrightChild();// right child as the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// next current node\n\t\t\t}\n\t\t}\n\t\t// we iterate through the described loop in order to get to the\n\t\t// appropriate place(in respect to the given key) where the new node\n\t\t// should be put\n\t\tnewNode.setParent(currentNodeParent);// we make the new node's parent\n\t\t\t\t\t\t\t\t\t\t\t\t// the last non empty node that\n\t\t\t\t\t\t\t\t\t\t\t\t// we've reached\n\t\tif (currentNodeParent == mSentinel) {\n\t\t\tmRoot = newNode;// if there is no such node then the tree is empty\n\t\t\t\t\t\t\t// and our node is actually going to be the root\n\t\t} else {\n\t\t\tif (key.compareTo(currentNodeParent.getKey()) < 0) {// otherwise we\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// put our new\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// node\n\t\t\t\tcurrentNodeParent.setLeftChild(newNode);// as a left\n\t\t\t} else { // or\n\t\t\t\tcurrentNodeParent.setrightChild(newNode);// right child of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// last node we've\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// reached\n\t\t\t}\n\t\t}\n\t\treturn newNode;\n\t}",
"public int insert(int k, String i) {\r\n\t\t WAVLNode parentToInsert;\r\n\t\t if(this.root == null)\r\n\t\t {\r\n\t\t\t this.root = new WAVLNode (k,i,this.getExternalNode());\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t\t parentToInsert = this.root.placeToInsert(k);\r\n\t\t\t //System.out.println(parentToInsert.getKey());\r\n\t\t\t WAVLNode nodeToInsert = new WAVLNode(k,i,this.getExternalNode());\r\n\t\t\t if(parentToInsert == null)\r\n\t\t\t {\r\n\t\t\t\t return -1;\r\n\t\t\t }\r\n\t\t\t if(this.min == null || k < this.min.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.min = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(this.max == null || k > this.max.getKey())\r\n\t\t\t {\r\n\t\t\t\t this.max = nodeToInsert;\r\n\t\t\t }\r\n\t\t\t if(parentToInsert.getKey() > k)\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setLeft(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t parentToInsert.setRight(nodeToInsert);\r\n\t\t\t\t nodeToInsert.setParent(parentToInsert);\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t WAVLNode currentNode = nodeToInsert;\r\n\t\t\t while(currentNode.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getParent();\r\n\t\t\t\t currentNode.setSubTreeSize(currentNode.getSubTreeSize()+1);\r\n\t\t\t\t //System.out.println(\"Changed \" +currentNode.getKey()+ \" To \" + (currentNode.getSubTreeSize()));\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t int numRebalance = parentToInsert.rebalanceInsert();\r\n\t\t\t while(this.root.getParent() != null)\r\n\t\t\t {\r\n\t\t\t\t //System.out.println(this.root.getKey());\r\n\t\t\t\t this.setRoot(this.root.getParent());\r\n\t\t\t }\r\n\t\t\t return numRebalance;\r\n\t\t }\r\n\t }",
"private boolean bstInsert(Node newNode, Node currentNode) {\n if (mRoot == null) {\n // case 1\n mRoot = newNode;\n return true;\n }\n else{\n int compare = currentNode.mKey.compareTo(newNode.mKey);\n if (compare < 0) {\n // newNode is larger; go right.\n if (currentNode.mRight != NIL_NODE)\n return bstInsert(newNode, currentNode.mRight);\n else {\n currentNode.mRight = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else if (compare > 0) {\n if (currentNode.mLeft != NIL_NODE)\n return bstInsert(newNode, currentNode.mLeft);\n else {\n currentNode.mLeft = newNode;\n newNode.mParent = currentNode;\n mCount++;\n return true;\n }\n }\n else {\n // found a node with the given key; update value.\n currentNode.mValue = newNode.mValue;\n return false; // did NOT insert a new node.\n }\n }\n }",
"@SuppressWarnings(\"unchecked\")\r\n private Node insertHelperSize1(Key key, Value value) {\r\n Node tmp;\r\n if(key.compareTo(keys[0]) < 0) { // add key:value before contents\r\n tmp = children[0].insert(key,value);\r\n if(tmp != children[0]) { // merge interior node that bubbled up\r\n InteriorNode merge = (InteriorNode)tmp;\r\n setKeyValuePairs(merge.keys[0],merge.values[0],keys[0],values[0]);\r\n setChildren(merge.children[0],merge.children[1],children[1]);\r\n }\r\n } else { // add key:value after contents\r\n tmp = children[1].insert(key,value);\r\n if(tmp != children[1]) { // merge interior node that bubbled up\r\n InteriorNode merge = (InteriorNode)tmp;\r\n setKeyValuePairs(keys[0],values[0],merge.keys[0],merge.values[0]);\r\n setChildren(children[0],merge.children[0],merge.children[1]);\r\n }\r\n }\r\n return this;\r\n }",
"public Node<T> insert(T x) {\n Node<T> node = new Node<>(x);\n\n if (min == null) {\n min = node;\n } else {\n if (min.leftSibling != null) {\n node.leftSibling = min;\n node.rightSibling = min.rightSibling;\n min.rightSibling = node;\n node.rightSibling.leftSibling = node;\n } else {\n min.leftSibling = node;\n }\n if (node.key.compareTo(min.key) < 0) {\n min = node;\n }\n }\n size++;\n return node;\n }",
"public void insert(double key, Double value){\n\tif(search(key)!=null){\r\n\t\tLeaf Leaf = (Leaf)Search(root, key);\r\n\t\t\r\n\t\tfor(int i=0; i<Leaf.keyvalues.size(); i++) {\r\n\t\t\tif(key==Leaf.getKeyValue(i).getKey()) {\r\n\t\t\t\t\tLeaf.getKeyValue(i).values.add(value);\r\n\t\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\tLeaf newleaf = new Leaf(key, value);\r\n\t\r\n\tPair<Double,Node> entry=new Pair<Double, Node>(key,newleaf);\r\n\r\n\tif(root == null ) {\r\n\t\troot = entry.getValue();\r\n\t}\r\n\t\r\n\r\n\tPair<Double, Node> newChildEntry = getChildEntry(root, entry, null);\r\n\t\r\n\tif(newChildEntry == null) {\r\n\t\treturn;\r\n\t} else {\r\n\t\tIntrnlNode newRoot = new IntrnlNode(newChildEntry.getKey(), root, newChildEntry.getValue());\r\n\t\troot = newRoot;\r\n\t\treturn;\r\n\t}\r\n}",
"default Node<X> insert(X x, Comparator<X> ord) {\n int comp = ord.compare(x, val());\n if (comp == 0) return this;\n if (comp < 0) {\n Node<X> l = left().insert(x, ord);\n if (l == left()) return this; else return make(l, right());\n } else {\n Node<X> r = right().insert(x, ord);\n if (r == right()) return this; else return make(left(), r);\n }\n }",
"public void insert(K k, V v) {\n if (k == null) {\n throw new IllegalArgumentException();\n }\n Item<K,V> i = new Item<K,V>(k, v);\n size += 1;\n if (root == null) {\n root = i;\n return;\n }\n\n Item<K,V> x = root;\n Item<K,V> p = root;\n while (true) {\n if (x == null) {\n break;\n }\n p = x;\n // less than\n if (x.getK().compareTo(k) <= 0){ \n x = x.getR();\n } else {\n x = x.getL();\n }\n }\n i.setP(p);\n if (p.getK().compareTo(k) <= 0){\n p.setR(i);\n } else {\n p.setL(i);\n }\n }",
"private BSTNode<K> insertNode(BSTNode<K> currentNode, K key) \n throws DuplicateKeyException, IllegalArgumentException {\n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, create a new node, because of reaching a leaf\n if (currentNode == null) {\n BSTNode<K> newNode = new BSTNode<K>(key);\n return newNode;\n }\n // otherwise, keep searching through the tree until meet a leaf, or find a duplicated node \n else {\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(insertNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(insertNode(currentNode.getRightChild(), key));\n break;\n default:\n throw new DuplicateKeyException(\"A node with the same value is already existed\");\n }\n // after update currentNode's left and right childNote, let's check currentNode's balanceValue\n // ancestor two levels away from a lead node, its absolute balanceValue may exceeds 1,\n // so codes below has meaning for it \n int balanceValue = getNodeBalance(currentNode); \n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n switch (key.compareTo(currentNode.getLeftChild().getId())) {\n case -1: // after Left Left Case, balance is updated, so sent currentNode to its ancestor \n return rotateRight(currentNode); \n case 1: // after Left Right Case, balance is updated, so sent currentNode to its ancestor \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n switch (key.compareTo(currentNode.getRightChild().getId())){\n case 1: // after Right Right Case, balance is updated, so sent currentNode to its ancestor \n return rotateLeft(currentNode);\n case -1: // after Right Left Case, balance is updated, so sent currentNode to its ancestor \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n } \n }\n }\n // for leaf node's balanceValue == 0, and for -1 <= leaf node's first ancestor's balanceValue <= 1,\n // codes above(from balanceValue) has no meaning for it, return currentNode straight forward\n return currentNode;\n }",
"public void insert(TKey key, TValue data) {\n Node n = new Node(key, data, true); // nodes start red\n // normal BST insert; n will be placed into its initial position.\n // returns false if an existing node was updated (no rebalancing needed)\n boolean insertedNew = bstInsert(n, mRoot); \n if (!insertedNew) return;\n // check cases 1-5 for balance violations.\n checkBalance(n);\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }",
"public boolean Insert(int v_key){\n\tTree new_node ;\n\tboolean ntb ;\n\tboolean cont ;\n\tint key_aux ;\n\tTree current_node ;\n\n\tnew_node = new Tree();\n\tntb = new_node.Init(v_key) ;\n\tcurrent_node = this ;\n\tcont = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux){\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Left(true);\n\t\t ntb = current_node.SetLeft(new_node);\n\t\t}\n\t }\n\t else{\n\t\tif (current_node.GetHas_Right())\n\t\t current_node = current_node.GetRight() ;\n\t\telse {\n\t\t cont = false ;\n\t\t ntb = current_node.SetHas_Right(true);\n\t\t ntb = current_node.SetRight(new_node);\n\t\t}\n\t }\n\t}\n\treturn true ;\n }"
] | [
"0.70752734",
"0.7062105",
"0.6850483",
"0.6832592",
"0.67324615",
"0.6725074",
"0.6723013",
"0.67208385",
"0.671731",
"0.67131865",
"0.67010546",
"0.6698782",
"0.66632366",
"0.6612705",
"0.6611628",
"0.65820086",
"0.65757835",
"0.65657485",
"0.65593684",
"0.6559212",
"0.6558521",
"0.65319824",
"0.6499543",
"0.64916503",
"0.64914644",
"0.6474475",
"0.6466626",
"0.64153594",
"0.6401126",
"0.6399155",
"0.6388078",
"0.6351892",
"0.63456136",
"0.63440424",
"0.6333483",
"0.63082016",
"0.6301408",
"0.6296403",
"0.6288934",
"0.6286986",
"0.62849236",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.62809855",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922",
"0.627922"
] | 0.0 | -1 |
Search: If less, go left. If greater, go right. If equal,search hit Cost: Number of compares if 1+depth of Node | public Value get(Key key) //Value passed with Key(Null if key is absent)
{
Node x=root;
while(x!=null)
{
int cmp=key.compareTo(x.key);
if(cmp<0) x=x.left;
else if(cmp>0) x=x.right;
else if(cmp==0) return x.val;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void test(){\n BinarySearchTree tree = new BinarySearchTree(new Node(35));\n\n tree.addNode(4);\n tree.addNode(15);\n tree.addNode(3);\n tree.addNode(1);\n tree.addNode(20);\n tree.addNode(8);\n tree.addNode(50);\n tree.addNode(40);\n tree.addNode(30);\n tree.addNode(80);\n tree.addNode(70);\n\n tree.addNode(90);\n\n tree.deleteNode(50);\n System.out.println(\"=====中序遍历 递归法=====\");\n TreeUtil.traverseInOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traverseInOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====前序遍历=====\");\n TreeUtil.traversePreOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====中序遍历 迭代法=====\");\n TreeUtil.traversePreOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历=====\");\n TreeUtil.traversePostOrder(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====后序遍历 迭代法=====\");\n TreeUtil.traversePostOrderByIteration(tree.getRoot());\n\n System.out.println(\"\");\n System.out.println(\"=====层次遍历=====\");\n TreeUtil.traverseLevelOrder(tree.getRoot());\n\n int height = TreeUtil.getChildDepth(tree.getRoot());\n System.out.println(\"\");\n System.out.println(\"树高:\"+height);\n }",
"private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }",
"public static void main(String[] args) {\n SearchTree search = new SearchTree(new Node(INITIAL_STATE), GOAL_STATE);\n long startTime = System.currentTimeMillis();\n\n search.breadthFirstSearch();\n// search.depthFirstSearch();\n// search.iterativeDeepening(10);\n\n long finishTime = System.currentTimeMillis();\n long totalTime = finishTime - startTime;\n System.out.println(\"\\n[Elapsed time: \" + totalTime + \" milliseconds]\");\n System.out.println(\"========================================================\");\n }",
"public void traverse(double num){\n //This means go left\n if (num <= value){\n if (left == null){\n left = new Node(num);\n }\n else{\n left.traverse(num);\n }\n }//This means it goes left; num > value\n else{\n if (right == null){\n right = new Node(num);\n }\n else{\n right.traverse(num);\n }\n }\n }",
"private static int breadthFirstSearch(Vertex start) throws Queue.UnderflowException, Queue.EmptyException {\n boolean visited[] = new boolean[48];\n //Keep a queue of vertecies and a queue of the depth of the verticies - they will be added to and poped from identically\n ListQueue<Vertex> queue = new ListQueue<Vertex>();\n ListQueue<Integer> numQueue = new ListQueue<Integer>();\n //Set the starting node as visited\n visited[start.index()] = true;\n queue.enqueue(start);\n numQueue.enqueue(new Integer(1));\n\n //Keep last\n int last = -1;\n //While the queue isnt empty\n while (!queue.isEmpty()) {\n //Pop off the top from both queues and mark as visited\n start = queue.dequeue();\n int current = numQueue.dequeue();\n visited[start.index] = true;\n //For all neigbors\n for (Vertex v : start.neighbors) {\n //If we havent visited it make sure to visit it\n if (visited[v.index()] == false) {\n //As we keep adding new nodes to visit keep track of the depth\n queue.enqueue(v);\n numQueue.enqueue(current + 1);\n }\n }\n //Keep track of the most recent depth before we pop it off (queue will be empty when we exit)\n last = current;\n }\n //Return the max of the depth\n return last;\n }",
"private BTNode<T> find ( T data, BTNode<T> node ){\n \t\tfindCount++;\n\t\tif (data.compareTo (node.getData()) == 0){\n \t\treturn node;\n\t\t}else {\n\t\t//findCount++;\n\t\tif (data.compareTo (node.getData()) < 0){\n \t\treturn (node.getLeft() == null) ? null : find (data, node.getLeft());\n\t\t}else{\n \t\treturn (node.getRight() == null) ? null : find (data, node.getRight());\n\t\t}\n\t\t}\n }",
"private int dfs(TreeNode node, TreeNode target, int K, List<Integer> res) {\r\n if (node == null) return -1;\r\n\r\n if (node.val == target.val) {\r\n // add nodes from current subtree\r\n addNodes(node, K, res);\r\n return 0;\r\n }\r\n\r\n int left = dfs(node.left, target, K, res);\r\n int right = dfs(node.right, target, K, res);\r\n \r\n // at most one of left and right could be not -1\r\n if (right != -1) {\r\n // current node is k far from target\r\n if (K == right + 1) res.add(node.val);\r\n // target is in the right subtree, add nodes in left subtree\r\n else addNodes(node.left, K - right - 2, res);\r\n return right + 1;\r\n }\r\n\r\n if (left != -1) {\r\n // current node is k far from target\r\n if (K == left + 1) res.add(node.val);\r\n // target is in the left subtree, add nodes in right subtree\r\n else addNodes(node.right, K - left - 2, res);\r\n return left + 1;\r\n }\r\n\r\n // both left and right are - 1\r\n return -1;\r\n }",
"public long search(Node root, int key) {\n\n comparisons++;\n // Base Cases: root is null or key is present at root\n if (root==null || root.key==key)\n return comparisons;\n\n // val is greater than root's key\n if (root.key > key)\n return search(root.left, key);\n\n // val is less than root's key\n return search(root.right, key);\n }",
"public static void main(String[] args) {\n\t\tNode a = new Node(10);\r\n\t\tNode b = new Node(-5);\r\n\t\tNode c = new Node(-10);\r\n\t\tNode d = new Node(5);\r\n\t\tNode e = new Node(25);\r\n\t\tNode f = new Node(36);\r\n\t\ta.left = b;\r\n\t\tb.left = c;\r\n\t\tb.right = d;\r\n\t\ta.right = e;\r\n\t\te.right = f;\r\n\t\tboolean found1 = search(a,22);\r\n\t\tboolean found2 = search(a,5);\r\n\t\tSystem.out.println(found1);\r\n\t\tSystem.out.println(found2);\r\n\t}",
"private void valueSearch(int key, Node currNode) {\n int numChildren = getNumChildren();\n\n // Returns if currNode is null.\n if (currNode == null) {\n queueNodeSelectAnimation(null, \"Current Node null, desired Node not found\",\n AnimationParameters.ANIM_TIME);\n return;\n\n }\n\n // Finishes the traversal if the key has been found.\n if (currNode.key == key) {\n queueNodeSelectAnimation(currNode, key + \" == \"\n + currNode.key + \", desired Node found\",\n AnimationParameters.ANIM_TIME);\n\n }\n // Explores the left subtree.\n else if (key < currNode.key) {\n for (int i = 0; i < numChildren / 2; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" < \" + currNode.key +\n \", exploring left subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n // Explores the right subtree.\n else {\n for (int i = numChildren / 2; i < numChildren; ++i) {\n queueNodeSelectAnimation(currNode.children[i],\n key + \" > \" + currNode.key +\n \", exploring right subtree\",\n AnimationParameters.ANIM_TIME);\n valueSearch(key, currNode.children[i]);\n\n }\n }\n }",
"private Node<T> searchRecursively(Node<T> node, T value) {\n\n // If the key is less than that of the current node, calls this method again with the current node's\n // left branch as the new node to compare keys with.\n if (value.compareTo(node.getValue()) == -1) {\n node = node.getLeft();\n return searchRecursively(node, value);\n }\n\n // Otherwise, calls the method again, comparing with the current node's right branch.\n else if (value.compareTo(node.getValue()) == 1) {\n node = node.getRight();\n return searchRecursively(node, value);\n }\n\n // If the current node contains the key, returns this node.\n return node;\n }",
"private void BinarySearch(Node node, int index) {\n Node left, right;\n left = node.left;\n right = node.right;\n\n int leftIndex = (2 * index) + 1;\n int rightIndex = (2 * index) + 2;\n if (left != null) {\n ArrayTree[leftIndex] = left.key;\n BinarySearch(left, leftIndex);\n lastIndex = Math.max(leftIndex, lastIndex);\n } else {\n if (leftIndex < ArrayTree.length - 1) {\n ArrayTree[leftIndex] = 0;\n }\n }\n\n if (right != null) {\n ArrayTree[rightIndex] = right.key;\n BinarySearch(right, rightIndex);\n lastIndex = Math.max(rightIndex, lastIndex);\n } else {\n if (rightIndex < ArrayTree.length - 1) {\n ArrayTree[rightIndex] = 0;\n }\n }\n }",
"public static void main(String[] args) {\n Node root = new Node(10);\n root.right = new Node(-3);\n root.right.right = new Node(11);\n\n Node l1 = root.left = new Node(5);\n l1.right = new Node(2);\n l1.right.right = new Node(1);\n\n l1.left = new Node(3);\n l1.left.right = new Node(-2);\n l1.left.left = new Node(3);\n\n int k = 7;\n List<Node> path = new ArrayList<>();\n findPath(root, 7, path); //O(n^2) in worst, O(nlogn) if tree is balanced.\n\n }",
"public static void main(String[] args) {\n TreeNode node1 = new TreeNode(1);\n TreeNode node2 = new TreeNode(2);\n TreeNode node3 = new TreeNode(3);\n TreeNode node4 = new TreeNode(4);\n TreeNode node5 = new TreeNode(5);\n TreeNode node6 = new TreeNode(6);\n TreeNode node7 = new TreeNode(7);\n TreeNode node8 = new TreeNode(8);\n\n node1.left = node2;\n node2.left = node3;\n node3.left = node4;\n node4.left = node5;\n\n node2.right = node6;\n node6.left = node7;\n node7.right = node8;\n\n// int count = leaveCount(node1.left, 0);\n int count = leaveCountFast(node1.left);\n\n traverse(node1, 0, 5, -1000000);\n Main.print(count);\n }",
"@Test\n public void searchNodesBST()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n bst.insert(root, root);\n bst.insert(root, new No(2));\n bst.insert(root, new No(9));\n No k = new No(1);\n bst.insert(root, k);\n bst.insert(root, new No(4));\n bst.insert(root, new No(8));\n assertEquals(k, bst.search(root, k));\n //bst.inOrder(root);\n }",
"private Node searchAux(Node tree, K key) {\n if(root == null) { return null; } //empty tree\n int cmp = key.compareTo(tree.key);\n if(cmp == 0 || cmp < 0 && tree.left == null || cmp > 0 && tree.right == null) { //found the node or last checked\n comparisons += 1;\n return tree;\n }\n if(cmp < 0) {\n comparisons += 1;\n return searchAux(tree.left, key);\n } else {\n comparisons += 1;\n return searchAux(tree.right, key);\n }\n }",
"public static void main(String[] args) {\n Node root = newNode(1);\n\n root.left = newNode(2);\n root.right = newNode(3);\n\n root.left.left = newNode(4);\n root.left.right = newNode(5);\n\n root.left.left.left = newNode(8);\n root.left.left.right = newNode(9);\n\n root.left.right. left = newNode(10);\n root.left.right. right = newNode(11);\n\n root.right.left = newNode(6);\n root.right.right = newNode(7);\n root.right.left .left = newNode(12);\n root.right.left .right = newNode(13);\n root.right.right. left = newNode(14);\n root.right.right. right = newNode(15);\n System.out.println(findNode(root, 5, 6, 15));\n }",
"public int depthHelp(BSTNode<E,K> node)\r\n\t{\r\n\t\tint sum1 = 0;\r\n\t\tint sum2 = 0;\r\n\t\tif(node.getLeft() != null)\r\n\t\t{\r\n\t\t\tsum1 += depthHelp(node.getLeft());\r\n\t\t}\r\n\t\tif(node.getRight() != null)\r\n\t\t{\r\n\t\t\tsum2 += depthHelp(node.getRight());\r\n\t\t}\r\n\t\tif(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(sum1>sum2)\r\n\t\t{\r\n\t\t\treturn sum1 +1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn sum2 +1;\r\n\t\t}\r\n\t}",
"public int solution(Tree T) {\n if(T == null)\n {\n return 0;\n\n }\n //Check if the tree has no children\n if(T.l == null && T.r == null)\n {\n return 0;\n }\n\n\n AtomicInteger leftSide = new AtomicInteger(0);\n AtomicInteger rightSide = new AtomicInteger(0);\n\n if(T.l != null) traverseTree(T.l, 0, true, leftSide);\n if(T.r != null) traverseTree(T.r, 0, false, rightSide);\n\n\n if(leftSide.intValue() > rightSide.intValue())\n {\n return leftSide.intValue();\n }\n else{\n return rightSide.intValue();\n }\n\n }",
"@Test\n public void whenSearchTwoThenResultIndexOne() {\n tree.addChild(nodeOne, \"1\");\n nodeOne.addChild(nodeTwo, \"2\");\n nodeTwo.addChild(nodeThree, \"3\");\n assertThat(tree.searchByValue(\"4\"), is(\"Element not found\"));\n }",
"public ReferenceNode searchMatchNode(Set<String> data) {\n // Try the first first\n ReferenceNode node = nodeList.get(0);\n double similarity = node.calculateSimilarity(data);\n ReferenceNode winningNode = node;\n double newSim = 0.0;\n for (int i = 1; i < nodeList.size(); i++) {\n node = nodeList.get(i);\n newSim = node.calculateSimilarity(data);\n if (newSim > similarity) {\n winningNode = node;\n similarity = newSim;\n }\n if (newSim == 1.0d)\n break; // The highest\n }\n if (similarity == 0.0d) {\n // Try to find an empty node. Otherwise, pathways will be grouped in the\n // first node\n for (ReferenceNode tmp : nodeList) {\n if (tmp.isEmpty()) {\n winningNode = tmp;\n break;\n }\n }\n }\n return winningNode;\n }",
"public int depth() { return Math.max(left.depth(), right.depth()) + 1; }",
"private void getAllNodesBreadthFirstSearch(List<Expression> nodesList)\n/* */ {\n/* 156 */ int indx = 0;\n/* 157 */ nodesList.add(this);\n/* */ \n/* 159 */ while (indx < nodesList.size()) {\n/* 160 */ Expression node = (Expression)nodesList.get(indx++);\n/* 161 */ for (Expression child : node.childs) {\n/* 162 */ nodesList.add(child);\n/* */ }\n/* */ }\n/* */ }",
"void findSearchOrder() {\n boolean filled = false;\n for(int node: queryGraphNodes.keySet()) {\n\n vertexClass vc = queryGraphNodes.get(node);\n searchOrderSeq.add(node);\n for(int edge: queryGraphNodes.get(node).edges.keySet()) {\n filled = calcOrdering(edge);\n if (filled)\n break;\n }\n if(searchOrderSeq.size() == queryGraphNodes.size())\n break;\n\n }\n\n }",
"private Node bstFind(TKey key, Node currentNode) {\n return (currentNode == null || currentNode == NIL_NODE ||\n key.compareTo(currentNode.mKey) == 0) ?\n currentNode:\n ((key.compareTo(currentNode.mKey) < 0) ?\n bstFind(key, currentNode.mLeft) : \n bstFind(key, currentNode.mRight));\n // That's right. A ternary operator WITHIN a ternary operator.\n // That's how it's done, son.\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }",
"public int Search(int v_key){\n\tboolean cont ;\n\tint ifound ;\n\tTree current_node;\n\tint key_aux ;\n\n\tcurrent_node = this ;\n\tcont = true ;\n\tifound = 0 ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left())\n\t\t current_node = current_node.GetLeft() ;\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right())\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t else cont = false ;\n\t\telse { \n\t\t ifound = 1 ;\n\t\t cont = false ;\n\t\t}\n\t}\n\treturn ifound ;\n }"
] | [
"0.62762135",
"0.6229403",
"0.5989156",
"0.5981272",
"0.59802973",
"0.5970413",
"0.59657764",
"0.59626704",
"0.5937357",
"0.5906323",
"0.590263",
"0.5872881",
"0.58455396",
"0.58396286",
"0.5821841",
"0.58162767",
"0.5800993",
"0.5786465",
"0.57549113",
"0.574099",
"0.5740244",
"0.57223624",
"0.57182956",
"0.5716922",
"0.5712374",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5701058",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036",
"0.5700036"
] | 0.0 | -1 |
Floor: largest keyCase 1: k is equal to the key at root > The floor of k is k Case 2: k is less than the key at root > The floor of k is in the left subtree. Case 3: k is greater than the key at root > The floor of k lies in the right subtree if there is any key<=k in right subtree. Otherwise it is the key at root. | public Key floor(Key key) //largest key less than or equal to the given key
{
Node x=floor(root,key);
if(x!=null)
return x.key;
else return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public K floor(K key) {\n if (root == null)\n return null;\n else {\n Node tmp = null;\n Node curr = root;\n while (true) {\n if (curr == null) {\n if (tmp != null)\n return tmp.key;\n return null;\n }\n int cmp = key.compareTo(curr.key);\n if (cmp == 0)\n return curr.key;\n else if (cmp < 0)\n curr = curr.left;\n else {\n tmp = curr;\n curr = curr.right;\n }\n }\n }\n }",
"private Node floor(Node x, int key) {\n if (x == null)\n return null;\n int cmp = key - x.key;\n if (cmp == 0)\n return x;\n if (cmp < 0)\n return floor(x.left, key);\n Node t = floor(x.right, key);\n if (t != null)\n return t;\n else\n return x;\n }",
"public Key ceiling(Key key)\t\t\t\t//smallest key greater than or equal to the given key\n\t{\n\t\tNode x=ceiling(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}",
"public Key getCeiling(Key key) {\n\n Node current = root;\n while (current != null) {\n if (current.key == key) {\n return key;\n }\n if (current.key.compareTo(key) > 0) {\n if (current.left != null && current.left.key.compareTo(key) < 0) {\n return current.key;\n } else {\n current = current.left;\n }\n } else {\n current = current.right;\n }\n }\n return null;\n }",
"public Node floor(K k){\n int floorRank = rank(k);\n Node res = select(floorRank);\n if(res.k.compareTo(k)>0) floorRank = floorRank - 1;\n return select(floorRank);\n }",
"public Key floor(final Key key) {\n int rank = rank(key);\n if (rank == 0) {\n return null;\n }\n if (rank < size && key.compareTo(keys[rank]) == 0) {\n return keys[rank];\n } else {\n return keys[rank - 1];\n }\n }",
"public K floor(K key);",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> floorEntry(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || ! key.equals(map.get(j).getKey())) j--;\n\t\treturn safeEntry(j);\n\t}",
"public int kthSmallest_binary_search(TreeNode root, int k) {\n int count = getNodeCount(root.left);\n if (k <= count) {\n return kthSmallest(root.left, k);\n } else if (k > count + 1) {\n return kthSmallest(root.right, k - 1 - count); // 1 is counted as current node\n }\n return root.val;\n }",
"public K select(int k) {\n if (root == null) {\n return null;\n } else {\n int size = 0;\n Node curr = root;\n while (curr != null) {\n int leftSize = size(curr.left);\n if (leftSize + size > k) {\n curr = curr.left;\n } else if (leftSize + size < k) {\n size += leftSize + 1;\n curr = curr.right;\n } else {\n break;\n }\n }\n if (curr == null)\n return null;\n return curr.key;\n }\n }",
"public int minValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.left != null)\n current = current.left;\n\n return (current.key);\n }",
"abstract K getFirstLeafKey();",
"abstract K getFirstLeafKey();",
"public static Node findKthSmallest(Node node, int k){\n if(node!=null){ // node มีตัวตน\n int l = size(node.left);\n if(k==l+1){\n return node;\n }else if(k<l+1){ //ถ้า k is น้อยกว่า size ค่าของ kth จะอยูที่ left subtree.\n return findKthSmallest(node.left,k);\n }else{\n return findKthSmallest(node.right,k-l-1); // recursive right-subtree และค่า k ลบด้วย size ทางขวา และตัวมันเอง(1)\n }\n }\n else {\n return null;\n }\n\n }",
"private long minKey() {\n if (left.size == 0) return key;\n // make key 'absolute' (i.e. relative to the parent of this):\n return left.minKey() + this.key;\n }",
"public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }",
"public QuestObj floor(int key) {\n Node x = floor(root, key);\n if (x == null)\n return null;\n return new QuestObj(x.key, x.val);\n }",
"public int kthSmallest(TreeNode root, int k) {\n if (root == null || k <= 0) return -1;\n\n BSTIterator it = new BSTIterator(root);\n TreeNode node = null;\n while (k-- > 0) {\n node = it.next();\n if (node == null) return -1;\n }\n return node.val;\n }",
"public int kthSmallest_3(TreeNode root, int k) {\n \tStack<TreeNode> stack =new Stack<TreeNode>();\n \twhile(root!=null){\n \t\tstack.push(root);\n \t\troot = root.left;\n \t}\n \t\n \twhile(k!=0){\n \t\tTreeNode n = stack.pop();\n \t\tk--;\n \t\tif(k==0)\n \t\t\treturn n.val;\n \t\tTreeNode right = n.right;\n \t\twhile(right!=null){\n \t\t\tstack.push(right);\n \t\t\tright =right.left;\n \t\t}\n \t}\n \treturn -10086;\n }",
"private static <K extends Comparable<? super K>, V> @Nullable Node<K, V> findBestRoot(\n @Nullable Node<K, V> pRoot,\n @Nullable K pFromKey,\n boolean pFromInclusive,\n @Nullable K pToKey,\n boolean pToInclusive) {\n\n @Var Node<K, V> current = pRoot;\n while (current != null) {\n\n if (pFromKey != null && exceedsLowerBound(current.getKey(), pFromKey, pFromInclusive)) {\n // current and left subtree can be ignored\n current = current.right;\n } else if (pToKey != null && exceedsUpperBound(current.getKey(), pToKey, pToInclusive)) {\n // current and right subtree can be ignored\n current = current.left;\n } else {\n // current is in range\n return current;\n }\n }\n\n return null; // no mapping in range\n }",
"public static int kthSmallest(TreeNode root, int k) {\n\n int count = countNode(root.left);\n if (k <= count) {\n return kthSmallest(root.left, k);\n } else if (k > count + 1) {\n return kthSmallest(root.right, k - 1 - count); // 1 is counted as current node\n }\n\n return root.val;\n }",
"public long search(Node root, int key) {\n\n comparisons++;\n // Base Cases: root is null or key is present at root\n if (root==null || root.key==key)\n return comparisons;\n\n // val is greater than root's key\n if (root.key > key)\n return search(root.left, key);\n\n // val is less than root's key\n return search(root.right, key);\n }",
"private void checkMinKeys(BTreeNode<T> currentNode) {\n BTreeNode<T> parent = findParent(root, currentNode);\n int indexCurrentChild = getIndexChild(parent, currentNode);\n\n BTreeNode<T> leftBrother;\n BTreeNode<T> rightBrother;\n\n //Dependiendo del indice del hijo se realizaran las operaciones\n //de prestamo y union\n switch (indexCurrentChild) {\n \n //Si el indice es 0 solo tiene hermano derecho por ende\n //las operaciones se realizan con el hermano derecho\n case 0 -> {\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n //Si el hermano derecho tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, rightBrother, indexCurrentChild + 1, 1);\n }\n }\n \n //Si el indice es 5 solo tiene hermano izquierdo por ende las\n //operaciones solo se pueden realizar con el hermano izquierdo\n case 5 -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n\n //Si el hermano izquierdo tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n \n //Si el indice es cualquier otro las operaciones se pueden realizar\n //tanto con el hermano derecho como con el hermano izquierdo\n default -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n // Si cualquiera de los dos hermanos tiene mas de 2 llaves se\n //toma una de ellas, de lo contrario se realiza una union con\n //el hermano izquierdo.\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n }\n\n //Despues de realizar las operaciones en el nodo hijo se valida que \n //el nodo padre no quede con menos de 2 llaves\n if (parent != root && parent.getNumKeys() < 2) {\n checkMinKeys(parent);\n }\n }",
"private int binaryFind(K key) {\n int sortedCount = this.sortedCount.get();\n // if there are no sorted keys, or the first item is already larger than key -\n // return the head node for a regular linear search\n if ((sortedCount == 0) || comparator.compareKeyAndSerializedKey(key, readKey(FIRST_ITEM)) <= 0) {\n return HEAD_NODE;\n }\n\n // optimization: compare with last key to avoid binary search\n if (comparator.compareKeyAndSerializedKey(key, readKey((sortedCount - 1) * FIELDS + FIRST_ITEM)) > 0) {\n return (sortedCount - 1) * FIELDS + FIRST_ITEM;\n }\n\n int start = 0;\n int end = sortedCount;\n\n while (end - start > 1) {\n int curr = start + (end - start) / 2;\n\n if (comparator.compareKeyAndSerializedKey(key, readKey(curr * FIELDS + FIRST_ITEM)) <= 0) {\n end = curr;\n } else {\n start = curr;\n }\n }\n\n return start * FIELDS + FIRST_ITEM;\n }",
"@Override\r\n public K floorKey(final K key) {\n return null;\r\n }",
"private int kthSmallestTreeNode(Tree tree, int k){\n List<Integer> values = new ArrayList<>();\n List<Integer> arr = printTree(tree, values);\n System.out.println(\"\\nPrinting out the whole list created by In order traversal\\n\");\n System.out.print(arr);\n return arr.get(k);\n}",
"public void compareLeaf(int k){\n\t\twhile(k > 1 && lessThan(k, k/2)){\n\t\t\tString tempKey = queueArray[k/2][0];\n\t\t\tString tempVal = queueArray[k/2][1];\n\t\t\tqueueArray[k/2][0] = queueArray[k][0];\n\t\t\tqueueArray[k/2][1] = queueArray[k][1];\n\t\t\tqueueArray[k][0] = tempKey;\n\t\t\tqueueArray[k][1] = tempVal;\n\t\t\tk = k/2;\n\t\t}\n\t}",
"public int kthSmallest(TreeNode root, int k) {\n ArrayList<Integer> arr = new ArrayList<>();\n inorder(root, arr);\n return arr.get(k-1);\n }",
"private int recursiveBinarySearchSol(TreeNode root, int k) {\n // Corner Case\n if (root == null) {\n return 0;\n }\n\n if (root.left != null) { // 判断左子节点是否为空\n // 若左子节点不为空,计算左子树的节点数\n int leftCount = countNodes(root.left);\n if (leftCount >= k) { // 说明第k小的数一定在当前的左子树\n return recursiveBinarySearchSol(root.left, k);\n } else { // 说明第k小的数不再当前左子树,减去左子树的节点数量\n k -= leftCount;\n }\n }\n\n if (k == 1) { // 说明第k小的数就是当前根节点\n return root.val;\n } else { // 否则减去当前根节点的数量(1)\n k -= 1;\n }\n\n // 此时说明第k小的数一定在当前右子树\n return recursiveBinarySearchSol(root.right, k);\n }",
"public T k_minimum(int k) {\n CntAVLTreeNode<T> p = k_minimum(mRoot, k);\n return p != null ? (p.key) : null;\n }",
"public RBNode search(RBNode x, int k){\r\n\t\twhile (x != nil && k != x.key){\r\n\t\t\tif (k < x.key)\r\n\t\t\t\tx = x.left;\r\n\t\t\telse x = x.right;\r\n\t\t}\r\n\t\treturn x;\r\n\t}",
"public int level(K key) {\n\t\tif (lookup(key) == null) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tint level = 1;\n\t\t\tTree<K, V> t = this;\n\t\t\treturn level(t, level, key);\n\t\t}\n\t}",
"public Data poll(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n\n if (next == null) {\n return null;\n } else {\n var ret = next.data;\n\n if (next.right != null && next.left != null) {\n int predHeight = 0;\n var pred = next.right;\n var predP = next;\n while (pred.left != null) {\n predP = pred;\n pred = pred.left;\n predHeight++;\n }\n\n int succHeight = 0;\n var succ = next.left;\n var succP = next;\n while (succ.right != null) {\n succP = succ;\n succ = succ.right;\n succHeight++;\n }\n \n Node newNode;\n Node newNodeP;\n Node newNodeS;\n if (succHeight > predHeight) {\n newNode = succ;\n newNodeP = succP;\n newNodeS = succ.left;\n } else {\n newNode = pred;\n newNodeP = predP;\n newNodeS = succ.right;\n }\n\n if (newNodeP.right == newNode) {\n newNodeP.right = newNodeS;\n } else {\n newNodeP.left = newNodeS;\n }\n\n next.key = newNode.key;\n next.data = newNode.data;\n } else {\n var child = next.right == null ? next.left\n : next.right;\n if (next == root) {\n root = child;\n } else {\n if (curr.left == next) {\n curr.left = child;\n } else {\n curr.right = child;\n }\n }\n }\n return ret;\n }\n }",
"public K min() {\n if (root == null)\n return null;\n else {\n Node curr = root;\n while (true) {\n if (curr.left != null)\n curr = curr.left;\n else\n return curr.key;\n }\n }\n }",
"private K smallest(BSTnode<K> n) {\n\t\tif (n.getLeft() == null) {\n\t\t\treturn n.getKey();\n\t\t} else {\n\t\t\treturn smallest(n.getLeft());\n\t\t}\n\t}",
"private int method2(TreeNode root, int k) {\n result = root.val;\n count = 0;\n inorder(root, k);\n return result;\n }",
"private K lookup(BSTnode<K> n, K key) {\n\t\tif (n == null) {// if key is not present\n\t\t\treturn null;\n\t\t}\n\t\tif (key.equals(n.getKey())) {// if key is present, return the match to\n\t\t\t\t\t\t\t\t\t\t// be incremented\n\t\t\treturn n.getKey();\n\t\t}\n\t\tif (key.compareTo(n.getKey()) < 0) {\n\t\t\t// key < this node's key; look in left subtree\n\t\t\treturn lookup(n.getLeft(), key);\n\t\t}\n\n\t\telse {\n\t\t\t// key > this node's key; look in right subtree\n\t\t\treturn lookup(n.getRight(), key);\n\t\t}\n\t}",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(1);\n root.right = new TreeNode(4);\n root.left.right = new TreeNode(2);\n\n System.out.println(kthSmallest(root, 1));\n }",
"public void pruneK(Integer k) {\n\n Integer sum = (Integer)root.element;\n if (largestPath(root.left, sum) >= k) {\n pruneRecur(root.left, sum, k);\n } else {\n root.left = null;\n }\n if (largestPath(root.right, sum) >= k) {\n pruneRecur(root.right, sum, k);\n } else {\n root.right = null;\n }\n }",
"public int kthSmallest(TreeNode root, int k) {\n\t\tint[] nums = new int[2];\n\t\tinorder(root, k, nums);\n\t\treturn nums[1];\n\t}",
"public int insert(int newKey){\n int i=n-1;\n int x =0;\n if (isLeaf){\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i]) \n return -1;//duplicate return withoiut doinganything\n key[i+1] = key[i];\n i--;\n \n }\n if(x>=0){\n n++;\n key[i+1]=newKey;\n }\n }\n else{\n while ((i>=0)&& (newKey<=key[i])) {\n if(newKey==key[i])\n return -1;// find duplictte return without doing anithing \n \n else\n i--;\n }\n if(x>=0){\n \n int insertChild = i+1; // Subtree where new key must be inserted\n if (c[insertChild].isFull()){\n x++;// one more node.\n // The root of the subtree where new key will be inserted has to be split\n // We promote the mediand of that root to the current node and\n // update keys and references accordingly\n \n //System.out.println(\"This is the full node we're going to break \");// Debugging code\n //c[insertChild].printNodes();\n //System.out.println(\"going to promote \" + c[insertChild].key[T-1]);\n n++;\n c[n]=c[n-1];\n for(int j = n-1;j>insertChild;j--){\n c[j] =c[j-1];\n key[j] = key[j-1];\n }\n key[insertChild]= c[insertChild].key[T-1];\n c[insertChild].n = T-1;\n \n BTreeNode newNode = new BTreeNode(T);\n for(int k=0;k<T-1;k++){\n newNode.c[k] = c[insertChild].c[k+T];\n newNode.key[k] = c[insertChild].key[k+T];\n }\n \n newNode.c[T-1] = c[insertChild].c[2*T-1];\n newNode.n=T-1;\n newNode.isLeaf = c[insertChild].isLeaf;\n c[insertChild+1]=newNode;\n \n //System.out.println(\"This is the left side \");\n //c[insertChild].printNodes(); \n //System.out.println(\"This is the right side \");\n //c[insertChild+1].printNodes();\n //c[insertChild+1].printNodes();\n \n if (newKey <key[insertChild]){\n c[insertChild].insert(newKey); }\n else{\n c[insertChild+1].insert(newKey); }\n }\n else\n c[insertChild].insert(newKey);\n }\n \n \n }\n return x ;\n }",
"private static boolean search(Node root, int key) {\n\t\tif(root == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(key == root.data) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(key < root.data ) {\r\n\t\t\t\treturn search(root.left,key);\r\n\t\t\t}\r\n\t\t\telse if(key > root.data) {\r\n\t\t\t\treturn search(root.right,key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected Node<T> getNode(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public int level(Tree<K, V> t, int level, K key) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\treturn level;\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\treturn left.level(left, level + 1, key);\n\t\t} else {\n\t\t\treturn right.level(right, level + 1, key);\n\t\t}\n\t}",
"public V put(K key, V value){\n\t\tV v=null;\n\t\tNode n;\n\t\t\n\t\t\n\t\tif(root==null){\n\t\t\t\n\t\t\troot=new Node(key,value);\t\t\t\n\t\t\troot.parent=null;\n\t\t\t\n\t\t}\n\t\telse if(get(key)!=null){\n\t\t\t\n\t\t\tv=searchkey(root, key).value;\n\t\t\t\n\t\t\tsearchkey(root, key).value=value;\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\tif(root.key.compareTo(key)>0){\n\t\t\t\tn=leftend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){if(t.key.compareTo(key)<0&&t!=root){break;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.left;\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=rightend(n);\n\t\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tn.right.parent=n;\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(root.key.compareTo(key)<0 ){\n\t\t\t\t\n\t\t\t\tn=rightend(root);\n\t\t\t\tNode t=root;\n\t\t\t\twhile( t!=n){\n\t\t\t\t\tif(t.key.compareTo(key)>0 && t!=root){\n\t\t\t\t\t\tbreak;}\n\t\t\t\telse{\n\t\t\t\t\tt=t.right;\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tn=t;\n\t\t\t\t\n\t\t\t\tif(n.key.compareTo(key)<0){\n\t\t\t\t\t\n\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tn=leftend(n);\n\t\t\t\t\tif(n.key.compareTo(key)>0){\n\t\t\t\t\tcheck=-1;\n\t\t\t\t\tn.left=new Node(key,value);\n\t\t\t\t\tn.left.parent=n;\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcheck=1;\n\t\t\t\t\tn.right=new Node(key,value);\n\t\t\t\t\tn.rank++;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tn.right.parent=n;\t\t\t\t\n\t\t\t\t\tbalanceCheck(n);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\treturn v;\t\n\t}",
"public int kthSmallest(TreeNode root, int k) {\n if (root == null || k <= 0) return -1;\n List<Integer> res = new ArrayList<>();\n helper(root, k, res);\n return res.get(k - 1);\n }",
"public T get(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node.value;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public int findKthLargestValueInBst(BST tree, int k) {\n\n Node current = new Node(-1, 0);\n\n findKthLargestValueInBst(tree, current, k);\n\n return current.value;\n }",
"Node deleteNode(Node root, int key) {\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\tif (key < root.data)\n\t\t\troot.left = deleteNode(root.left, key);\n\t\telse if (key > root.data)\n\t\t\troot.right = deleteNode(root.right, key);\n\t\telse {\n\n\t\t\t// if node to be deleted has 1 or 0 child\n\t\t\tif (root.left == null)\n\t\t\t\treturn root.right;\n\t\t\telse if (root.right == null)\n\t\t\t\treturn root.left;\n\n\t\t\t// Get the inorder successor (smallest\n\t\t\t// in the right subtree)\n\t\t\tNode minkey = minValueNode(root.right);\n\t\t\troot.data = minkey.data;\n\t\t\troot.right = deleteNode(root.right, minkey.data);\n\n\t\t}\n\n\t\t// now Balance tree operation perform just like we did in insertion\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\troot.height = max(height(root.left), height(root.right)) + 1;\n\n\t\tint balance = getBalance(root);\n\n\t\t// If this node becomes unbalanced, then there are 4 cases\n\t\t// Left Left Case\n\t\tif (balance > 1 && getBalance(root.left) >= 0)\n\t\t\treturn rightRotate(root);\n\n\t\t// Left Right Case\n\t\tif (balance > 1 && getBalance(root.left) < 0) {\n\t\t\troot.left = leftRotate(root.left);\n\t\t\treturn rightRotate(root);\n\t\t}\n\n\t\t// Right Right Case\n\t\tif (balance < -1 && getBalance(root.right) <= 0)\n\t\t\treturn leftRotate(root);\n\n\t\t// Right Left Case\n\t\tif (balance < -1 && getBalance(root.right) > 0) {\n\t\t\troot.right = rightRotate(root.right);\n\t\t\treturn leftRotate(root);\n\t\t}\n\n\t\treturn root;\n\t}",
"public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}",
"public K ceiling(K key);",
"public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}",
"public Node ceil(K k){\n int ceiRank = rank(k);\n// Node res = select(ceiRank);\n// if(res.e.equals(e))\n// ceiRank = ceiRank+1;\n return select(ceiRank);\n }",
"private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }",
"private int findKthSmallest(LargeFile file, int k) {\n long lower = Integer.MIN_VALUE;\n long upper = Integer.MAX_VALUE;\n int res = Integer.MIN_VALUE;\n while (lower <= upper) {\n long mid = lower + (upper - lower) / 2;\n //count how many nums smaller than or equal to mid in file\n int count = 0;\n int kthNum = Integer.MIN_VALUE;\n while (file.hasNext()) {\n int next = file.next();\n if (next <= mid) {\n kthNum = Math.max(kthNum, next);\n count++;\n }\n }\n file.reset();\n if (count >= k) {\n //store potential ans\n res = kthNum;\n upper = mid - 1;\n } else {\n lower = mid + 1;\n }\n }\n return res;\n }",
"@Override\r\n public Entry<K, V> floorEntry(final K key) {\n return null;\r\n }",
"public static void main(String[] args) {\n Node root = new Node(10);\n root.right = new Node(-3);\n root.right.right = new Node(11);\n\n Node l1 = root.left = new Node(5);\n l1.right = new Node(2);\n l1.right.right = new Node(1);\n\n l1.left = new Node(3);\n l1.left.right = new Node(-2);\n l1.left.left = new Node(3);\n\n int k = 7;\n List<Node> path = new ArrayList<>();\n findPath(root, 7, path); //O(n^2) in worst, O(nlogn) if tree is balanced.\n\n }",
"public K min(Tree<K, V> t, K key) {\n\t\treturn left.min(left, this.key);\n\t}",
"int binarySearchWithRecursion(int[] arr, int low, int high, int key){\n if (high < low)\n return -1;\n int mid = (low + high) / 2;\n if (key == arr[mid])\n return mid;\n if (key > arr[mid])\n return binarySearchWithRecursion(arr,(mid + 1), high, key);\n return binarySearchWithRecursion(arr, low, (mid - 1), key);\n }",
"public int rank(K key) {\n int r = 0;\n if (root != null) {\n Node curr = root;\n while (curr != null) {\n int cmp = key.compareTo(curr.key);\n if (cmp > 0) {\n r += size(curr.left) + 1;\n curr = curr.right;\n } else if (cmp < 0) {\n curr = curr.left;\n } else {\n r += size(curr.left);\n break;\n }\n }\n }\n return r;\n }",
"private int binarySearchQ7(int first, int last, K key)\n {\n int index;\n \n if (first > last)\n index = first; \n else \n {\n int mid = first + (last - first) / 2;\n K midKey = dictionary[mid].getKey(); \n if (key.equals(midKey))\n index = mid; \n else if (key.compareTo(midKey) < 0)\n index = binarySearchQ7(first, mid - 1, key);\n else\n index = binarySearchQ7(mid + 1, last, key);\n } \n return index;\n }",
"@Override\n @SuppressWarnings(\"Duplicates\")\n public V remove(K key) {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n V value = null;\n TreeNode<KeyValuePair<K, V>> result = null;\n int iter = 0;\n while(true) {\n if(current == null) {\n break;\n }\n// System.out.println(\"Iteration #\" + iter);\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(key.compareTo(current.getValue().getKey()) < 0) {\n// System.out.println(\"Less\");\n smaller = true;\n previous = current;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n// System.out.println(\"Larger\");\n smaller = false;\n previous = current;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n if(current.getValue().getKey() == previous.getValue().getKey()) {\n if(current.getLeft() == null && current.getRight() == null) root = null;\n else if(current.getLeft() == null && current.getRight() != null) root = root.getRight();\n else if(current.getLeft() != null && current.getRight() == null) root = root.getLeft();\n else if(current.getRight() != null && current.getLeft() != null) current.setValue(minVal(current));\n }\n// System.out.println(\"Found the value! key:val = \" + current.getValue().getKey()+\":\"+current.getValue().getValue());\n// System.out.println(\"Previous = \" + previous.getValue());\n result = current;\n break;\n }\n iter++;\n }\n if(result != null) {\n// System.out.println(\"not null result\");\n value = result.getValue().getValue();\n if(current.getLeft() == null && current.getRight() == null) {\n if(smaller) previous.setLeft(null);\n else previous.setRight(null);\n } else if(current.getLeft() != null && current.getRight() == null) {\n if(smaller) previous.setLeft(current.getLeft());\n else previous.setRight(current.getLeft());\n } else if(current.getLeft() == null && current.getRight() != null) {\n// System.out.println(\"Right not null\");\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(smaller) previous.setLeft(current.getRight());\n else previous.setRight(current.getRight());\n } else {\n// System.out.println(\"Else\");\n current.setValue(minVal(current));\n }\n size--;\n return value;\n }\n return null;\n }",
"public int largestSmaller(TreeNode root, int target) {\n\t int max = Integer.MIN_VALUE;\n\t if (root == null) {\n\t return max;\n\t }\n\t while (root != null) {\n\t if (root.key >= target) {\n\t root = root.left;\n\t } else {\n\t max = root.key;\n\t root = root.right;\n\t }\n\t }\n\t return max;\n\t }",
"public static void Test() {\t\t\n\t\tTreeMap<String, Integer> treeMap = new TreeMap<String, Integer>();\n\t\ttreeMap.put(\"Key#1\", 1);\n\t\ttreeMap.put(\"Key#2\", 2);\n\t\ttreeMap.put(\"Key#2\", 3); // Duplicate is not allowed. Replaces old value with new\n\t\t//treeMap.put(null, 1); //NULL key is not allowed; throws NPE \n\t\t//treeMap.put(null, 2);\n\t\tSystem.out.println(\"Tree Map: \" + treeMap.toString());\n\t\t\n\t\t// Sorts key based on natural ordering (sorts in \"ascending order\")\n\t\tTreeMap<MapKey<String>, Integer> treeMap2 = new TreeMap<MapKey<String>, Integer>(); // uses \"natural ordering\" provided by the key object for comparison i.e. MapKey.compareTo() method\n\t\ttreeMap2.put(new MapKey<String>(\"x\"), 1);\n\t\ttreeMap2.put(new MapKey<String>(\"y\"), 2);\t\t\n\t\t// Comparable\n\t\tboolean status = treeMap2.put(new MapKey<String>(\"z\"), 3) == null;\n\t\tMapKey<String> mapKey = new MapKey<String>(\"xyz\");\t\t\n\t\tstatus = treeMap2.put(mapKey, 123) == null;\n\t\tstatus = treeMap2.put(mapKey, 1234) == null;\n\t\tSystem.out.println(\"Tree Map: \" + treeMap2.toString());\n\t\t\n\t\tTreeMap<String, Integer> treeMap3 = new TreeMap<String, Integer>(new TestComparator());\n\t\t\n\t\tTreeMap<MyKey, Integer> treeMap4 = new TreeMap<MyKey, Integer>();\n\t\ttreeMap4.put(new MyKey(), 10);\n\t\ttreeMap4.put(new MyKey(), 20);\n\t\t\n\t\t\n\t}",
"private Node bstFind(TKey key, Node currentNode) {\n return (currentNode == null || currentNode == NIL_NODE ||\n key.compareTo(currentNode.mKey) == 0) ?\n currentNode:\n ((key.compareTo(currentNode.mKey) < 0) ?\n bstFind(key, currentNode.mLeft) : \n bstFind(key, currentNode.mRight));\n // That's right. A ternary operator WITHIN a ternary operator.\n // That's how it's done, son.\n }",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> higherEntry(K key) {\n\t/* TCJ \n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j < size() && key.equals(map.get(j).getKey())) j++;\n\t\treturn safeEntry(j);\n\t}",
"private KeyedItem findLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\t//return the root when we find that we reached the leftmost child\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\treturn tree.getRoot();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//keep going. has more left children\r\n\t\t\treturn findLeftMost(tree.getLeftChild());\r\n\t\t}\r\n\t}",
"public String search(int k)\r\n\t {\r\n\t\t WAVLNode currentNode = this.root;\r\n\t\t while(currentNode.isInnerNode())\r\n\t\t {\r\n\t\t\t if(currentNode.getKey() == k)\r\n\t\t\t {\r\n\t\t\t\t return currentNode.getValue();\r\n\t\t\t }\r\n\t\t\t else if(currentNode.getKey() > k)\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getLeft();\r\n\t\t\t }\r\n\t\t\t else\r\n\t\t\t {\r\n\t\t\t\t currentNode = currentNode.getRight();\r\n\t\t\t }\r\n\t\t }\r\n\t\t return null;\r\n\t }",
"public int compareTo(LeafPage node) {\r\n//\t\tSystem.out.println(\"Leaf compare\");\r\n if (this.getKey(0)>node.getKey(0)){\r\n \treturn 1;\r\n } else if(this.getKey(0)<node.getKey(0)){\r\n \treturn -1;\r\n }\r\n return 0;\r\n }",
"public Key min(Node node)\n {\n \tif(node==null)\n \t\treturn null;\n \tif(node.left==null)\n \treturn node.key;\n \telse\n \t\treturn min(node.left);\n \t\n }",
"public Value valueOf(Key key) \n {\n Node n = root;\n while (n != null) \n {\n int cmp = key.compareTo(n.key);\n \n if (cmp < 0) \n n = n.left;\n else if (cmp > 0) \n n = n.right;\n else \n return n.val;\n }\n return null; \n \n }",
"private int kthChild(int index, int k) {\n return 2 * index + k; // 2 = binary heap\n }",
"Key max(Node node)\n {\n \tif(node==null)\n \t return null;\n \tif(node.right==null)\n \t return node.key;\n \telse\n \t return max(node.right);\n }",
"public E searchHelper(K key, BSTNode<E, K> node)\r\n\t{\r\n\t\tE left = null;\r\n\t\tE right = null;\r\n\t\t\r\n\t\tif(node.getKey().compareTo(key) <= -1) //root is less than key\r\n\t\t{\r\n\t\t\tif(node.getRight()!=null)\r\n\t\t\t{\r\n\t\t\t\treturn searchHelper(key, node.getRight());\r\n\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(node.getKey().compareTo(key) >= 1)\r\n\t\t{\r\n\t\t\tif(node.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\treturn searchHelper(key, node.getLeft());\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(node.getKey().compareTo(key) == 0)\r\n\t\t{\r\n\t\t\treturn node.getElement();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}",
"public int findNext(Node root, int key){\n\t\tint res = key;\n\t\twhile(root != nil){\n\t\t\tif(root.id <= key){\n\t\t\t\troot = root.right;\n\t\t\t}\n\t\t\tif(root != nil && root.id > key){\n\t\t\t\tres = root.id;\n\t\t\t\troot=root.left;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}",
"public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {\n TreeNode ans = null;\n while (root != null) {\n if (root.val > p.val) {\n ans = root;\n root = root.left;\n } else root = root.right;\n }\n return ans;\n}",
"public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}",
"public Node binomialHeapMinimum() {\n\t\tNode y = null;\n\t\tNode x = this.head;\n\t\tint min = Integer.MAX_VALUE;\n\t\twhile(x!=null) {\n\t\t\tif (x.key < min) {\n\t\t\t\tmin = x.key;\n\t\t\t\ty = x;\n\t\t\t}\n\t\t\tx = x.rightSibling;\n\t\t}\n\t\treturn y;\n\t}",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> lowerEntry(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\treturn safeEntry(findIndex(key) - 1);\n\t}",
"public static int kthLargest(Node node, int k){\n return 0;\n }",
"public int searchStrictlyGreater(T key) {\n if ((array.length == 1) ||\n (array[0].compareTo(key) == -1) ||\n (array[array.length - 1].compareTo(key) == 1)) {\n return 0;\n }\n\n int start = 0, end = array.length - 2;\n\n do {\n int mid = start + (end - start)/2;\n if (array[mid].compareTo(key) <= 0) {\n if (array[mid + 1].compareTo(key) > 0) {\n return mid + 1;\n }\n else {\n start = mid + 1;\n }\n }\n else {\n end = mid - 1;\n }\n }\n while (start <= end);\n\n return 0;\n }",
"void printKeysInGvnRange(Node node, int k1, int k2) {\n\n\t\t/* base case */\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * Since the desired o/p is sorted, recurse for left subtree first If\n\t\t * root->data is greater than k1, then only we can get o/p keys in left\n\t\t * subtree\n\t\t */\n\t\tif (k1 < node.key) {\n\t\t\tprintKeysInGvnRange(node.left, k1, k2);\n\t\t}\n\n\t\t/* if root's data lies in range, then prints root's data */\n\t\tif (k1 <= node.key && k2 >= node.key) {\n\t\t\tSystem.out.print(node.key + \" \");\n\t\t}\n\n\t\t/*\n\t\t * If root->data is smaller than k2, then only we can get o/p keys in\n\t\t * right subtree\n\t\t */\n\t\tif (k2 > node.key) {\n\t\t\tprintKeysInGvnRange(node.right, k1, k2);\n\t\t}\n\t}",
"private int recFind(int searchKey, int lowerbound, int upperbound) {\n\t\tint curIn = (lowerbound + upperbound) / 2;\n\t\tif (arr[curIn] == searchKey)\n\t\t\treturn curIn;\n\t\telse if (lowerbound > upperbound)\n\t\t\treturn n;\n\t\telse {\n\t\t\tif (arr[curIn] < searchKey)\n\t\t\t\treturn recFind(searchKey, curIn + 1, upperbound);\n\t\t\telse\n\t\t\t\treturn recFind(searchKey, lowerbound, curIn - 1);\n\t\t}\n\t}",
"public TreeNode inorderSuccessor(TreeNode root, TreeNode p) {\n if (root == null) return null;\n if (root.val > p.val) {\n TreeNode left = inorderSuccessor(root.left, p);\n return left == null ? root : left;\n } else return inorderSuccessor(root.right, p);\n}",
"@Override\r\n public K ceilingKey(final K key) {\n return null;\r\n }",
"public int minkeys() {\n\t\tint min = 0;\n\t\tif (parentref == null) {\n\t\t\treturn 1;\n\t\t}\n\t\tmin = (int)Math.ceil((degree) / 2.0) - 1;\n\t\t//min = (int)Math.ceil(degree / 2.0);\n\t\treturn Math.max(min, 0);\n\t}",
"public void increaseKey(FHeapNode x, int k)\r\n {\r\n x.key = x.key + k;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//increment value of x.key\r\n FHeapNode y = x.parent;\t\t\r\n\r\n if ((y != null) && (x.key > y.key))\t\t\t\t\t\t\t\t\t\t\t//remove node x and its children if incremented key value is greater than its parent\r\n\t\t{\r\n cut(x, y);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//remove node x from parent node y, add x to root list of heap.\r\n cascadingCut(y);\t\t\t\t\t\t\t\t\t\t\t\t\t\t//check the child cut value of parent y and perform cascading cut if required\r\n }\r\n\r\n if (x.key > maxNode.key)\t\t\t\t\t\t\t\t\t\t\t\t\t//update maxnode pointer if necessary\r\n\t\t{\r\n maxNode = x;\r\n }\r\n }",
"Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }",
"static int downToZero(Node root) {\n /*\n * Write your code here.\n */\n Queue<Node> queue = new PriorityQueue<>();\n queue.add(root);\n int min = 100001;\n while (!queue.isEmpty()){\n Node current = queue.poll();\n if(current.value <= 4){\n if (current.value == 4){\n min = current.depth + 3;\n return min;\n }\n min = current.depth+current.value;\n return min;\n }\n Node toAdd1 = new Node(current.value-1, current.depth+1);\n queue.add(toAdd1);\n for(int i = 2; i<=Math.sqrt(current.value); i++){\n if(current.value%i==0){\n Node toAdd = new Node(current.value/i, current.depth+1);\n queue.add(toAdd);\n }\n }\n }\n return min;\n }",
"public Data get(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n return next == null ? null\n : next.data;\n }",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> ceilingEntry(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\treturn safeEntry(findIndex(key));\n\t}",
"private static <K extends Comparable<? super K>, V> Node<K, V> findSmallestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.left != null) {\n current = current.left;\n }\n return current;\n }",
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"@Nullable\n protected abstract Map.Entry<K, V> onGetFloorEntry(@Nullable final K key);",
"public int rank(Key key) \n {\n return rank(key, root);\n }",
"public Key lowestCommonAncestor (Node node, Key key1, Key key2){\n \t\tif (node == null)\n return null;\n \t\tif (node.key == key1) {\n \t\t\treturn node.key;\n \t\t}\n \t\tif (node.key == key2) {\n \t\t\treturn node.key;\n \t\t}\n \t\tint cmp1 = node.key.compareTo(key1);\n \t\tint cmp2 = node.key.compareTo(key2);\n \t\t\n if (cmp1 >= 0 && cmp2 >= 0)\n return lowestCommonAncestor(node.left, key1, key2);\n \n if (cmp1 <= 0 && cmp2 <= 0)\n return lowestCommonAncestor(node.right, key1, key2);\n \n return node.key;\n \t}",
"static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }",
"private static <K extends Comparable<? super K>, V> Node<K, V> findLargestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }",
"private int rank(Integer key, Node x) {\n\t if (x == null) return 0; \n\t int cmp = key.compareTo(x.key); \n\t if (cmp < 0) return rank(key, x.left); \n\t else if (cmp > 0) return 1 + size(x.left) + rank(key, x.right); \n\t else return size(x.left); \n\t }",
"int query(int L, int R, int l, int r, int dep, int k) {\n if (l == r)\n return tree[dep][l];\n //System.out.println(l + \" \" + r);\n int mid = (L + R) >> 1;\n int[] row = toLeft[dep];\n int count = row[r] - row[l - 1];\n if (count >= k) {\n // left\n int newl = L - row[L - 1] + row[l - 1];\n int newr = newl + count - 1;\n return query(L, mid, newl, newr, dep + 1, k);\n } else {\n // right\n int newr = r + row[R] - row[r];\n int newl = newr - (r - l - count);\n return query(mid + 1, R, newl, newr, dep + 1, k - count);\n }\n }"
] | [
"0.780632",
"0.7153924",
"0.6971838",
"0.6945831",
"0.6806052",
"0.6702776",
"0.6667219",
"0.66529036",
"0.6550837",
"0.6536465",
"0.6371847",
"0.6368024",
"0.6368024",
"0.6344382",
"0.62925714",
"0.6282507",
"0.62435555",
"0.62116945",
"0.6143063",
"0.60721874",
"0.60343444",
"0.59903765",
"0.59888995",
"0.5971625",
"0.5967998",
"0.5951449",
"0.5925249",
"0.5907073",
"0.5902963",
"0.5878056",
"0.5876891",
"0.584725",
"0.5845485",
"0.5835806",
"0.5824361",
"0.582359",
"0.5807877",
"0.5800748",
"0.5795478",
"0.57704586",
"0.5767743",
"0.57490575",
"0.57429045",
"0.5737813",
"0.5730183",
"0.57200724",
"0.5715482",
"0.5710461",
"0.57078195",
"0.57059544",
"0.5701712",
"0.56984836",
"0.56983143",
"0.56948036",
"0.5689771",
"0.5688333",
"0.5681244",
"0.5680479",
"0.5657458",
"0.565464",
"0.5648084",
"0.5645729",
"0.56270176",
"0.5620266",
"0.56034297",
"0.56029755",
"0.55973333",
"0.55805504",
"0.5575428",
"0.55732423",
"0.55719763",
"0.55663097",
"0.55642736",
"0.55577177",
"0.5556729",
"0.55560905",
"0.55545",
"0.555127",
"0.55505866",
"0.5549489",
"0.55486345",
"0.55485696",
"0.5545587",
"0.5542934",
"0.5542048",
"0.55419374",
"0.55392796",
"0.5538514",
"0.5534201",
"0.5527005",
"0.5522652",
"0.5521164",
"0.5510446",
"0.55084324",
"0.54991883",
"0.54924846",
"0.5492059",
"0.54829854",
"0.5481435",
"0.54756767"
] | 0.77415466 | 1 |
Ceiling: smallest key>=given key Case 1: k is equal to the key at root > The floor of k is k Case 2: k is less than the key at root > The floor of k is in the right subtree. Case 3: k is greater than the key at root > The floor of k lies in the left subtree if there is any key<=k in right subtree. Otherwise it is the key at root. | public Key ceiling(Key key) //smallest key greater than or equal to the given key
{
Node x=ceiling(root,key);
if(x!=null)
return x.key;
else return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Key getCeiling(Key key) {\n\n Node current = root;\n while (current != null) {\n if (current.key == key) {\n return key;\n }\n if (current.key.compareTo(key) > 0) {\n if (current.left != null && current.left.key.compareTo(key) < 0) {\n return current.key;\n } else {\n current = current.left;\n }\n } else {\n current = current.right;\n }\n }\n return null;\n }",
"public Key floor(Key key)\t\t\t\t//largest key less than or equal to the given key\n\t{\n\t\tNode x=floor(root,key);\n\t\tif(x!=null)\n\t\t\treturn x.key;\n\t\telse return null;\n\t}",
"public K floor(K key) {\n if (root == null)\n return null;\n else {\n Node tmp = null;\n Node curr = root;\n while (true) {\n if (curr == null) {\n if (tmp != null)\n return tmp.key;\n return null;\n }\n int cmp = key.compareTo(curr.key);\n if (cmp == 0)\n return curr.key;\n else if (cmp < 0)\n curr = curr.left;\n else {\n tmp = curr;\n curr = curr.right;\n }\n }\n }\n }",
"public K ceiling(K key);",
"private Node floor(Node x, int key) {\n if (x == null)\n return null;\n int cmp = key - x.key;\n if (cmp == 0)\n return x;\n if (cmp < 0)\n return floor(x.left, key);\n Node t = floor(x.right, key);\n if (t != null)\n return t;\n else\n return x;\n }",
"public Key floor(final Key key) {\n int rank = rank(key);\n if (rank == 0) {\n return null;\n }\n if (rank < size && key.compareTo(keys[rank]) == 0) {\n return keys[rank];\n } else {\n return keys[rank - 1];\n }\n }",
"public K floor(K key);",
"public Node ceil(K k){\n int ceiRank = rank(k);\n// Node res = select(ceiRank);\n// if(res.e.equals(e))\n// ceiRank = ceiRank+1;\n return select(ceiRank);\n }",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> ceilingEntry(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\treturn safeEntry(findIndex(key));\n\t}",
"public Node floor(K k){\n int floorRank = rank(k);\n Node res = select(floorRank);\n if(res.k.compareTo(k)>0) floorRank = floorRank - 1;\n return select(floorRank);\n }",
"@Override\r\n public K ceilingKey(final K key) {\n return null;\r\n }",
"@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic Entry<K, V> floorEntry(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || ! key.equals(map.get(j).getKey())) j--;\n\t\treturn safeEntry(j);\n\t}",
"public int kthSmallest_binary_search(TreeNode root, int k) {\n int count = getNodeCount(root.left);\n if (k <= count) {\n return kthSmallest(root.left, k);\n } else if (k > count + 1) {\n return kthSmallest(root.right, k - 1 - count); // 1 is counted as current node\n }\n return root.val;\n }",
"@Nullable\n protected abstract Map.Entry<K, V> onGetCeilingEntry(@Nullable final K key);",
"@Override\r\n public Entry<K, V> ceilingEntry(final K key) {\n return null;\r\n }",
"public QuestObj floor(int key) {\n Node x = floor(root, key);\n if (x == null)\n return null;\n return new QuestObj(x.key, x.val);\n }",
"public int get(int key) {\n Node x = root;\r\n while (x != null) {\r\n if (key > x.key) x = x.right;\r\n else if (key < x.key) x = x.left;\r\n else if (x.key == key) return key;\r\n }\r\n System.out.print(\"No key found\");\r\n return -1; //return 0 means did not find!\r\n }",
"public static Node findKthSmallest(Node node, int k){\n if(node!=null){ // node มีตัวตน\n int l = size(node.left);\n if(k==l+1){\n return node;\n }else if(k<l+1){ //ถ้า k is น้อยกว่า size ค่าของ kth จะอยูที่ left subtree.\n return findKthSmallest(node.left,k);\n }else{\n return findKthSmallest(node.right,k-l-1); // recursive right-subtree และค่า k ลบด้วย size ทางขวา และตัวมันเอง(1)\n }\n }\n else {\n return null;\n }\n\n }",
"Node deleteNode(Node root, int key) {\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\tif (key < root.data)\n\t\t\troot.left = deleteNode(root.left, key);\n\t\telse if (key > root.data)\n\t\t\troot.right = deleteNode(root.right, key);\n\t\telse {\n\n\t\t\t// if node to be deleted has 1 or 0 child\n\t\t\tif (root.left == null)\n\t\t\t\treturn root.right;\n\t\t\telse if (root.right == null)\n\t\t\t\treturn root.left;\n\n\t\t\t// Get the inorder successor (smallest\n\t\t\t// in the right subtree)\n\t\t\tNode minkey = minValueNode(root.right);\n\t\t\troot.data = minkey.data;\n\t\t\troot.right = deleteNode(root.right, minkey.data);\n\n\t\t}\n\n\t\t// now Balance tree operation perform just like we did in insertion\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\troot.height = max(height(root.left), height(root.right)) + 1;\n\n\t\tint balance = getBalance(root);\n\n\t\t// If this node becomes unbalanced, then there are 4 cases\n\t\t// Left Left Case\n\t\tif (balance > 1 && getBalance(root.left) >= 0)\n\t\t\treturn rightRotate(root);\n\n\t\t// Left Right Case\n\t\tif (balance > 1 && getBalance(root.left) < 0) {\n\t\t\troot.left = leftRotate(root.left);\n\t\t\treturn rightRotate(root);\n\t\t}\n\n\t\t// Right Right Case\n\t\tif (balance < -1 && getBalance(root.right) <= 0)\n\t\t\treturn leftRotate(root);\n\n\t\t// Right Left Case\n\t\tif (balance < -1 && getBalance(root.right) > 0) {\n\t\t\troot.right = rightRotate(root.right);\n\t\t\treturn leftRotate(root);\n\t\t}\n\n\t\treturn root;\n\t}",
"public K select(int k) {\n if (root == null) {\n return null;\n } else {\n int size = 0;\n Node curr = root;\n while (curr != null) {\n int leftSize = size(curr.left);\n if (leftSize + size > k) {\n curr = curr.left;\n } else if (leftSize + size < k) {\n size += leftSize + 1;\n curr = curr.right;\n } else {\n break;\n }\n }\n if (curr == null)\n return null;\n return curr.key;\n }\n }",
"public int minValue(Node node) {\n /* loop down to find the rightmost leaf */\n Node current = node;\n while (current.left != null)\n current = current.left;\n\n return (current.key);\n }",
"private static <K extends Comparable<? super K>, V> @Nullable Node<K, V> findBestRoot(\n @Nullable Node<K, V> pRoot,\n @Nullable K pFromKey,\n boolean pFromInclusive,\n @Nullable K pToKey,\n boolean pToInclusive) {\n\n @Var Node<K, V> current = pRoot;\n while (current != null) {\n\n if (pFromKey != null && exceedsLowerBound(current.getKey(), pFromKey, pFromInclusive)) {\n // current and left subtree can be ignored\n current = current.right;\n } else if (pToKey != null && exceedsUpperBound(current.getKey(), pToKey, pToInclusive)) {\n // current and right subtree can be ignored\n current = current.left;\n } else {\n // current is in range\n return current;\n }\n }\n\n return null; // no mapping in range\n }",
"public Node deleteNode(Node root, int key) {\n if (root == null)\n return root;\n\n /* Otherwise, recur down the tree */\n if (key < root.data)\n root.left = deleteNode(root.left, key);\n else if (key > root.data)\n root.right = deleteNode(root.right, key);\n\n // if key is same as root's\n // key, then This is the\n // node to be deleted\n else {\n // node with only one child or no child\n if (root.left == null)\n return root.right;\n else if (root.right == null)\n return root.left;\n\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n root.data = minValue(root.right);\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, root.data);\n }\n\n return root;\n }",
"public int kthSmallest(TreeNode root, int k) {\n if (root == null || k <= 0) return -1;\n\n BSTIterator it = new BSTIterator(root);\n TreeNode node = null;\n while (k-- > 0) {\n node = it.next();\n if (node == null) return -1;\n }\n return node.val;\n }",
"private long minKey() {\n if (left.size == 0) return key;\n // make key 'absolute' (i.e. relative to the parent of this):\n return left.minKey() + this.key;\n }",
"public int searchStrictlyGreater(T key) {\n if ((array.length == 1) ||\n (array[0].compareTo(key) == -1) ||\n (array[array.length - 1].compareTo(key) == 1)) {\n return 0;\n }\n\n int start = 0, end = array.length - 2;\n\n do {\n int mid = start + (end - start)/2;\n if (array[mid].compareTo(key) <= 0) {\n if (array[mid + 1].compareTo(key) > 0) {\n return mid + 1;\n }\n else {\n start = mid + 1;\n }\n }\n else {\n end = mid - 1;\n }\n }\n while (start <= end);\n\n return 0;\n }",
"public int findNext(Node root, int key){\n\t\tint res = key;\n\t\twhile(root != nil){\n\t\t\tif(root.id <= key){\n\t\t\t\troot = root.right;\n\t\t\t}\n\t\t\tif(root != nil && root.id > key){\n\t\t\t\tres = root.id;\n\t\t\t\troot=root.left;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn res;\n\t}",
"public Data poll(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n\n if (next == null) {\n return null;\n } else {\n var ret = next.data;\n\n if (next.right != null && next.left != null) {\n int predHeight = 0;\n var pred = next.right;\n var predP = next;\n while (pred.left != null) {\n predP = pred;\n pred = pred.left;\n predHeight++;\n }\n\n int succHeight = 0;\n var succ = next.left;\n var succP = next;\n while (succ.right != null) {\n succP = succ;\n succ = succ.right;\n succHeight++;\n }\n \n Node newNode;\n Node newNodeP;\n Node newNodeS;\n if (succHeight > predHeight) {\n newNode = succ;\n newNodeP = succP;\n newNodeS = succ.left;\n } else {\n newNode = pred;\n newNodeP = predP;\n newNodeS = succ.right;\n }\n\n if (newNodeP.right == newNode) {\n newNodeP.right = newNodeS;\n } else {\n newNodeP.left = newNodeS;\n }\n\n next.key = newNode.key;\n next.data = newNode.data;\n } else {\n var child = next.right == null ? next.left\n : next.right;\n if (next == root) {\n root = child;\n } else {\n if (curr.left == next) {\n curr.left = child;\n } else {\n curr.right = child;\n }\n }\n }\n return ret;\n }\n }",
"private int binaryFind(K key) {\n int sortedCount = this.sortedCount.get();\n // if there are no sorted keys, or the first item is already larger than key -\n // return the head node for a regular linear search\n if ((sortedCount == 0) || comparator.compareKeyAndSerializedKey(key, readKey(FIRST_ITEM)) <= 0) {\n return HEAD_NODE;\n }\n\n // optimization: compare with last key to avoid binary search\n if (comparator.compareKeyAndSerializedKey(key, readKey((sortedCount - 1) * FIELDS + FIRST_ITEM)) > 0) {\n return (sortedCount - 1) * FIELDS + FIRST_ITEM;\n }\n\n int start = 0;\n int end = sortedCount;\n\n while (end - start > 1) {\n int curr = start + (end - start) / 2;\n\n if (comparator.compareKeyAndSerializedKey(key, readKey(curr * FIELDS + FIRST_ITEM)) <= 0) {\n end = curr;\n } else {\n start = curr;\n }\n }\n\n return start * FIELDS + FIRST_ITEM;\n }",
"@Override\n @SuppressWarnings(\"Duplicates\")\n public V remove(K key) {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n V value = null;\n TreeNode<KeyValuePair<K, V>> result = null;\n int iter = 0;\n while(true) {\n if(current == null) {\n break;\n }\n// System.out.println(\"Iteration #\" + iter);\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(key.compareTo(current.getValue().getKey()) < 0) {\n// System.out.println(\"Less\");\n smaller = true;\n previous = current;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n// System.out.println(\"Larger\");\n smaller = false;\n previous = current;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n if(current.getValue().getKey() == previous.getValue().getKey()) {\n if(current.getLeft() == null && current.getRight() == null) root = null;\n else if(current.getLeft() == null && current.getRight() != null) root = root.getRight();\n else if(current.getLeft() != null && current.getRight() == null) root = root.getLeft();\n else if(current.getRight() != null && current.getLeft() != null) current.setValue(minVal(current));\n }\n// System.out.println(\"Found the value! key:val = \" + current.getValue().getKey()+\":\"+current.getValue().getValue());\n// System.out.println(\"Previous = \" + previous.getValue());\n result = current;\n break;\n }\n iter++;\n }\n if(result != null) {\n// System.out.println(\"not null result\");\n value = result.getValue().getValue();\n if(current.getLeft() == null && current.getRight() == null) {\n if(smaller) previous.setLeft(null);\n else previous.setRight(null);\n } else if(current.getLeft() != null && current.getRight() == null) {\n if(smaller) previous.setLeft(current.getLeft());\n else previous.setRight(current.getLeft());\n } else if(current.getLeft() == null && current.getRight() != null) {\n// System.out.println(\"Right not null\");\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(smaller) previous.setLeft(current.getRight());\n else previous.setRight(current.getRight());\n } else {\n// System.out.println(\"Else\");\n current.setValue(minVal(current));\n }\n size--;\n return value;\n }\n return null;\n }",
"public static int kthSmallest(TreeNode root, int k) {\n\n int count = countNode(root.left);\n if (k <= count) {\n return kthSmallest(root.left, k);\n } else if (k > count + 1) {\n return kthSmallest(root.right, k - 1 - count); // 1 is counted as current node\n }\n\n return root.val;\n }",
"public void pruneK(Integer k) {\n\n Integer sum = (Integer)root.element;\n if (largestPath(root.left, sum) >= k) {\n pruneRecur(root.left, sum, k);\n } else {\n root.left = null;\n }\n if (largestPath(root.right, sum) >= k) {\n pruneRecur(root.right, sum, k);\n } else {\n root.right = null;\n }\n }",
"public long search(Node root, int key) {\n\n comparisons++;\n // Base Cases: root is null or key is present at root\n if (root==null || root.key==key)\n return comparisons;\n\n // val is greater than root's key\n if (root.key > key)\n return search(root.left, key);\n\n // val is less than root's key\n return search(root.right, key);\n }",
"public boolean decreaseKey(Node<T> x, T k) {\n if (x.key.compareTo(k) < 0) {\n return false;\n }\n x.key = k;\n Node<T> y = x.parent;\n if (y != null && x.key.compareTo(y.key) <= 0) {\n cut(x, y);\n cascadingCut(y);\n }\n if (x.key.compareTo(min.key) <= 0) {\n min = x;\n }\n\n return true;\n }",
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"public static <T> T floor(Collection<T> c, T key, Comparator<T> comp) {\n // a is null or has a length of 0\n if (c == null || comp == null) {\n throw new IllegalArgumentException();\n }\n if (c.isEmpty()) {\n throw new NoSuchElementException();\n }\n \n // Minimum value\n Iterator<T> itr = c.iterator();\n T floor = itr.next();\n if (itr.hasNext()) {\n \n for (T element: c) {\n if (comp.compare(element, floor) < 0) {\n floor = element;\n }\n }\n \n }\n \n \n int change = 0;\n \n // Lowest value equal to or above the key.\n for (T element: c) {\n if ((comp.compare(element, key) <= 0)\n && (comp.compare(element, floor) >= 0)) {\n floor = element;\n change++;\n }\n }\n \n // No qualifying value for ceiling.\n if (change == 0) {\n throw new NoSuchElementException();\n }\n \n return floor;\n }",
"public int kthSmallest(TreeNode root, int k) {\n ArrayList<Integer> arr = new ArrayList<>();\n inorder(root, arr);\n return arr.get(k-1);\n }",
"Node deleteNode(Node root, int key) {\n if (root == null) {\n return root;\n }\n\n // If the key to be deleted is smaller than the root's key,\n // then it lies in left subtree\n if (key < root.key) {\n root.left = deleteNode(root.left, key);\n }\n\n // If the key to be deleted is greater than the root's key,\n // then it lies in right subtree\n else if (key > root.key) {\n root.right = deleteNode(root.right, key);\n }\n\n // if key is same as root's key, then this is the node\n // to be deleted\n else {\n\n // node with only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // No child case\n if (temp == null) {\n temp = root;\n root = null;\n } else // One child case\n {\n root = temp; // Copy the contents of the non-empty child\n }\n } else {\n\n // node with two children: Get the inorder successor (smallest\n // in the right subtree)\n Node temp = minValueNode(root.right);\n\n // Copy the inorder successor's data to this node\n root.key = temp.key;\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, temp.key);\n }\n }\n\n // If the tree had only one node then return\n if (root == null) {\n return root;\n }\n\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\n root.height = max(height(root.left), height(root.right)) + 1;\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\n // this node became unbalanced)\n int balance = getBalance(root);\n\n // If this node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && getBalance(root.left) >= 0) {\n return rightRotate(root);\n }\n\n // Left Right Case\n if (balance > 1 && getBalance(root.left) < 0) {\n root.left = leftRotate(root.left);\n return rightRotate(root);\n }\n\n // Right Right Case\n if (balance < -1 && getBalance(root.right) <= 0) {\n return leftRotate(root);\n }\n\n // Right Left Case\n if (balance < -1 && getBalance(root.right) > 0) {\n root.right = rightRotate(root.right);\n return leftRotate(root);\n }\n\n return root;\n }",
"private void checkMinKeys(BTreeNode<T> currentNode) {\n BTreeNode<T> parent = findParent(root, currentNode);\n int indexCurrentChild = getIndexChild(parent, currentNode);\n\n BTreeNode<T> leftBrother;\n BTreeNode<T> rightBrother;\n\n //Dependiendo del indice del hijo se realizaran las operaciones\n //de prestamo y union\n switch (indexCurrentChild) {\n \n //Si el indice es 0 solo tiene hermano derecho por ende\n //las operaciones se realizan con el hermano derecho\n case 0 -> {\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n //Si el hermano derecho tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, rightBrother, indexCurrentChild + 1, 1);\n }\n }\n \n //Si el indice es 5 solo tiene hermano izquierdo por ende las\n //operaciones solo se pueden realizar con el hermano izquierdo\n case 5 -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n\n //Si el hermano izquierdo tiene mas de 2 llaves toma una de ellas\n //si no realiza una union\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n \n //Si el indice es cualquier otro las operaciones se pueden realizar\n //tanto con el hermano derecho como con el hermano izquierdo\n default -> {\n leftBrother = parent.getChild(indexCurrentChild - 1);\n rightBrother = parent.getChild(indexCurrentChild + 1);\n\n // Si cualquiera de los dos hermanos tiene mas de 2 llaves se\n //toma una de ellas, de lo contrario se realiza una union con\n //el hermano izquierdo.\n if (leftBrother != null && leftBrother.getNumKeys() > 2) {\n borrowFromPrev(parent, currentNode, leftBrother, indexCurrentChild);\n } else if (rightBrother != null && rightBrother.getNumKeys() > 2) {\n borrowFromNext(parent, currentNode, rightBrother, indexCurrentChild);\n } else {\n merge(parent, currentNode, leftBrother, indexCurrentChild, 0);\n }\n }\n }\n\n //Despues de realizar las operaciones en el nodo hijo se valida que \n //el nodo padre no quede con menos de 2 llaves\n if (parent != root && parent.getNumKeys() < 2) {\n checkMinKeys(parent);\n }\n }",
"public int largestSmaller(TreeNode root, int target) {\n\t int max = Integer.MIN_VALUE;\n\t if (root == null) {\n\t return max;\n\t }\n\t while (root != null) {\n\t if (root.key >= target) {\n\t root = root.left;\n\t } else {\n\t max = root.key;\n\t root = root.right;\n\t }\n\t }\n\t return max;\n\t }",
"private Node bstFind(TKey key, Node currentNode) {\n return (currentNode == null || currentNode == NIL_NODE ||\n key.compareTo(currentNode.mKey) == 0) ?\n currentNode:\n ((key.compareTo(currentNode.mKey) < 0) ?\n bstFind(key, currentNode.mLeft) : \n bstFind(key, currentNode.mRight));\n // That's right. A ternary operator WITHIN a ternary operator.\n // That's how it's done, son.\n }",
"public TreeNode deleteNode1(TreeNode root, int key) {\n if (root == null) {\n return root;\n }\n\n // delete current node if root is the target node\n if (root.val == key) {\n // replace root with root->right if root->left is null\n if (root.left == null) {\n return root.right;\n }\n\n // replace root with root->left if root->right is null\n if (root.right == null) {\n return root.left;\n }\n\n // replace root with its successor if root has two children\n TreeNode p = findSuccessor(root);\n root.val = p.val;\n root.right = deleteNode1(root.right, p.val);\n return root;\n }\n if (root.val < key) {\n // find target in right subtree if root->val < key\n root.right = deleteNode1(root.right, key);\n } else {\n // find target in left subtree if root->val > key\n root.left = deleteNode1(root.left, key);\n }\n return root;\n }",
"static int downToZero(Node root) {\n /*\n * Write your code here.\n */\n Queue<Node> queue = new PriorityQueue<>();\n queue.add(root);\n int min = 100001;\n while (!queue.isEmpty()){\n Node current = queue.poll();\n if(current.value <= 4){\n if (current.value == 4){\n min = current.depth + 3;\n return min;\n }\n min = current.depth+current.value;\n return min;\n }\n Node toAdd1 = new Node(current.value-1, current.depth+1);\n queue.add(toAdd1);\n for(int i = 2; i<=Math.sqrt(current.value); i++){\n if(current.value%i==0){\n Node toAdd = new Node(current.value/i, current.depth+1);\n queue.add(toAdd);\n }\n }\n }\n return min;\n }",
"private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ \n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, return null\n if (currentNode == null) \n return currentNode; \n // otherwise, keep searching through the tree until meet the node with value key\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key));\n break;\n case 0:\n // build a temporary node when finding the node that need to be deleted\n BSTNode<K> tempNode = null;\n // when the node doesn't have two childNodes\n // has one childNode: currentNode = tempNode = a childNode\n // has no childNode: currentNode = null, tempNode = currentNode\n if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) {\n if (currentNode.getLeftChild() == null) \n tempNode = currentNode.getRightChild(); \n else \n tempNode = currentNode.getLeftChild(); \n \n if (tempNode == null) {\n //tempNode = currentNode; \n currentNode = null; \n }\n else\n currentNode = tempNode;\n }\n // when the node has two childNodes, \n // use in-order way to find the minimum node in its subrighttree, called rightMinNode\n // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID\n // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id\n else {\n BSTNode<K> rightMinNode = currentNode.getRightChild();\n while (rightMinNode.getLeftChild() != null)\n rightMinNode = rightMinNode.getLeftChild();\n \n tempNode = rightMinNode;\n currentNode.setId(tempNode.getId());\n \n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId()));\n }\n }\n // since currentNode == null means currentNode has no childNode, return null to its ancestor\n if (currentNode == null) \n return currentNode; \n // since currentNode != null, we have to update its balance\n int balanceValue = getNodeBalance(currentNode);\n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case \n return rotateRight(currentNode);\n }\n else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case \n return rotateLeft(currentNode);\n }\n else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n }\n }\n return currentNode;\n }",
"private int findKthSmallest(LargeFile file, int k) {\n long lower = Integer.MIN_VALUE;\n long upper = Integer.MAX_VALUE;\n int res = Integer.MIN_VALUE;\n while (lower <= upper) {\n long mid = lower + (upper - lower) / 2;\n //count how many nums smaller than or equal to mid in file\n int count = 0;\n int kthNum = Integer.MIN_VALUE;\n while (file.hasNext()) {\n int next = file.next();\n if (next <= mid) {\n kthNum = Math.max(kthNum, next);\n count++;\n }\n }\n file.reset();\n if (count >= k) {\n //store potential ans\n res = kthNum;\n upper = mid - 1;\n } else {\n lower = mid + 1;\n }\n }\n return res;\n }",
"@Override\r\n public K floorKey(final K key) {\n return null;\r\n }",
"private int recursiveBinarySearchSol(TreeNode root, int k) {\n // Corner Case\n if (root == null) {\n return 0;\n }\n\n if (root.left != null) { // 判断左子节点是否为空\n // 若左子节点不为空,计算左子树的节点数\n int leftCount = countNodes(root.left);\n if (leftCount >= k) { // 说明第k小的数一定在当前的左子树\n return recursiveBinarySearchSol(root.left, k);\n } else { // 说明第k小的数不再当前左子树,减去左子树的节点数量\n k -= leftCount;\n }\n }\n\n if (k == 1) { // 说明第k小的数就是当前根节点\n return root.val;\n } else { // 否则减去当前根节点的数量(1)\n k -= 1;\n }\n\n // 此时说明第k小的数一定在当前右子树\n return recursiveBinarySearchSol(root.right, k);\n }",
"public Node findClosest(int search_key){\n\n Node current, closest; //จำตำแหน่ง node ตอนนี้\n closest = current = root; // เก็บตำแหน่ง node ที่ใกล้ค่าที่หามากสุด\n int min_diff = Integer.MAX_VALUE; // ตัวเปรียบเทียบคสาต่าง\n while (current!= null){ // Use while loop to traverse from root to the closest leaf\n if (search_key == current.key){ //ถ้าเจอก็ return\n return current;\n }\n else{\n if(Math.abs(current.key - search_key) < min_diff){ //หาค่าความต่าง ถ้าอันใหม่ต่างน้อยกว่า แสดงว่าใกล้กว่า\n min_diff = Math.abs(current.key - search_key);\n closest = current;\n }\n\n }\n\n if(search_key < current.key) // กำหยดว่าจะลงไปในทิศทางไหนของ subtree\n {current = current.left;}\n else{current = current.right;}\n }\n\n\n\n return closest;\n }",
"public RBNode search(RBNode x, int k){\r\n\t\twhile (x != nil && k != x.key){\r\n\t\t\tif (k < x.key)\r\n\t\t\t\tx = x.left;\r\n\t\t\telse x = x.right;\r\n\t\t}\r\n\t\treturn x;\r\n\t}",
"private int kthSmallestTreeNode(Tree tree, int k){\n List<Integer> values = new ArrayList<>();\n List<Integer> arr = printTree(tree, values);\n System.out.println(\"\\nPrinting out the whole list created by In order traversal\\n\");\n System.out.print(arr);\n return arr.get(k);\n}",
"public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}",
"public T get(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node.value;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public int largestSmaller(TreeNode root, int target) {\n if(root == null) {\n return (int)(-1 * Math.pow(2, 31));\n }\n TreeNode nextNode = root;\n Deque<TreeNode> stack = new LinkedList<>();\n List<Integer> result = new ArrayList<>();\n while(nextNode != null || !stack.isEmpty()) {\n if(nextNode != null) {\n stack.offerFirst(nextNode);\n nextNode = nextNode.left;\n }\n else {\n nextNode = stack.pollFirst();\n result.add(nextNode.key);\n nextNode = nextNode.right;\n }\n }\n int i = 0;\n for(i = result.size() - 1; i >= 0; i--) {\n if(result.get(i) < target) {\n break;\n }\n }\n if(i == -1) {\n return Integer.MIN_VALUE;\n }\n return result.get(i);\n }",
"private int recFind(int searchKey, int lowerbound, int upperbound) {\n\t\tint curIn = (lowerbound + upperbound) / 2;\n\t\tif (arr[curIn] == searchKey)\n\t\t\treturn curIn;\n\t\telse if (lowerbound > upperbound)\n\t\t\treturn n;\n\t\telse {\n\t\t\tif (arr[curIn] < searchKey)\n\t\t\t\treturn recFind(searchKey, curIn + 1, upperbound);\n\t\t\telse\n\t\t\t\treturn recFind(searchKey, lowerbound, curIn - 1);\n\t\t}\n\t}",
"public static <T> T ceiling(Collection<T> c, T key, Comparator<T> comp) {\n \n // a is null or has a length of 0\n if (c == null || comp == null) {\n throw new IllegalArgumentException(); \n }\n \n if (c.isEmpty()) {\n throw new NoSuchElementException();\n }\n \n T ceiling = null;\n Iterator<T> itr = c.iterator();\n boolean found = false; //Tells if first possible ceiling found\n while (itr.hasNext()) {\n T temp = itr.next();\n //if haven't found first ceiling, just compare to key.\n if (!found && comp.compare(temp, key) >= 0) {\n ceiling = temp;\n found = true;\n }\n //if found first ceiling, compare to key and current ceiling value\n else if (comp.compare(temp, key) >= 0 && comp.compare(temp, ceiling) <= 0) {\n ceiling = temp;\n }\n }\n if (!found) {\n throw new NoSuchElementException();\n }\n return ceiling;\n }",
"public int kthSmallest_3(TreeNode root, int k) {\n \tStack<TreeNode> stack =new Stack<TreeNode>();\n \twhile(root!=null){\n \t\tstack.push(root);\n \t\troot = root.left;\n \t}\n \t\n \twhile(k!=0){\n \t\tTreeNode n = stack.pop();\n \t\tk--;\n \t\tif(k==0)\n \t\t\treturn n.val;\n \t\tTreeNode right = n.right;\n \t\twhile(right!=null){\n \t\t\tstack.push(right);\n \t\t\tright =right.left;\n \t\t}\n \t}\n \treturn -10086;\n }",
"public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}",
"private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }",
"public int kthSmallest(TreeNode root, int k) {\n\t\tint[] nums = new int[2];\n\t\tinorder(root, k, nums);\n\t\treturn nums[1];\n\t}",
"public Node deleteBST(Node root, int key) {\n if (root == null) {\n return root;\n }\n if (key < root.key) {\n root.left = deleteBST(root.left, key);\n } else if (key > root.key) {\n root.right = deleteBST(root.right, key);\n } // deletes the target key node\n else {\n // condition if node has only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // Condition if there's no child\n if (temp == null) {\n temp = root;\n root = null;\n // else if there's one child\n } else\n {\n root = temp;\n }\n } else {\n // Gets the Inorder traversal inlined with the node w/ two children\n Node temp = minNode(root.right);\n // Stores the inorder successor's node to this node\n root.key = temp.key;\n // Delete the inorder successor\n root.right = deleteBST(root.right, temp.key);\n }\n }\n // Condition if there's only one child then returns the root\n if (root == null) {\n return root;\n }\n // Gets the updated height of the BST\n root.height = maxInt(heightBST(root.left), heightBST(root.right)) + 1;\n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n\n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n\n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n\n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n return root;\n\n }",
"public K min(Tree<K, V> t, K key) {\n\t\treturn left.min(left, this.key);\n\t}",
"private K smallest(BSTnode<K> n) {\n\t\tif (n.getLeft() == null) {\n\t\t\treturn n.getKey();\n\t\t} else {\n\t\t\treturn smallest(n.getLeft());\n\t\t}\n\t}",
"public Node find(int key) {\n Node current = root; // start at root\n while (current.iData != key) {\n // while no match\n if (key < current.iData)\n // go left\n current = current.leftChild;\n else\n current = current.rightChild;\n if (current == null) // if no child, didn't find it\n return null;\n }\n return current; // found it\n }",
"@Test\n void descendingSetCeilingReturnsCorrectValue() {\n assertNull(reverseSet.ceiling(0));\n assertEquals(Integer.valueOf(1), reverseSet.ceiling(1));\n assertEquals(Integer.valueOf(2), reverseSet.ceiling(2));\n assertEquals(Integer.valueOf(2), reverseSet.ceiling(3));\n assertEquals(Integer.valueOf(4), reverseSet.ceiling(4));\n assertEquals(Integer.valueOf(4), reverseSet.ceiling(5));\n assertEquals(Integer.valueOf(6), reverseSet.ceiling(6));\n assertEquals(Integer.valueOf(6), reverseSet.ceiling(7));\n assertEquals(Integer.valueOf(6), reverseSet.ceiling(8));\n assertEquals(Integer.valueOf(9), reverseSet.ceiling(9));\n assertEquals(Integer.valueOf(9), reverseSet.ceiling(10));\n }",
"public int kthSmallest(TreeNode root, int k) {\n if (root == null || k <= 0) return -1;\n List<Integer> res = new ArrayList<>();\n helper(root, k, res);\n return res.get(k - 1);\n }",
"private static <K extends Comparable<? super K>, V> Node<K, V> findSmallestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.left != null) {\n current = current.left;\n }\n return current;\n }",
"Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }",
"public int findPrev(Node root, int key){\n\t\tint res = key;\n\t\twhile(root != nil){\n\t\t\tif(key==root.id){\n\t\t\t\treturn root.left.id;\n\t\t\t}\n\t\t\tif(root.id > key ){\n\t\t\t\troot = root.left;\n\t\t\t}\n\t\t\tif( root != nil && root.id < key){\n\t\t\t\tres = root.id;\n\t\t\t\troot = root.right;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn res;\n\t}",
"public K min() {\n if (root == null)\n return null;\n else {\n Node curr = root;\n while (true) {\n if (curr.left != null)\n curr = curr.left;\n else\n return curr.key;\n }\n }\n }",
"private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }",
"int binarySearchWithRecursion(int[] arr, int low, int high, int key){\n if (high < low)\n return -1;\n int mid = (low + high) / 2;\n if (key == arr[mid])\n return mid;\n if (key > arr[mid])\n return binarySearchWithRecursion(arr,(mid + 1), high, key);\n return binarySearchWithRecursion(arr, low, (mid - 1), key);\n }",
"protected Node<T> getNode(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public TreeNode trimBSTTopDown(TreeNode root, int L, int R) {\n if(root==null) return null;\n if(root.val<L) return trimBSTTopDown(root.right,L,R);\n if(root.val>R) return trimBSTTopDown(root.left,L,R);\n root.left = trimBSTTopDown(root.left,L,R);\n root.right = trimBSTTopDown(root.right,L,R);\n return root;\n }",
"private static boolean search(Node root, int key) {\n\t\tif(root == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif(key == root.data) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\telse if(key < root.data ) {\r\n\t\t\t\treturn search(root.left,key);\r\n\t\t\t}\r\n\t\t\telse if(key > root.data) {\r\n\t\t\t\treturn search(root.right,key);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public long moreKeySize(long key) {\n return root != null ? (root.all - lessKeySize(key + 1)) : 0;\n }",
"public RBNode<T, E> searchAndRetrieve(T key) {\r\n\t\tRBNode<T, E> c = root;\r\n\t\tRBNode<T, E> p = nillLeaf;\r\n\t\twhile (c != nillLeaf) {\r\n\t\t\t// if when comparing if it hasnt found the key go to the left\r\n\t\t\tif (key.compareTo(c.uniqueKey) < 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t\t// if when comparing if it hasnt found the key go to the right\r\n\t\t\telse if (key.compareTo(c.uniqueKey) > 0) {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.rightChild;\r\n\t\t\t}\r\n\t\t\t// they are equal\r\n\t\t\telse {\r\n\t\t\t\tp = c;\r\n\t\t\t\tc = c.leftChild;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn p;\r\n\t}",
"public Tree<K, V> delete(K key) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\ttry {\n\t\t\t\tthis.key = left.max();\n\t\t\t\tthis.value = left.lookup(left.max());\n\t\t\t\tleft = left.delete(this.key); \n\t\t\t} catch (EmptyTreeException e) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.key = right.min();\n\t\t\t\t\tthis.value = right.lookup(right.min());\n\t\t\t\t\tright = right.delete(this.key);\n\t\t\t\t} catch (EmptyTreeException f) {\n\t\t\t\t\treturn EmptyTree.getInstance();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.delete(key);\n\t\t} else {\n\t\t\tright = right.delete(key);\n\t\t}\n\t\treturn this;\n\t}",
"public AVLNode delFindNode(int k) {\n\t\t\tif (this.key == k) {\n\t\t\t\tAVLNode node = this;\n\t\t\t\treturn node;\n\t\t\t}\n\t\t\tif (k > this.key) {\n\t\t\t\tif (this.right == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tAVLNode rightChild = (AVLNode) this.right;\n\t\t\t\treturn rightChild.delFindNode(k);\n\t\t\t} else {// k<this.key\n\t\t\t\tif (this.left == null) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tAVLNode leftChild = (AVLNode) this.left;\n\t\t\t\treturn leftChild.delFindNode(k);\n\t\t\t}\n\t\t}",
"private double findMin(){\r\n Set<Map.Entry<Double, Double>> list = heap.entrySet();\r\n double minKey = heap.firstKey();\r\n double minVal = MAX_WEIGHT;\r\n if (list != null){\r\n for (Map.Entry<Double, Double> entry: list){\r\n if (minVal > entry.getValue()){\r\n minVal = entry.getValue();\r\n minKey = entry.getKey();\r\n }\r\n }\r\n }\r\n return minKey;\r\n }",
"public static void main(String[] args) {\n TreeNode root = new TreeNode(3);\n root.left = new TreeNode(1);\n root.right = new TreeNode(4);\n root.left.right = new TreeNode(2);\n\n System.out.println(kthSmallest(root, 1));\n }",
"abstract K getFirstLeafKey();",
"abstract K getFirstLeafKey();",
"public Value valueOf(Key key) \n {\n Node n = root;\n while (n != null) \n {\n int cmp = key.compareTo(n.key);\n \n if (cmp < 0) \n n = n.left;\n else if (cmp > 0) \n n = n.right;\n else \n return n.val;\n }\n return null; \n \n }",
"public void delete(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null && currentNode.getKey() != key){\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (currentNode == null){\n\t\t\tSystem.out.println(\"No such key is found in the tree\");\n\t\t\treturn;\n\t\t}\n\t\tif (currentNode.getLeft() == null && currentNode.getRight() == null){\n\t\t\t//Leaf Node\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(null);\n\t\t\t}else{\n\t\t\t\tparent.setLeft(null);\n\t\t\t}\n\t\t}else if (currentNode.getLeft() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getRight());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getRight());\n\t\t\t}\n\t\t}else if(currentNode.getRight() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getLeft());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getLeft());\n\t\t\t}\n\t\t}else{\n\t\t\t// this is case where this node has two children\n\t\t\tBSTNode node = currentNode.getLeft();\n\t\t\tBSTNode parentTemp = currentNode;\n\t\t\twhile (node.getRight() != null){\n\t\t\t\tparentTemp = node;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t\t// switch the value with the target node we are deleting.\n\t\t\tcurrentNode.setKey(node.getKey());\n\t\t\t// remove this node but don't forget about its left tree\n\t\t\tparentTemp.setRight(node.getLeft());\n\t\t}\n\t}",
"private KeyedItem findLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\t//return the root when we find that we reached the leftmost child\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\treturn tree.getRoot();\r\n\t\t}\r\n\t\telse{\r\n\t\t\t//keep going. has more left children\r\n\t\t\treturn findLeftMost(tree.getLeftChild());\r\n\t\t}\r\n\t}",
"public Data get(Key key) {\n var curr = root;\n var next = root;\n while (next != null && next.key.compareTo(key) != 0) {\n curr = next;\n\n if (key.compareTo(curr.key) < 0) {\n next = curr.left; \n } else {\n next = curr.right;\n }\n }\n return next == null ? null\n : next.data;\n }",
"@Override\n\tpublic T ceiling(T e) {\n\t\tT found = null;\n\t\tif (isBelowRange(e)) {\n\t\t\tfound = first();\n\t\t} else if (!isAboveRange(e)) {\n\t\t\tfound = superset.ceiling(e);\n\t\t}\n\t\t\n\t\treturn nullIfOutOfBounds(found);\n\t}",
"public Node find(int key) // find node with given key\n\t{ // (assumes non-empty tree)\n\t\tNode current = root; // start at root\n\t\tif(current == null) {\n\t\t\treturn null;\n\t\t}\n\t\twhile(current.iData != key) // while no match,\n\t\t{\n\t\t\tif(key < current.iData) // go left?\n\t\t\t\tcurrent = current.leftChild;\n\t\t\telse // or go right?\n\t\t\t\tcurrent = current.rightChild;\n\t\t\tif(current == null) // if no child,\n\t\t\t\treturn null; // didn't find it\n\t\t}\n\t\treturn current; // found it\n\t}",
"private void trickleDown(int index) {\n Map.Entry<String, Double> smallest;\n Map.Entry<String, Double> top = this.get(index);\n int currentSize = this.size();\n\n while (index < currentSize / 2) { // while node has at leat one child\n Map.Entry<String, Double> left = LEFT(this.get(index));\n Map.Entry<String, Double> right = RIGHT(this.get(index));\n\n // find smaller child\n // if right child exists\n if (right != null && left.getValue().compareTo(right.getValue()) > 0) {\n smallest = right;\n } else {\n smallest = left;\n }\n\n // top <= smallest ?\n if (top.getValue().compareTo(smallest.getValue()) <= 0) {\n break;\n }\n\n // shift child up\n int smallestIndex = this.indexOf(smallest);\n Collections.swap(this, index, smallestIndex);\n index = smallestIndex;\n } // end while\n }",
"public int findKthLargestValueInBst(BST tree, int k) {\n\n Node current = new Node(-1, 0);\n\n findKthLargestValueInBst(tree, current, k);\n\n return current.value;\n }",
"private static <K extends Comparable<? super K>, V> Node<K, V> findLargestNode(Node<K, V> root) {\n @Var Node<K, V> current = root;\n while (current.right != null) {\n current = current.right;\n }\n return current;\n }",
"public void compareLeaf(int k){\n\t\twhile(k > 1 && lessThan(k, k/2)){\n\t\t\tString tempKey = queueArray[k/2][0];\n\t\t\tString tempVal = queueArray[k/2][1];\n\t\t\tqueueArray[k/2][0] = queueArray[k][0];\n\t\t\tqueueArray[k/2][1] = queueArray[k][1];\n\t\t\tqueueArray[k][0] = tempKey;\n\t\t\tqueueArray[k][1] = tempVal;\n\t\t\tk = k/2;\n\t\t}\n\t}",
"public static Node findClosestLeaf(Node node, int search_key){\n\n if(search_key==node.key){ //เมื่อเจอ return ค่า\n return node;\n }\n else if(search_key>node.key){ //ถ้า search_key มากกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านขวา\n if(node.right!=null){ //ถ้า node ตอนนี้มี right-subtree เรียก recursive โดยส่ง right-subtree\n return findClosestLeaf(node.right, search_key);\n }\n else {return node;} //ถ้า node ตอนนี้มีไม่มี right-subtree แสดงว่า node ตอนนีใกล้ search_key ที่สุด\n }\n else { //ถ้า search_key น้อยกว่า node.key ตอนนี้ แสดงว่า อยู่ทางด้านซ้าย\n if(node.left!=null){ //ถ้า node ตอนนี้มี left-subtree เรียก recursive โดยส่ง left-subtree\n return findClosestLeaf(node.left, search_key);\n }\n else{ return node;} ////ถ้า node ตอนนี้มีไม่มี left-subtree แสดงว่า node ตอนนีใกล้ search_key ที่สุด\n }\n\n }",
"public Key lowestCommonAncestor (Node node, Key key1, Key key2){\n \t\tif (node == null)\n return null;\n \t\tif (node.key == key1) {\n \t\t\treturn node.key;\n \t\t}\n \t\tif (node.key == key2) {\n \t\t\treturn node.key;\n \t\t}\n \t\tint cmp1 = node.key.compareTo(key1);\n \t\tint cmp2 = node.key.compareTo(key2);\n \t\t\n if (cmp1 >= 0 && cmp2 >= 0)\n return lowestCommonAncestor(node.left, key1, key2);\n \n if (cmp1 <= 0 && cmp2 <= 0)\n return lowestCommonAncestor(node.right, key1, key2);\n \n return node.key;\n \t}",
"public E searchHelper(K key, BSTNode<E, K> node)\r\n\t{\r\n\t\tE left = null;\r\n\t\tE right = null;\r\n\t\t\r\n\t\tif(node.getKey().compareTo(key) <= -1) //root is less than key\r\n\t\t{\r\n\t\t\tif(node.getRight()!=null)\r\n\t\t\t{\r\n\t\t\t\treturn searchHelper(key, node.getRight());\r\n\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(node.getKey().compareTo(key) >= 1)\r\n\t\t{\r\n\t\t\tif(node.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\treturn searchHelper(key, node.getLeft());\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if(node.getKey().compareTo(key) == 0)\r\n\t\t{\r\n\t\t\treturn node.getElement();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}",
"public void increaseKey(FHeapNode x, int k)\r\n {\r\n x.key = x.key + k;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//increment value of x.key\r\n FHeapNode y = x.parent;\t\t\r\n\r\n if ((y != null) && (x.key > y.key))\t\t\t\t\t\t\t\t\t\t\t//remove node x and its children if incremented key value is greater than its parent\r\n\t\t{\r\n cut(x, y);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//remove node x from parent node y, add x to root list of heap.\r\n cascadingCut(y);\t\t\t\t\t\t\t\t\t\t\t\t\t\t//check the child cut value of parent y and perform cascading cut if required\r\n }\r\n\r\n if (x.key > maxNode.key)\t\t\t\t\t\t\t\t\t\t\t\t\t//update maxnode pointer if necessary\r\n\t\t{\r\n maxNode = x;\r\n }\r\n }",
"private MyBinaryNode<K> searchRecursive(MyBinaryNode<K> current, K key) {\n\t\tif (current == null) \n\t\treturn null;\n\t\telse if(current.key.compareTo(key) == 0) \n\t\t\treturn current;\n\t\telse if(current.key.compareTo(key) < 0) \n\t\t\treturn searchRecursive(current.right, key);\n\t\telse\n\t\t\treturn searchRecursive(current.left, key); \n\t}",
"public Node binomialHeapMinimum() {\n\t\tNode y = null;\n\t\tNode x = this.head;\n\t\tint min = Integer.MAX_VALUE;\n\t\twhile(x!=null) {\n\t\t\tif (x.key < min) {\n\t\t\t\tmin = x.key;\n\t\t\t\ty = x;\n\t\t\t}\n\t\t\tx = x.rightSibling;\n\t\t}\n\t\treturn y;\n\t}",
"static void rBSTInsert(Node tmp,int key)\n {\n // if the new value is greater than root then it will be inserted to the right subtree\n if(tmp.val<key)\n {\n if(tmp.right==null)\n {\n tmp.right=new Node(key);\n \n \n return;\n }\n \n else rBSTInsert(tmp.right,key);\n \n \n }\n // otherwise the new value will be inserted to the left subtree\n else\n {\n if(tmp.left==null)\n {\n tmp.left=new Node(key);\n \n return;\n }\n \n rBSTInsert(tmp.left,key);\n }\n return;\n }",
"IntTree<V> changeKeysAbove(final long key, final int delta) {\n if (size == 0 || delta == 0) return this;\n\n if (this.key >= key)\n // adding delta to this.key changes the keys of _all_ children of this,\n // so we now need to un-change the children of this smaller than key,\n // all of which are to the left. note that we still use the 'old' relative key...:\n return new IntTree<V>(\n this.key + delta, value, left.changeKeysBelow(key - this.key, -delta), right);\n\n // otherwise, doesn't apply yet, look to the right:\n IntTree<V> newRight = right.changeKeysAbove(key - this.key, delta);\n if (newRight == right) return this;\n return new IntTree<V>(this.key, value, left, newRight);\n }"
] | [
"0.8171861",
"0.77418995",
"0.7658847",
"0.71880144",
"0.7069398",
"0.6743506",
"0.6526992",
"0.6521157",
"0.65130717",
"0.6449486",
"0.64151037",
"0.63814914",
"0.6357563",
"0.6241253",
"0.62219447",
"0.62115407",
"0.6136102",
"0.61253864",
"0.6117771",
"0.6081025",
"0.6078044",
"0.6050811",
"0.60337436",
"0.596688",
"0.59491915",
"0.59213",
"0.59127724",
"0.5906322",
"0.58869666",
"0.5872347",
"0.58659023",
"0.58375424",
"0.5816802",
"0.5759348",
"0.5749125",
"0.57249784",
"0.5723387",
"0.5711451",
"0.5705542",
"0.5696712",
"0.5691537",
"0.5684324",
"0.56785405",
"0.5669198",
"0.5660941",
"0.56471187",
"0.56344897",
"0.5630719",
"0.56283176",
"0.5613797",
"0.5602247",
"0.55989736",
"0.5592744",
"0.55899084",
"0.55898464",
"0.5585432",
"0.5583044",
"0.5573435",
"0.5560604",
"0.5559549",
"0.55502707",
"0.55324507",
"0.5526961",
"0.5523327",
"0.55216676",
"0.55203885",
"0.5502696",
"0.55011994",
"0.5497453",
"0.54697186",
"0.5468045",
"0.54672295",
"0.5462063",
"0.5450046",
"0.5447055",
"0.54464686",
"0.5445769",
"0.54433274",
"0.5441322",
"0.5440189",
"0.54401547",
"0.54401547",
"0.54353243",
"0.54335713",
"0.5431661",
"0.54308796",
"0.5427046",
"0.5417243",
"0.54145217",
"0.5414084",
"0.54081696",
"0.54078156",
"0.54034346",
"0.54000294",
"0.5388567",
"0.53864497",
"0.53801054",
"0.5378685",
"0.5374588",
"0.53652066"
] | 0.8165591 | 1 |
Rank: How many keys <= k | public int rank(Key key)
{
return rank(root,key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int rank(K key);",
"private static int getSmallerThanOrEqualToKCount(int[] a, int k){\n int left=0, right=a.length-1;\n while(left<right){\n int mid=left+(right+1-left)/2;\n if(a[mid]>k){\n right=mid-1;\n } else{\n left=mid;\n }\n }\n return left-0+1;\n }",
"public int kth(int k) {\n\t int counter = 0;\n\t int begin = 0;\n\t while (counter < k) {\n\t begin++;\n\t if (check(begin) == 1) {\n\t counter++;\n\t }\n\t }\n\t return begin;\n\t }",
"int rank(int[] array, int k) {\n\t\tif (k >= array.length) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\treturn rank(array, k, 0, array.length - 1);\n\t}",
"private static int[] topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int n: nums){\n map.put(n, map.getOrDefault(n, 0) + 1);\n }\n\n // Step2: Build max heap.\n PriorityQueue<Integer> pq = new PriorityQueue<>();\n for (int value: map.values()){\n pq.add(value);\n if (pq.size() > k){\n pq.poll();\n }\n }\n\n // Step3: Build result list.\n ArrayList<Integer> retList = new ArrayList<>();\n for (int n: pq){\n for (Map.Entry<Integer, Integer> entry: map.entrySet()){\n if (n == entry.getValue()){\n retList.add(entry.getKey());\n }\n }\n }\n\n return retList.stream().distinct().mapToInt(x -> x).toArray();\n }",
"public List<Integer> topKFrequent(int[] nums, int k) {\n\n\tList<Integer>[] bucket = new List[nums.length + 1];\n\tMap<Integer, Integer> frequencyMap = new HashMap<Integer, Integer>();\n\n\tfor (int n : nums) {\n\t\tfrequencyMap.put(n, frequencyMap.getOrDefault(n, 0) + 1);\n\t}\n\n\t// assgin elements in bucket and frequency will serve as bucket index\n\tfor (int key : frequencyMap.keySet()) {\n\t\tint frequency = frequencyMap.get(key);\n\t\tif (bucket[frequency] == null) {\n\t\t\tbucket[frequency] = new ArrayList<>(); // imp step\n\t\t}\n\t\tbucket[frequency].add(key);\n\t}\n\n\tList<Integer> res = new ArrayList<>();\n\n\tfor (int pos = bucket.length - 1; pos >= 0 && res.size() < k; pos--) {\n\t\tif (bucket[pos] != null) {\n\t\t\tres.addAll(bucket[pos]);\n\t\t}\n\t}\n\treturn res;\n}",
"public static int countPairs(List<Integer> arr, long k) {\n arr = arr.stream().sorted().collect(Collectors.toList());\n Map<String, Long> map = new HashMap<>();\n for (Integer i : arr) {\n if (i <= k && i <= (k - i) && arr.contains((int) k - i)) {\n map.put(i + \"_\" + (k - i), (long) (i + (i + 1)));\n }\n }\n return map.size();\n }",
"public int size(K lo, K hi);",
"public List<Integer> topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int num : nums) {\n map.put(num, map.getOrDefault(num, 0) + 1);\n }\n\n List<Integer>[] bucket = new List[nums.length + 1];\n for (int num : map.keySet()) {\n int freq = map.get(num);\n if (bucket[freq] == null) {\n bucket[freq] = new ArrayList<>();\n }\n bucket[freq].add(num);\n }\n List<Integer> res = new ArrayList<>();\n for (int i = bucket.length - 1; i >= 0 && res.size() < k; i--) {\n if (bucket[i] != null) {\n res.addAll(bucket[i]);\n }\n }\n return res;\n }",
"public int KthInArrays(int[][] arrays, int k) {\n return 0;\n }",
"int rank(int[] array, int k, int start, int end) {\n\t\t// Partition array around an arbitrary pivot.\n\t\tint pivot = array[randomIntInRange(start, end)];\n\t\tPartitionResult partition = partition(array, start, end, pivot);\n\t\tint leftSize = partition.leftSize;\n\t\tint middleSize = partition.middleSize;\n\n\t\t// Search position of array\n\t\tif (k < leftSize) { // Rank k is on the left half\n\t\t\treturn rank(array, k, start, start + leftSize - 1);\n\t\t} else if (k < leftSize + middleSize) { // Rank k is in middle\n\t\t\treturn pivot; // middle is all pivot values\n\t\t} else { // Rank k is on right\n\t\t\treturn rank(array, k - leftSize - middleSize, start + leftSize\n\t\t\t\t\t+ middleSize, end);\n\t\t}\n\t}",
"int getClusteringKeyCount();",
"public int getLength(int[] arr, int k) {\n int winStart = 0, maxFreq = 0, maxLength = 0, numberOfOne = 0;\n for (int winEnd = 0; winEnd < arr.length; winEnd++) {\n if (arr[winEnd] == 1) {\n numberOfOne++;\n }\n if (winEnd - winStart + 1 > k + numberOfOne) {\n if (arr[winStart++] == 1) {\n numberOfOne--;\n }\n }\n maxLength = Math.max(maxLength, winEnd - winStart + 1);\n }\n return maxLength;\n }",
"static int numOfSubsets(int[] arr, int n, int k) {\n List<Integer> vect1 = new ArrayList<Integer>(); \n List<Integer> vect2 = new ArrayList<Integer>(); \n List<Integer> subset1 = new ArrayList<Integer>(); \n List<Integer> subset2 = new ArrayList<Integer>(); \n \n // ignore element greater than k and divide\n // array into 2 halves\n for (int i = 0; i < n; i++) {\n \n // ignore element if greater than k\n if (arr[i] > k)\n continue;\n if (i <= n / 2)\n vect1.add(arr[i]);\n else\n vect2.add(arr[i]);\n }\n \n // generate all subsets for 1st half (vect1)\n for (int i = 0; i < (1 << vect1.size()); i++) {\n int value = 1;\n for (int j = 0; j < vect1.size(); j++) {\n if (i & (1 << j))\n value *= vect1[j];\n }\n \n // add only in case subset product is less\n // than equal to k\n if (value <= k)\n subset1.add(value);\n }\n \n // generate all subsets for 2nd half (vect2)\n for (int i = 0; i < (1 << vect2.size()); i++) {\n int value = 1;\n for (int j = 0; j < vect2.size(); j++) {\n if (i & (1 << j))\n value *= vect2[j];\n }\n \n // add only in case subset product is\n // less than equal to k\n if (value <= k)\n subset2.add(value);\n }\n \n // sort subset2\n sort(subset2.begin(), subset2.end());\n \n int count = 0;\n for (int i = 0; i < subset1.size(); i++)\n count += upper_bound(subset2.begin(), subset2.end(),\n (k / subset1[i]))\n - subset2.begin();\n \n // for null subset decrement the value of count\n count--;\n \n // return count\n return count;\n }",
"private static int findPairs(int[] nums, int k) {\n if(nums == null || nums.length == 0 || k < 0)\n return 0;\n\n int count = 0;\n Map<Integer, Integer> map = new HashMap<>();\n for(int i : nums)\n map.put(i, map.getOrDefault(i, 0) + 1);\n\n for(Map.Entry<Integer, Integer> entry : map.entrySet()) {\n if(k == 0) {\n if(entry.getValue() >= 2)\n count++;\n } else {\n if(map.containsKey(entry.getKey() + k))\n count++;\n }\n }\n return count;\n }",
"public int rank(K key) {\n \n int lo = 0, hi = N - 1;\n K loK = nvps[lo].getKey(), hiK = nvps[hi].getKey();\n \n if (compare(key, loK) <= 0)\n return 0;\n \n while (lo <= hi) {\n int mid = lo + (hi - lo)\n * (int) ((key.doubleValue() - loK.doubleValue()) / (hiK.doubleValue() - loK.doubleValue()));\n int cmp = compare(key, nvps[mid].getKey());\n if (cmp < 0) {\n hi = mid - 1;\n hiK = nvps[hi].getKey();\n } else if (cmp > 0) {\n lo = mid + 1;\n loK = nvps[lo].getKey();\n } else\n return mid;\n }\n return lo;\n \n /*\n int lo = 0, hi = N - 1;\n while (lo <= hi) {\n int mid = lo + (hi - lo) / 2;\n int cmp = compare(key, nvps[mid].getKey());\n if (cmp < 0)\n hi = mid - 1;\n else if (cmp > 0)\n lo = mid + 1;\n else\n return mid;\n }\n return lo;\n */\n }",
"public static int orderStatistics(int[] array, int k){\r\n\t\tk = k - 1; // since array index starts with 0\r\n\t\treturn kSmall(array, 0, array.length - 1, k);\r\n\t}",
"public List<Integer> topKFrequent(int[] nums, int k) {\n HashMap<Integer, Integer> map=new HashMap<Integer, Integer>();\n for(int num:nums)\n {\n if(map.containsKey(num))\n map.put(num, map.get(num)+1);\n else\n map.put(num,1);\n }\n\t\t//make min heap\n PriorityQueue<Node> pq=new PriorityQueue<Node>(new Comparator<Node>(){\n public int compare(Node a, Node b)\n {\n return a.count-b.count;\n }\n });\n for(int key:map.keySet())\n {\n Node n=new Node(key, map.get(key));\n pq.offer(n);\n if(pq.size()>k)\n pq.poll();\n }\n List<Integer> list=new ArrayList<Integer>();\n while(!pq.isEmpty())\n {\n list.add(pq.poll().n);\n }\n \n return list;\n }",
"public int findPairs(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Set<Integer> unique = new HashSet<>();\n Set<Integer> duplicate = new HashSet<>();\n for (int n : nums) {\n if (!unique.add(n)) {\n duplicate.add(n);\n }\n }\n if (k == 0) {\n return duplicate.size();\n }\n int count = 0;\n for (int v : unique) {\n if (unique.contains(v + k)) {\n count += 1;\n }\n }\n return count;\n }",
"public static int[] topKFrequent(int[] nums, int k) {\n int[] a = new int[k];\n Map<Integer, Integer> map = new HashMap<Integer, Integer>();\n for (int i = 0; i < nums.length; i++) {\n if (map.containsKey(nums[i])) {\n map.put(nums[i], map.get(nums[i]) + 1);\n } else {\n map.put(nums[i], 1);\n }\n }\n\n PriorityQueue<Map.Entry<Integer, Integer>> maxHeap = new PriorityQueue<Map.Entry<Integer, Integer>>(k, Map.Entry.<Integer, Integer>comparingByValue().reversed());\n for (Map.Entry<Integer, Integer> e : map.entrySet()) {\n maxHeap.offer(e);\n }\n\n while (k > 0) {\n a[--k] = maxHeap.poll().getKey();\n }\n\n return a;\n }",
"public static int kthLargest(Node node, int k){\n return 0;\n }",
"public List<Integer> topKFrequent3(int[] nums, int k) {\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int num : nums) {\n map.put(num, map.getOrDefault(num, 0) + 1);\n }\n\n TreeMap<Integer, List<Integer>> freqMap = new TreeMap<>();\n for (int num : map.keySet()) {\n int freq = map.get(num);\n if (freqMap.containsKey(freq)) {\n freqMap.get(freq).add(num);\n } else {\n freqMap.put(freq, new LinkedList<>());\n freqMap.get(freq).add(num);\n }\n }\n\n List<Integer> res = new ArrayList<>();\n while (res.size() < k) {\n Map.Entry<Integer, List<Integer>> entry = freqMap.pollLastEntry();\n res.addAll(entry.getValue());\n }\n return res;\n }",
"public static int degreeOfArray(List<Integer> arr) { arr.length = n\n // num of Keys = k\n // O(n + k)\n // max value count = m\n //\n PriorityQueue<Node> pq = new PriorityQueue<>((i, j)-> j.count - i.count);\n Map<Integer, NodePosition> posMap = new HashMap<>();\n Map<Integer, Node> countMap = new HashMap<>();\n // [1, 2, 3, 4, 5, 6]\n for (int i = 0; i < arr.size(); i++) {\n int cur = arr.get(i);\n\n if (!countMap.containsKey(cur)) {\n countMap.put(cur, new Node(cur, 1));\n } else {\n Node curNode = countMap.get(cur);\n curNode.count++;\n countMap.put(cur, curNode);\n }\n\n if (!posMap.containsKey(cur)) {\n posMap.put(cur, new NodePosition(i, i));\n } else {\n NodePosition curNodePos = posMap.get(cur);\n curNodePos.endIndex = i;\n posMap.put(cur, curNodePos);\n }\n }\n //Iterator<Map.Entry<Integer, Node> it = new Iterator<>(countMap);\n for (Map.Entry<Integer, Node> e : countMap.entrySet()) {\n pq.add(e.getValue());\n }\n\n // [1, 2, 1, 3 ,2]\n // 1 , 2 , 3\n Node curNode = pq.remove();\n int maxCount = curNode.count;\n\n int minRange = posMap.get(curNode.num).endIndex - posMap.get(curNode.num).startIndex;\n\n while (!pq.isEmpty() && maxCount == pq.peek().count) {\n curNode = pq.remove();\n NodePosition nPos = posMap.get(curNode.num);\n minRange = Math.min(minRange, nPos.endIndex - nPos.startIndex);\n }\n\n return minRange + 1;\n }",
"public static List<Integer> topKFrequent(int[] nums, int k) {\n \tMap<Integer, Integer> map=new HashMap<Integer, Integer>();\n \tfor(int i=0; i<nums.length; i++){\n \t\tif(!map.containsKey(nums[i])){\n \t\t\tmap.put(nums[i], 1);\n \t\t}else{\n \t\t\tmap.put(nums[i], 1+map.get(nums[i]));\n \t\t}\n \t}\n \tList<Map.Entry<Integer, Integer>> list=new ArrayList<Map.Entry<Integer, Integer>>(map.entrySet());\n \tCollections.sort(list, new Comparator<Map.Entry<Integer, Integer>>(){\n \t\tpublic int compare( Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2){\n \t\t\treturn o2.getValue().compareTo(o1.getValue());\n \t\t}\n \t});\n \tList<Integer> re=new ArrayList<Integer>();\n \tfor(int i=0; i<k; i++){\n \t\tre.add(list.get(i).getKey());\n \t}\n \treturn re;\n }",
"public int[] topKFrequent(int[] nums, int k) {\n Map<Integer, Integer> map = new HashMap();\n for(int num : nums) {\n map.put(num, map.getOrDefault(num, 0) + 1);\n }\n\n /*\n * List<int[]> list\n * List of int[]\n\n * List<Integer>[] array\n * Array of List<Integer>\n */\n List<Integer>[] bucket = new ArrayList[nums.length + 1];\n for(int key : map.keySet()) {\n int freq = map.get(key);\n\n if(bucket[freq] == null) {\n List<Integer> list = new ArrayList();\n list.add(key);\n\n bucket[freq] = list;\n } else {\n bucket[freq].add(key);\n }\n }\n\n int[] result = new int[k];\n int index = 0;\n for(int i = bucket.length - 1; i >= 0; i--) {\n if(bucket[i] != null) {\n for(int num : bucket[i]) {\n result[index] = num;\n index++;\n\n if(index == k) {\n return result;\n }\n }\n }\n }\n\n return result;\n }",
"public static List<List<Integer>> gen_size_k_candidate(Map<List<Integer>, Float> oldCandidate, Integer k){\n\n List<List<Integer>> sizeKPlusCandidate = new ArrayList<>();\n\n // size 2 candidate\n if( k <= 1){\n List<Integer> size1Candidate = new ArrayList<>();\n for (List<Integer> size1: oldCandidate.keySet()){\n size1Candidate.addAll(size1);\n }\n // sort\n Collections.sort(size1Candidate);\n // Generate\n sizeKPlusCandidate = CombinationGenerator.findsort(size1Candidate, 2);\n\n }else {\n List<List<Integer>> oldList = new ArrayList<>();\n oldList.addAll(oldCandidate.keySet());\n\n for(int iOld = 0; iOld < oldList.size()-1; iOld ++){\n for(int jOld =iOld+1; jOld < oldList.size(); jOld++){\n // check k element of feature is the same\n List<Integer> formerList = new ArrayList<>();\n List<Integer> laterList = new ArrayList<>();\n\n for (int fl=0; fl < k-1; fl++){\n formerList.add(oldList.get(iOld).get(fl));\n laterList.add(oldList.get(jOld).get(fl));\n }\n\n if (formerList.equals(laterList)){\n\n HashSet<Integer> tempCandidate = new HashSet<>();\n\n tempCandidate.addAll(oldList.get(iOld));\n tempCandidate.addAll(oldList.get(jOld));\n\n List<Integer> tempCandidateList = new ArrayList<>();\n tempCandidateList.addAll(tempCandidate);\n\n Collections.sort(tempCandidateList);\n // Prunning\n List<List<Integer>> prunningCandidate = CombinationGenerator.findsort(tempCandidateList, k);\n\n int flag = 0;\n for(List<Integer> checkPrun: prunningCandidate){\n if(oldCandidate.containsKey(checkPrun)){\n flag++;\n }\n }\n if (flag == k+1){\n sizeKPlusCandidate.add(tempCandidateList);\n }\n }\n }\n }\n }\n return sizeKPlusCandidate;\n }",
"public int kthLargestElement(int k, ArrayList<Integer> numbers) {\n\t\tthis.k = k;\r\n\t\tkthQsort(numbers, 0, numbers.size()-1);\r\n\t\treturn rs;\r\n }",
"public int findKthNumber(int m, int n, int k) {\n int low = 1, high = m * n + 1, mid;\n\n while (low < high) {\n mid = low + ((high - low) >> 1);\n if (count(mid, m, n) >= k) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }",
"public boolean isKth(int[] a, int[] b, int k, int i) {\n if (i > k-1) return false;\n\n\n\n }",
"public int kthSmallest(int[][] matrix, int k) {\n return 0;\n }",
"public static int findPairs(int[] nums, int k) {\n \tif(k<0){\n \t\treturn 0;\n \t}\n \t\n int re=0;\n Map<Integer, Integer> map=new HashMap<Integer, Integer>();\n for(int num: nums){\n \tif(map.containsKey(num)){\n \t\tif(k==0&&map.get(num)==1){\n \t\t\tre++;\n \t\t\tmap.put(num, 0);\n \t\t}\n \t\tcontinue;\n \t}\n \tif(map.containsKey(num+k)){\n \t\tre++;\n \t}\n \tif(map.containsKey(num-k)){\n \t\tre++;\n \t}\n \tmap.put(num, 1);\n }\n return re;\n }",
"public static int numSubarrayProductLessThanK(int[] nums, int k) {\n if(k <= 1) return 0;\n int prod = 1;\n int left = 0;\n int ans = 0;\n \n for (int right = 0; right < nums.length; right++) {\n prod *= nums[right];\n \n while(prod >= k) {\n prod /= nums[left];\n left++;\n }\n ans += right - left + 1; \n }\n \n return ans;\n }",
"private static List<Integer> getTopKFrequentElementsAverageCase(int[] nums, int k) {\n if(k > nums.length) {\n return new ArrayList<>();\n }\n\n Map<Integer, Integer> numToCount = new HashMap<>();\n\n for(int num : nums) {\n numToCount.put(num, numToCount.getOrDefault(num, 0) + 1);\n }\n\n PriorityQueue<Integer> queue = new PriorityQueue<>(new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return numToCount.get(i1) - numToCount.get(i2);\n }\n });\n\n for(int num : numToCount.keySet()) {\n queue.add(num);\n\n if(queue.size() > k) {\n queue.poll();\n }\n }\n\n List<Integer> result = new ArrayList<>();\n\n while(!queue.isEmpty()) {\n result.add(queue.poll());\n }\n\n // queue will add the nums in reverse order\n Collections.reverse(result);\n return result;\n }",
"private static List<Integer> getTopKFrequentElementsBestCase(int[] nums, int k) {\n if(k > nums.length) {\n return new ArrayList<>();\n }\n\n Map<Integer, Integer> numToCount = new HashMap<>();\n int max = 0;\n for(int i = 0; i < nums.length; i++) {\n numToCount.put(nums[i], numToCount.getOrDefault(nums[i], 0) + 1);\n max = Math.max(max, numToCount.get(nums[i]));\n }\n\n List<Integer>[] numsPerFrequency = new ArrayList[max + 1];\n for(int i = 1; i <= max; i++) {\n numsPerFrequency[i] = new ArrayList<>();\n }\n\n for(Map.Entry<Integer, Integer> entry : numToCount.entrySet()) {\n numsPerFrequency[entry.getValue()].add(entry.getKey());\n }\n\n List<Integer> result = new ArrayList<>();\n\n for(int i = max; i >= 0; i--) {\n List<Integer> numsWithThisFreq = numsPerFrequency[i];\n\n for(int num : numsWithThisFreq) {\n result.add(num);\n if(result.size() == k) {\n return result;\n }\n }\n }\n\n return new ArrayList<>();\n }",
"public int sizeAboveDepth(int k) {\n\t\t// TODO\n\t\t return sizeAboveDepth(root, k , 0);\n\t }",
"public int count(int n, int k)\n {\n\n long MOD = 1000000007;\n long res;\n\n res = (long)Math.pow(k, n);\n Map<Integer, Integer> divisor = new HashMap<>();\n\n long count = 0;\n for(int i = 2; i <= k; i++) {\n if(!(i % 2 == 0 && divisor.containsKey(i / 2))) {\n int div = divisorCount(i);\n divisor.put(i, div);\n count += div - 1;\n }\n else{\n int log2 = 31 - Integer.numberOfLeadingZeros(i);\n int div;\n if(Math.pow(2, log2) == i){\n div = divisor.get(i / 2) + 1;\n\n }\n else\n div = divisor.get(i / 2) * 2;\n\n divisor.put(i, div);\n count += div - 1;\n\n }\n\n }\n\n res -= (n - 1) * Math.pow(k, n - 2) * count;\n return (int)(res % MOD);\n }",
"public int kth1(int k) {\n\t int[] dp = new int[k];\n\t int indexTwo = 0;\n\t int indexThree = 0; \n\t int numberOfTwo = 2;\n\t int numberOfThree = 3;\n\t int nextNumber = 1;\n\t dp[0] = 1;\n\t for (int i = 1 ; i < k ; i++) {\n\t nextNumber = Math.min(numberOfTwo, numberOfThree);\n\t dp[i] = nextNumber;\n\t if (nextNumber == numberOfTwo) {\n\t indexTwo += 1;\n\t numberOfTwo = dp[indexTwo] * 2;\n\t }\n\t if (nextNumber == numberOfThree) {\n\t indexThree +=1;\n\t numberOfThree = dp[indexThree] * 3;\n\t }\n\t }\n\t return nextNumber;\n\t }",
"static int numberOfWays(int[] arr, int k) {\n\n Map<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < arr.length; i++) {\n if (!map.containsKey(arr[i])) {\n map.put(arr[i], 1);\n } else {\n map.put(arr[i], map.get(arr[i]) + 1);\n }\n }\n int result = 0;\n Iterator<Map.Entry<Integer, Integer>> iter = map.entrySet().iterator();\n while (iter.hasNext()) {\n Map.Entry<Integer, Integer> e = iter.next();\n int curNum = (int) e.getKey();\n int countOfOccurance = (int) e.getValue();\n int complement = k - curNum;\n\n if (map.containsKey(complement)) {\n // found target value\n if (curNum == complement) {\n // 3 + 3 = 6\n // add combination of them. count choose 2. For example [3, 3, 3, 3] = 4 choose 2\n result += getCombinationCount(countOfOccurance, 2);\n } else {\n // 1 + 5 = 6\n result += countOfOccurance;\n }\n }\n iter.remove();\n }\n\n return result;\n }",
"int sizeOfKeyArray();",
"public int partitionArray(int[] nums, int k) {\n Arrays.sort(nums);\n \n int min = nums[0], max = nums[0], count = 1;\n \n for(int i=0; i<nums.length; i++){\n \n // taking max and min for each group\n min = Math.min(min, nums[i]);\n max = Math.max(max, nums[i]);\n \n // if the difference between max and min is more than k in a group a new group is needed\n if(max - min > k){\n count++;\n // reseting the max and min for the new group\n max = min = nums[i];\n }\n }\n \n return count;\n }",
"public int rank(final Key key){\n int lo = 0;\n int hi = size - 1;\n while (lo <= hi) {\n int mid = lo + (hi - lo) / 2;\n int comp = key.compareTo(keys[mid]);\n if (comp < 0) {\n hi = mid - 1;\n } else if (comp > 0) {\n lo = mid + 1;\n } else {\n return mid;\n }\n }\n return lo;\n }",
"public static int numberOfPairs(int[] a, long k) {\n\t\t\n\t\tArrayList<Integer> list = new ArrayList<>();\n\t\t\n\t\tfor(int x : a) {\n\t\t\tlist.add(x);\n\t\t}\n\n\t\tArrayList<String> distinct = new ArrayList<>();\n\t\t\n\t\tfor(Integer curr : list) {\n\t\t\t\n\t\t\tint indexCurr = list.indexOf(curr);\n\t\t\t\n\t\t\tint anotherOne = (int) (k - curr);\n\t\t\t\n\t\t\tlist.set(indexCurr, curr*(-1));\n\t\t\t\n\t\t\tif(list.contains(anotherOne)) {\n\t\t\t\t\n\t\t\t\tint indexAnotherOne = list.indexOf(anotherOne);\n\t\t\t\t\n\t\t\t\tif(indexAnotherOne!=indexCurr) {\n\t\t\t\t\tString Way1 = curr+\"\"+anotherOne;\n\t\t\t\t\tString Way2 = anotherOne+\"\"+curr;\n\t\t\t\t\tif(!distinct.contains(Way1) && !distinct.contains(Way2)) {\n\t\t\t\t\t\tdistinct.add(Way1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlist.set(indexCurr, curr);\n\t\t\n\t\t}\n\t\t\n\t\treturn distinct.size();\n\t\t\n }",
"int cardinality();",
"public int rank(Key key) \n {\n return rank(key, root);\n }",
"private static void findKClosestNumbers(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Integer> pq;\n\t\tint max = findMaxInArr(arr);\n\t\tint min = findMinInArr(arr);\n\n\t\tint maxDiff = Math.abs(key - max);\n\t\tint minDiff = Math.abs(key - min);\n\n\t\tif (maxDiff <= minDiff) {\n\t\t\tpq = new PriorityQueue<>(Collections.reverseOrder());\n\t\t} else {\n\t\t\tpq = new PriorityQueue<>();\n\t\t}\n\n\t\tfor (int e : arr) {\n\t\t\tpq.add(e);\n\t\t}\n\n\t\tint c = 0;\n\n\t\twhile (c < k) {\n\t\t\tSystem.out.println(pq.remove());\n\t\t\tc++;\n\t\t}\n\n\t}",
"public int numWaysTopDown(int n, int k) {\n Integer[] mem = new Integer[n + 1]; // memoized table\n return paint(n, k, mem); // call recursive helper\n }",
"boolean hasRank();",
"public int kthSum(int[] A, int[] B, int k) {\n // Best First Search, need a minHeap on the value of each Pair\n PriorityQueue<Pair> minHeap = new PriorityQueue<>(k, new MyComparator());\n // all the generated cells will be marked true to avoid being generated more than once\n boolean[][] visited = new boolean[A.length][B.length];\n minHeap.offer(new Pair(A, 0, B, 0));\n visited[0][0] = true;\n // iterate k - 1 rounds, and Best First Search the smallest k - 1 values\n for (int q = 0; q < k - 1; q++) {\n Pair cur = minHeap.poll();\n // the neighbor Pair will be inserted into the minHeap only if\n // 1. it is not out of boundary\n // 2. it has not been generated before\n if (cur.row + 1 < A.length && !visited[cur.row + 1][cur.col]) {\n minHeap.offer(new Pair(A, cur.row + 1, B, cur.col));\n visited[cur.row + 1][cur.col] = true;\n }\n if (cur.col + 1 < B.length && !visited[cur.row][cur.col + 1]) {\n minHeap.offer(new Pair(A, cur.row, B, cur.col + 1));\n visited[cur.row][cur.col + 1] = true;\n }\n }\n return minHeap.peek().value;\n }",
"int getNumKeys();",
"public int getNumberOfpairs(int[] returnArray, int k) {\n\t\tint[] temp = new int[returnArray.length];\r\n\t\ttemp = mergeSort(returnArray, temp, 0, returnArray.length - 1);\r\n\t\tint p1 = 0;\r\n\t\tint p2 = temp.length - 1;\r\n\t\tint cnt = 0;\r\n\t\twhile(p1<p2){\r\n\t\t\tint sum = temp[p1] + temp[p2];\r\n\t\t\tif (sum == k) {\r\n\t\t\t\tcnt++;\r\n\t\t\t\tp1++;\r\n\t\t\t\tp2--;\r\n\t\t\t} else if (sum < k)\r\n\t\t\t\tp1++;\r\n\t\t\telse\r\n\t\t\t\tp2--;\r\n\t\t}\r\n\t\tSystem.out.print(cnt + \" \");\r\n\t\tSystem.out.println();\r\n\t\treturn cnt;\r\n\t}",
"public int findKth (ArrayList<Integer> arr, int k) {\n int start = 0;\n int end = arr.size()-1;\n int pivotIndex = 0;\n \n while (start < end) {\n pivotIndex = partition(arr, start, end);\n if (pivotIndex == k) return arr.get(k);\n else if (pivotIndex < k) {\n start = pivotIndex+1;\n } else {\n end = pivotIndex-1;\n }\n }\n \n //System.out.println(start +\" - \"+ arr.get(k));\n return arr.get(k);\n }",
"private int h(K k) {\r\n return (k.hashCode() + capacity()) % capacity();\r\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n int n = in.nextInt();\n int k = in.nextInt();\n ArrayList<Integer> list = new ArrayList<>();\n for(int arr_i=0; arr_i < n; arr_i++){\n int integer = in.nextInt();\n list.add(new Integer(integer));\n }\n in.close();\n\n\n\n if(k == 1){\n System.out.println(k);\n return;\n }\n\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i) % k;\n list.set(i, x);\n }\n\n int[] kx = new int[k];\n for(int i = 0;i < k;i ++){\n kx[i] = 0;\n }\n for(int i = 0;i < list.size();i ++){\n int x = list.get(i);\n kx[x] ++;\n }\n\n\n int num = 0;\n int A = 0;\n if(k % 2 == 0){\n A = k / 2 - 1;\n }else{\n A = k / 2;\n }\n if(kx[0] != 0){\n num += 2;\n }\n for(int i = 1; i <= A;i ++){\n if(kx[i] >= kx[k - i]){\n num += kx[i];\n }else {\n\n num += kx[k - i];\n }\n\n }\n System.out.println(num);\n }",
"public int numSubarrayProductLessThanK(int[] nums, int k) {\n return effective(nums, k);\n }",
"public static int countP(int n, int k) {\n // Base cases\n if (n == 0 || k == 0 || k > n)\n return 0;\n if (k == 1 || k == n)\n return 1;\n\n // S(n+1, k) = k*S(n, k) + S(n, k-1)\n return (k * countP(n - 1, k)\n + countP(n - 1, k - 1));\n }",
"public static int[] mostCompetitive(int[] nums, int k) {\n int[] copy = Arrays.copyOf(nums, nums.length); // 复制一个数组\n Arrays.sort(copy); // 排序\n for (int value : copy) { // 挨个顺序作为最小竞争子序列的头元素\n for (int j = 0; j < nums.length; j++) {\n if (nums[j] == value) {\n // 判断后续元素个数可够k长度\n if(k == 1){\n int[] ret = new int[1];\n ret[0] = nums[j];\n return ret;\n }\n if (j + k > nums.length) break;\n else if (j + k == nums.length) return Arrays.copyOfRange(nums, j, nums.length);\n else {\n int[] child = Arrays.copyOfRange(nums, j + 1, nums.length);\n int[] childMost = mostCompetitive(child, k - 1);\n System.out.println(Arrays.toString(childMost));\n // 取前k-1即为最优解\n int[] ret = new int[k];\n ret[0] = nums[j];\n System.arraycopy(childMost, 0, ret, 1, k - 1);\n System.out.println(Arrays.toString(ret));\n return ret;\n }\n }\n }\n }\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n // [10, 23, 61, 62, 34, 41, 80, 25, 91, 43, 4, 75, 65, 13, 37, 41, 46, 90, 55, 8, 85, 61, 95, 71]\n /* 2\n 4 3 3 5 4 9 6 3\n 3\n 3 5 4 9 6 3\n 2\n 5 4 9 6\n 1\n */\n return Arrays.copyOf(nums, k); // 这步不会执行\n }",
"static int printCount(Node root, int k) {\n\t\tHashMap<Integer, Integer> p = new HashMap<>();\n\n\t\t// Function call\n\t\tk_paths(root, k, p, 0);\n\n\t\t// Return the required answer\n\t\treturn res;\n\t}",
"public static int getRealTopK(int k, long items){\n return (int)(k > items ? items : k);\n }",
"public boolean containsNearbyDuplicate2(int[] nums, int k) {\n\n int max = Integer.MIN_VALUE;\n for (int i = 0; i < nums.length; i++) {\n max=Math.max(max,nums[i]);\n }\n Integer[] map = new Integer[max+1];\n for (int i = 0; i < nums.length; i++) {\n Integer c = map[nums[i]];\n if(c!=null && i-c<=k){\n return true;\n }else {\n map[nums[i]]=i;\n }\n }\n return false;\n }",
"static long sumOfGroup(int k) {\n long start = 1;\n long sum = 0;\n for(int i=1;i<=k;i++){\n long count = 0;\n sum = 0;\n while(count<i){\n if(start%2 == 1){\n sum = sum+start;\n count++;\n }\n start++;\n }\n }\n return sum;\n }",
"static int printpairs(int arr[],int k)\n {\n\t\tint count = 0; // Initialize count\n\t\tint size = arr.length;\n\t\t // Declares and initializes the whole array as false\n boolean[] binmap = new boolean[MAX];\n\n // Insert array elements to hashmap\n for(int i=0; i<size; i++)\n \t binmap[arr[i]] = true;\n \n for(int i=0; i<size; i++)\n {\n \t int temp = arr[i]- k;\n \t\n \t if (temp >= 0 && binmap[temp])\n \t {\n \t\t System.out.println(\"Pair with given diff \" + k + \" is (\" + arr[i] + \", \"+temp+\")\");\n \t\t count++;\n \t }\n \n \t temp = arr[i]+ k;\n if (temp < MAX && binmap[temp])\n {\n \t\t System.out.println(\"Pair with given diff \" + k + \" is (\" + arr[i] + \", \"+temp+\")\");\n \t\t count++;\n \t }\n binmap[temp] = false;\n }\n \n return count++;\n }",
"private static void p347() {\n int[] nums1 = {5, 5, 5, 3, 1, 1};\n int k1 = 2;\n int[] ret1 = topKFrequent(nums1, k1);\n System.out.println(Arrays.toString(ret1));\n// int[] nums2 = {1, 2};\n// int k2 = 2;\n// int[] ret2 = topKFrequent(nums2, k2);\n// System.out.println(Arrays.toString(ret2));\n int[] nums3 = {5, 5, 5, 5, 2, 2, 2, 4, 4, 1};\n int k3 = 2;\n int[] ret3 = topKFrequentOptimize(nums3, k3);\n System.out.println(Arrays.toString(ret3));\n\n int[] nums4 = {5, 5, 5, 5, 2, 2, 2, 4, 4, 4, 1};\n int k4 = 2;\n int[] ret4 = topKFrequentUsingBucket(nums4, k4);\n System.out.println(Arrays.toString(ret4));\n\n// int[] nums5 = {1};\n// int k5 = 1;\n// int[] ret5 = topKFrequentUsingBucket(nums5, k5);\n// System.out.println(Arrays.toString(ret5));\n }",
"public List<int[]> kSmallestPairs(int[] nums1, int[] nums2, int k) {\n return null;\n }",
"@Override\r\n\tpublic int runn(int k) {\n\t\treturn 0;\r\n\t}",
"public static int kthElement(int[] arr1, int[] arr2, int k) {\n\t\treturn 1; // not implemented yet, too hard!\n\t}",
"public int rank(K key) {\n int r = 0;\n if (root != null) {\n Node curr = root;\n while (curr != null) {\n int cmp = key.compareTo(curr.key);\n if (cmp > 0) {\n r += size(curr.left) + 1;\n curr = curr.right;\n } else if (cmp < 0) {\n curr = curr.left;\n } else {\n r += size(curr.left);\n break;\n }\n }\n }\n return r;\n }",
"public static int maxSubArrayLen(int[] nums, int k) {\n Map<Integer, Integer> map = new HashMap<>();\n int sum = 0, maxLen = 0;\n for (int i = 0; i < nums.length; i++) {\n sum += nums[i];\n\n if (!map.containsKey(sum)) {\n map.put(sum, i);\n }\n\n if (sum == k) {\n maxLen = i + 1;\n } else {\n int diff = sum - k;\n if (map.containsKey(diff)) {\n maxLen = Math.max(maxLen, i - map.get(diff));\n }\n }\n }\n return maxLen;\n }",
"public static int[] sortInNk(int[] input, int k) {\r\n int length = input.length;\r\n int[] map = new int[k];\r\n int[] output = new int[length];\r\n\r\n // get min O(n)\r\n // this block can be replaced with\r\n // min = input[0];\r\n // it will reduce time complexity but\r\n // than the size of the map would have to be increased\r\n int min = Integer.MAX_VALUE;\r\n for (int currentValue : input) {\r\n if (currentValue < min) {\r\n min = currentValue;\r\n }\r\n }\r\n\r\n // create map O(n)\r\n for (int currentValue : input) {\r\n map[currentValue - min]++;\r\n }\r\n\r\n // map to output O(n)\r\n int mapIter = 0;\r\n for (int i = 0; i < length; i++) {\r\n while (map[mapIter] == 0) {\r\n mapIter++;\r\n if (mapIter == length) {\r\n break;\r\n }\r\n }\r\n // FIXME can this block be done better?\r\n while (map[mapIter] > 0) {\r\n output[i] = min + mapIter;\r\n map[mapIter]--;\r\n if (map[mapIter] > 0) {\r\n i++;\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n }",
"public int majorityNumber(List<Integer> nums, int k) {\n HashMap<Integer, Integer> hash = \n new HashMap();\n double size = (double) nums.size();\n for(int i =0; i<nums.size(); i++) {\n if(hash.containsKey(nums.get(i) )) {\n hash.put(nums.get(i), hash.get(nums.get(i)) + 1);\n }\n else{\n hash.put(nums.get(i), 1);\n }\n if(hash.get(nums.get(i)) > size /(double)k){\n return nums.get(i);\n }\n }\n \n \n return -1;\n \n }",
"public int kthFromEnd(int k) {\r\n\r\n if (head == null) {\r\n return 0;\r\n }\r\n Node lead = head;\r\n while (k >= 0) {\r\n lead = lead.next;\r\n k--;\r\n }\r\n Node tail = head;\r\n while (lead != null) {\r\n lead = lead.next;\r\n tail = tail.next;\r\n }\r\n int i = tail.data;\r\n return i;\r\n }",
"List<PersonHelpfulness> topKHelpfullUsers(final int k) {\n // map to pairs of uID and helpfulness, then cut the helpfulness to 2 parts\n // filter out 0s, then sum both parts using reduce by key\n // then, map to PersonHelpfulness CLASS that has it's own comparator\n // then, return topK (validity checked) list (collect)\n JavaRDD<PersonHelpfulness> helpfulUsers = movieReviews\n .mapToPair(a -> new Tuple2<>(a.getUserId(), a.getHelpfulness()))\n .mapToPair(s -> new Tuple2<>(s._1, new Tuple2<>(Double.parseDouble(s._2.substring(0,s._2.lastIndexOf('/'))),\n Double.parseDouble(s._2.substring(s._2.lastIndexOf('/') + 1, s._2.length())))))\n .filter(s -> s._2._2 != 0)\n .reduceByKey((a,b) -> new Tuple2<>(a._1 + b._1, a._2 + b._2))\n .map(s -> new PersonHelpfulness(s._1, roundFiveDecimal(s._2._1/s._2._2)));\n return helpfulUsers.top(getRealTopK(k,helpfulUsers.count() ));\n }",
"private static int solution4( int[] arr, int k) {\n\t\tif ( arr == null || arr.length < k ) {\n\t\t\treturn Integer.MIN_VALUE;\n\t\t}\n\t\t\n\t\tMaxHeapTree heap = new MaxHeapTree(arr);\n\t\tSystem.out.printf(\"Time complexity: construct = %d\", heap.count);\n\t\t\n\t\tint res = Integer.MIN_VALUE;\n\t\t\n\t\tfor ( int i = 0; i < k; ++i ) {\n\t\t\tres = heap.getMax();\n\t\t}\n\t\tSystem.out.printf(\", total = %d\\n\", heap.count);\n\t\t\n\t\t\n\t\treturn res;\n\t}",
"public int getK() {\n\t\treturn k;\n\t}",
"public int sizeAtDepth(int k) {\n\t\t// TODO\n\t\treturn sizeAtDepth(root, k, 0);\n\t }",
"public int rank(Key key) {\n return rank(key, root);\n }",
"public Map<String,List<Integer>> createN_TSpecificTrainingSet(int k){\r\n\t\tMap<String,List<Integer>> n_tSpecificTrainingIndices=new HashMap<>();\r\n\t\tfor(int n=0;n<this.N;n++) {\r\n\t\t\tfor(int t=0;t<this.T;t++) {\r\n\t\t\t\tString key=Integer.toString(n)+\"_\"+Integer.toString(t);\r\n\t\t\t\tn_tSpecificTrainingIndices.put(key, FarthestPointSampler.pickKFurthestPoint(this.fullDistanceMatrixMap.get(key), k));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn n_tSpecificTrainingIndices;\r\n\t}",
"public int rank(Key key) {\n return rank(root, key);\n }",
"private int seekRank(TreeNode root, int k)\n {\n if (root == null) throw new IllegalArgumentException(\"seek\");\n\n int myRank = count(root.left) + 1;\n\n if (k == myRank)\n return root.val;\n else if (k > myRank)\n return seekRank(root.right, k - myRank);\n else\n return seekRank(root.left, k);\n }",
"static int expt(int n,int k) {\n\t\tif (k==0)\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn n*expt(n,k-1);\n\t}",
"public int subarraysWithKDistinct(int[] nums, int k) {\n return lessThanOrEqualToK(nums, k) - lessThanOrEqualToK(nums, k - 1);\n }",
"public static int findKthLargest(int[] nums, int k) {\n\t\tint start = 0, end = nums.length - 1, index = nums.length - k;\n\t\twhile (start < end) {\n\t\t\tint pivot = partition(nums, start, end);\n\t\t\tif (pivot < index)\n\t\t\t\tstart = pivot + 1;\n\t\t\telse if (pivot > index)\n\t\t\t\tend = pivot - 1;\n\t\t\telse\n\t\t\t\treturn nums[pivot];\n\t\t}\n\t\treturn nums[start];\n\t}",
"private int rank(Integer key, Node x) {\n\t if (x == null) return 0; \n\t int cmp = key.compareTo(x.key); \n\t if (cmp < 0) return rank(key, x.left); \n\t else if (cmp > 0) return 1 + size(x.left) + rank(key, x.right); \n\t else return size(x.left); \n\t }",
"public int subarraysDivByK(int[] nums, int k) {\n\t \n int n = nums.length;\n\t\tint [] cumulativeMods = new int[n]; //store cumulative modulus\n int count =0; //count subarrays\n\t\tHashMap <Integer,Integer> repeatedMonitor = new HashMap<>();\n\t\t\n repeatedMonitor.put(0,1); \n\t\t//magic hidden zero :P, next appearing of 0 in cumulative will be the second to the monitor, \n\t\t//if you love to know why, do search xD\n\t\t\n cumulativeMods[0]= nums[0]%k<0? (nums[0]%k)+k : nums[0]%k;\n \n\t\t//Fill cumulativeMods array\n for(int i=1; i<n; i++){\n cumulativeMods[i] = cumulativeMods[i-1]+nums[i];\n cumulativeMods[i] = cumulativeMods[i]%k <0? (cumulativeMods[i]%k)+k: cumulativeMods[i]%k;\n } \n \n\t\t//count contiguous subarrays by monitoring the repeated items in cumulativeMods\n int toAdd=0;\n for(int i=0; i<n; i++){\n toAdd = repeatedMonitor.getOrDefault(cumulativeMods[i],0); \n count+= toAdd;\n repeatedMonitor.put(cumulativeMods[i], toAdd+1);\n }\n return count; \n }",
"public int getK() {\r\n\t\treturn this.k;\r\n\t}",
"long getRank();",
"public int getKthVariantDimension(final int k) {\n int n = k - 1;\n\n if (n > dimensions) {\n System.out.println(\"ERROR: Non-existent dimension requested\");\n\n return -1;\n }\n\n boolean[] pastGreatest = new boolean[dimensions];\n double[] variances = new double[dimensions];\n ArrayList<Integer> ret = new ArrayList<Integer>();\n\n /* Make an array of variances and populate booles */\n for (int i = 0; i < dimensions; i++) {\n Double var = new Double(getCovariance(i, i));\n\n // System.out.println(\"[\" + i + \"]=\" + var);\n variances[i] = var.doubleValue();\n pastGreatest[i] = false;\n }\n\n /* Find k-th maximium variance */\n for (int i = 0; i <= n; i++) {\n double max = 0;\n int greatest = 0;\n\n for (int j = 0; j < dimensions; j++) {\n if (pastGreatest[j]) {\n continue;\n }\n\n if (variances[j] > max) {\n max = variances[j];\n greatest = j;\n }\n }\n\n pastGreatest[greatest] = true;\n ret.add(greatest);\n }\n\n return ret.get(n);\n }",
"static int workbook(int n, int k, int[] arr) {\n int specialProblems = 0;\n int page = 1;\n for (int i = 0; i < n; i++) {\n for (int j = 1; j <= arr[i]; j++) {\n if (j == page)\n specialProblems++;\n if (j % k == 0)\n page++;\n }\n if (arr[i] % k != 0) page++;\n }\n return specialProblems;\n }",
"private int rank(K key, Node x) {\n if (x == null) return 0;\n int cmp = key.compareTo(x.key);\n if (cmp < 0) return rank(key, x.left);\n else if (cmp > 0) return 1 + size(x.left) + rank(key, x.right);\n else return size(x.left);\n }",
"static void countDistinct(int arr[], int k) \n {\n HashMap<Integer, Integer> hM = new HashMap<Integer, Integer>(); \n \n // Traverse the first window and store count \n // of every element in hash map \n for (int i = 0; i < k; i++) \n hM.put(arr[i], hM.getOrDefault(arr[i], 0) + 1); \n \n // Print count of first window \n System.out.println(hM.size()); \n \n // Traverse through the remaining array \n for (int i = k; i < arr.length; i++) { \n \n // Remove first element of previous window \n // If there was only one occurrence \n if (hM.get(arr[i - k]) == 1) { \n hM.remove(arr[i - k]); \n } \n \n else // reduce count of the removed element \n hM.put(arr[i - k], hM.get(arr[i - k]) - 1); \n \n // Add new element of current window \n // If this element appears first time, \n // set its count as 1, \n hM.put(arr[i], hM.getOrDefault(arr[i], 0) + 1); \n \n // Print count of current window \n System.out.println(hM.size()); \n } \n }",
"private Double find_kth_element(Object arr[], int left, int right, int k) {\n\t\t\n\t\tif (k >= 0 && k <= right - left + 1) {\n\t\t\tint pos = random_partition(arr, left, right), offset = pos - left;\n\t\t\tif (offset == k - 1)\n\t\t\t\treturn (Double)arr[pos];\n\t\t\telse if (offset > k - 1)\n\t\t\t\treturn find_kth_element(arr, left, pos - 1, k);\n\t\t\treturn find_kth_element(arr, pos + 1, right, k - pos + left - 1);\n\t\t}\n\t\treturn null; // return null when k is invalid\n\t}",
"public int solution2(int[] nums, int k) {\n PriorityQueue<Integer> pq = new PriorityQueue<Integer>();\n \n for (int i : nums) {\n pq.offer(i);\n \n if (pq.size() > k) {\n pq.poll();\n }\n }\n \n \n return pq.peek();\n }",
"public static void findKBitLeft(int n, int k){\r\n\t\tif((n & (1<<(k-1)))!=0)\r\n\t\t\tSystem.out.println(\"Kth bit is set\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"Kth bit is not set\");\r\n\t\t\t\r\n\t\t}",
"public int maxSubArrayLen(int[] nums, int k) {\n if(nums == null || nums.length == 0) {\n return 0;\n }\n int maxLength = 0;\n int[] sums = new int[nums.length];\n sums[0] = nums[0];\n HashMap<Integer, Integer> map = new HashMap<>();\n map.put(sums[0], 0);\n for(int i = 1; i < nums.length; i++) {\n sums[i] = sums[i - 1] + nums[i];\n map.put(sums[i], i);\n if(sums[i] == k && i + 1 > maxLength) {\n maxLength = i + 1;\n }\n Integer index = map.get(sums[i] - k);\n if(index == null) {\n continue;\n }\n int length = i - index; // length = i - (index + 1) + 1 = i - index\n if(length > maxLength) {\n maxLength = length; \n }\n }\n return maxLength;\n }",
"public int findKthLargest(int[] nums, int k) {\n if (nums.length == 0 || nums == null) return -1;\n PriorityQueue<Integer> pq = new PriorityQueue<>(k);\n for (int num : nums){\n if (pq.size() < k) pq.add(num);\n else if (num > pq.peek()){\n pq.remove();\n pq.add(num);\n }\n\n }\n return pq.peek();\n }",
"public int getK() {\n\t\treturn K; \n\t}",
"private static void findKClosestNumbersOtherApproach(int[] arr, int key, int k) {\n\n\t\tPriorityQueue<Pair<Integer, Integer>> pq = new PriorityQueue<>();\n\t\tint len = arr.length;\n\t\tint absDiff[] = new int[len];\n\n\t\tfor (int i = 0; i < len; i++) {\n\t\t\tabsDiff[i] = Math.abs(arr[i] - key);\n\t\t\tPair p = new Pair<>(absDiff[i], arr[i]);\n\t\t\tpq.add(p);\n\n\t\t}\n\n\t\tint c = 0;\n\t\tSystem.out.println(\"closest numbers\");\n\t\twhile (!pq.isEmpty() && c < k) {\n\t\t\tint k1 = (int) pq.peek().getValue(0);\n\t\t\tint v = (int) pq.peek().getValue(1);\n\n\t\t\tpq.remove();\n\t\t\tc++;\n\t\t\tSystem.out.println( v);\n\t\t}\n\n\t}",
"public int kthSmallest(int[][] matrix, int k) {\n int rows = matrix.length;\n int columns = matrix[0].length;\n if (rows == 1)\n return matrix[0][k-1];\n else if (columns == 1)\n return matrix[k-1][0];\n List<Integer> list = new LinkedList<>();\n for (int i = 0; i < rows; i++) {\n int index = Math.min(columns, (k - 1) / (i + 1));\n list = merge(list, k, matrix, i, index);\n }\n if (list.size() <= k){\n int result = list.size()< k? Integer.MAX_VALUE : list.get(list.size()-1);\n for (int i = 0; i < rows; i++) {\n int index = Math.min(columns, (k - 1) / (i + 1));\n if (index != columns)\n result = Math.min(result, matrix[i][index]);\n }\n return result;\n }\n return list.get(k-1);\n }",
"public int findPairsTwoPointers(int[] nums, int k) {\n if (k < 0) {\n return 0;\n }\n Arrays.sort(nums); // O(N*logN)\n\n int i = 0;\n int j = 1;\n int count = 0;\n while (j < nums.length) { // O(N)\n if (i == j || nums[j] - nums[i] < k) {\n j++;\n } else if (nums[j] - nums[i] > k) {\n i++;\n } else {\n count += 1;\n j++;\n while (j < nums.length && nums[j] == nums[j - 1]) {\n j++;\n }\n }\n }\n return count;\n }",
"public static List<String> topKFrequent_pq_opt(String[] words, int k) {\n Map<String, Integer> countMap = new HashMap<>();\n for (String word : words) {\n countMap.put(word, countMap.getOrDefault(word, 0) + 1);\n }\n\n PriorityQueue<String> pq = new PriorityQueue<String>((word1, word2) -> {\n if (countMap.get(word1).equals(countMap.get(word2))) {\n return word1.compareTo(word2);\n }\n return countMap.get(word2) - countMap.get(word1);\n });\n\n for (String word : countMap.keySet()) {\n pq.offer(word);\n }\n\n List<String> ans = new ArrayList<>();\n for (int i = 0; i < k; i++) {\n ans.add(pq.poll());\n }\n\n return ans;\n }",
"public int kth(int[] a, int[] b, int k) {\n\t\treturn kthHelper(a, 0, b, 0, k);\n\t}"
] | [
"0.7519329",
"0.72230875",
"0.67280835",
"0.67050266",
"0.66749024",
"0.6589681",
"0.6540926",
"0.65206087",
"0.6477601",
"0.6450178",
"0.6434037",
"0.6410609",
"0.64021146",
"0.63966423",
"0.6373813",
"0.6368472",
"0.6358402",
"0.63558155",
"0.6346023",
"0.63097876",
"0.6300087",
"0.626956",
"0.6233087",
"0.62290406",
"0.6218898",
"0.6214158",
"0.6178854",
"0.6175753",
"0.61749375",
"0.6173177",
"0.6154771",
"0.6133478",
"0.61328727",
"0.6119083",
"0.61167",
"0.61116755",
"0.6088112",
"0.6081204",
"0.6066054",
"0.6056502",
"0.60504633",
"0.605016",
"0.60300606",
"0.6021091",
"0.60164857",
"0.6010174",
"0.6008147",
"0.5991027",
"0.5986632",
"0.59788346",
"0.5970914",
"0.5961656",
"0.59449494",
"0.59280795",
"0.59260595",
"0.59220296",
"0.5921677",
"0.59186554",
"0.58998054",
"0.5894058",
"0.58936614",
"0.58926153",
"0.58689475",
"0.5863201",
"0.5857568",
"0.5847719",
"0.58290666",
"0.5825003",
"0.5807733",
"0.58061284",
"0.5787183",
"0.57692426",
"0.5767673",
"0.57546324",
"0.57543314",
"0.5751998",
"0.5751205",
"0.57391226",
"0.5738569",
"0.5738291",
"0.5737885",
"0.57284474",
"0.5716411",
"0.5715706",
"0.5711261",
"0.5707984",
"0.5703745",
"0.5692622",
"0.569257",
"0.5688935",
"0.5686802",
"0.5677558",
"0.566999",
"0.5657194",
"0.5655478",
"0.56542987",
"0.5652177",
"0.56477505",
"0.5646786",
"0.5644853"
] | 0.59190243 | 57 |
Inorder Traversal: Traverse left subtree > Enqueue key > Traverse right subtree Yields keys in ascending order | public Iterable<Key> Keys()
{
Queue<Key> q=new Queue<>();
Inorder(root,q);
return q;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void inOrderTraverseRecursive();",
"public void inorder()\n {\n inorderRec(root);\n }",
"public void inorder()\r\n {\r\n inorder(root);\r\n }",
"public void inorder()\n {\n inorder(root);\n }",
"public void inorder()\n {\n inorder(root);\n }",
"public Iterable<K> inOrder() {\n Queue<K> q = new Queue<>();\n inOrder(root, q);\n return q;\n }",
"private void inorder() {\n inorder(root);\n }",
"public Iterator<T> inorderIterator() { return new InorderIterator(root); }",
"private void inorder() {\r\n\t\t\tinorder(root);\r\n\t\t}",
"public Iterable<Integer> levelOrder() {\n\t\tLinkedList<Integer> keys = new LinkedList<Integer>();\n\t\tLinkedList<Node> queue = new LinkedList<Node>();\n\t\tqueue.add(root);\n\t\twhile (!queue.isEmpty()) {\n\t\t\tNode n = queue.remove();\n\t\t\tif (n == null) continue;\n\t\t\tkeys.add(n.key);\n\t\t\tqueue.add(n.left);\n\t\t\tqueue.add(n.right);\n\t\t}\n\t\treturn keys;\n\t}",
"public Iterable<K> levelOrder() {\n Queue<K> keys = new Queue<>();\n Queue<Node> queue = new Queue<>();\n queue.enqueue(root);\n while (!queue.isEmpty()) {\n Node x = queue.dequeue();\n if (x == null) continue;\n keys.enqueue(x.key);\n queue.enqueue(x.left);\n queue.enqueue(x.right);\n }\n return keys;\n }",
"public static void main(String[] args)\n throws Exception\n {\n PrintWriter pen = new PrintWriter(System.out, true);\n BST<String, String> dict =\n new BST<String, String>((left, right) -> left.compareTo(right));\n\n String[] values =\n new String[] { \"gorilla\", \"dingo\", \"chimp\", \"emu\", \"elephant\", \"beta\",\n \"aardvark\", \"chinchilla\", \"yeti\", \"gibbon\", \"horse\",\n \"elephant\", \"duck\", \"emu\" };\n String[] moreValues =\n new String[] { \"gnu\", \"dingo\", \"flying squirrel\", \"iguana\", \"squirrel\",\n \"red squirrel\", \"moose\" };\n\n // Add each element and make sure that it's there.\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n\n // A quick printout for fun\n pen.println(\"After setting the first set of values\");\n iterate(pen, dict.iterator());\n\n // Another quick printout for fun\n for (String value : values)\n {\n addString(pen, dict, value);\n } // for\n pen.println(\"After setting the second set of values\");\n iterate(pen, dict.iterator());\n\n // Build iterators that traverse in different ways\n Iterable<String> df_pre_lr =\n dict.values(Traversal.DEPTH_FIRST_PREORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_lr =\n dict.values(Traversal.DEPTH_FIRST_INORDER_LEFT_TO_RIGHT);\n Iterable<String> df_in_rl =\n dict.values(Traversal.DEPTH_FIRST_INORDER_RIGHT_TO_LEFT);\n Iterable<String> bf_pre_rl =\n dict.values(Traversal.BREADTH_FIRST_PREORDER_RIGHT_TO_LEFT);\n\n // Iterate!\n pen.println(\"Iterating depth-first, preorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_pre_lr);\n \n pen.println(\"Iterating depth-first, inorder, left-to-right\");\n pen.print(\" \");\n iterate(pen, df_in_lr);\n \n pen.println(\"Iterating depth-first, inorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, df_in_rl);\n \n pen.println(\"Iterating breadth-first, preorder, right-to-left\");\n pen.print(\" \");\n iterate(pen, bf_pre_rl);\n\n // And we're done\n pen.close();\n }",
"private void inOrder(Node x) {\n if (x == null) {\n return;\n }\n inOrder(x.left);\n System.out.println(x.key);\n inOrder(x.right);\n }",
"public Iterable<Key> iterator() {\n Queue<Key> queue = new LinkedList<>();\n inorder(root, queue);\n return queue;\n }",
"private void Inorder(Node p, Set<K> keyset){\n if(p == null){\n return;\n }\n Inorder(p.left, keyset);\n keyset.add(p.key);\n Inorder(p.right, keyset);\n }",
"public Iterable<Integer> levelOrder() {\n Queue<Integer> keys = new Queue<Integer>();\n Queue<TreeNode> queue = new Queue<TreeNode>();\n queue.enqueue(root);\n while (!queue.isEmpty()) {\n TreeNode x = queue.dequeue();\n if (x == null) {\n\t\t\t\t/* -1 stands for null node. */\n\t\t\t\tkeys.enqueue(-1);\n\t\t\t\tcontinue;\n\t\t\t}\n keys.enqueue(x.val);\n queue.enqueue(x.left);\n queue.enqueue(x.right);\n }\n return keys;\n }",
"public void inOrder(){\n inOrder(root);\n }",
"public void inorder(Node source) {\n inorderRec(source);\n }",
"public void inorder()\r\n\t{\r\n\t\tif(root==null)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"tree is empty\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// find the leftmost node of the tree\r\n\t\tNode p =root;\r\n\t\twhile(p.leftThread==false)\r\n\t\t\tp=p.left;\r\n\t\twhile(p!=null)//loop until we reach the right most node whose right link(rightThread) is null\r\n\t\t{\r\n\t\t\tSystem.out.print(p.info + \" \");\r\n\t\t\tif(p.rightThread==true) // if 'right' is pointing to the inorder successor\r\n\t\t\t\tp = p.right;\r\n\t\t\telse // find the inorder successor i.e the left most node in the right sub tree\r\n\t\t\t{\r\n\t\t\t\tp = p.right;\r\n\t\t\t\twhile(p.leftThread==false)\r\n\t\t\t\t\tp = p.left;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"public void inorderTraverse(){\n\t\tinorderHelper(root);\n\t\tSystem.out.println();\n\t}",
"static void inorder(Node root) {\n if (root != null) {\n inorder(root.left);\n System.out.print(root.key + \" \");\n inorder(root.right);\n }\n }",
"public void inOrder() {\n inOrder(root);\n }",
"private void inorder(Node x, MyQueue<Key> q) {\n if (x == null) return;\n inorder(x.left, q);\n q.add(x.key);\n inorder(x.right, q);\n }",
"public static void inorder(TreapNode root)\n {\n if (root != null)\n {\n inorder(root.left);\n System.out.println(\"key: \" + root.key + \" priority: \" + root.priority);\n if (root.left != null){\n System.out.println(\"left child: \" + root.left.key);\n }\n if (root.right != null){\n System.out.println(\"right child: \" + root.right.key);\n }\n inorder(root.right);\n }\n }",
"public void inOrderTraversal(){\n System.out.println(\"inOrderTraversal\");\n\n Stack<Node> stack = new ArrayStack<Node>();\n\n for(Node node = root; node!= null; node=node.getLeft()){\n stack.push(node);\n }\n while(!stack.isEmpty()){\n Node node = stack.pop();\n System.out.print(node.getData() + \" \");\n\n for(node=node.getRight(); node!= null; node = node.getLeft()){\n stack.push(node);\n }\n }\n\n System.out.println();\n }",
"public ArrayList<K> inOrdorTraverseBST(){\n BSTNode<K> currentNode = this.rootNode;\n LinkedList<BSTNode<K>> nodeStack = new LinkedList<BSTNode<K>>();\n ArrayList<K> result = new ArrayList<K>();\n \n if (currentNode == null)\n return null;\n \n while (currentNode != null || nodeStack.size() > 0) {\n while (currentNode != null) {\n nodeStack.add(currentNode);\n currentNode = currentNode.getLeftChild();\n }\n currentNode = nodeStack.pollLast();\n result.add(currentNode.getId());\n currentNode = currentNode.getRightChild();\n }\n \n return result;\n }",
"@Override\r\n\tpublic Iterator<T> iteratorLevelOrder() {\r\n\t\tLinkedList<T> list = new LinkedList<T>();\r\n\t\tQueue<BSTNode<T>> work = new ArrayDeque<BSTNode<T>>();\r\n\t\twork.add(this.root);//start at the root\r\n\r\n\t\twhile(!work.isEmpty()) {\r\n\t\t\tBSTNode<T> node = work.remove();//pop the first\r\n\t\t\tlist.add(node.data);\r\n\t\t\t\r\n\t\t\tif(node.left!= null) {\r\n\t\t\t\twork.add(node.left);\r\n\t\t\t}\r\n\t\t\tif(node.right!= null) {\r\n\t\t\t\twork.add(node.right);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn list.iterator();\r\n\t}",
"public void inOrder() {\r\n \r\n // call the private inOrder method with the root\r\n inOrder(root);\r\n }",
"public InorderIterator() {\r\n\t\t\tinorder(); // Traverse binary tree and store elements in list\r\n\t\t}",
"public InorderIterator() {\n inorder(); // Traverse binary tree and store elements in list\n }",
"public void inOrderTraverseIterative();",
"public void inorderTraversal() {\n inorderThroughRoot(root);\n System.out.println();\n }",
"void getInorderIteratively(Node node) {\n Stack<Node> stack = new Stack<Tree.Node>();\n if (node == null)\n return;\n Node current = node;\n while (!stack.isEmpty() || current != null) {\n // While the sub tree is not empty keep on adding them\n while (current != null) {\n stack.push(current);\n current = current.left;\n }\n // No more left sub tree\n Node temp = stack.pop();\n System.out.println(temp.data);\n // We now have to move to the right sub tree of the just popped out node\n current = temp.right;\n }\n\n }",
"private static BinaryTreeNode<String> reconstructPreorderSubtree(\n List<String> inOrder,boolean left) {\n String subtreeKey=null;\n if(left && leftsubtreeldx>0) {\n subtreeKey = inOrder.get(leftsubtreeldx);\n --leftsubtreeldx;\n }\n if(!left && rightsubtreeldx<inOrder.size()){\n subtreeKey = inOrder.get(rightsubtreeldx);\n rightsubtreeldx++;\n }\n if (subtreeKey == null) {\n return null;\n }\n\n BinaryTreeNode<String> leftSubtree = reconstructPreorderSubtree(inOrder,true);\n BinaryTreeNode<String> rightSubtree = reconstructPreorderSubtree(inOrder,false);\n BinaryTreeNode bn=new BinaryTreeNode(subtreeKey, leftSubtree, rightSubtree);\n return bn;\n }",
"public void traverseInOrder() {\n\t System.out.println(\"============= BTREE NODES ===============\");\n\t\tinOrder(root);\n System.out.println(\"=========================================\");\n\t}",
"void preOrder(Node node) \n { \n if (node != null) \n { \n System.out.print(node.key + \" \"); \n preOrder(node.left); \n preOrder(node.right); \n } \n }",
"public void inorderTraversal() \n { \n inorderTraversal(header.rightChild); \n }",
"public void inOrderTraversalRecursive(ArrayList<Integer> o, RBNode x){\r\n\t\tif(x.left != nil) inOrderTraversalRecursive(o,x.left);\r\n\t\to.add(x.key);\r\n\t\tif(x.right != nil) inOrderTraversalRecursive(o,x.right);\r\n\t}",
"List<Integer> traverseInOrder(List<Integer> oList) \n\t{\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traverseInOrder(oList);\n\t\t}\n\t\n\t\toList.add(this.key);\n\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traverseInOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\n\t}",
"public ArrayList<Integer> inOrderTraversal (RBNode x) {\r\n\t\tArrayList<Integer> output = new ArrayList<Integer>(size);\r\n\t\toutput.add(x.key);\r\n\t\tRBNode next = nextNode(x);\r\n\t\twhile (next != nil){\r\n\t\t\toutput.add(next.key);\r\n\t\t\tnext = nextNode(next);\r\n\t\t}\r\n\t\treturn output;\r\n\t}",
"void inorderRecursively(Node currentNode, List<Data> sortedDictionary) { \r\n if (currentNode != null) { \r\n inorderRecursively(currentNode.leftChild, sortedDictionary); \r\n sortedDictionary.add(currentNode.getKeyValuePair());\r\n inorderRecursively(currentNode.rightChild, sortedDictionary); \r\n } \r\n }",
"void printInOrder(Node R){\n if( R != null ){\n printInOrder(R.left);\n System.out.println(R.item.key + \" \" + R.item.value);\n printInOrder(R.right);\n }\n }",
"public void inOrder(){\n inOrder(root);\n System.out.println();\n }",
"@Override\r\n\tpublic List<Node<T>> getInOrderTraversal() {\r\n\t\tList<Node<T>> lista = new LinkedList<Node<T>>();// Lista para el\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// recursivo\r\n\t\tlista = auxiliarRecorridoIn(raiz, lista, raiz);\r\n\t\treturn lista;\r\n\t}",
"private void inOrderTraversal(StringBuilder sb) {\n if (left != null) {\n left.inOrderTraversal(sb);\n }\n\n sb.append(data + \" \");\n\n\n if (right != null) {\n right.inOrderTraversal(sb);\n }\n }",
"public String inOrderTraverse(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tString treeAsString = \"\";\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsString += curr.toString() + \" \";\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsString;\r\n\t}",
"private List<Integer> inOrderTraversal(Tree tree, List<Integer> arr){\n if(tree==null){\n return null;\n }\n\n if(tree.left!=null){\n inOrderTraversal(tree.left, arr);\n }\n arr.add(tree.data);\n\n if(tree.right!=null){\n inOrderTraversal(tree.right,arr);\n }\n return arr;\n\n}",
"public Iterator<T> preorderIterator() { return new PreorderIterator(root); }",
"public static void main(String[] args) {\n\n\n TreeNode root = new TreeNode(1);\n TreeNode left1 = new TreeNode(2);\n TreeNode left2 = new TreeNode(3);\n TreeNode left3 = new TreeNode(4);\n TreeNode left4 = new TreeNode(5);\n TreeNode right1 = new TreeNode(6);\n TreeNode right2 = new TreeNode(7);\n TreeNode right3 = new TreeNode(8);\n TreeNode right4 = new TreeNode(9);\n TreeNode right5 = new TreeNode(10);\n root.left = left1;\n root.right = right1;\n left1.left = left2;\n left1.right = left3;\n left3.right = left4;\n right1.left = right2;\n right1.right = right3;\n right2.right = right4;\n right3.left = right5;\n //[3, 2, 4, 5, 1, 7, 9, 6, 10, 8]\n List<Integer> list = inorderTraversalN(root);\n System.err.println(list);\n }",
"List<Integer> traversePreOrder(List<Integer> oList) \n\t{\t\t\n\t\toList.add(this.key);\n\t\t\n\t\tif(this.left != null)\n\t\t{\n\t\t\tthis.left.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\tif(this.right != null)\n\t\t{\n\t\t\tthis.right.traversePreOrder(oList);\n\t\t}\n\t\t\n\t\treturn oList;\t\t\n\t}",
"public Iteratable<IRNode> topDown(IRNode subtree);",
"public Iterable<K> keys() {\n Queue<K> q = new Queue<>();\n inOrder(root, q);\n return q;\n }",
"public void levelOrderTraversal(){\n System.out.println(\"levelOrderTraversal\");\n\n Queue<Node> queue = new ArrayCircularQueue<>();\n\n if(root!=null){\n queue.insert(root);\n }\n\n while(!queue.isEmpty()){\n Node node = queue.delete();\n System.out.print(node.getData() + \" \");\n if(node.getLeft()!=null){\n queue.insert(node.getLeft());\n }\n if(node.getRight()!=null){\n queue.insert(node.getRight());\n }\n }\n System.out.println();\n }",
"public static void main(String[] args) {\n\t\tTreeNode root = new TreeNode(1);\n\t\troot.right = new TreeNode(2);\n\t\t//root.left.left = new TreeNode(3);\n\t\t//root.left.right = new TreeNode(3);\n\t\troot.right.left = new TreeNode(3);\n\t\t//root.right.right = new TreeNode(3);\n\t\t\n\t\tSystem.out.println(inorderTraversal(root));\n\t}",
"public void inorderRec(Node root)\n {\n //If condition to check root is not null .\n if(root!= null) {\n inorderRec(root.left);\n System.out.print(root.key + \" \");\n inorderRec(root.right);\n }\n }",
"public List < Integer > inorderTraversal(TreeNode root) {\n List < Integer > res = new ArrayList < > ();\n TreeNode curr = root;\n TreeNode pre;\n while (curr != null) {\n if (curr.left == null) {\n res.add(curr.val);\n curr = curr.right; // move to next right node\n } else { // has a left subtree\n pre = curr.left;\n while (pre.right != null) { // find rightmost\n pre = pre.right;\n }\n pre.right = curr; // put cur after the pre node\n TreeNode temp = curr; // store cur node\n curr = curr.left; // move cur to the top of the new tree\n temp.left = null; // original cur left be null, avoid infinite loops\n }\n }\n return res;\n }",
"public void InOrder() {\n\t\tInOrder(root);\n\t}",
"void inOrder(TreeNode node) \n { \n if (node == null) \n return; \n \n inOrder(node.left); \n System.out.print(node.val + \" \"); \n \n inOrder(node.right); \n }",
"public void levelOrderTraversal() {\n LinkedList<Node> queue = new LinkedList<>();\n queue.add(root);\n\n while (!queue.isEmpty()) {\n Node removed = queue.removeFirst();\n System.out.print(removed.data + \" \");\n if (removed.left != null) queue.add(removed.left);\n if (removed.right != null) queue.add(removed.right);\n }\n\n System.out.println();\n }",
"public ArrayList<Integer> inOrderTraversal() {\r\n\t\treturn inOrderTraversal(treeMinimum());\r\n\t}",
"void printInorder(Node node) {\n if (node == null)\n return;\n\n /* first recur on left child */\n printInorder(node.left);\n\n /* then print the data of node */\n System.out.print(node.key + \" \");\n\n /* now recur on right child */\n printInorder(node.right);\n }",
"private void inorderTraverse(Node node) {\n\t\tif (node == null)\n\t\t\treturn;\n\n\t\tinorderTraverse(node.left); // walk trough left sub-tree\n\t\tthis.child.add(node);\n\t\tinorderTraverse(node.right); // walk trough right sub-tree\n\t}",
"void inOrderTraversal(Node node){\r\n\t\tif( node == null ) {\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tinOrderTraversal( node.left );\r\n\t\tSystem.out.print( node.value + \" \");\r\n\t\tinOrderTraversal( node.right );\r\n\t}",
"public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (Node temp = first; temp != null; temp = temp.next)\n queue.enqueue(temp.key);\n return queue;\n }",
"public void visitInorder(Visitor<T> visitor) {\n if (left != null) left.visitInorder(visitor);\n visitor.visit(value);\n if (right != null) right.visitInorder(visitor);\n }",
"static void levelOrder(Queue<Node> q1) \n\t{\n\t\tif(q1.isEmpty())\n\t\t\treturn;\n\t\tQueue<Node> q=new LinkedList<Node>();\n\t\twhile(!q1.isEmpty()) {\n\t\t\t\n\t\t\tNode temp=q1.poll();\n\t\t\tif(temp.left!=null) {\n\t\t\t\tq.add(temp.left);\n\t\t\t}\n\t\t\tif(temp.right!=null) {\n\t\t\t\tq.add(temp.right);\n\t\t\t}\n\t\t}\n\t\tif(!q.isEmpty())\n\t\t\tSystem.out.println(q.peek().key);\n\t\tlevelOrder(q);\n\t}",
"public LinkedList ascendingOrder(){\r\n\r\n\t\t//Stack that keeps track of where we go\r\n\t\tStack<BinarySearchTree> traverseStack = new Stack<BinarySearchTree>();\r\n\t\t\r\n\t\t//This is where we want to start\r\n\t\tBinarySearchTree curr = this;\r\n\t\t\r\n\t\t//When true, the string is returned\r\n\t\tBoolean done = false;\r\n\t\t\r\n\t\t//The string to return\r\n\t\tLinkedList treeAsList = new LinkedList();\r\n\t\t\r\n\t\t//INORDER: LEFT > ROOT > RIGHT\r\n\r\n\t\twhile(!done){\r\n\t\t\tif(curr != null){\r\n\t\t\t\t\r\n\t\t\t\t//We need to get left first push it onto the stack\r\n\t\t\t\ttraverseStack.push(curr);\r\n\r\n\t\t\t\t//Getting the left first\r\n\t\t\t\tcurr = curr.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t\r\n\t\t\t\t//curr is null. We checked left.\r\n\t\t\t\tif(!traverseStack.isEmpty()){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//pop the stack to get the item\r\n\t\t\t\t\tcurr = traverseStack.pop();\r\n\r\n\t\t\t\t\t//append the item\r\n\t\t\t\t\ttreeAsList.add(curr);\r\n\r\n\t\t\t\t\t//Check the right\r\n\t\t\t\t\tcurr = curr.getRightChild();\r\n\t\t\t\t}\r\n\t\t\t\t//curr was null, the stack was empty, we visited all\r\n\t\t\t\t//of the 'nodes'\r\n\t\t\t\telse{\r\n\t\t\t\t\tdone = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn treeAsList;\r\n\t}",
"private void recInOrderTraversal(BSTNode<T> node) {\n\t\tif (node != null) {\n\t\t\trecInOrderTraversal(node.getLeft());\n\t\t\ta.add(node.getData());\n\t\t\trecInOrderTraversal(node.getRight());\n\t\t}\n\t}",
"private void inorder(TreeNode<E> root) {\n if (root == null) {\n return;\n }\n inorder(root.left);\n list.add(root.element);\n inorder(root.right);\n }",
"private void inOrder(BSTNode node) {\r\n \r\n // if the node is NOT null, execute the if statement\r\n if (node != null) {\r\n \r\n // go to the left node\r\n inOrder(node.getLeft());\r\n \r\n // visit the node (increment the less than or equal counter)\r\n node.incrementLessThan();\r\n \r\n // go to the right node\r\n inOrder(node.getRight());\r\n }\r\n }",
"public List<Integer> inorderTraversal2(TreeNode root) {\n List<Integer> result = new ArrayList<>();\n if (root == null) {\n return result;\n }\n TreeNode curr = root; // not necessary\n Deque<TreeNode> stack = new ArrayDeque<>();\n\n while (true) {\n // inorder: left, root, right\n // add all left nodes into stack\n while (curr != null) {\n stack.push(curr);\n curr = curr.left;\n } // curr == null\n // if stack is empty, then finished\n if (stack.isEmpty()) {\n break;\n }\n // all left nodes in stack\n // if right node empty, pop, else add right\n curr = stack.pop();\n // add left and root\n result.add(curr.val);\n // if right is null, then next round pop stack\n // else next round add right.left first ...\n curr = curr.right;\n }\n // stack is empty\n return result;\n }",
"public ArrayList<Integer> getAllKeysOrdered() {\n ArrayList<Integer> keyArrl = new ArrayList<>();\n if(root == null){\n return null;\n }\n Node currNode = root;\n keyArrl.add(currNode.key);\n java.util.LinkedList<Node> queue = new java.util.LinkedList<Node>();\n\n\n // Explores Nodes until the queue is empty.\n while (true) {\n\n // Marks that this Node's children should be explored.\n for (int i = 0; i < getNumChildren(); ++i) {\n if (currNode.children[i] != null) {\n queue.addLast(currNode.children[i]);\n }\n }\n\n // Pops the next Node from the queue.\n if (!queue.isEmpty()) {\n currNode = queue.pop();\n keyArrl.add(currNode.key);\n }\n // If the queue is empty, breaks.\n else break;\n\n }\n\n return keyArrl;\n\n }",
"public Listof<K> sortedKeys() {\n return this.bst.toSortedList().map(i -> i.left);\n }",
"public void iterate() {\n\t\t// iterator\n\t\tQueue<NDLMapEntryNode<T>> nodes = new LinkedList<NDLMapEntryNode<T>>();\n\t\tnodes.add(rootNode);\n\t\twhile(!nodes.isEmpty()) {\n\t\t\t// iterate BFSwise\n\t\t\tNDLMapEntryNode<T> node = nodes.poll();\n\t\t\tif(node.end) {\n\t\t\t\t// end of entry, call processor\n\t\t\t\tif(keyProcessor != null) {\n\t\t\t\t\tkeyProcessor.process(node.data);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(node.keys != null) {\n\t\t\t\t// if available\n\t\t\t\tnodes.addAll(node.keys.values()); // next nodes to traverse\n\t\t\t}\n\t\t}\n\t}",
"public static List<Node> inOrderTraversal(BinarySearchTree BST) {\n inorder = new LinkedList<Node>();\n inOrderTraversal(BST.getRoot());\n return inorder;\n }",
"public void preorder()\r\n {\r\n preorder(root);\r\n }",
"@Test\n public void levelOrder() throws Exception {\n Node node = new Node(150);\n node.setLeft(new Node(120));\n node.setRight(new Node(40));\n Node root = new Node(110);\n root.setLeft(new Node(80));\n root.setRight(node);\n\n Queue<Integer> expected = new LinkedList<Integer>();\n expected.add(110);\n expected.add(80);\n expected.add(150);\n expected.add(120);\n expected.add(40);\n BinarySearchTree.levelOrder(root);\n assertEquals(expected, BinarySearchTree.printQ);\n }",
"public List<T> inOrder() { //Time Complexity: O(1)\n List<T> list = new ArrayList<>();\n return inOrder(root, list);\n }",
"private void inorder(TreeNode<E> root) {\r\n\t\t\tif (root == null)\r\n\t\t\t\treturn;\r\n\t\t\tinorder(root.left);\r\n\t\t\tlist.add(root.element);\r\n\t\t\tinorder(root.right);\r\n\t\t}",
"public void inOrder(Node myNode){\n \n if (myNode != null){ //If my node is not null, excute the following\n \n inOrder(myNode.left); //Recurse with left nodes\n System.out.println(myNode.name); //Print node name \n inOrder(myNode.right); //Recurse with right nodes\n \n }\n }",
"public static void inOrderTraverse(Node root) {\n\t\tStack<Node> stack = new Stack<Node>();\n\t\tNode node = root;\n\t\twhile (node!=null || !stack.empty()) {\n if(node!=null){\n \t stack.push(node);\n \t node = node.lchild;\n }else{\n \t node = stack.pop();\n \t node.visit();\n \t node = node.rchild;\n }\n\t\t}\n\t}",
"private E[] getPreOrderLeftSubTree(E[] inOrderTraversal,E[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"public List<Integer> inorderTraversal(TreeNode root) {\n List<Integer> result = new ArrayList<>();\n Stack<TreeNode> stack = new Stack<>();\n TreeNode node = root;\n while (node != null || !stack.empty()) {\n // push left nodes into stack\n while (node != null) {\n stack.push(node);\n node = node.left;\n }\n node = stack.pop();\n result.add(node.val);\n // ! key step: invoke recursive call on node's right child\n node = node.right;\n }\n return result;\n }",
"public void inOrderTraversal(Node node)\n\t{\n\t\tif(node!=null){\n\t\t\t\n\t\t\tinOrderTraversal(node.leftChild);\n\t\t\tarr.add(node.data);\n\t\t\tinOrderTraversal(node.rightChild);\n\t\t}\n\t}",
"private void levelOrderTraversal() {\n\t\tif(root==null) {\n\t\t\tSystem.out.println(\"\\nBinary node is empty.\");\n\t\t\treturn;\n\t\t}\n\t\tQueue<OO8BinaryTreeNode> queue = new LinkedList<OO8BinaryTreeNode>();\n\t\tqueue.add(root);\n\t\tOO8BinaryTreeNode currentNode = null;\n\t\twhile(!queue.isEmpty()) {\n\t\t\tcurrentNode=queue.remove();\n\t\t\tSystem.out.print(currentNode.getValue() + \" \");\n\t\t\tif(currentNode.getLeftNode()!=null)\n\t\t\t\tqueue.add(currentNode.getLeftNode());\n\t\t\tif(currentNode.getRightNode()!=null)\n\t\t\t\tqueue.add(currentNode.getRightNode());\n\t\t}\n\t\tSystem.out.println();\n\t}",
"void inorderTraversal(Node node) {\n\t\tif (node != null) {\n\t\t\tinorderTraversal(node.left);\n\t\t\tSystem.out.print(node.data + \" \");\n\t\t\tinorderTraversal(node.right);\n\t\t}\n\t}",
"public void preorderTraverse(){\n\t\tpreorderHelper(root);\n\t\tSystem.out.println();\n\t}",
"public void visitInorder(Visitor<T> visitor) { if (root != null) root.visitInorder(visitor); }",
"public void inorderRec(Node source) {\n if (source != null) {\n inorderRec(source.getLeft());\n results.add(source);\n inorderRec(source.getRight());\n }\n }",
"public void inOrderTraversal() {\n beginAnimation();\n treeInOrderTraversal(root);\n stopAnimation();\n\n }",
"void inOrderTraversal(OO8BinaryTreeNode node) {\n\t\tif(node==null)\n\t\t\treturn;\n\t\tinOrderTraversal(node.getLeftNode());\n\t\tSystem.out.print(node.getValue() + \" \");\n\t\tinOrderTraversal(node.getRightNode());\n\t}",
"public void inOrder() {\r\n\t\tSystem.out.print(\"IN: \");\r\n\t\tinOrder(root);\r\n\t\tSystem.out.println();\r\n\t}",
"void inorder(Node root) {\n\t\tboolean leftdone = false;\n\n\t\t// Start traversal from root\n\t\twhile (root != null) {\n\t\t\t// If left child is not traversed, find the\n\t\t\t// leftmost child\n\t\t\tif (!leftdone) {\n\t\t\t\twhile (root.left != null) {\n\t\t\t\t\troot = root.left;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print root's data\n\t\t\tSystem.out.print(root.data + \" \");\n\n\t\t\t// Mark left as done\n\t\t\tleftdone = true;\n\n\t\t\t// If right child exists\n\t\t\tif (root.right != null) {\n\t\t\t\tleftdone = false;\n\t\t\t\troot = root.right;\n\t\t\t}\n\n\t\t\t// If right child doesn't exist, move to parent\n\t\t\telse if (root.parent != null) {\n\t\t\t\t// If this node is right child of its parent,\n\t\t\t\t// visit parent's parent first\n\t\t\t\twhile (root.parent != null && root == root.parent.right)\n\t\t\t\t\troot = root.parent;\n\n\t\t\t\tif (root.parent == null)\n\t\t\t\t\tbreak;\n\t\t\t\troot = root.parent;\n\t\t\t} else\n\t\t\t\tbreak;\n\t\t}\n\t}",
"private E[] getInOrderLeftSubTree(E[] inOrderTraversal,\n\t\t\tE[] preOrderTraversal) {\n\t\treturn null;\n\t}",
"void traverseInOrder(Node node){\n if (node != null) {\n traversePreOrder(node.left); // fokus left sampai dihabiskan, lalu right (berbasis sub-tree)\n System.out.println(\" \" + node.data);\n traversePreOrder(node.right);\n }\n }",
"static void inorderTraversal(Node root) {\n if (root == null) {\n return;\n }\n inorderTraversal(root.left);\n System.out.print(root.data + \" \");\n inorderTraversal(root.right);\n }",
"public static void main(String[] args) {\n\t\ttn=new TreeNode(null,null,null,1);\n\t\tTreeNode tleft=new TreeNode(tn,null,null,2);\n\t\tTreeNode tright=new TreeNode(tn,null,null,3);\n\t\ttn.left=tleft;\n\t\ttn.right=tright;\n\t\t\n\t\tTreeNode tleft1=new TreeNode(tleft,null,null,4);\n\t\tTreeNode tright1=new TreeNode(tleft,null,null,5);\n\t\ttleft.left=tleft1;\n\t\ttleft.right=tright1;\n\t\t\n\t\tTreeNode tleft2=new TreeNode(tright,null,null,6);\n\t\tTreeNode tright2=new TreeNode(tright,null,null,7);\n\t\ttright.left=tleft2;\n\t\ttright.right=tright2;\n\t\t\n\t\tTreeNode tleft3=new TreeNode(tleft1,null,null,8);\n\t\tTreeNode tright3=new TreeNode(tleft1,null,null,9);\n\t\ttleft1.left=tleft3;\n\t\ttleft1.right=tright3;\n\t\t\n\t\tTreeNode tleft4=new TreeNode(tright1,null,null,10);\n\t\tTreeNode tright4=new TreeNode(tright1,null,null,11);\n\t\ttright1.left=tleft4;\n\t\ttright1.right=tright4;\n\t\t\n\t\tSystem.out.println(inorderTraversal2(tn));\n\t}",
"private static Node buildTreeHelper(int[] preorder, int[] preorderIndex, int left, int right, Map<Integer, Integer> inorderMap) {\n\n if (left > right) { return null; }\n int rootVal = preorder[preorderIndex[0]++];\n Node root = new Node(rootVal);\n\n root.left = buildTreeHelper(preorder, preorderIndex, left, inorderMap.get(rootVal) - 1, inorderMap);\n root.right = buildTreeHelper(preorder, preorderIndex, inorderMap.get(rootVal) + 1, right, inorderMap);\n return root;\n }",
"public void inOrder(MyBinNode<Type> r){\n if(r != null){\n this.inOrder(r.left);\n System.out.print(r.value.toString() + \" \");\n this.inOrder(r.right);\n }\n }",
"public static void main(String[] args) {\n\t\tBinary_Tree_Inorder_Traversal_94 b=new Binary_Tree_Inorder_Traversal_94();\n\t\tTreeNode root=new TreeNode(1);\n\t\troot.right=new TreeNode(2);\n\t\troot.right.left=new TreeNode(3);\n\t\tList<Integer> list=b.inorderTraversal(root);\n\t\tfor(Integer i:list){\n\t\t\tSystem.out.print(i+\" \");\n\t\t}\n\t}"
] | [
"0.6844714",
"0.67230743",
"0.6715096",
"0.66215503",
"0.66215503",
"0.6605926",
"0.6595872",
"0.65454197",
"0.65370774",
"0.65318793",
"0.6485",
"0.6390815",
"0.6352058",
"0.6341062",
"0.6282945",
"0.6244275",
"0.6238227",
"0.62249935",
"0.62141216",
"0.61867565",
"0.61610204",
"0.6152451",
"0.61126083",
"0.61093307",
"0.6108892",
"0.6076858",
"0.605798",
"0.60374624",
"0.6021846",
"0.60211504",
"0.6018346",
"0.6012821",
"0.600724",
"0.6006733",
"0.600406",
"0.5979668",
"0.5975695",
"0.596203",
"0.59543294",
"0.59255767",
"0.5913728",
"0.5876124",
"0.58454955",
"0.5838771",
"0.58342946",
"0.5829626",
"0.58273685",
"0.5807847",
"0.58062863",
"0.57790196",
"0.5770431",
"0.5754137",
"0.5742066",
"0.5741127",
"0.57408285",
"0.57366556",
"0.5725175",
"0.5722319",
"0.5719188",
"0.57081604",
"0.5703644",
"0.57025266",
"0.5701031",
"0.5699859",
"0.5696336",
"0.5695455",
"0.5684718",
"0.56840247",
"0.56806076",
"0.5670843",
"0.56683266",
"0.56388724",
"0.56294584",
"0.5629332",
"0.56250304",
"0.5619924",
"0.56191415",
"0.56183714",
"0.5612552",
"0.56075644",
"0.55972695",
"0.55965686",
"0.5594761",
"0.5590837",
"0.55815244",
"0.5577401",
"0.5563803",
"0.556357",
"0.5552286",
"0.552925",
"0.5527802",
"0.55262524",
"0.5520615",
"0.55149364",
"0.54996353",
"0.5498385",
"0.5487423",
"0.54773134",
"0.54659986",
"0.54632235"
] | 0.60049754 | 34 |
Delete the Minimum: Go left until finding a node with null left link Replace that node by its right link Update subtree counts. Can also use the tombstone method for deleting but leads to memory overload | public void deleteMin() //delete smallest key
{
root=deleteMin(root);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Node deleteMin(Node n)\n {\n if (n.left == null) \n return n.right;\n n.left = deleteMin(n.left); \n n.count= 1 + size(n.left)+ size(n.right); \n return n;\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }",
"private RBNode<T> removeMin(RBNode<T> node){\n //find the min node\n RBNode<T> parent = node;\n while(node!=null && node.getLeft()!=null){\n parent = node;\n node = node.getLeft();\n }\n //remove min node\n if(parent==node){\n return node;\n }\n\n parent.setLeft(node.getRight());\n setParent(node.getRight(),parent);\n\n //don't remove right pointer,it is used for fixed color balance\n //node.setRight(null);\n return node;\n }",
"public Node deleteMin() {\n\t\t// if the heap is empty\n\t\t// return MAXINT as output\n\t\tNode min = new Node(Integer.MAX_VALUE);\n\t\tif(this.head == null)\n\t\t\treturn min;\n\t\t\n\t\t\n\t\tNode prevMin = null;\n\t\tNode curr = this.head;\n\t\tNode prev = null;\n\t\t\n\t\t// find the smallest node\n\t\t// keep track of node who points to this minimum node\n\t\twhile(curr!=null) {\n\t\t\tif(curr.key<min.key) {\n\t\t\t\tmin = curr;\n\t\t\t\tprevMin = prev;\n\t\t\t}\n\t\t\tprev = curr;\n\t\t\tcurr = curr.rightSibling;\n\t\t}\n\t\t\n\t\t// if its the head then move one pointer ahead\n\t\tif(prevMin == null)\n\t\t\tthis.head = min.rightSibling;\n\t\telse {\n\t\t\t// else attach the previous node to the rightSibling of min\n\t\t\tprevMin.rightSibling = min.rightSibling;\n\t\t}\n\t\tmin.rightSibling = null;\n\t\t\n\t\t//return min node\n\t\treturn min;\n\t}",
"private Node<Value> delMin(Node<Value> x)\r\n {\r\n if (x.left == null) return x.right;\r\n x.left = delMin(x.left);\r\n return x;\r\n }",
"public void removeMin() {\n\t\troot = removeMin(root);\n\t}",
"private static <K, V> @Nullable Node<K, V> removeMininumNodeInTree(@Var Node<K, V> current) {\n if (current.left == null) {\n // This is the minium node to delete\n return null;\n }\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary (similar to general removal strategy).\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeMininumNodeInTree(current.left);\n current = current.withLeftChild(newLeft);\n\n return restoreInvariants(current);\n }",
"private Node deleteMin(Node h) {\n if (h.left == null)\n return null;\n\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n\n h.left = deleteMin(h.left);\n return balance(h);\n }",
"public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }",
"public AnyType deleteMin() {\n if (isEmpty())\n throw new UnderflowException();\n\n AnyType minItem = root.element;\n root = merge(root.left, root.right);\n\n return minItem;\n }",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n// TODO:adding check for assurance\n }",
"private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"public HuffmanTree removeMin();",
"public T deleteMin()\n\t{\t\n\t\t//declating variables\n\t\tint minIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\t//if size == 0; returns null\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t//if checks size and deletes accordingly.\n\t\tif(size == 1)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn tempo;\n\n\t\t}\n\n\t\tif(size == 2)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tint small = grandChildMin(1, 2);\n\t\t\tarray[0] = array[small];\n\t\t\tif(small == 2)\n\t\t\t{\n\t\t\t\tarray[small] = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t}\n\n\t\t\tsize--;\n\t\t\treturn tempo;\n\t\t}\n\n\t\t//if size > 3 does sophisticated deleting\n\t\tT temp = array[0];\n\t\tarray[0] = array[size-1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\t\tint index = 0;\n\n\t\t//gets the smallest of the children & grandchildren\n\t\tint smallest = min(index).get(0);\n\t\t//while it has grandchildren, keeps going\n\t\twhile(smallest != 0)\n\t\t{\n\t\t\t//doesn't switch if im less than the smallest grandchild\n\t\t\t//& breaks\n\t\t\tif(object.compare(array[index], array[smallest]) <= 0 )\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//special case when i could switch with child or grandchild\n\t\t\tif( min(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t}\n\n\t\t\t//switches the locations and updates index\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[smallest];\n\t\t\tarray[smallest] = lemp;\n\t\t\tindex = smallest;\n\t\t\tsmallest = min(smallest).get(0);\n\n\t\t}\n\t\t//if i dont switch, i check if i have to switch then percolate back up\n\t\tif(flag == true)\n\t\t{\n\t\t\tif(object.compare(array[index], array[grandChildMin(2*index+1, 2*index+2)]) > 0)\n\t\t\t{\n\t\t\t\tint mIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\t\tT k = array[mIndex];\n\t\t\t\tarray[mIndex] = array[index];\n\t\t\t\tarray[index] = k;\n\n\t\t\t\tint y = mIndex;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT f = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = f;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(object.compare(array[index], array[(index-1)/2]) > 0)\n\t\t\t{\n\t\t\t\tT m = array[(index-1)/2];\n\t\t\t\tarray[(index-1)/2] = array[index];\n\t\t\t\tarray[index] = m;\n\t\t\t\tint y = (index-1)/2;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\n\t\t\tif(getLevel(y+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMin(2*index +1, 2*index+2)]) > 0 && grandChildMin(2*index +1, 2*index+2) != 0)\n\t\t{\n\t\t\tminIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[minIndex];\n\t\t\tarray[minIndex] = wemp;\n\n\t\t\tint y = minIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if (object.compare(array[index], array[(index-1)/2]) > 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\treturn temp;\n\t}",
"Nodefh removeMin(){\n\t\t\n\t\tif(min == null){\n\t\t\tNodefh dummy = new Nodefh();\n\t\t\tdummy.index = -1;\n\t\t\treturn dummy;\n\t\t}\n\t\tNodefh temp = new Nodefh();\n\t\ttemp = min;\n\t\tif((min.Child == null) && (min == min.Right)){\n\t\t\tmin = null;\n\t\t\treturn temp;\n\t\t}\n\t\tpairwiseCombine();\n\t\treturn temp;\n\t}",
"public AnyType deleteMin() throws NoSuchElementException {\n\t\t\n\t\t// if the heap is empty, throw a NoSuchElementException\n\t\tif(this.size() == 0){\n\t\t\tthrow new NoSuchElementException();\n\t\t}\n\n\t\t// store the minimum item so that it may be returned at the end\n\t\tAnyType minValue = this.findMin();\n\n\t\t// replace the item at minIndex with the last item in the tree\n\t\tAnyType lastValue = this.array[this.size()-1];\n\t\tthis.array[0] = lastValue;\n\t\tthis.array[this.size() - 1] = null;\n\t\t\n\t\t// update size\n\t\tthis.currentSize--;\n\n\t\t// percolate the item at minIndex down the tree until heap order is restored\n\t\t// It is STRONGLY recommended that you write a percolateDown helper method!\n\t\tthis.percolateDown(0);\n\t\t\n\t\t// return the minimum item that was stored\n\t\treturn minValue;\n\t}",
"public Node<E> remove_min_node(){\r\n if (theData.size() <= 0) return null;\r\n\r\n int index = 0 ;\r\n E min = theData.get(0).getData();\r\n //searching min element\r\n for (int i = 0; i< theData.size() ; i++){\r\n if (min.compareTo(theData.get(i).getData()) > 0 ){\r\n min = theData.get(i).getData();\r\n index = i;\r\n }\r\n }\r\n\r\n //copying element for return\r\n Node<E> item = new Node<E>(theData.get(index).getData());\r\n item.data = theData.get(index).getData();\r\n item.count = theData.get(index).getCount();\r\n\r\n //removing all occurances\r\n while (theData.get(index).count > 1)\r\n theData.get(index).count-=1;\r\n\r\n if (theData.get(index).count == 1 ){\r\n\r\n if(index != theData.size()-1){\r\n theData.set(index, theData.remove(theData.size() - 1));\r\n fixHeap(index);\r\n }else\r\n theData.remove(theData.size() - 1);\r\n }\r\n return item;\r\n }",
"public Node removeMin() {\n \t\t// TODO Complete this method!\n \t\tif (indexOfLeastPriority == 2) {\n \t\t\tNode toReturn = getNode(1);\n \t\t\tsetNode(1, null);\n \t\t\treturn toReturn;\n \t\t}\n \t\tint indexOfReplacement = indexOfLeastPriority - 1;\n \t\tNode nodeOfReplacement = getNode(indexOfReplacement);\n \t\tNode toRemove = getNode(1);\n \t\tsetNode(indexOfReplacement, null);\n \t\tsetNode(1, nodeOfReplacement);\n \t\tbubbleDown(1);\n \t\t//decrement IoLP\n \t\tindexOfLeastPriority--;\n \t\treturn toRemove;\n \t}",
"private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ \n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, return null\n if (currentNode == null) \n return currentNode; \n // otherwise, keep searching through the tree until meet the node with value key\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key));\n break;\n case 0:\n // build a temporary node when finding the node that need to be deleted\n BSTNode<K> tempNode = null;\n // when the node doesn't have two childNodes\n // has one childNode: currentNode = tempNode = a childNode\n // has no childNode: currentNode = null, tempNode = currentNode\n if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) {\n if (currentNode.getLeftChild() == null) \n tempNode = currentNode.getRightChild(); \n else \n tempNode = currentNode.getLeftChild(); \n \n if (tempNode == null) {\n //tempNode = currentNode; \n currentNode = null; \n }\n else\n currentNode = tempNode;\n }\n // when the node has two childNodes, \n // use in-order way to find the minimum node in its subrighttree, called rightMinNode\n // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID\n // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id\n else {\n BSTNode<K> rightMinNode = currentNode.getRightChild();\n while (rightMinNode.getLeftChild() != null)\n rightMinNode = rightMinNode.getLeftChild();\n \n tempNode = rightMinNode;\n currentNode.setId(tempNode.getId());\n \n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId()));\n }\n }\n // since currentNode == null means currentNode has no childNode, return null to its ancestor\n if (currentNode == null) \n return currentNode; \n // since currentNode != null, we have to update its balance\n int balanceValue = getNodeBalance(currentNode);\n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case \n return rotateRight(currentNode);\n }\n else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case \n return rotateLeft(currentNode);\n }\n else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n }\n }\n return currentNode;\n }",
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"public void delete(Node<T> x) {\n decreaseKey(x, min.key);\n extractMin();\n }",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n assert check();\n }",
"private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }",
"public void deleteMin();",
"public int Delete_Min()\n {\n \tthis.array[0]=this.array[this.getSize()-1];\n \tthis.size--; \n \tthis.array[0].setPos(0);\n \tint numOfCompares = heapifyDown(this, 0);\n \treturn numOfCompares;\n }",
"public void deleteMin() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMin(root);\n }",
"public void removeMin() {\n if (isEmpty()) throw new RuntimeException(\"underflow\");\n root = removeMin(root);\n }",
"public MinHeapNode<T> deleMin() {\n\t\tif(!isEmpty()) { \r\n\t\t\tMinHeapNode<T> min = heap[1]; //min node\r\n\t heap[1] = heap[currentSize--]; //move bottom node to root\r\n\t heapDown(1); //move root down\r\n\t return min; \r\n\t } \r\n\t return null; \r\n\t}",
"protected BinaryNode<AnyType> removeMin(BinaryNode<AnyType> t) {\n\t\tif (t == null)\n\t\t\tthrow new ItemNotFoundException();\n\t\telse if (t.left != null) {\n\t\t\tt.left = removeMin(t.left);\n\t\t\treturn t;\n\t\t} else\n\t\t\treturn t.right;\n\t}",
"private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}",
"private static <K extends Comparable<? super K>, V> @Nullable Node<K, V> removeAndCopy0(\n K key, @Var Node<K, V> current) {\n\n @Var int comp = key.compareTo(current.getKey());\n\n if (comp < 0) {\n // key < current.data\n if (current.left == null) {\n // Target key is not in map.\n return current;\n }\n\n // Go down leftwards, keeping a red node.\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary.\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeAndCopy0(key, current.left);\n current = current.withLeftChild(newLeft);\n\n } else {\n // key >= current.data\n if ((comp > 0) && (current.right == null)) {\n // Target key is not in map.\n return current;\n }\n\n if (Node.isRed(current.left)) {\n // First chance to push red to right.\n current = rotateClockwise(current);\n\n // re-update comp\n comp = key.compareTo(current.getKey());\n assert comp >= 0;\n }\n\n if ((comp == 0) && (current.right == null)) {\n assert current.left == null;\n // We can delete the node easily, it's a leaf.\n return null;\n }\n\n if (!Node.isRed(current.right) && !Node.isRed(current.right.left)) {\n // Push red to right.\n current = makeRightRed(current);\n\n // re-update comp\n comp = key.compareTo(current.getKey());\n assert comp >= 0;\n }\n\n if (comp == 0) {\n // We have to delete current, but is has children.\n // We replace current with the smallest node in the right subtree (the \"successor\"),\n // and delete that (leaf) node there.\n\n @Var Node<K, V> successor = current.right;\n while (successor.left != null) {\n successor = successor.left;\n }\n\n // Delete the successor\n Node<K, V> newRight = removeMininumNodeInTree(current.right);\n // and replace current with it\n current =\n new Node<>(\n successor.getKey(),\n successor.getValue(),\n current.left,\n newRight,\n current.getColor());\n\n } else {\n // key > current.data\n // Go down rightwards.\n\n Node<K, V> newRight = removeAndCopy0(key, current.right);\n current = current.withRightChild(newRight);\n }\n }\n\n return restoreInvariants(current);\n }",
"public void deleteMax() {\n root = deleteMax(root);\n }",
"public void deleteMax() {\n root = deleteMax(root);\n }",
"@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"private A deleteLargest(int subtree) {\n return null; \n }",
"private void reFixForDel(WAVLNode y) { // in a case of deletion of a node that doesnt exist in the tree, the method will fix the size all the way to the root\r\n\t y.sizen++;\r\n\t while(y.parent!=null) {\r\n\t\t y=y.parent;\r\n\t\t y.sizen++;\r\n\t }\r\n }",
"public T deleteMin();",
"void deleteMin() {\n delete(keys[0]);\n }",
"public abstract int deleteMin();",
"private Node<Value> delMax(Node<Value> x)\r\n {\r\n if (x.right == null) return x.left;\r\n x.right = delMax(x.right);\r\n return x;\r\n }",
"private int deleteMax() {\n int ret = heap[0];\n heap[0] = heap[--size];\n\n // Move root back down\n int pos = 0;\n while (pos < size / 2) {\n int left = getLeftIdx(pos), right = getRightIdx(pos);\n\n // Compare left and right child elements and swap accordingly\n if (heap[pos] < heap[left] || heap[pos] < heap[right]) {\n if (heap[left] > heap[right]) {\n swap(pos, left);\n pos = left;\n } else {\n swap(pos, right);\n pos = right;\n }\n } else {\n break;\n }\n }\n\n return ret;\n }",
"Node deleteNode(Node root, int key) {\n if (root == null) {\n return root;\n }\n\n // If the key to be deleted is smaller than the root's key,\n // then it lies in left subtree\n if (key < root.key) {\n root.left = deleteNode(root.left, key);\n }\n\n // If the key to be deleted is greater than the root's key,\n // then it lies in right subtree\n else if (key > root.key) {\n root.right = deleteNode(root.right, key);\n }\n\n // if key is same as root's key, then this is the node\n // to be deleted\n else {\n\n // node with only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // No child case\n if (temp == null) {\n temp = root;\n root = null;\n } else // One child case\n {\n root = temp; // Copy the contents of the non-empty child\n }\n } else {\n\n // node with two children: Get the inorder successor (smallest\n // in the right subtree)\n Node temp = minValueNode(root.right);\n\n // Copy the inorder successor's data to this node\n root.key = temp.key;\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, temp.key);\n }\n }\n\n // If the tree had only one node then return\n if (root == null) {\n return root;\n }\n\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\n root.height = max(height(root.left), height(root.right)) + 1;\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\n // this node became unbalanced)\n int balance = getBalance(root);\n\n // If this node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && getBalance(root.left) >= 0) {\n return rightRotate(root);\n }\n\n // Left Right Case\n if (balance > 1 && getBalance(root.left) < 0) {\n root.left = leftRotate(root.left);\n return rightRotate(root);\n }\n\n // Right Right Case\n if (balance < -1 && getBalance(root.right) <= 0) {\n return leftRotate(root);\n }\n\n // Right Left Case\n if (balance < -1 && getBalance(root.right) > 0) {\n root.right = rightRotate(root.right);\n return leftRotate(root);\n }\n\n return root;\n }",
"private static void leftLeftDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {60, 50, 70, 30, 65, 55, 20, 40};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(65);\n System.out.println(\"After delete nodes 65, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }",
"public Node deleteNode(Node root, int key) {\n if (root == null)\n return root;\n\n /* Otherwise, recur down the tree */\n if (key < root.data)\n root.left = deleteNode(root.left, key);\n else if (key > root.data)\n root.right = deleteNode(root.right, key);\n\n // if key is same as root's\n // key, then This is the\n // node to be deleted\n else {\n // node with only one child or no child\n if (root.left == null)\n return root.right;\n else if (root.right == null)\n return root.left;\n\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n root.data = minValue(root.right);\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, root.data);\n }\n\n return root;\n }",
"public Node<E> remove_first_node(){\r\n if (theData.size() <= 0) return null;\r\n\r\n Node<E> item = new Node<E>(theData.get(0).getData());\r\n item.data = theData.get(0).getData();\r\n item.count = theData.get(0).getCount();\r\n\r\n if (theData.get(0).count == 1 ){\r\n\r\n if(0 != theData.size()-1){\r\n theData.set(0, theData.remove(theData.size() - 1));\r\n fixHeap(0);\r\n }else {\r\n theData.remove(theData.size() - 1);\r\n }\r\n\r\n\r\n }else{\r\n theData.get(0).count-=1;\r\n remove_first_node();\r\n }\r\n\r\n return item;\r\n }",
"@Test\n public void remove_BST_1_CaseLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(2);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(9));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }",
"private static Node delMin(ArrayList<Node> minHeap) {\n\t\tNode min = minHeap.remove(1);\n\t\t//put last element first\n\t\tint n = minHeap.size();\n\t\tif (n==1) return min;\n\t\tNode last = minHeap.remove(n-1);\n\t\tminHeap.add(1, last);\n\t\t//sink the new top to its right position\n\t\tsink(minHeap);\n\t\treturn min;\n\t}",
"public void delete(Integer data) {\n ArrayList<Node> parents = new ArrayList<>();\n Node nodeDel = this.root;\n Node parent = this.root;\n Node imBalance;\n Integer balanceFactor;\n boolean isLeftChild = false;\n if (nodeDel == null) {\n return;\n }\n while (nodeDel != null && !nodeDel.getData().equals(data)) {\n parent = nodeDel;\n if (data < nodeDel.getData()) {\n nodeDel = nodeDel.getLeftChild();\n isLeftChild = true;\n } else {\n nodeDel = nodeDel.getRightChild();\n isLeftChild = false;\n }\n parents.add(nodeDel);\n }\n\n if (nodeDel == null) {\n return;\n// delete a leaf node\n } else if (nodeDel.getLeftChild() == null && nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = null;\n } else {\n if (isLeftChild) {\n parent.setLeftChild(null);\n } else {\n parent.setRightChild(null);\n }\n }\n }\n// deleting a node with degree of one\n else if (nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getLeftChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getLeftChild());\n } else {\n parent.setRightChild(nodeDel.getLeftChild());\n }\n } else if (nodeDel.getLeftChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getRightChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getRightChild());\n } else {\n parent.setRightChild(nodeDel.getRightChild());\n }\n }\n // deleting a node with degree of two\n else {\n Integer minimumData = minimumData(nodeDel.getRightChild());\n delete(minimumData);\n nodeDel.setData(minimumData);\n }\n parent.setHeight(maximum(height(parent.getLeftChild()), height(parent.getRightChild())));\n balanceFactor = getBalance(parent);\n if (balanceFactor <= 1 && balanceFactor >= -1) {\n for (int i = parents.size() - 1; i >= 0; i--) {\n imBalance = parents.get(i);\n balanceFactor = getBalance(imBalance);\n if (balanceFactor > 1 || balanceFactor < -1) {\n if (imBalance.getData() > parent.getData()) {\n parent.setRightChild(rotateCase(imBalance, data, balanceFactor));\n } else\n parent.setLeftChild(rotateCase(imBalance, data, balanceFactor));\n break;\n }\n }\n }\n }",
"private BSTNode<T> minimum(BSTNode node){\r\n\t\twhile(node.left != null) {\r\n\t\t\tnode = node.left;\r\n\t\t}\r\n\t\treturn node;\r\n\t}",
"public Node<T> extractMin() {\n Node<T> z = min;\n if (z != null) {\n if (z.child != null) {\n Node<T> leftChild = z.child.leftSibling;\n Node<T> rightChild = z.child;\n z.child.parent = null;\n while (leftChild != rightChild) {\n leftChild.parent = null;\n leftChild = leftChild.leftSibling;\n }\n leftChild = leftChild.rightSibling;\n\n // add child to the root list\n Node<T> tmp = z.rightSibling;\n z.rightSibling = leftChild;\n leftChild.leftSibling = z;\n tmp.leftSibling = rightChild;\n rightChild.rightSibling = tmp;\n }\n\n // remove z from the root list\n z.rightSibling.leftSibling = z.leftSibling;\n z.leftSibling.rightSibling = z.rightSibling;\n\n if (z == z.rightSibling) {\n min = null;\n } else {\n min = z.rightSibling;\n consolidate();\n }\n\n size--;\n }\n return z;\n }",
"public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}",
"public int deleteMin() {\n int keyItem = heap[0];\n delete(0);\n return keyItem;\n }",
"public LeftistHeap() {\n root = null;\n }",
"public NodeBinaryTree deleteNode(NodeBinaryTree node, int value)\n {\n if(node == null)\n {\n return null;\n }\n\n if(value < node.data)\n {\n node.leftNode = deleteNode(node.leftNode, value);\n }\n else if(value > node.data)\n {\n node.rightNode = deleteNode(node.rightNode, value);\n }\n else\n {\n // it is the condition where the the ndoe value is itself\n if(node.leftNode == null)\n {\n return node.rightNode;\n }\n else if(node.rightNode == null)\n {\n return node.leftNode;\n }\n\n // we traverse right part of tree for minimum value\n node.data = minimumValueOfRight(node.rightNode);\n node.rightNode = deleteNode(node.rightNode, node.data);\n }\n return node;\n }",
"public static Node rmin(Node root) {\n\t\twhile(root.left!=null)\r\n\t\t\troot=root.left;\r\n\t\t\r\n\t\treturn root;\r\n\t}",
"private Node delete(Node h, int key) {\n if (key - h.key < 0) {\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n h.left = delete(h.left, key);\n } else {\n if (isRed(h.left))\n h = rotateRight(h);\n if (key - h.key == 0 && (h.right == null))\n return null;\n if (!isRed(h.right) && !isRed(h.right.left))\n h = moveRedRight(h);\n if (key - h.key == 0) {\n Node x = min(h.right);\n h.key = x.key;\n h.val = x.val;\n h.right = deleteMin(h.right);\n } else\n h.right = delete(h.right, key);\n }\n return balance(h);\n }",
"public Tree<K, V> delete(K key) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\ttry {\n\t\t\t\tthis.key = left.max();\n\t\t\t\tthis.value = left.lookup(left.max());\n\t\t\t\tleft = left.delete(this.key); \n\t\t\t} catch (EmptyTreeException e) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.key = right.min();\n\t\t\t\t\tthis.value = right.lookup(right.min());\n\t\t\t\t\tright = right.delete(this.key);\n\t\t\t\t} catch (EmptyTreeException f) {\n\t\t\t\t\treturn EmptyTree.getInstance();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.delete(key);\n\t\t} else {\n\t\t\tright = right.delete(key);\n\t\t}\n\t\treturn this;\n\t}",
"private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }",
"private Node minNode(Node node) {\n Node updt = node;\n // Finding the leftmost leaf\n while (updt.left != null) {\n updt = updt.left;\n }\n return updt;\n }",
"@Test\n public void remove_BST_0_CaseRootOneChildren()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(20);\n bst.insert(null, root);\n bst.insert(root, new No(10));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }",
"private Node removeMax(Node node){\n if(node == null)\n return null;\n else if(node.right == null){ //use its left child to replace this node(max value node)\n if(node.count!=0) { //multiple value in same node\n node.count--;\n return node;\n }\n else {\n decDepth(node.left); //maintain depth when chain in left tree\n return node.left;\n }\n }\n\n //walk through right branch\n node.right = removeMax(node.right);\n if(node!=null) node.size--; // the max value must be removed\n return node;\n }",
"public Node deleteBST(Node root, int key) {\n if (root == null) {\n return root;\n }\n if (key < root.key) {\n root.left = deleteBST(root.left, key);\n } else if (key > root.key) {\n root.right = deleteBST(root.right, key);\n } // deletes the target key node\n else {\n // condition if node has only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // Condition if there's no child\n if (temp == null) {\n temp = root;\n root = null;\n // else if there's one child\n } else\n {\n root = temp;\n }\n } else {\n // Gets the Inorder traversal inlined with the node w/ two children\n Node temp = minNode(root.right);\n // Stores the inorder successor's node to this node\n root.key = temp.key;\n // Delete the inorder successor\n root.right = deleteBST(root.right, temp.key);\n }\n }\n // Condition if there's only one child then returns the root\n if (root == null) {\n return root;\n }\n // Gets the updated height of the BST\n root.height = maxInt(heightBST(root.left), heightBST(root.right)) + 1;\n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n\n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n\n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n\n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n return root;\n\n }",
"public boolean delete(Integer key){\n\n TreeNode parent=null;\n TreeNode curr=root;\n\n while (curr!=null && (Integer.compare(key,curr.data)!=0)){\n parent=curr;\n curr=Integer.compare(key,curr.data)>0?curr.right:curr.left;\n }\n\n if(curr==null){ // node does not exist\n\n return false;\n }\n\n TreeNode keyNode=curr;\n\n if(keyNode.right!=null){ //has right subtree\n\n // Find the minimum of Right Subtree\n\n TreeNode rKeyNode=keyNode.right;\n TreeNode rParent=keyNode;\n\n while (rKeyNode.left!=null){\n rParent=rKeyNode;\n rKeyNode=rKeyNode.left;\n }\n\n keyNode.data=rKeyNode.data;\n\n // Move Links to erase data\n\n if(rParent.left==rKeyNode){\n\n rParent.left=rKeyNode.right;\n }else{\n\n rParent.right=rKeyNode.right;\n }\n rKeyNode.right=null;\n\n }else{ // has only left subtree\n\n if(root==keyNode){ // if node to be deleted is root\n\n root=keyNode.left; // making new root\n keyNode.left=null; // unlinking initial root's left pointer\n }\n else{\n\n if(parent.left==keyNode){ // if nodes to be deleted is a left child of it's parent\n\n parent.left=keyNode.left;\n }else{ // // if nodes to be deleted is a right child of it's parent\n\n parent.right=keyNode.left;\n }\n\n }\n\n }\n return true;\n }",
"void deleteTreeRef(Node nodeRef) {\n\t\tSystem.out.println(\"\\nSize of given Tree before delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t\tdeleteTree(nodeRef);\n\t\tnodeRef = null;\n\n\t\tSystem.out.println(\"\\nSize of given Tree after delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t}",
"void replaceMin(Node root) {\n\t\tarr[0] = root;\n\t\tminHeapify(0);\n\t}",
"private void rebalanceLeft(TreeNodeDataType n) {\n left(n);\r\n \r\n \r\n }",
"public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }",
"public void deleteFirst() {\n\t\t\n\t\tif (head !=null) {\n\t\t\t// we have 1 or more node in LL\n\t\t\t\n\t\t\t// check if we have only 1 node\n\t\t\tif(this.head.next == null) {\n\t\t\t\t// yes we have onlu 1 node in LL\n\t\t\t\t//delete that node and make head = null\n\t\t\t\tNode temp = this.head;\n\t\t\t\tthis.head = null;\n\t\t\t\t\n\t\t\t\t// java dont have delete.... so just make object ref as null\n\t\t\t\t// GC will delete this object ASAP\n\t\t\t\ttemp.next = null;\n\t\t\t\ttemp = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// we have more than 1 node\n\t\t\t\tNode temp = this.head;\n\t\t\t\tthis.head =temp.next;\n\t\t\t\t\n\t\t\t\ttemp.next= null;\n\t\t\t\ttemp=null;\n\t\t\t}\n\t\t}\n\t}",
"public void binomialHeapDelete(Node x) {\n\t\tthis.binomialHeapDecreaseKey(x, Integer.MIN_VALUE);\n\t\tthis.binomialHeapExtractMin();\n\t}",
"public void removeAtFront(){\r\n\t head = head.getLink();\r\n\t cursor = head; \r\n\t precursor = null; \r\n\t \r\n\t manyNodes--;\r\n }",
"Node deleteNode(Node root, int key) {\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\tif (key < root.data)\n\t\t\troot.left = deleteNode(root.left, key);\n\t\telse if (key > root.data)\n\t\t\troot.right = deleteNode(root.right, key);\n\t\telse {\n\n\t\t\t// if node to be deleted has 1 or 0 child\n\t\t\tif (root.left == null)\n\t\t\t\treturn root.right;\n\t\t\telse if (root.right == null)\n\t\t\t\treturn root.left;\n\n\t\t\t// Get the inorder successor (smallest\n\t\t\t// in the right subtree)\n\t\t\tNode minkey = minValueNode(root.right);\n\t\t\troot.data = minkey.data;\n\t\t\troot.right = deleteNode(root.right, minkey.data);\n\n\t\t}\n\n\t\t// now Balance tree operation perform just like we did in insertion\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\troot.height = max(height(root.left), height(root.right)) + 1;\n\n\t\tint balance = getBalance(root);\n\n\t\t// If this node becomes unbalanced, then there are 4 cases\n\t\t// Left Left Case\n\t\tif (balance > 1 && getBalance(root.left) >= 0)\n\t\t\treturn rightRotate(root);\n\n\t\t// Left Right Case\n\t\tif (balance > 1 && getBalance(root.left) < 0) {\n\t\t\troot.left = leftRotate(root.left);\n\t\t\treturn rightRotate(root);\n\t\t}\n\n\t\t// Right Right Case\n\t\tif (balance < -1 && getBalance(root.right) <= 0)\n\t\t\treturn leftRotate(root);\n\n\t\t// Right Left Case\n\t\tif (balance < -1 && getBalance(root.right) > 0) {\n\t\t\troot.right = rightRotate(root.right);\n\t\t\treturn leftRotate(root);\n\t\t}\n\n\t\treturn root;\n\t}",
"public void delete() {\n this.root = null;\n }",
"public TreeNode deleteNode1(TreeNode root, int key) {\n if (root == null) {\n return root;\n }\n\n // delete current node if root is the target node\n if (root.val == key) {\n // replace root with root->right if root->left is null\n if (root.left == null) {\n return root.right;\n }\n\n // replace root with root->left if root->right is null\n if (root.right == null) {\n return root.left;\n }\n\n // replace root with its successor if root has two children\n TreeNode p = findSuccessor(root);\n root.val = p.val;\n root.right = deleteNode1(root.right, p.val);\n return root;\n }\n if (root.val < key) {\n // find target in right subtree if root->val < key\n root.right = deleteNode1(root.right, key);\n } else {\n // find target in left subtree if root->val > key\n root.left = deleteNode1(root.left, key);\n }\n return root;\n }",
"public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}",
"Node minValueNode(Node node) \n { \n Node current = node; \n \n /* loop down to find the leftmost leaf */\n while (current.left != null) \n current = current.left; \n \n return current; \n }",
"private Node removeVn(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) {\n node.right = removeVn(node.right, k);\n }else if(k.compareTo(node.k) < 0){\n node.left = removeVn(node.left, k);\n }else{ //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }\n else if(node.right!=null) { // had right child, use min of right child to replace this node\n node.copyValue(min(node.right));\n node.right = removeMin(node.right);\n }\n else if(node.left!=null) {// left child only , use left child to replace this node\n decDepth(node.left); //maintain depth when chain in left tree\n node = node.left;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n // update size of node and its parent nodes\n if (node != null && deleting) node.size--;\n return node;\n }",
"public void removeFirstNode()\n {\n if(head != null) {\n head = head.next;\n size = size - size;\n }\n }",
"public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }",
"private Node<T> delete(Node<T> node,Comparable<T> item) {\r\n if (node == null) { // this is the base case\r\n return null;\r\n }\r\n if (node.data.compareTo((T) item) < 0) {\r\n node.right = delete(node.right, item);\r\n return node;\r\n }\r\n else if (node.data.compareTo((T) item) > 0) {\r\n node.left = delete(node.left, item);\r\n return node;\r\n }\r\n else { // the item == node.data\r\n if (node.left == null) { // no left child\r\n return node.right;\r\n }\r\n else if (node.right == null) { // no right child\r\n return node.left;\r\n }\r\n else { // 2 children: find in-order successor\r\n if (node.right.left == null) { // if right child does not have a left child of its own\r\n node.data = node.right.data;\r\n node.right = node.right.right;\r\n }\r\n else {\r\n node.data = (Comparable<T>) removeSmallest(node.right); // if the right child has two children, or has a left subtree\r\n }\r\n return node;\r\n }\r\n }\r\n }",
"private static BstDeleteReturn deleteHelper(BinarySearchTreeNode<Integer> root, int x) {\n if (root == null) {\n return new BstDeleteReturn(null, false);\n }\n\n if (root.data < x) {\n BstDeleteReturn outputRight = deleteHelper(root.right, x);\n root.right = outputRight.root;\n outputRight.root = root;\n return outputRight;\n }\n\n if (root.data > x) {\n BstDeleteReturn outputLeft = deleteHelper(root.left, x);\n root.left = outputLeft.root;\n outputLeft.root = root;\n return outputLeft;\n }\n\n // 0 children\n if (root.left == null && root.right == null) {\n return new BstDeleteReturn(null, true);\n }\n\n // only left child\n if (root.left != null && root.right == null) {\n return new BstDeleteReturn(root.left, true);\n }\n\n // only right child\n if (root.right != null && root.left == null) {\n return new BstDeleteReturn(root.right, true);\n }\n\n // both children are present\n int minRight = minimum(root.right);\n root.data = minRight;\n BstDeleteReturn output = deleteHelper(root.right, minRight);\n root.right = output.root;\n return new BstDeleteReturn(root, true);\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }",
"public boolean RemoveLeft(Tree p_node, Tree c_node){\n\tboolean ntb ;\n\n\twhile (c_node.GetHas_Left()){\n\t //auxtree01 = c_node.GetLeft() ;\n\t //auxint02 = auxtree01.GetKey();\n\t //ntb = c_node.SetKey(auxint02);\n\t ntb = c_node.SetKey((c_node.GetLeft()).GetKey());\n\t p_node = c_node ;\n\t c_node = c_node.GetLeft() ;\n\t}\n\tntb = p_node.SetLeft(my_null);\n\tntb = p_node.SetHas_Left(false);\n\treturn true ;\n }"
] | [
"0.79771656",
"0.7816343",
"0.7816343",
"0.7623825",
"0.75432974",
"0.74203056",
"0.7373595",
"0.7332162",
"0.72906345",
"0.7276822",
"0.72424245",
"0.7018748",
"0.6951822",
"0.6883201",
"0.6865951",
"0.6815342",
"0.6812903",
"0.67436916",
"0.673449",
"0.6723405",
"0.66986203",
"0.66678876",
"0.66678035",
"0.661464",
"0.6609476",
"0.65893006",
"0.6576673",
"0.65739834",
"0.65562814",
"0.6487547",
"0.6448282",
"0.6397082",
"0.6389157",
"0.63795936",
"0.6364916",
"0.6364916",
"0.63640296",
"0.6336954",
"0.6315355",
"0.628996",
"0.62821084",
"0.6248689",
"0.6242969",
"0.62386024",
"0.62384844",
"0.621795",
"0.6211112",
"0.61937284",
"0.6190006",
"0.61822903",
"0.6157148",
"0.61520696",
"0.60971355",
"0.60916877",
"0.60822755",
"0.6081933",
"0.60751224",
"0.60622424",
"0.60480577",
"0.6044645",
"0.6036368",
"0.6029604",
"0.602743",
"0.6007804",
"0.6003064",
"0.60018253",
"0.5995003",
"0.5993282",
"0.59787434",
"0.59670097",
"0.5953677",
"0.5951814",
"0.5948319",
"0.5941517",
"0.593989",
"0.59363294",
"0.5930138",
"0.5926351",
"0.5916128",
"0.5911558",
"0.5904726",
"0.5900463",
"0.58994734",
"0.5899015",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754",
"0.5898754"
] | 0.7145173 | 11 |
Delete the Maximum: Go right until finding a node with null right link Replace that node by its left link Update subtree counts. Can also use the tombstone method for deleting but leads to memory overload | public void deleteMax() //delete largest key
{
root=deleteMax(root);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteMax() {\n root = deleteMax(root);\n }",
"public void deleteMax() {\n root = deleteMax(root);\n }",
"private Node removeMax(Node node){\n if(node == null)\n return null;\n else if(node.right == null){ //use its left child to replace this node(max value node)\n if(node.count!=0) { //multiple value in same node\n node.count--;\n return node;\n }\n else {\n decDepth(node.left); //maintain depth when chain in left tree\n return node.left;\n }\n }\n\n //walk through right branch\n node.right = removeMax(node.right);\n if(node!=null) node.size--; // the max value must be removed\n return node;\n }",
"private int deleteMax() {\n int ret = heap[0];\n heap[0] = heap[--size];\n\n // Move root back down\n int pos = 0;\n while (pos < size / 2) {\n int left = getLeftIdx(pos), right = getRightIdx(pos);\n\n // Compare left and right child elements and swap accordingly\n if (heap[pos] < heap[left] || heap[pos] < heap[right]) {\n if (heap[left] > heap[right]) {\n swap(pos, left);\n pos = left;\n } else {\n swap(pos, right);\n pos = right;\n }\n } else {\n break;\n }\n }\n\n return ret;\n }",
"private Node<Value> delMax(Node<Value> x)\r\n {\r\n if (x.right == null) return x.left;\r\n x.right = delMax(x.right);\r\n return x;\r\n }",
"private A deleteLargest(int subtree) {\n return null; \n }",
"private Node deleteMin(Node n)\n {\n if (n.left == null) \n return n.right;\n n.left = deleteMin(n.left); \n n.count= 1 + size(n.left)+ size(n.right); \n return n;\n }",
"private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }",
"private void reFixForDel(WAVLNode y) { // in a case of deletion of a node that doesnt exist in the tree, the method will fix the size all the way to the root\r\n\t y.sizen++;\r\n\t while(y.parent!=null) {\r\n\t\t y=y.parent;\r\n\t\t y.sizen++;\r\n\t }\r\n }",
"public FHeapNode removeMax()\r\n {\r\n FHeapNode z = maxNode;\r\n //hmap.remove(maxNode.gethashtag());\t\t\t\t\t\t\t\t\t\t//remove the node from the hashtable\r\n \r\n if (z != null) \r\n\t\t{\r\n \t for (HashMap.Entry<String, FHeapNode> entry : hmap.entrySet()) \r\n {\r\n \tif(entry.getValue() == maxNode)\r\n \t{\r\n \t\thmap.remove(entry.getKey());\r\n \t\tbreak;\r\n \t}\r\n }\r\n \t \r\n int numKids = z.degree;\r\n FHeapNode x = z.child;\r\n FHeapNode tempRight;\r\n\r\n while (numKids > 0) \t\t\t\t\t\t\t\t\t\t\t\t\t// iterate trough all the children of the max node\r\n\t\t\t{\r\n tempRight = x.right; \r\n x.left.right = x.right;\t\t\t\t\t\t\t\t\t\t\t\t// remove x from child list\r\n x.right.left = x.left;\r\n \r\n x.left = maxNode;\t\t\t\t\t\t\t\t\t\t\t\t\t// add x to root list of heap\r\n x.right = maxNode.right;\r\n maxNode.right = x;\r\n x.right.left = x;\r\n \r\n x.parent = null;\t\t\t\t\t\t\t\t\t\t\t\t\t// set parent[x] to null\r\n x = tempRight;\r\n numKids--;\r\n }\r\n\t\t\tz.left.right = z.right;\t\t\t\t\t\t\t\t\t\t\t\t\t// remove z from root list of heap\r\n z.right.left = z.left;\r\n\r\n if (z == z.right)\r\n\t\t\t{\r\n maxNode = null;\r\n } \r\n\t\t\telse \r\n\t\t\t{\r\n maxNode = z.right;\r\n meld();\r\n } \r\n nNodes--;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// decrement size of heap\r\n }\r\n \r\n\r\n return z;\r\n }",
"private BinarySearchTree deleteLeftMost(BinarySearchTree tree){\r\n\t\t\r\n\t\tif(tree.getLeftChild() == null){\r\n\t\t\t//this is the node we want. No left child\r\n\t\t\t//Right child might exist\r\n\t\t\t\r\n\t\t\treturn tree.getRightChild();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tBinarySearchTree replacement = deleteLeftMost(tree.getLeftChild());\r\n\t\t\ttree.attachRightSubtree(replacement);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"private Node removeMin(Node node){\n if(node == null)\n return null;\n else if(node.left == null) {//use right child to replace this node (min value node)\n if(node.count!=0){ //multiple value in same node\n node.count--;\n return node;\n }\n else{\n decDepth(node.right); //maintain depth when chain in right tree\n return node.right;\n }\n }\n\n //walk through left branch\n node.left = removeMin(node.left);\n if(node!=null) node.size--; // the min value must be removed\n return node;\n }",
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"private Node<K, D> removeRightMost(Node<K, D> root) {\n if(root.right.right == null) {\n if(root.right.left != null) {\n Node<K,D> temp = root.right;\n root.right = root.right.left;\n return temp;\n }\n Node<K,D> temp = root.right;\n root.right = null;\n return temp;\n }\n else {\n return removeRightMost(root.right);\n }\n }",
"public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }",
"public void deleteMax() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMax(root);\n// TODO:adding check for assurance\n\n\n }",
"private static <K extends Comparable<? super K>, V> @Nullable Node<K, V> removeAndCopy0(\n K key, @Var Node<K, V> current) {\n\n @Var int comp = key.compareTo(current.getKey());\n\n if (comp < 0) {\n // key < current.data\n if (current.left == null) {\n // Target key is not in map.\n return current;\n }\n\n // Go down leftwards, keeping a red node.\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary.\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeAndCopy0(key, current.left);\n current = current.withLeftChild(newLeft);\n\n } else {\n // key >= current.data\n if ((comp > 0) && (current.right == null)) {\n // Target key is not in map.\n return current;\n }\n\n if (Node.isRed(current.left)) {\n // First chance to push red to right.\n current = rotateClockwise(current);\n\n // re-update comp\n comp = key.compareTo(current.getKey());\n assert comp >= 0;\n }\n\n if ((comp == 0) && (current.right == null)) {\n assert current.left == null;\n // We can delete the node easily, it's a leaf.\n return null;\n }\n\n if (!Node.isRed(current.right) && !Node.isRed(current.right.left)) {\n // Push red to right.\n current = makeRightRed(current);\n\n // re-update comp\n comp = key.compareTo(current.getKey());\n assert comp >= 0;\n }\n\n if (comp == 0) {\n // We have to delete current, but is has children.\n // We replace current with the smallest node in the right subtree (the \"successor\"),\n // and delete that (leaf) node there.\n\n @Var Node<K, V> successor = current.right;\n while (successor.left != null) {\n successor = successor.left;\n }\n\n // Delete the successor\n Node<K, V> newRight = removeMininumNodeInTree(current.right);\n // and replace current with it\n current =\n new Node<>(\n successor.getKey(),\n successor.getValue(),\n current.left,\n newRight,\n current.getColor());\n\n } else {\n // key > current.data\n // Go down rightwards.\n\n Node<K, V> newRight = removeAndCopy0(key, current.right);\n current = current.withRightChild(newRight);\n }\n }\n\n return restoreInvariants(current);\n }",
"private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ \n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, return null\n if (currentNode == null) \n return currentNode; \n // otherwise, keep searching through the tree until meet the node with value key\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key));\n break;\n case 0:\n // build a temporary node when finding the node that need to be deleted\n BSTNode<K> tempNode = null;\n // when the node doesn't have two childNodes\n // has one childNode: currentNode = tempNode = a childNode\n // has no childNode: currentNode = null, tempNode = currentNode\n if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) {\n if (currentNode.getLeftChild() == null) \n tempNode = currentNode.getRightChild(); \n else \n tempNode = currentNode.getLeftChild(); \n \n if (tempNode == null) {\n //tempNode = currentNode; \n currentNode = null; \n }\n else\n currentNode = tempNode;\n }\n // when the node has two childNodes, \n // use in-order way to find the minimum node in its subrighttree, called rightMinNode\n // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID\n // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id\n else {\n BSTNode<K> rightMinNode = currentNode.getRightChild();\n while (rightMinNode.getLeftChild() != null)\n rightMinNode = rightMinNode.getLeftChild();\n \n tempNode = rightMinNode;\n currentNode.setId(tempNode.getId());\n \n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId()));\n }\n }\n // since currentNode == null means currentNode has no childNode, return null to its ancestor\n if (currentNode == null) \n return currentNode; \n // since currentNode != null, we have to update its balance\n int balanceValue = getNodeBalance(currentNode);\n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case \n return rotateRight(currentNode);\n }\n else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case \n return rotateLeft(currentNode);\n }\n else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n }\n }\n return currentNode;\n }",
"private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}",
"private Node deleteMin(Node h) {\n if (h.left == null)\n return null;\n\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n\n h.left = deleteMin(h.left);\n return balance(h);\n }",
"private RBNode<T> removeMin(RBNode<T> node){\n //find the min node\n RBNode<T> parent = node;\n while(node!=null && node.getLeft()!=null){\n parent = node;\n node = node.getLeft();\n }\n //remove min node\n if(parent==node){\n return node;\n }\n\n parent.setLeft(node.getRight());\n setParent(node.getRight(),parent);\n\n //don't remove right pointer,it is used for fixed color balance\n //node.setRight(null);\n return node;\n }",
"private static <K, V> @Nullable Node<K, V> removeMininumNodeInTree(@Var Node<K, V> current) {\n if (current.left == null) {\n // This is the minium node to delete\n return null;\n }\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary (similar to general removal strategy).\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeMininumNodeInTree(current.left);\n current = current.withLeftChild(newLeft);\n\n return restoreInvariants(current);\n }",
"public Node deleteMin() {\n\t\t// if the heap is empty\n\t\t// return MAXINT as output\n\t\tNode min = new Node(Integer.MAX_VALUE);\n\t\tif(this.head == null)\n\t\t\treturn min;\n\t\t\n\t\t\n\t\tNode prevMin = null;\n\t\tNode curr = this.head;\n\t\tNode prev = null;\n\t\t\n\t\t// find the smallest node\n\t\t// keep track of node who points to this minimum node\n\t\twhile(curr!=null) {\n\t\t\tif(curr.key<min.key) {\n\t\t\t\tmin = curr;\n\t\t\t\tprevMin = prev;\n\t\t\t}\n\t\t\tprev = curr;\n\t\t\tcurr = curr.rightSibling;\n\t\t}\n\t\t\n\t\t// if its the head then move one pointer ahead\n\t\tif(prevMin == null)\n\t\t\tthis.head = min.rightSibling;\n\t\telse {\n\t\t\t// else attach the previous node to the rightSibling of min\n\t\t\tprevMin.rightSibling = min.rightSibling;\n\t\t}\n\t\tmin.rightSibling = null;\n\t\t\n\t\t//return min node\n\t\treturn min;\n\t}",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public E deleteMax() {\r\n\t\tE max = null;\r\n\t\tif (currentIndex > 0) { // replace the root of heap with the last element on the last level\r\n\t\t\tmax = heap.get(0); // save current max\r\n\t\t\t\r\n\t\t\theap.set(0, heap.get(currentIndex - 1));\r\n\t\t\theap.remove(currentIndex - 1);\r\n\t\t\tcurrentIndex--;\r\n\t\t\t\r\n\t\t\theapifyDown(0); // re-heapify\r\n\t\t}\r\n\t\treturn max; // if tree is empty, returns null\r\n\t}",
"private Node<Value> delMin(Node<Value> x)\r\n {\r\n if (x.left == null) return x.right;\r\n x.left = delMin(x.left);\r\n return x;\r\n }",
"public static <T> Node<T> removeMax(Node<T> t) {\n if (t == null)\n return null;\n else if (t.right != null) {\n t.right = removeMax(t.right);//recursive call to remove max\n return t;\n } else\n return t.left;// otherwise return left node\n }",
"private Node delete(Node h, int key) {\n if (key - h.key < 0) {\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n h.left = delete(h.left, key);\n } else {\n if (isRed(h.left))\n h = rotateRight(h);\n if (key - h.key == 0 && (h.right == null))\n return null;\n if (!isRed(h.right) && !isRed(h.right.left))\n h = moveRedRight(h);\n if (key - h.key == 0) {\n Node x = min(h.right);\n h.key = x.key;\n h.val = x.val;\n h.right = deleteMin(h.right);\n } else\n h.right = delete(h.right, key);\n }\n return balance(h);\n }",
"private void heapifyRemove() {\n // this is called after the item at the bottom-left has been put at the root\n // we need to see if this item should swap down\n int node = 0;\n int left = 1;\n int right = 2;\n int next;\n\n // store the item at the root in temp\n T temp = heap[node];\n\n // find out where we might want to swap root \n if ((heap[left] == null) && (heap[right] == null)) {\n next = count; // no children, so no swapping\n return;\n } else if (heap[right] == null) {\n next = left; // we will check left child\n } else if (((Comparable) heap[left]).compareTo(heap[right]) > 0) { // figure out which is the biggest of the two children\n next = left; // left is bigger than right, so check left child\n } else {\n next = right; // check right child\n }\n\n // compare heap[next] to item temp, if bigger, swap, and then repeat process\n while ((next < count) && (((Comparable) heap[next]).compareTo(temp) > 0)) {\n heap[node] = heap[next];\n node = next;\n left = 2 * node + 1; // left child of current node\n right = 2 * (node + 1); // right child of current node\n if ((heap[left] == null) && (heap[right] == null)) {\n next = count;\n } else if (heap[right] == null) {\n next = left;\n } else if (((Comparable) heap[left]).compareTo(heap[right]) > 0) {\n next = left;\n } else {\n next = right;\n }\n }\n heap[node] = temp;\n\n }",
"public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}",
"AVLNode delete(AVLNode node, int key) {\n if (node == null) \n return node; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < node.key) \n node.left = delete(node.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n node.right = delete(node.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n \n // node with only one child or no child \n if ((node.left == null) || (node.right == null)) \n { \n AVLNode temp = null; \n if (temp == node.left) \n temp = node.right; \n else\n temp = node.left; \n \n if (temp == null) \n { \n temp = node; \n node = null; \n } \n else \n node = temp; \n } \n else\n { \n AVLNode temp = getSucc(node.right); \n node.key = temp.key; \n node.right = delete(node.right, temp.key); \n } \n } \n \n if (node== null) \n return node; \n \n node.height = max(height(node.left), height(node.right)) + 1; \n \n int balance = getBF(node); \n \n if (balance > 1 && getBF(node.left) >= 0) \n return rightrot(node); \n \n if (balance > 1 && getBF(node.left) < 0) \n { \n node.left = leftrot(node.left); \n return rightrot(node); \n } \n \n if (balance < -1 && getBF(node.right) <= 0) \n return leftrot(node); \n\n if (balance < -1 && getBF(node.right) > 0) \n { \n node.right = rightrot(node.right); \n return leftrot(node); \n } \n return node;\n }",
"public void delete(Integer data) {\n ArrayList<Node> parents = new ArrayList<>();\n Node nodeDel = this.root;\n Node parent = this.root;\n Node imBalance;\n Integer balanceFactor;\n boolean isLeftChild = false;\n if (nodeDel == null) {\n return;\n }\n while (nodeDel != null && !nodeDel.getData().equals(data)) {\n parent = nodeDel;\n if (data < nodeDel.getData()) {\n nodeDel = nodeDel.getLeftChild();\n isLeftChild = true;\n } else {\n nodeDel = nodeDel.getRightChild();\n isLeftChild = false;\n }\n parents.add(nodeDel);\n }\n\n if (nodeDel == null) {\n return;\n// delete a leaf node\n } else if (nodeDel.getLeftChild() == null && nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = null;\n } else {\n if (isLeftChild) {\n parent.setLeftChild(null);\n } else {\n parent.setRightChild(null);\n }\n }\n }\n// deleting a node with degree of one\n else if (nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getLeftChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getLeftChild());\n } else {\n parent.setRightChild(nodeDel.getLeftChild());\n }\n } else if (nodeDel.getLeftChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getRightChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getRightChild());\n } else {\n parent.setRightChild(nodeDel.getRightChild());\n }\n }\n // deleting a node with degree of two\n else {\n Integer minimumData = minimumData(nodeDel.getRightChild());\n delete(minimumData);\n nodeDel.setData(minimumData);\n }\n parent.setHeight(maximum(height(parent.getLeftChild()), height(parent.getRightChild())));\n balanceFactor = getBalance(parent);\n if (balanceFactor <= 1 && balanceFactor >= -1) {\n for (int i = parents.size() - 1; i >= 0; i--) {\n imBalance = parents.get(i);\n balanceFactor = getBalance(imBalance);\n if (balanceFactor > 1 || balanceFactor < -1) {\n if (imBalance.getData() > parent.getData()) {\n parent.setRightChild(rotateCase(imBalance, data, balanceFactor));\n } else\n parent.setLeftChild(rotateCase(imBalance, data, balanceFactor));\n break;\n }\n }\n }\n }",
"Node deleteNode(Node root, int key) {\n if (root == null) {\n return root;\n }\n\n // If the key to be deleted is smaller than the root's key,\n // then it lies in left subtree\n if (key < root.key) {\n root.left = deleteNode(root.left, key);\n }\n\n // If the key to be deleted is greater than the root's key,\n // then it lies in right subtree\n else if (key > root.key) {\n root.right = deleteNode(root.right, key);\n }\n\n // if key is same as root's key, then this is the node\n // to be deleted\n else {\n\n // node with only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // No child case\n if (temp == null) {\n temp = root;\n root = null;\n } else // One child case\n {\n root = temp; // Copy the contents of the non-empty child\n }\n } else {\n\n // node with two children: Get the inorder successor (smallest\n // in the right subtree)\n Node temp = minValueNode(root.right);\n\n // Copy the inorder successor's data to this node\n root.key = temp.key;\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, temp.key);\n }\n }\n\n // If the tree had only one node then return\n if (root == null) {\n return root;\n }\n\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\n root.height = max(height(root.left), height(root.right)) + 1;\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\n // this node became unbalanced)\n int balance = getBalance(root);\n\n // If this node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && getBalance(root.left) >= 0) {\n return rightRotate(root);\n }\n\n // Left Right Case\n if (balance > 1 && getBalance(root.left) < 0) {\n root.left = leftRotate(root.left);\n return rightRotate(root);\n }\n\n // Right Right Case\n if (balance < -1 && getBalance(root.right) <= 0) {\n return leftRotate(root);\n }\n\n // Right Left Case\n if (balance < -1 && getBalance(root.right) > 0) {\n root.right = rightRotate(root.right);\n return leftRotate(root);\n }\n\n return root;\n }",
"public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"private Node removeElement() {\n if (this.leftChild != null) {\n if (this.rightChild != null) {\n Node current = this.rightChild;\n\n while (current.leftChild != null) {\n current = current.leftChild;\n }\n\n //swap\n E value = this.value;\n this.value = current.value;\n current.value = value;\n\n this.rightChild = this.rightChild.removeElement(current.value);\n return this.balance();\n } else {\n return this.leftChild;\n }\n } else {\n return this.rightChild;\n }\n }",
"private static void rightRightDelete() {\n System.out.println(\"LeftLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 70, 55, 65};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }",
"private PersistentLinkedList<T> pop() {\n //the latest element won't become empty\n int index = this.treeSize - 1;\n Node<T> newRoot = new Node<>(branchingFactor);\n\n Node<T> currentNode = this.root;\n Node<T> currentNewNode = newRoot;\n\n ArrayList<Node<T>> newNodes = new ArrayList<>();\n newNodes.add(newRoot);\n ArrayList<Integer> newNodesIndices = new ArrayList<>();\n\n for (int b = base; b > 1; b = b / branchingFactor) {\n TraverseData traverseData = traverseOneLevel(\n new TraverseData(currentNode, currentNewNode, newRoot, index, b));\n currentNode = traverseData.currentNode;\n currentNewNode = traverseData.currentNewNode;\n newNodes.add(currentNewNode);\n newNodesIndices.add(index / b);\n index = traverseData.index;\n }\n newNodesIndices.add(index);\n\n for (int i = 0; i < branchingFactor && i < index; i++) {\n currentNewNode.set(i, currentNode.get(i));\n }\n currentNewNode.set(index, null);\n\n if (index == 0) {\n int latestIndex = newNodes.size() - 2;\n newNodes.get(latestIndex).set(newNodesIndices.get(latestIndex), null);\n\n for (int i = latestIndex; i > 0; i--) {\n if (newNodesIndices.get(i) == 0) {\n newNodes.get(i - 1).set(newNodesIndices.get(i - 1), null);\n } else {\n break;\n }\n }\n }\n\n if (newNodes.size() > 1) {\n int nonNullChildren = 0;\n for (Node<T> child : newRoot.children) {\n if (child != null) {\n nonNullChildren++;\n }\n }\n if (nonNullChildren == 1) { //need new root\n newRoot = newRoot.get(0);\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth - 1,\n this.base / branchingFactor, this.treeSize - 1, unusedTreeIndices,\n indexCorrespondingToTheFirstElement, indexCorrespondingToTheLatestElement);\n }\n }\n return new PersistentLinkedList<>(newRoot, this.branchingFactor, this.depth, this.base,\n this.treeSize - 1, unusedTreeIndices, indexCorrespondingToTheFirstElement,\n indexCorrespondingToTheLatestElement);\n }",
"void arbitraryRemove(Nodefh node){\n\t\n\t\tif(node.Parent.Child == node){\n\t\t\tif(node.Right != null && node.Right != node){\n\t\t\t\tnode.Parent.Child = node.Right;\n\t\t\t\tif(node.Left!=null && node.Left != node){\n\t\t\t\t\tnode.Left.Right = node.Right;\n\t\t\t\t\tnode.Right.Left = node.Left;\n\t\t\t\t\tnode.Parent = null;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnode.Right.Left = node.Right;\n\t\t\t\t\tnode.Parent = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnode.Parent.Child = null;\n\t\t\t\tnode.Parent = null;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(node.Left != null && node.Left != node){\n\t\t\t\tnode.Left.Right = node.Right;\n\t\t\t\tnode.Right.Left = node.Left;\n\t\t\t}\n\t\t\tnode.Parent = null;\n\n\t\t}\n\t\tif(node.Child!=null){\n\t\t\tNodefh temp = node.Child;\n\t\t\tif(node.Child.Right!=null){\n\t\t\t\ttemp = node.Child.Right;\n\t\t\t}\n\t\t\tfhInsert(node.Child);\n\t\t\twhile(temp!=node.Child.Right){\n\t\t\t\tfhInsert(temp);\n\t\t\t\ttemp = temp.Right;\n\t\t\t}\n\n\t\t}\n\n\t}",
"public Tree<K, V> delete(K key) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\ttry {\n\t\t\t\tthis.key = left.max();\n\t\t\t\tthis.value = left.lookup(left.max());\n\t\t\t\tleft = left.delete(this.key); \n\t\t\t} catch (EmptyTreeException e) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.key = right.min();\n\t\t\t\t\tthis.value = right.lookup(right.min());\n\t\t\t\t\tright = right.delete(this.key);\n\t\t\t\t} catch (EmptyTreeException f) {\n\t\t\t\t\treturn EmptyTree.getInstance();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.delete(key);\n\t\t} else {\n\t\t\tright = right.delete(key);\n\t\t}\n\t\treturn this;\n\t}",
"private Node removeVx(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) { //value is greater, then looking right node\n node.right = removeVx(node.right, k);\n }else if(k.compareTo(node.k) < 0){ //value is smaller, then looking left node\n node.left = removeVx(node.left, k);\n }else { //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }else if (node.left != null) { //had left children use max of left children to replace this node\n node.copyValue(max(node.left));\n node.left = removeMax(node.left);\n }\n else if(node.right!=null) { //only had right child, use right child to replace this node\n decDepth(node.right); //maintain depth when chain in right tree\n node = node.right;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n if (node != null && deleting) node.size--;\n return node;\n }",
"private static void rightLeftDelete() {\n System.out.println(\"RightLeft Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 55, 70, 57};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(40);\n System.out.println(\"After delete nodes 40, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n \n System.out.println(\"Does 40 exist in tree? \"+tree1.search(40));\n System.out.println(\"Does 50 exist in tree? \"+tree1.search(50));\n System.out.print(\"Does null exist in tree? \");\n System.out.println(tree1.search(null));\n System.out.println(\"Try to insert 55 again: \");\n tree1.insert(55);\n System.out.println(\"Try to insert null: \");\n tree1.insert(null);\n System.out.println(\"Try to delete null: \");\n tree1.delete(null);\n System.out.println(\"Try to delete 100: nothing happen!\");\n tree1.delete(100);\n tree1.print();\n }",
"private void deleteNode(Cat valueToDelete, Node root){\n Node temp = findNode(valueToDelete, root);\n if(temp.getRight()==null){\n Node parent = temp.getParent();\n if(temp.getLeft()==null){\n temp.setParent(null);\n if(temp==parent.getRight()){\n parent.setRight(null);\n fixBalanceValues(parent,-1);\n }\n else{\n parent.setLeft(null);\n fixBalanceValues(parent,1);\n }\n \n }\n else{\n //copy value of leftchild into the node to deletes data and delete it's leftchild\n temp.setData(temp.getLeft().getData());\n temp.setLeft(null);\n fixBalanceValues(temp, 1);\n }\n }\n Node nodeToDelete = temp.getRight();\n if(nodeToDelete.getLeft()==null){\n temp.setData(nodeToDelete.getData());\n temp.setRight(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(temp,-1);\n }\n else{\n while(nodeToDelete.getLeft()!=null){\n nodeToDelete=nodeToDelete.getLeft(); \n } \n temp.setData(nodeToDelete.getData());\n Node parent = nodeToDelete.getParent();\n parent.setLeft(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(parent,1);\n }\n \n \n }",
"public void deleteMax();",
"public void delete(E e) {\n\t\tNode node = getNode(root, e);\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tif (parentOfLast.right != null) {\n\t\t\tnode.data = parentOfLast.right.data;\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tnode.data = parentOfLast.left.data;\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t\tsize--;\n\t}",
"public Node deleteBST(Node root, int key) {\n if (root == null) {\n return root;\n }\n if (key < root.key) {\n root.left = deleteBST(root.left, key);\n } else if (key > root.key) {\n root.right = deleteBST(root.right, key);\n } // deletes the target key node\n else {\n // condition if node has only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // Condition if there's no child\n if (temp == null) {\n temp = root;\n root = null;\n // else if there's one child\n } else\n {\n root = temp;\n }\n } else {\n // Gets the Inorder traversal inlined with the node w/ two children\n Node temp = minNode(root.right);\n // Stores the inorder successor's node to this node\n root.key = temp.key;\n // Delete the inorder successor\n root.right = deleteBST(root.right, temp.key);\n }\n }\n // Condition if there's only one child then returns the root\n if (root == null) {\n return root;\n }\n // Gets the updated height of the BST\n root.height = maxInt(heightBST(root.left), heightBST(root.right)) + 1;\n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n\n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n\n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n\n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n return root;\n\n }",
"private AvlNode<E> remove(Comparable<E> element, AvlNode<E> node){\n if(node == null) {\n return node;\n } else if(node.value.compareTo((E)element) > 0){\n node.left = remove(element, node.left);\n } else if(node.value.compareTo((E)element) < 0){\n node.right = remove(element, node.right);\n } else {\n if(node.left == null && node.right == null){\n return null;\n } else if(node.left == null){\n return node.right;\n } else if(node.right == null){\n return node.left;\n } else {\n AvlNode<E> replacement = findMax(node.left);\n replacement.left = remove(replacement.value, node.left);\n replacement.right = node.right;\n return replacement;\n }\n }\n\n if(height(node.left) - height(node.right) > 1){\n if(height(node.left.left) > height(node.left.right)){\n node = rotateWithLeftChild(node);\n } else {\n node = doubleWithLeftChild(node);\n }\n } else if(height(node.left) - height(node.right) < -1){\n if(height(node.right.right) > height(node.right.left)){\n node = rotateWithRightChild(node);\n } else {\n node = doubleWithRightChild(node);\n }\n }\n node.height = max(height(node.left), height(node.right)) + 1;\n return node;\n }",
"@Test\n public void remove_BST_0_CaseRootOneChildren()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(20);\n bst.insert(null, root);\n bst.insert(root, new No(10));\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(root, bst.remove(root));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"@Override\n public void nullstill() {\n Node<T> curr= hode;\n while (curr!=null){\n Node<T> p= curr.neste;\n curr.forrige=curr.neste= null;\n curr.verdi= null;\n curr= p;\n }\n hode= hale= null;\n endringer++;\n antall=0;\n }",
"void deleteTreeRef(Node nodeRef) {\n\t\tSystem.out.println(\"\\nSize of given Tree before delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t\tdeleteTree(nodeRef);\n\t\tnodeRef = null;\n\n\t\tSystem.out.println(\"\\nSize of given Tree after delete : \" + sizeOfTreeWithRecursion(nodeRef));\n\t}",
"public void deleteNode(BinaryTreeNode node) // Only leaf nodes and nodes with degree 1 can be deleted. If a degree 1 node is deleted, it is replaced by its subtree.\r\n {\n if(!node.hasRightChild() && !node.hasLeftChild()){\r\n if(node.mActualNode.mParent.mRightChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mRightChild = null;\r\n }\r\n else if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n node.mActualNode.mParent.mLeftChild = null;\r\n }\r\n //node.mActualNode = null;\r\n\r\n }\r\n //if deleted node has degree 1 and has only left child\r\n else if(node.hasLeftChild() && !node.hasRightChild()){\r\n node.mActualNode.mLeftChild.mParent = node.mActualNode.mParent;\r\n //if deleted node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode)\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mLeftChild;\r\n //if deleted node is right child of his father\r\n else {\r\n\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mLeftChild;\r\n }\r\n }\r\n // if deleted node has degree 1 and has only right child\r\n else if(node.hasRightChild() && !node.hasLeftChild()){\r\n node.mActualNode.mRightChild.mParent = node.mActualNode.mParent;\r\n\r\n //if node is left child of his father\r\n if(node.mActualNode.mParent.mLeftChild == node.mActualNode) {\r\n\r\n\r\n node.mActualNode.mParent.mLeftChild = node.mActualNode.mRightChild;\r\n\r\n }\r\n //if node is right child of his father\r\n else\r\n node.mActualNode.mParent.mRightChild = node.mActualNode.mRightChild;\r\n\r\n\r\n }\r\n else\r\n System.out.println(\"Error : node has two child\");\r\n\r\n }",
"public void deleteMax() {\n if (isEmpty()) throw new NoSuchElementException(\"Symbol table underflow\");\n root = deleteMax(root);\n assert check();\n }",
"@Test\n public void remove_BST_0_CaseRootLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(3);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"public int remove() {\n int result = peek();\n\n // move rightmost leaf to become new root\n elementData[1] = elementData[size];\n size--;\n \n // \"bubble down\" root as necessary to fix ordering\n int index = 1;\n boolean found = false; // have we found the proper place yet?\n while (!found && hasLeftChild(index)) {\n int left = leftChild(index);\n int right = rightChild(index);\n int child = left;\n if (hasRightChild(index) &&\n elementData[right] < elementData[left]) {\n child = right;\n }\n \n if (elementData[index] > elementData[child]) {\n swap(elementData, index, child);\n index = child;\n } else {\n found = true; // found proper location; stop the loop\n }\n }\n \n return result;\n }",
"public Node deleteNode(Node root, int key) {\n if (root == null)\n return root;\n\n /* Otherwise, recur down the tree */\n if (key < root.data)\n root.left = deleteNode(root.left, key);\n else if (key > root.data)\n root.right = deleteNode(root.right, key);\n\n // if key is same as root's\n // key, then This is the\n // node to be deleted\n else {\n // node with only one child or no child\n if (root.left == null)\n return root.right;\n else if (root.right == null)\n return root.left;\n\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n root.data = minValue(root.right);\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, root.data);\n }\n\n return root;\n }",
"private static void leftRightDelete() {\n System.out.println(\"LeftRight Tree Delete Case\");\n AVLTree<Integer> tree1 = new AVLTree<Integer>();\n System.out.println(\"Before insert nodes, tree is empty: \"+tree1.isEmpty());\n \n Integer[] numbers = {50, 30, 60, 40, 10, 70, 35};\n for (int i=0; i<numbers.length; i++) {\n tree1.insert(numbers[i]);\n }\n \n System.out.println(\"After insert nodes, tree is empty: \"+tree1.isEmpty());\n System.out.println(\"Tree looks like: \");\n tree1.printTree();\n tree1.print();\n \n tree1.delete(70);\n System.out.println(\"After delete nodes 70, Tree looks like: \"); \n tree1.printTree();\n tree1.print();\n \n System.out.println(\"Tree is balanced: \"+tree1.checkForBalancedTree());\n System.out.println(\"Tree is a BST: \"+tree1.checkForBinarySearchTree()+\"\\n\");\n }",
"private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"Node deleteNode(Node root, int key) {\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\tif (key < root.data)\n\t\t\troot.left = deleteNode(root.left, key);\n\t\telse if (key > root.data)\n\t\t\troot.right = deleteNode(root.right, key);\n\t\telse {\n\n\t\t\t// if node to be deleted has 1 or 0 child\n\t\t\tif (root.left == null)\n\t\t\t\treturn root.right;\n\t\t\telse if (root.right == null)\n\t\t\t\treturn root.left;\n\n\t\t\t// Get the inorder successor (smallest\n\t\t\t// in the right subtree)\n\t\t\tNode minkey = minValueNode(root.right);\n\t\t\troot.data = minkey.data;\n\t\t\troot.right = deleteNode(root.right, minkey.data);\n\n\t\t}\n\n\t\t// now Balance tree operation perform just like we did in insertion\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\troot.height = max(height(root.left), height(root.right)) + 1;\n\n\t\tint balance = getBalance(root);\n\n\t\t// If this node becomes unbalanced, then there are 4 cases\n\t\t// Left Left Case\n\t\tif (balance > 1 && getBalance(root.left) >= 0)\n\t\t\treturn rightRotate(root);\n\n\t\t// Left Right Case\n\t\tif (balance > 1 && getBalance(root.left) < 0) {\n\t\t\troot.left = leftRotate(root.left);\n\t\t\treturn rightRotate(root);\n\t\t}\n\n\t\t// Right Right Case\n\t\tif (balance < -1 && getBalance(root.right) <= 0)\n\t\t\treturn leftRotate(root);\n\n\t\t// Right Left Case\n\t\tif (balance < -1 && getBalance(root.right) > 0) {\n\t\t\troot.right = rightRotate(root.right);\n\t\t\treturn leftRotate(root);\n\t\t}\n\n\t\treturn root;\n\t}",
"@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }",
"public void deleteItem() throws ContainerEmpty280Exception {\n if(this.isEmpty()){ // if there's no item , so not possible to delete\n throw new ContainerEmpty280Exception(\"Impossible to delete item from empty heap\");\n }\n if(this.count>1){ // if the cursor is bigger then 1\n this.currentNode=1; // the current node is 1\n this.items[currentNode]= this.items[count]; // cursor is now at the number 1 node\n }\n this.count--; // decreasing the coutner by 1\n if( this.count == 0) { // if it's empty make the current node the root node\n this.currentNode = 0;\n return;\n }\n int n=1; // starting on the 1 node\n while(findLeftChild(n)<=count){ // while we find the left node child, when its less or equal to the count\n int child= findLeftChild(n);\n if(child+1 <=count && items[child].compareTo(items[child+1])<0){ // if its the right side, and if its bigger\n child++; // select that right child\n }\n if( items[n].compareTo(items[child]) < 0 ) { // if parent is smaller than the rot\n I temp = items[n];\n items[n] = items[child]; // prev node is now the current node\n items[child] = temp; //current node to the right node's item\n }\n else return;\n }\n\n\n }",
"public void delete() {\n this.root = null;\n }",
"private AVLNode handleDeletion(AVLNode treeRoot) {\n if ((treeRoot.getLeft() == null) || (treeRoot.getRight() == null)) {\n\n // Node with only one child or with no childs at all\n\n // Store the node which can be non-null\n AVLNode node = null;\n if (node == treeRoot.getLeft()) {\n node = treeRoot.getRight();\n } else {\n node = treeRoot.getLeft();\n }\n\n // Two possible cases:\n // - No child case\n // - One child case\n\n // No child case\n if (node == null) {\n treeRoot = null;\n }\n else { // One child case\n treeRoot = node; // Copy the contents of the non-empty child\n }\n } else {\n\n // Case of node with two children\n\n // Store the inorder successor (smallest node in the right subtree)\n AVLNode temp = minValueNode(treeRoot.getRight());\n\n // Copy the inorder successor's data to this node\n treeRoot.setElement(temp.getElement());\n\n // Delete the inorder successor\n treeRoot.setRight(deleteNodeImmersion(treeRoot.getRight(), temp.getKey()));\n }\n\n return treeRoot;\n }",
"public int delete(int k){\n\t WAVLNode x = treePosForDel(this, k); // find the node to delete\r\n\t int cnt = 0; // rebalance operations counter\r\n\t if(x.key!=k) { // if a node with a key of k doesnt exist in the tree there is nothing to delete, return -1\r\n\t\t return -1;\r\n\t }\r\n\t if(this.root.key==x.key&&this.root.rank==0) {//root is a leaf\r\n\t\t this.root=EXT_NODE;// change the root pointer to EXT_NODE\r\n\t\t return 0;\r\n\t }\r\n\t else if(this.root.key==x.key&&(this.root.right==EXT_NODE||this.root.left==EXT_NODE)) {//root is onary\r\n\t\t if(x.left!=EXT_NODE) { // x is a root with a left child\r\n\t\t\t x.left.parent = null;\r\n\t\t\t this.root = x.left; // change the root pointer to the root's left child\r\n\t\t\t x.left.sizen=1;\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t x.right.parent = null; // x is a root with a right child \r\n\t\t x.right.sizen=1;\r\n\t\t this.root = x.right; // change the root pointer to the root's right child\r\n\t\t return 0;\r\n\t }\r\n\t WAVLNode z;\r\n\t if(isInnerNode(x)) {// x is an inner node, requires a call for successor and swap\r\n\t\t z = successorForDel(x); // find the successor of x\r\n\t\t x = swap(x,z); // put x's successor instead of x and delete successor \r\n\t }\r\n\t\t if(x.rank == 0) {//x is a leaf\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.left = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.left;\r\n\t\t\t }\r\n\t\t\telse { // x is a right child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.right = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.right; \r\n\t\t\t }\r\n\t\t }\r\n\t\t else {//x is onary\r\n\t\t\t boolean onaryside = onaryLeft(x); // check if x is onary with a left child\r\n\t\t\t WAVLNode x_child = EXT_NODE;\r\n\t\t\t if (onaryside) {\r\n\t\t\t\t x_child=x.left; // get a pointer for x child\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t x_child=x.right;\r\n\t\t\t }\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.left=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {// x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.right=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t }\r\n\t\t }\r\n\t if (z.left.rank==-1&&z.right.rank==-1) {//special case, z becomes a leaf, change pointers and demote\r\n\t\t demote(z);\r\n\t\t x=z;\r\n\t\t z=z.parent;\r\n\t\t cnt++;\r\n\t }\r\n\t \r\n\t while(z!=null&&z.rank-x.rank==3) { // while the tree is not balanced continue to balance the tree\r\n\t\t if(parentside(z, x).equals(\"left\")) { // x is z's left son\r\n\t\t\t if(z.rank-z.right.rank==2) {//condition for demote\r\n\r\n\t\t\t\t demote(z);\r\n\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.right.rank-z.right.left.rank==2&&z.right.rank-z.right.right.rank==2) {//condition for doubledemote left\r\n\t\t\t\t\t doubleDemoteLeft(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if((z.right.rank-z.right.left.rank==1||z.right.rank-z.right.left.rank==2)&&z.right.rank-z.right.right.rank==1) {// condition for rotate left for del\r\n\t\t\t\t\t rotateLeftDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t\t else {//condition for doublerotate left for del\r\n\t\t\t\t\t doubleRotateLeftDel(z);\r\n\t\t\t\t\t \r\n\t\t\t\t\t cnt=cnt+5;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t\t else { // x is z's right son, conditions are symmetric to left side\r\n\t\t\t if(z.rank-z.left.rank==2) {\r\n\t\t\t\t demote(z);\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.left.rank-z.left.right.rank==2&&z.left.rank-z.left.left.rank==2) {\r\n\t\t\t\t\t doubleDemoteright(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t }\r\n\t\t\t\t else if((z.left.rank-z.left.right.rank==1||z.left.rank-z.left.right.rank==2)&&z.left.rank-z.left.left.rank==1) {\r\n\t\t\t\t\t rotateRightDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t else {\r\n\r\n\t\t\t\t\t doubleRotateRightDel(z);\r\n\t\t\t\t\t cnt+=5;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t return cnt;\r\n }",
"public void delete(int index) {\n\t\tNode node = getNode(index+1);\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tnode.data = parentOfLast.right != null ? parentOfLast.right.data : parentOfLast.left.data;\n\t\tif (parentOfLast.right != null) {\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t}",
"public boolean delete(Integer key){\n\n TreeNode parent=null;\n TreeNode curr=root;\n\n while (curr!=null && (Integer.compare(key,curr.data)!=0)){\n parent=curr;\n curr=Integer.compare(key,curr.data)>0?curr.right:curr.left;\n }\n\n if(curr==null){ // node does not exist\n\n return false;\n }\n\n TreeNode keyNode=curr;\n\n if(keyNode.right!=null){ //has right subtree\n\n // Find the minimum of Right Subtree\n\n TreeNode rKeyNode=keyNode.right;\n TreeNode rParent=keyNode;\n\n while (rKeyNode.left!=null){\n rParent=rKeyNode;\n rKeyNode=rKeyNode.left;\n }\n\n keyNode.data=rKeyNode.data;\n\n // Move Links to erase data\n\n if(rParent.left==rKeyNode){\n\n rParent.left=rKeyNode.right;\n }else{\n\n rParent.right=rKeyNode.right;\n }\n rKeyNode.right=null;\n\n }else{ // has only left subtree\n\n if(root==keyNode){ // if node to be deleted is root\n\n root=keyNode.left; // making new root\n keyNode.left=null; // unlinking initial root's left pointer\n }\n else{\n\n if(parent.left==keyNode){ // if nodes to be deleted is a left child of it's parent\n\n parent.left=keyNode.left;\n }else{ // // if nodes to be deleted is a right child of it's parent\n\n parent.right=keyNode.left;\n }\n\n }\n\n }\n return true;\n }",
"private void deleteDegreeOneChild(Node curr, AtomicReference<Node> rootRef) {\n\t\tNode child = curr.right.isNull ? curr.left : curr.right;\n replaceNode(curr, child, rootRef);\n if(curr.color == Color.BLACK) {\n if(child.color == Color.RED) {\n child.color = Color.BLACK;\n } else {\n adjustRootDeficiency(child, rootRef);\n }\n }\n\t}",
"public void removeMin() {\n\t\troot = removeMin(root);\n\t}",
"public T deleteMin()\n\t{\t\n\t\t//declating variables\n\t\tint minIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\t//if size == 0; returns null\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t//if checks size and deletes accordingly.\n\t\tif(size == 1)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn tempo;\n\n\t\t}\n\n\t\tif(size == 2)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT tempo = array[0];\n\t\t\tint small = grandChildMin(1, 2);\n\t\t\tarray[0] = array[small];\n\t\t\tif(small == 2)\n\t\t\t{\n\t\t\t\tarray[small] = null;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t}\n\n\t\t\tsize--;\n\t\t\treturn tempo;\n\t\t}\n\n\t\t//if size > 3 does sophisticated deleting\n\t\tT temp = array[0];\n\t\tarray[0] = array[size-1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\t\tint index = 0;\n\n\t\t//gets the smallest of the children & grandchildren\n\t\tint smallest = min(index).get(0);\n\t\t//while it has grandchildren, keeps going\n\t\twhile(smallest != 0)\n\t\t{\n\t\t\t//doesn't switch if im less than the smallest grandchild\n\t\t\t//& breaks\n\t\t\tif(object.compare(array[index], array[smallest]) <= 0 )\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t//special case when i could switch with child or grandchild\n\t\t\tif( min(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t}\n\n\t\t\t//switches the locations and updates index\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[smallest];\n\t\t\tarray[smallest] = lemp;\n\t\t\tindex = smallest;\n\t\t\tsmallest = min(smallest).get(0);\n\n\t\t}\n\t\t//if i dont switch, i check if i have to switch then percolate back up\n\t\tif(flag == true)\n\t\t{\n\t\t\tif(object.compare(array[index], array[grandChildMin(2*index+1, 2*index+2)]) > 0)\n\t\t\t{\n\t\t\t\tint mIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\t\tT k = array[mIndex];\n\t\t\t\tarray[mIndex] = array[index];\n\t\t\t\tarray[index] = k;\n\n\t\t\t\tint y = mIndex;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT f = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = f;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(object.compare(array[index], array[(index-1)/2]) > 0)\n\t\t\t{\n\t\t\t\tT m = array[(index-1)/2];\n\t\t\t\tarray[(index-1)/2] = array[index];\n\t\t\t\tarray[index] = m;\n\t\t\t\tint y = (index-1)/2;\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\n\t\t\tif(getLevel(y+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMin(2*index +1, 2*index+2)]) > 0 && grandChildMin(2*index +1, 2*index+2) != 0)\n\t\t{\n\t\t\tminIndex = grandChildMin(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[minIndex];\n\t\t\tarray[minIndex] = wemp;\n\n\t\t\tint y = minIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if (object.compare(array[index], array[(index-1)/2]) > 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\t\n\t\treturn temp;\n\t}",
"@Test\n public void remove_BST_0_CaseRootLeafLeft()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(2);\n No no = new No(1);\n \n bst.insert(root, root);\n //bst.printTree();\n \n bst.insert(root, no);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(new Integer(2), bst.size());\n assertEquals(no, bst.remove(no));\n assertEquals(new Integer(1), bst.size());\n //bst.printTree();\n }",
"private Node removeVn(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) {\n node.right = removeVn(node.right, k);\n }else if(k.compareTo(node.k) < 0){\n node.left = removeVn(node.left, k);\n }else{ //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }\n else if(node.right!=null) { // had right child, use min of right child to replace this node\n node.copyValue(min(node.right));\n node.right = removeMin(node.right);\n }\n else if(node.left!=null) {// left child only , use left child to replace this node\n decDepth(node.left); //maintain depth when chain in left tree\n node = node.left;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n // update size of node and its parent nodes\n if (node != null && deleting) node.size--;\n return node;\n }",
"private void reFix(WAVLNode x) {\n\t x.sizen--;\r\n\t while(x.parent!=null) {\r\n\t\t x=x.parent;\r\n\t\t x.sizen--;\r\n\t }\r\n }",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n if (root == null)\n return root;\n\n if (key < root.key)\n root.left = deleteNode(root.left, key);\n else if (key > root.key)\n root.right = deleteNode(root.right, key);\n\n // IF KEY IS AT ROOT\n\n // If left is null\n else if (root.left == null)\n {\n TreapNode temp = root.right;\n root = temp; // Make right child as root\n }\n\n // If Right is null\n else if (root.right == null)\n {\n TreapNode temp = root.left;\n root = temp; // Make left child as root\n }\n\n // If key is at root and both left and right are not null\n else if (root.left.priority < root.right.priority)\n {\n root = leftRotate(root);\n root.left = deleteNode(root.left, key);\n }\n else\n {\n root = rightRotate(root);\n root.right = deleteNode(root.right, key);\n }\n\n return root;\n }",
"public String remove()\n\t{\n\t\tString result = null;\n\t\tif (pointer > 0)\n\t\t{\n\t\t\tif (pointer == 1)\n\t\t\t{\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tString oldRoot = data[0];\n\t\t\t\tString oldLast = data[pointer - 1];\n\t\t\t\tdata[0] = oldLast;\n\t\t\t\tdata[pointer - 1] = oldRoot;\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t\tint parent = 0;\n\t\t\t\t//left child\n\t\t\t\tint childLeft = parent * 2 + 1;\n\n\t\t\t\twhile (childLeft < pointer)\n\t\t\t\t{\n\t\t\t\t\t//right child\n\t\t\t\t\tint childRight = parent * 2 + 2;\n\t\t\t\t\t//assume the mininum of the two children is left child\n\t\t\t\t\tint childMin = childLeft;\n\t\t\t\t\tif (childRight < pointer)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (smallerThan(childRight, childLeft))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildMin = childRight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (smallerThan(childMin, parent))\n\t\t\t\t\t{\n\t\t\t\t\t\t//downheap\n\t\t\t\t\t\tswap(childMin, parent);\n\t\t\t\t\t\tparent = childMin;\n\t\t\t\t\t\tchildLeft = parent * 2 + 1;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"private NodeTest delete(NodeTest root, int data)\n\t{\n\t\t//if the root is null then there's no tree\n\t\tif (root == null)\n\t\t{\n\t\t\tSystem.out.println(\"There was no tree.\");\n\t\t\treturn null;\n\t\t}\n\t\t//if the data is less go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = delete(root.left, data);\n\t\t}\n\t\t//otherwise go to the right\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = delete(root.right, data);\n\t\t}\n\t\t//else, we have a hit, so find out how we are going to delete it\n\t\telse\n\t\t{\n\t\t\t//if there are no children then return null\n\t\t\t//because we can delete the NodeTest without worries\n\t\t\tif (root.left == null && root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no children NodeTests\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t//if there is no right-child then return the left\n\t\t\t//\n\t\t\telse if (root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no right-children NodeTests\");\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t//if there is no left child return the right\n\t\t\telse if (root.left == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no left-children NodeTests\");\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if it is a parent NodeTest, we need to find the max of the lowest so we can fix the BST\n\t\t\t\troot.data = findMax(root.left);\n\t\t\t\troot.left = delete(root.left, root.data);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\t}",
"public LeftistHeap() {\n root = null;\n }",
"public boolean delete(int m) {\r\n \r\n System.out.println(\"We are deleting \" + m);\r\n\tbtNode current = root;\r\n btNode parent = root;\r\n boolean LeftChild = true;\r\n\r\n while(current.getData() != m) \r\n {\r\n parent = current;\r\n if(m < current.getData()) \r\n {\r\n LeftChild = true;\r\n current = current.left;\r\n }\r\n else { \r\n LeftChild = false;\r\n current = current.right;\r\n }\r\n if(current == null) \r\n return false; \r\n } // end while\r\n // found node to delete\r\n\r\n // if no children, simply delete it\r\n if(current.left==null && current.right==null)\r\n {\r\n if(current == root) // if root,\r\n root = null; // tree is empty\r\n else if(LeftChild)\r\n parent.left = null; // disconnect\r\n else // from parent\r\n parent.right = null;\r\n }\r\n\r\n // if no right child, replace with left subtree\r\n else if(current.right==null)\r\n if(current == root)\r\n root = current.left;\r\n else if(LeftChild)\r\n parent.left = current.left;\r\n else\r\n parent.right = current.left;\r\n\r\n // if no left child, replace with right subtree\r\n else if(current.left==null)\r\n if(current == root)\r\n root = current.right;\r\n else if(LeftChild)\r\n parent.left = current.right;\r\n else\r\n parent.right = current.right;\r\n\r\n else // two children, so replace with inorder successor\r\n {\r\n // get successor of node to delete (current)\r\n btNode successor = getNext(current);\r\n\r\n // connect parent of current to successor instead\r\n if(current == root)\r\n root = successor;\r\n else if(LeftChild)\r\n parent.left = successor;\r\n else\r\n parent.right = successor;\r\n\r\n // connect successor to current's left child\r\n successor.left = current.left;\r\n } // end else two children\r\n // (successor cannot have a left child)\r\n return true; // success\r\n }",
"public void delete(T data)\r\n { \r\n Node<T> tmp = head; //The traversal node ptr that we follow through the list. \r\n Node<T> Growtmp = head;\r\n \r\n ArrayDeque<Node<T>> droplvl = new ArrayDeque<>(); // Stores all the nodes that we drop at.\r\n\r\n Node<T> node = new Node<T>(data,1); //Create the new node used to traverse the list with dummy height 1. \r\n \r\n for(int i=tmp.height - 1; i >= 0; i--) //Loop through the heights of the head node. \r\n {\r\n //If the pointed to nodes data is greater than the newly created node or were pointing to null\r\n //drop down a level of height and repeat search process.\r\n //Checks to see if inserted node is less than current node\r\n if(tmp.pointers.get(i) == null || tmp.pointers.get(i).data.compareTo(node.data) > 0 || tmp.pointers.get(i).data.compareTo(node.data) == 0) \r\n {\r\n droplvl.push(tmp); //Store our drop nodes into a stack.\r\n continue; //This is essentially how we are dropping levels. \r\n }\r\n \r\n //If the pointed to nodes data is less than the inserting node move to that node. \r\n if(tmp.pointers.get(i).data.compareTo(node.data) < 0) \r\n {\r\n if(tmp.next(i) != null)\r\n tmp = tmp.next(i);\r\n \r\n if(tmp.pointers.get(i) != null)\r\n { \r\n while(tmp.pointers.get(i) != null && tmp.pointers.get(i).data.compareTo(node.data) < 0)\r\n {\r\n if(tmp.next(i) != null)\r\n tmp = tmp.next(i);\r\n \r\n else \r\n break;\r\n }\r\n }\r\n \r\n droplvl.push(tmp); //Store the drop \r\n continue; //Continue down our list\r\n }\r\n }\r\n\r\n //Once here our temp has traversed the list and is currently where our node needs to be inserted. \r\n //We now need to pop the stack node height number of times. \r\n \r\n Node<T> Delptr = tmp.next(0); //Points to the node to be deleted. \r\n \r\n if(Delptr != null && Delptr.data.compareTo(data) == 0) //Checks that Delptr is not null and that it is in our list. \r\n if(containsData.contains(Delptr.data) == true) //Checks to see that the element to be deleted is actually in our list. \r\n {\r\n \r\n \r\n for(int z = 0; z < Delptr.height; z++) //This is where we delete our node. \r\n {\r\n droplvl.pop().pointers.set(z, Delptr.pointers.get(z));\r\n Delptr.pointers.set(z, null);\r\n }\r\n Delptr.height = 0; //The deleted node should have no height.\r\n \r\n //Once here our desired node has been deleted. \r\n \r\n numNodes--;\r\n containsData.remove(Delptr.data); //Stores all the inserted <T>Data. \r\n \r\n //Now we need to check if our list must be trimmed.\r\n \r\n double logHeight = Math.log(numNodes)/Math.log(2);\r\n logHeight = Math.ceil(logHeight); //Takes the ceiling of log base 2 of n ie rounds up. \r\n int NewHeight = (int)logHeight; //The new height of our skiplist after inserting \r\n \r\n if(NewHeight <= 0) // If our list contains 1 element it should be of height 1 not 0; \r\n NewHeight = 1;\r\n \r\n if(NewHeight < Growtmp.height) //If this is the case we need to trim our skiplist!\r\n { \r\n ArrayList<Node<T>> NodesThatTrim = new ArrayList<>(); //This will hold the nodes that will shrink. \r\n \r\n int p = NewHeight; //Variable which we will use to traverse the maxheight of our list. \r\n \r\n Growtmp = head;\r\n \r\n Growtmp = Growtmp.next(p);// Point Growtmp to the first node of maxheight \r\n \r\n while(Growtmp != null)\r\n { \r\n NodesThatTrim.add(Growtmp);\r\n Growtmp = Growtmp.next(p);\r\n }\r\n \r\n Growtmp = head;\r\n \r\n Growtmp.pointers.add(p,null); //Setting our heads pervious maxheight to null. \r\n \r\n head.height = NewHeight; //We need to update the height of our head node. \r\n \r\n for(int j=0; j < NodesThatTrim.size();j++)\r\n {\r\n NodesThatTrim.get(j).pointers.set(p, null);\r\n NodesThatTrim.get(j).height = NewHeight; //Setting the heights of our nodes after being trimmed. \r\n }\r\n }\r\n }\r\n }",
"private TSTNode<E> deleteNodeRecursion(TSTNode<E> currentNode) {\n \n if(currentNode == null) return null;\n if(currentNode.relatives[TSTNode.EQKID] != null || currentNode.data != null) return null; // can't delete this node if it has a non-null eq kid or data\n\n TSTNode<E> currentParent = currentNode.relatives[TSTNode.PARENT];\n\n // if we've made it this far, then we know the currentNode isn't null, but its data and equal kid are null, so we can delete the current node\n // (before deleting the current node, we'll move any lower nodes higher in the tree)\n boolean lokidNull = currentNode.relatives[TSTNode.LOKID] == null;\n boolean hikidNull = currentNode.relatives[TSTNode.HIKID] == null;\n\n ////////////////////////////////////////////////////////////////////////\n // Add by Cheok. To resolve java.lang.NullPointerException\n // I am not sure this is the correct solution, as I have not gone\n // through this sourc code in detail.\n if (currentParent == null && currentNode == this.rootNode) {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n // Add by Cheok. To resolve java.lang.NullPointerException\n ////////////////////////////////////////////////////////////////////////\n\n // now find out what kind of child current node is\n int childType;\n if(currentParent.relatives[TSTNode.LOKID] == currentNode) {\n childType = TSTNode.LOKID;\n } else if(currentParent.relatives[TSTNode.EQKID] == currentNode) {\n childType = TSTNode.EQKID;\n } else if(currentParent.relatives[TSTNode.HIKID] == currentNode) {\n childType = TSTNode.HIKID;\n } else {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n\n if(lokidNull && hikidNull) {\n // if we make it to here, all three kids are null and we can just delete this node\n currentParent.relatives[childType] = null;\n return currentParent;\n }\n\n // if we make it this far, we know that EQKID is null, and either HIKID or LOKID is null, or both HIKID and LOKID are NON-null\n if(lokidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.HIKID];\n currentNode.relatives[TSTNode.HIKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n if(hikidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.LOKID];\n currentNode.relatives[TSTNode.LOKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n int deltaHi = currentNode.relatives[TSTNode.HIKID].splitchar - currentNode.splitchar;\n int deltaLo = currentNode.splitchar - currentNode.relatives[TSTNode.LOKID].splitchar;\n int movingKid;\n TSTNode<E> targetNode;\n \n // if deltaHi is equal to deltaLo, then choose one of them at random, and make it \"further away\" from the current node's splitchar\n if(deltaHi == deltaLo) {\n if(Math.random() < 0.5) {\n deltaHi++;\n } else {\n deltaLo++;\n }\n }\n\n\tif(deltaHi > deltaLo) {\n movingKid = TSTNode.HIKID;\n targetNode = currentNode.relatives[TSTNode.LOKID];\n } else {\n movingKid = TSTNode.LOKID;\n targetNode = currentNode.relatives[TSTNode.HIKID];\n }\n\n while(targetNode.relatives[movingKid] != null) targetNode = targetNode.relatives[movingKid];\n \n // now targetNode.relatives[movingKid] is null, and we can put the moving kid into it.\n targetNode.relatives[movingKid] = currentNode.relatives[movingKid];\n\n // now we need to put the target node where the current node used to be\n currentParent.relatives[childType] = targetNode;\n targetNode.relatives[TSTNode.PARENT] = currentParent;\n\n if(!lokidNull) currentNode.relatives[TSTNode.LOKID] = null;\n if(!hikidNull) currentNode.relatives[TSTNode.HIKID] = null;\n\n // note that the statements above ensure currentNode is completely dereferenced, and so it will be garbage collected\n return currentParent;\n }",
"private BSTnode<K> actualDelete(BSTnode<K> n, K key) {\n\t\tif (n == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (key.equals(n.getKey())) {\n\t\t\t// n is the node to be removed\n\t\t\tif (n.getLeft() == null && n.getRight() == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (n.getLeft() == null) {\n\t\t\t\treturn n.getRight();\n\t\t\t}\n\t\t\tif (n.getRight() == null) {\n\t\t\t\treturn n.getLeft();\n\t\t\t}\n\n\t\t\t// if we get here, then n has 2 children\n\t\t\tK smallVal = smallest(n.getRight());\n\t\t\tn.setKey(smallVal);\n\t\t\tn.setRight(actualDelete(n.getRight(), smallVal));\n\t\t\treturn n;\n\t\t}\n\n\t\telse if (key.compareTo(n.getKey()) < 0) {\n\t\t\tn.setLeft(actualDelete(n.getLeft(), key));\n\t\t\treturn n;\n\t\t}\n\n\t\telse {\n\t\t\tn.setRight(actualDelete(n.getRight(), key));\n\t\t\treturn n;\n\t\t}\n\t}",
"protected void siftDown() {\r\n\t\tint parent = 0, child = (parent << 1) + 1;// preguntar porque 0 y no 1\r\n\t\t\r\n\t\twhile (child < theHeap.size()) {\r\n\t\t\tif (child < theHeap.size() - 1\r\n\t\t\t\t\t&& compare(theHeap.get(child), theHeap.get(child + 1)) > 0)\r\n\t\t\t\tchild++; // child is the right child (child = (2 * parent) + 2)\r\n\t\t\tif (compare(theHeap.get(child), theHeap.get(parent)) >= 0)\r\n\t\t\t\tbreak;\r\n\t\t\tswap(parent, child);\r\n\t\t\tparent = child;\r\n\t\t\tchild = (parent << 1) + 1; // => child = (2 * parent) + 1\r\n\t\t}\r\n\t}",
"public int delete(int k) {\n\t\tif (this.empty()) {// empty tree, nothing to erase\n\t\t\treturn -1;\n\t\t}\n\t\tAVLNode root = (AVLNode) this.root;\n\t\tAVLNode node = (AVLNode) root.delFindNode(k);\n\t\tif (node == null) {// no node with key==k in this tree\n\t\t\treturn -1;\n\t\t}\n\t\tchar side = node.parentSide();\n\t\tboolean rootTerm = (node.getLeft().getKey() != -1 && node.getRight().getKey() != -1);\n\t\tif (side == 'N' && (rootTerm == false)) {\n\t\t\treturn this.deleteRoot(node);\n\t\t}\n\t\tif (side == 'L') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 1 && rightEdge == 2) {\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.left != null && node.right == null) || (node.left == null && node.right != null)) {// node is //\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// unary\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 2)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (side == 'R') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 2 && rightEdge == 1) {\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.getLeft().getHeight() != -1 && node.getRight().getHeight() == -1)\n\t\t\t\t\t|| (node.getLeft().getHeight() == -1 && node.getRight().getHeight() != -1)) {// node is unary\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 2 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// we get here only if node is binary, and thus not going through any other\n\t\t// submethod\n\t\tAVLNode successor = this.findSuccessor(node); // successor must be unary/leaf\n\t\tif (node.checkRoot()) {\n\t\t\tthis.root = successor;\n\t\t}\n\t\tint numOp = this.delete(successor.key);\n\t\tsuccessor.setHeight(node.getHeight());\n\t\tsuccessor.size = node.getSize();\n\t\tsuccessor.setRight(node.getRight());\n\t\tnode.right.setParent(successor);\n\t\tnode.setRight(null);\n\t\tsuccessor.setLeft(node.getLeft());\n\t\tnode.left.setParent(successor);\n\t\tnode.setLeft(null);\n\t\tsuccessor.setParent(node.getParent());\n\t\tif (node.parentSide() == 'L') {\n\t\t\tnode.parent.setLeft(successor);\n\t\t} else if (node.parentSide() == 'R') {// node.parentSide()=='R'\n\t\t\tnode.parent.setRight(successor);\n\t\t}\n\t\tnode.setParent(null);\n\t\treturn numOp;\n\n\t}",
"Nodefh removeMin(){\n\t\t\n\t\tif(min == null){\n\t\t\tNodefh dummy = new Nodefh();\n\t\t\tdummy.index = -1;\n\t\t\treturn dummy;\n\t\t}\n\t\tNodefh temp = new Nodefh();\n\t\ttemp = min;\n\t\tif((min.Child == null) && (min == min.Right)){\n\t\t\tmin = null;\n\t\t\treturn temp;\n\t\t}\n\t\tpairwiseCombine();\n\t\treturn temp;\n\t}",
"public NodeBinaryTree deleteNode(NodeBinaryTree node, int value)\n {\n if(node == null)\n {\n return null;\n }\n\n if(value < node.data)\n {\n node.leftNode = deleteNode(node.leftNode, value);\n }\n else if(value > node.data)\n {\n node.rightNode = deleteNode(node.rightNode, value);\n }\n else\n {\n // it is the condition where the the ndoe value is itself\n if(node.leftNode == null)\n {\n return node.rightNode;\n }\n else if(node.rightNode == null)\n {\n return node.leftNode;\n }\n\n // we traverse right part of tree for minimum value\n node.data = minimumValueOfRight(node.rightNode);\n node.rightNode = deleteNode(node.rightNode, node.data);\n }\n return node;\n }",
"public void delete(int val){\n Node parent = this.root;\n Node current = this.root;\n boolean isLeftChild = false;\n \n while (current.val != val){\n parent = current;\n if (current.val > val){\n isLeftChild = true;\n current = current.left;\n } else {\n isLeftChild = false;\n current = current.right;\n }\n \n if (current == null){\n return;\n }\n }\n \n // If we are here it means we have found the node\n // Case 1. leaf node\n if (current.left == null && current.right == null){\n if (current == this.root){\n this.root = null;\n }\n \n if (isLeftChild){\n parent.left = null;\n } else {\n parent.right = null;\n }\n }\n \n // Case 2. one child\n else if (current.left == null){\n if (current == this.root){\n this.root = current.right;\n } else if (isLeftChild){\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n } else if (current.right == null){\n if (current == this.root){\n this.root = current.left;\n } else if (isLeftChild){\n parent.left = current.left;\n } else {\n parent.right = current.left;\n }\n }\n \n // Case 3. two children. successor is the smallest node in the right subtree\n else if (current.left != null && current.right != null){\n Node successor = getSuccessor(current);\n if (current == this.root){\n root = successor;\n } else if (isLeftChild){\n parent.left = successor;\n } else {\n parent.right = successor;\n }\n }\n \n }",
"public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}",
"private BSTNode<T> maximum(BSTNode node){\r\n\t\twhile(node.right != null) {\r\n\t\t\tnode = node.right;\r\n\t\t}\r\n\t\treturn node;\r\n\t}",
"public AnyType deleteMin() {\n if (isEmpty())\n throw new UnderflowException();\n\n AnyType minItem = root.element;\n root = merge(root.left, root.right);\n\n return minItem;\n }",
"@Test\n public void remove_BST_1_CaseLeafRight()\n {\n BinarySearchTree bst = new BinarySearchTree();\n No root = new No(6);\n No leaf = new No(9);\n \n bst.insert(null, root);\n //bst.printTree();\n \n bst.insert(root, new No(2));\n //bst.printTree();\n \n bst.insert(root, leaf);\n //bst.printTree();\n //System.err.println(); // Print[ERR] Devido a prioridade do buffer de impressao (out, err)\n \n assertEquals(leaf, bst.remove(leaf));\n assertEquals(new Integer(2), bst.size());\n //bst.printTree();\n }",
"public int Delete_Min()\n {\n \tthis.array[0]=this.array[this.getSize()-1];\n \tthis.size--; \n \tthis.array[0].setPos(0);\n \tint numOfCompares = heapifyDown(this, 0);\n \treturn numOfCompares;\n }",
"public Boolean DeleteAndMerge(Node node) {\n\t\tif (node.getLeftChild() == null) {\n\t\t\tDeleteAllChild(node);\n\t\t\treturn true;\n\t\t}\n\n\t\tif (node.getParent().getLeftChild() == node) {\n\t\t\t// Node tempNode=node.getLeftChild();\n\t\t\tint level = node.getLevel();\n\t\t\tNode pa = node.getParent();\n\t\t\tPreorderLevel(node.getLeftChild());\n\t\t\tnode.getParent().setLeftChild(node.getLeftChild());\n\t\t\tnode.getLeftChild().setParent(node.getParent());\n\t\t\tnode.getLeftChild().setLevel(node.getLevel());\n\t\t\tNode tempNode = node.getRightChild();\n\t\t\tnode = node.getLeftChild();\n\n\t\t\tfor (;;) {\n\t\t\t\tif (node.getRightChild() == null) {\n\t\t\t\t\tnode.setRightChild(tempNode);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tnode = node.getRightChild();\n\n\t\t\t\t\tnode.setLevel(level);\n\t\t\t\t\tnode.setParent(pa);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\tint level = node.getLevel();\n\t\t\tNode tNode = node.getParent().getLeftChild();\n\n\t\t\tfor (;;) {\n\t\t\t\tif (tNode.getRightChild() == node)\n\t\t\t\t\tbreak;\n\t\t\t\ttNode = tNode.getRightChild();\n\t\t\t}\n\t\t\ttNode.setRightChild(node.getLeftChild());\n\n\t\t\tNode parent = node.getParent();\n\t\t\tNode rNode = node.getRightChild();\n\t\t\tnode = node.getLeftChild();\n\t\t\tPreorderLevel(node);\n\t\t\tfor (;;) {\n\t\t\t\tif (node.getRightChild() == null)\n\t\t\t\t\tbreak;\n\t\t\t\telse {\n\t\t\t\t\tnode.setParent(parent);// 改变子结点的父结点\n\t\t\t\t\t// 修改结点层级\n\t\t\t\t\tif (node.getParent() == null) {\n\t\t\t\t\t\tnode.setLevel(0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnode.setLevel(level);\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.getRightChild();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tnode.setParent(parent);\n\t\t\tnode.setLevel(level);\n\t\t\tnode.setRightChild(rNode);\n\t\t\t// if (rNode.getParent() == null) {\n\t\t\t// rNode.setLevel(0);\n\t\t\t// } else {\n\t\t\t// rNode.setLevel(rNode.getParent().getLevel() + 1);\n\t\t\t// }\n\t\t}\n\n\t\treturn true;\n\n\t}",
"public void clear(){\n root = null;\n count = 0;\n }",
"public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n // base case: the key is not found in the tree\n if (root == null) {\n return null;\n }\n\n // if the key is less than the root node, recur for the left subtree\n if (key < root.data) {\n root.left = deleteNode(root.left, key);\n }\n\n // if the key is more than the root node, recur for the right subtree\n else if (key > root.data) {\n root.right = deleteNode(root.right, key);\n }\n\n // if the key is found\n else {\n // Case 1: node to be deleted has no children (it is a leaf node)\n if (root.left == null && root.right == null)\n {\n // deallocate the memory and update root to null\n root = null;\n }\n\n // Case 2: node to be deleted has two children\n else if (root.left != null && root.right != null)\n {\n // if the left child has less priority than the right child\n if (root.left.priority < root.right.priority)\n {\n // call `rotateLeft()` on the root\n root = rotateLeft(root);\n\n // recursively delete the left child\n root.left = deleteNode(root.left, key);\n }\n else {\n // call `rotateRight()` on the root\n root = rotateRight(root);\n\n // recursively delete the right child\n root.right = deleteNode(root.right, key);\n }\n }\n\n // Case 3: node to be deleted has only one child\n else {\n // choose a child node\n TreapNode child = (root.left != null)? root.left: root.right;\n root = child;\n }\n }\n\n return root;\n }",
"private void doubleDemoteLeft (WAVLNode z) {\n\t z.rank--;\r\n\t z.right.rank--;\r\n }",
"private T removeHelper(Node<T> current, T data) {\n\t\tT removedData = null;\n\t\t\n\t\tif (current != null) {\n\t\t\tif (current.getLeft() != null \n\t\t\t\t\t&& data.compareTo(current.getLeft().getData()) <= 0) {\n\t\t\t\tif (data.equals(current.getLeft().getData())) {\n\t\t\t\t\t// Found data is to the left of this one\n\t\t\t\t\tremovedData = current.getLeft().getData();\n\t\t\t\t\tsize--;\n\t\t\t\t\tif (current.getLeft().getLeft() != null \n\t\t\t\t\t\t\t&& current.getLeft().getRight() == null) {\n\t\t\t\t\t\t// Found data (left) has one child (left), promote it\n\t\t\t\t\t\tcurrent.setLeft(current.getLeft().getLeft());\n\t\t\t\t\t} else if (current.getLeft().getRight() != null \n\t\t\t\t\t\t\t&& current.getLeft().getLeft() == null) {\n\t\t\t\t\t\t// Found data (left) has one child (right), promote it\n\t\t\t\t\t\tcurrent.setLeft(current.getLeft().getRight());\n\t\t\t\t\t} else if (current.getLeft().getLeft() != null\n\t\t\t\t\t\t\t&& current.getLeft().getRight() != null) {\n\t\t\t\t\t\t// Found data (left) has two children\n\t\t\t\t\t\t// Use successor method (smallest on right subtree)\n\t\t\t\t\t\tNode<T> currentSuccessor = current.getLeft().getRight();\n\t\t\t\t\t\tif (currentSuccessor.getLeft() == null) {\n\t\t\t\t\t\t\tcurrent.getLeft().setData(currentSuccessor.getData());\n\t\t\t\t\t\t\tcurrent.getLeft().setRight(null);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twhile (currentSuccessor.getLeft().getLeft() != null) {\n\t\t\t\t\t\t\t\tcurrentSuccessor = currentSuccessor.getLeft();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcurrent.getLeft().setData(currentSuccessor.getLeft().getData());\n\t\t\t\t\t\t\tcurrent.getLeft().setRight(currentSuccessor.getRight());\n\t\t\t\t\t\t\tcurrentSuccessor.setLeft(null);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Found data (left) has no children, remove it\n\t\t\t\t\t\tcurrent.setLeft(null);\n\t\t\t\t\t} \n\t\t\t\t} else {\n\t\t\t\t\tremovedData = removeHelper(current.getLeft(), data);\n\t\t\t\t}\n\t\t\t} else if (current.getRight() != null \n\t\t\t\t\t\t&& data.compareTo(current.getRight().getData()) >= 0) {\n\t\t\t\t\tif (data.equals(current.getRight().getData())) {\n\t\t\t\t\t\t// Found data is to the right of this one\n\t\t\t\t\t\tremovedData = current.getRight().getData();\n\t\t\t\t\t\tsize--;\n\t\t\t\t\t\tif (current.getRight().getLeft() != null \n\t\t\t\t\t\t\t\t&& current.getRight().getRight() == null) {\n\t\t\t\t\t\t\t// Found data (right) has one child (left), promote it\n\t\t\t\t\t\t\tcurrent.setRight(current.getRight().getLeft());\n\t\t\t\t\t\t} else if (current.getRight().getRight() != null \n\t\t\t\t\t\t\t\t&& current.getRight().getLeft() == null) {\n\t\t\t\t\t\t\t// Found data (left) has one child (right), promote it\n\t\t\t\t\t\t\tcurrent.setRight(current.getRight().getRight());\n\t\t\t\t\t\t} else if (current.getRight().getLeft() != null\n\t\t\t\t\t\t\t\t&& current.getRight().getRight() != null) {\n\t\t\t\t\t\t\t// Found data (right) has two children\n\t\t\t\t\t\t\t// Use successor method (smallest on right subtree)\n\t\t\t\t\t\t\tNode<T> currentSuccessor = current.getLeft().getRight();\n\t\t\t\t\t\t\tif (currentSuccessor.getLeft() == null) {\n\t\t\t\t\t\t\t\tcurrent.getRight().setData(currentSuccessor.getData());\n\t\t\t\t\t\t\t\tcurrent.getRight().setRight(null);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twhile (currentSuccessor.getRight().getLeft() != null) {\n\t\t\t\t\t\t\t\t\tcurrentSuccessor = currentSuccessor.getLeft();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcurrent.getRight().setData(currentSuccessor.getLeft().getData());\n\t\t\t\t\t\t\t\tcurrent.getRight().setRight(currentSuccessor.getRight());\n\t\t\t\t\t\t\t\tcurrentSuccessor.setLeft(null);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Found data (right) has no children, remove it\n\t\t\t\t\t\t\tcurrent.setRight(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tremovedData = removeHelper(current.getRight(), data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\treturn removedData;\n\t}",
"public void delete(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null && currentNode.getKey() != key){\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (currentNode == null){\n\t\t\tSystem.out.println(\"No such key is found in the tree\");\n\t\t\treturn;\n\t\t}\n\t\tif (currentNode.getLeft() == null && currentNode.getRight() == null){\n\t\t\t//Leaf Node\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(null);\n\t\t\t}else{\n\t\t\t\tparent.setLeft(null);\n\t\t\t}\n\t\t}else if (currentNode.getLeft() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getRight());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getRight());\n\t\t\t}\n\t\t}else if(currentNode.getRight() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getLeft());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getLeft());\n\t\t\t}\n\t\t}else{\n\t\t\t// this is case where this node has two children\n\t\t\tBSTNode node = currentNode.getLeft();\n\t\t\tBSTNode parentTemp = currentNode;\n\t\t\twhile (node.getRight() != null){\n\t\t\t\tparentTemp = node;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t\t// switch the value with the target node we are deleting.\n\t\t\tcurrentNode.setKey(node.getKey());\n\t\t\t// remove this node but don't forget about its left tree\n\t\t\tparentTemp.setRight(node.getLeft());\n\t\t}\n\t}",
"public T deleteMax()\n\t{\n\t\tint maxIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tif(size == 1)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\t\t}\n\t\tif(size == 2)\n\t\t{\n\n\t\t\tT wemp = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn wemp;\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT femp ;\n\t\t\tif(object.compare(array[1], array[2]) >0)\n\t\t\t{\n\t\t\t\tfemp = array[1];\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t\tsize--;\n\t\t\t\treturn femp;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfemp = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t\tsize--;\n\t\t\t\treturn femp;\n\t\t\t}\n\n\t\t}\n\t\tint index = 0;\n\t\tif(object.compare(array[1], array[2]) >= 0)\n\t\t{\n\t\t\tindex = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tindex = 2;\n\t\t}\n\n\t\tT temp = array[index];\n\t\tarray[index] = array[size -1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\n\t\tint max = max(index).get(0);\n\t\twhile(max != 0)\n\t\t{\n\t\t\tif(object.compare(array[index], array[max]) >= 0)\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif( max(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t\t\n\t\t\t}\n\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[max];\n\t\t\tarray[max] = lemp;\n\n\n\t\t\tindex = max;\n\t\t\tmax = max(max).get(0);\n\t\t}\n\n\t\tif(flag == true)\n\t\t{\n\n\t\t}\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\t\t\tif(getLevel(index+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMax(2*index+1, 2*index+2)]) < 0 && grandChildMax(2*index+1, 2*index+2) != 0)\n\t\t{\n\t\t\tmaxIndex = grandChildMax(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[maxIndex];\n\t\t\tarray[maxIndex] = wemp;\n\t\t\tint y = maxIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if(object.compare(array[index], array[(index-1)/2]) < 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\n\t\t\n\t\treturn temp;\n\t}",
"private void RemoveRootNode() {\n\t\t\n\t\troot_map.remove(this);\n\t\tis_node_set = false;\n\t\tif(left_ptr == null && right_ptr == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tleft_ptr.RemoveRootNode();\n\t\tright_ptr.RemoveRootNode();\n\t}",
"private void doubleRotateRightDel (WAVLNode z) {\n\t WAVLNode a = z.left.right;\r\n\t WAVLNode y = z.left;\r\n\t WAVLNode c = z.left.right.right;\r\n\t WAVLNode d = z.left.right.left;\r\n\t if(z.parent!=null) {\r\n\t\t if(parentside(z.parent, z).equals(\"left\")) {\r\n\t\t\t z.parent.left=a;\r\n\r\n\t }\r\n\t else {\r\n\t\t\t z.parent.right=a;\r\n\r\n\t }\r\n\t\t \r\n\t }\r\n\t else {\r\n\t\t this.root=a;\r\n\t }\r\n\t a.right=z;\r\n\t a.left=y;\r\n\t a.rank=a.rank+2;\r\n\t a.parent=z.parent;\r\n\t y.parent=a;\r\n\t y.right=d;\r\n\t y.rank--;\r\n\t z.parent=a;\r\n\t z.left=c;\r\n\t z.rank=z.rank-2;\r\n\r\n\t c.parent=z;\r\n\t d.parent=y;\r\n\t z.sizen=z.right.sizen+z.left.sizen+1;\r\n\t y.sizen=y.right.sizen+y.left.sizen+1;\r\n\t a.sizen=a.right.sizen+a.left.sizen+1;\r\n }",
"private Node<T> delete(Node<T> node,Comparable<T> item) {\r\n if (node == null) { // this is the base case\r\n return null;\r\n }\r\n if (node.data.compareTo((T) item) < 0) {\r\n node.right = delete(node.right, item);\r\n return node;\r\n }\r\n else if (node.data.compareTo((T) item) > 0) {\r\n node.left = delete(node.left, item);\r\n return node;\r\n }\r\n else { // the item == node.data\r\n if (node.left == null) { // no left child\r\n return node.right;\r\n }\r\n else if (node.right == null) { // no right child\r\n return node.left;\r\n }\r\n else { // 2 children: find in-order successor\r\n if (node.right.left == null) { // if right child does not have a left child of its own\r\n node.data = node.right.data;\r\n node.right = node.right.right;\r\n }\r\n else {\r\n node.data = (Comparable<T>) removeSmallest(node.right); // if the right child has two children, or has a left subtree\r\n }\r\n return node;\r\n }\r\n }\r\n }"
] | [
"0.72595483",
"0.72595483",
"0.72487676",
"0.71404696",
"0.70800745",
"0.69743",
"0.69306046",
"0.67563736",
"0.6736496",
"0.67073554",
"0.670721",
"0.6683074",
"0.65995765",
"0.6577194",
"0.6470782",
"0.64627653",
"0.6459971",
"0.64292884",
"0.64249176",
"0.6395016",
"0.6393545",
"0.63664025",
"0.6358382",
"0.63479906",
"0.63479906",
"0.6346113",
"0.62950575",
"0.6213178",
"0.62024236",
"0.6197771",
"0.61974347",
"0.6186499",
"0.6153401",
"0.6135345",
"0.6118078",
"0.61046374",
"0.60964483",
"0.6094975",
"0.6063782",
"0.60580665",
"0.6050412",
"0.60452366",
"0.60255545",
"0.59995675",
"0.5990639",
"0.59894514",
"0.5983695",
"0.5979712",
"0.59759784",
"0.59755796",
"0.5967229",
"0.59638953",
"0.59571016",
"0.5932428",
"0.59272534",
"0.59129053",
"0.5908622",
"0.5887037",
"0.5879391",
"0.5878499",
"0.58705103",
"0.5868239",
"0.58678675",
"0.5863054",
"0.586102",
"0.5861007",
"0.58581847",
"0.58567125",
"0.5851811",
"0.5848528",
"0.5846073",
"0.5835742",
"0.58300626",
"0.5822053",
"0.5816904",
"0.58138674",
"0.58094037",
"0.5800797",
"0.57984275",
"0.57977235",
"0.5783718",
"0.577673",
"0.5760368",
"0.5753634",
"0.57512784",
"0.57507664",
"0.57443166",
"0.57441455",
"0.5741602",
"0.57403916",
"0.5736943",
"0.573302",
"0.57327074",
"0.5731849",
"0.57310545",
"0.5730427",
"0.572476",
"0.5721508",
"0.5719911",
"0.5713301"
] | 0.62211543 | 27 |
Hibbard Deletion: To delete a node with key k, search for node t containing key k. Case 0: 0 children > Delete t by setting the parent link to null. Case 1: 1 children > Delete t by replacing the parent link like in deleteMin & deleteMax Case 2L 2 children > Find successor x of t. (x has no left child) Delete the minimum in t's right subtree. (But dont garbage collect x) Put x in t's spot (Still a BST) | public void delete(Key key)
{
root=delete(root,key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Node deleteNode(Node root, int key) \n {\n if (root == null) \n return root; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < root.key) \n root.left = deleteNode(root.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n root.right = deleteNode(root.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n // node with only one child or no child \n if ((root.left == null) || (root.right == null)) \n { \n Node temp = null; \n if (temp == root.left) \n temp = root.right; \n else\n temp = root.left; \n \n // No child case \n if (temp == null) \n { \n temp = root; \n root = null; \n } \n else // One child case \n root = temp; // Copy the contents of \n // the non-empty child \n } \n else\n { \n \n // node with two children: Get the inorder \n // successor (smallest in the right subtree) \n Node temp = minValueNode(root.right); \n \n // Copy the inorder successor's data to this node \n root.key = temp.key; \n \n // Delete the inorder successor \n root.right = deleteNode(root.right, temp.key); \n } \n } \n \n // If the tree had only one node then return \n if (root == null) \n return root; \n \n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE \n root.height = max(height(root.left), height(root.right)) + 1; \n \n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether \n // this node became unbalanced) \n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n \n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n \n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n \n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n \n return root; \n }",
"private AvlNode deleteNode(AvlNode root, int value) {\n\r\n if (root == null)\r\n return root;\r\n\r\n // If the value to be deleted is smaller than the root's value,\r\n // then it lies in left subtree\r\n if ( value < root.key )\r\n root.left = deleteNode(root.left, value);\r\n\r\n // If the value to be deleted is greater than the root's value,\r\n // then it lies in right subtree\r\n else if( value > root.key )\r\n root.right = deleteNode(root.right, value);\r\n\r\n // if value is same as root's value, then This is the node\r\n // to be deleted\r\n else {\r\n // node with only one child or no child\r\n if( (root.left == null) || (root.right == null) ) {\r\n\r\n AvlNode temp;\r\n if (root.left != null)\r\n temp = root.left;\r\n else\r\n temp = root.right;\r\n\r\n // No child case\r\n if(temp == null) {\r\n temp = root;\r\n root = null;\r\n }\r\n else // One child case\r\n root = temp; // Copy the contents of the non-empty child\r\n\r\n temp = null;\r\n }\r\n else {\r\n // node with two children: Get the inorder successor (smallest\r\n // in the right subtree)\r\n AvlNode temp = minValueNode(root.right);\r\n\r\n // Copy the inorder successor's data to this node\r\n root.key = temp.key;\r\n\r\n // Delete the inorder successor\r\n root.right = deleteNode(root.right, temp.key);\r\n }\r\n }\r\n\r\n // If the tree had only one node then return\r\n if (root == null)\r\n return root;\r\n\r\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\r\n root.height = Math.max(height(root.left), height(root.right)) + 1;\r\n\r\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\r\n // this node became unbalanced)\r\n int balance = balance(root).key;\r\n\r\n // If this node becomes unbalanced, then there are 4 cases\r\n\r\n // Left Left Case\r\n if (balance > 1 && balance(root.left).key >= 0)\r\n return doRightRotation(root);\r\n\r\n // Left Right Case\r\n if (balance > 1 && balance(root.left).key < 0) {\r\n root.left = doLeftRotation(root.left);\r\n return doRightRotation(root);\r\n }\r\n\r\n // Right Right Case\r\n if (balance < -1 && balance(root.right).key <= 0)\r\n return doLeftRotation(root);\r\n\r\n // Right Left Case\r\n if (balance < -1 && balance(root.right).key > 0) {\r\n root.right = doRightRotation(root.right);\r\n return doLeftRotation(root);\r\n }\r\n\r\n return root;\r\n }",
"public int delete(int k)\r\n\t{\r\n\t\tIAVLNode node = searchFor(this.root, k);\r\n\t\tIAVLNode parent;\r\n\t\tif(node==root)\r\n\t\t\tparent=new AVLNode(null);\r\n\t\telse\r\n\t\t\tparent=node.getParent();\r\n\t\t\r\n\t\tIAVLNode startHieghtUpdate = parent; // this will be the node from which we'll start updating the nodes' hieghts\r\n\t\t\r\n\t\tif (!node.isRealNode())\r\n\t\t\treturn -1;\r\n\t\t\r\n\t\t//updating the maximum and minimum fields\r\n\t\tif (node == this.maximum)\r\n\t\t\tthis.maximum = findPredecessor(node);\r\n\t\telse\r\n\t\t\tif (node == this.minimum)\r\n\t\t\t\tthis.minimum = findSuccessor(node); \r\n\t\t\r\n\t\t//if the node we wish to delete is a leaf\r\n\t\tif (!node.getLeft().isRealNode()&&!node.getRight().isRealNode())\r\n\t\t{\r\n\t\t\tif (node == parent.getLeft())\r\n\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\telse\r\n\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\tnode.getRight().setParent(parent);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t //if the node we wish to delete is unary:\r\n\t\t\tif (node.getLeft().isRealNode()&&!node.getRight().isRealNode()) //only left child\r\n\t\t\t{\r\n\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\tparent.setLeft(node.getLeft());\r\n\t\t\t\telse\r\n\t\t\t\t\tparent.setRight(node.getLeft());\r\n\t\t\t\tnode.getLeft().setParent(parent);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tif (node.getRight().isRealNode()&&!node.getLeft().isRealNode()) //only right child\r\n\t\t\t\t\t{\r\n\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\tparent.setLeft(node.getRight());\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tparent.setRight(node.getRight());\r\n\t\t\t\t\tnode.getRight().setParent(parent);\r\n\t\t\t\t\t}\r\n\t\t\t\t//if the node we wish to delete is a father of two\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t\tIAVLNode suc = findSuccessor(node);\r\n\t\t\t\t\t\tIAVLNode sucsParent = suc.getParent();\r\n\t\t\t\t\t\t//deleting the successor of the node we wish to delete\r\n\t\t\t\t\t\tif (suc == sucsParent.getLeft())\r\n\t\t\t\t\t\t\tsucsParent.setLeft(suc.getRight());\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tsucsParent.setRight(suc.getRight());\r\n\t\t\t\t\t\tsuc.getRight().setParent(sucsParent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//inserting the successor in it's new place (the previous place of the node we deleted)\r\n\t\t\t\t\t\tif (node == parent.getLeft())\r\n\t\t\t\t\t\t\tparent.setLeft(suc);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tparent.setRight(suc);\r\n\t\t\t\t\t\tsuc.setParent(parent);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// node's children are now his scuccessor's children\r\n\t\t\t\t\t\tsuc.setRight(node.getRight());\r\n\t\t\t\t\t\tsuc.setLeft(node.getLeft());\r\n\t\t\t\t\t\tsuc.getRight().setParent(suc);\r\n\t\t\t\t\t\tsuc.getLeft().setParent(suc);\r\n\t\t\t\t\t\t//now we check if the successor of the node we wanted to delete was his son\r\n\t\t\t\t\t\tif (node != sucsParent) // the successor's parent was the deleted node (which is no longer part of the tree)\r\n\t\t\t\t\t\t\tstartHieghtUpdate = sucsParent;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tstartHieghtUpdate = suc;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//if we wish to delete the tree's root, then we need to update the tree's root to a new node\r\n\t\tif (node == this.root) \r\n\t\t{\r\n\t\t\tthis.root = parent.getRight();\r\n\t\t\tthis.root.setParent(null);\r\n\t\t}\r\n\t\t\r\n\t\tint moneRot = HieghtsUpdating(startHieghtUpdate);\r\n\t\treturn moneRot;\r\n\t}",
"public void delete(K key)\r\n\t{\r\n\t\tif(search(key) == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == null) \r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tBSTNode<E,K> node = root;\r\n\t\tBSTNode<E,K> child = null;\r\n\t\tBSTNode<E,K> parent1 = null;\r\n\t\tBSTNode<E,K> parent2 = null;;\r\n\t\tboolean Left = true;\r\n\t\tboolean Left2 = false;\r\n\t\tboolean found = false;\r\n\t\t\r\n\t\twhile(!found)\r\n\t\t{\r\n\t\t\tif(node.getKey().compareTo(key) == 0)\r\n\t\t\t{\r\n\t\t\t\tfound = true;\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey())<=-1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getLeft() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getLeft();\r\n\t\t\t\t\tLeft = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if(key.compareTo(node.getKey()) >= 1)\r\n\t\t\t{\r\n\t\t\t\tif(node.getRight() != null)\r\n\t\t\t\t{\r\n\t\t\t\t\tparent1 = node;\r\n\t\t\t\t\tnode = node.getRight();\r\n\t\t\t\t\tLeft = false;\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(node.getLeft() != null && node.getRight() != null)\r\n\t\t{\r\n\t\t\tchild = node.getRight();\r\n\t\t\tparent2 = node;\r\n\t\t\twhile(child.getLeft() != null)\r\n\t\t\t{\r\n\t\t\t\tparent2 = child;\r\n\t\t\t\tchild = child.getLeft();\r\n\t\t\t\tLeft2 = true;\r\n\t\t\t}\r\n\t\t\tif(Left2)\r\n\t\t\t{\r\n\t\t\t\tparent2.setLeft(child.getLeft());\t\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tparent2.setRight(child.getLeft());\r\n\t\t\t}\r\n\t\t\tchild.setLeft(node.getLeft());\r\n\t\t\tchild.setRight(node.getRight());\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() != null)\r\n\t\t{\r\n\t\t child = node.getRight();\r\n\t\t}\r\n\t\telse if(node.getLeft() != null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tchild = node.getLeft();\r\n\t\t}\r\n\t\telse if(node.getLeft() == null && node.getRight() == null)\r\n\t\t{\r\n\t\t\tif(Left)\r\n\t\t\t{\r\n\t\t\t\tparent1.setLeft(null);\r\n\t\t\t} \r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tparent1.setRight(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(root == node)\r\n\t\t{\r\n\t\t\troot = child;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tif(Left) \r\n\t\t{\r\n\t\t\tparent1.setLeft(child);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tparent1.setRight(child);\r\n\t\t}\r\n\t}",
"private BSTNode<K> deleteNode(BSTNode<K> currentNode, K key) throws IllegalArgumentException{ \n // if key is null, throw an IllegalArgumentException\n if (key == null) {\n throw new IllegalArgumentException(\"Please input a valid key\");\n }\n // if currentNode is null, return null\n if (currentNode == null) \n return currentNode; \n // otherwise, keep searching through the tree until meet the node with value key\n switch(key.compareTo(currentNode.getId())){\n case -1:\n currentNode.setLeftChild(deleteNode(currentNode.getLeftChild(), key));\n break;\n case 1:\n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), key));\n break;\n case 0:\n // build a temporary node when finding the node that need to be deleted\n BSTNode<K> tempNode = null;\n // when the node doesn't have two childNodes\n // has one childNode: currentNode = tempNode = a childNode\n // has no childNode: currentNode = null, tempNode = currentNode\n if ((currentNode.getLeftChild() == null) || (currentNode.getRightChild() == null)) {\n if (currentNode.getLeftChild() == null) \n tempNode = currentNode.getRightChild(); \n else \n tempNode = currentNode.getLeftChild(); \n \n if (tempNode == null) {\n //tempNode = currentNode; \n currentNode = null; \n }\n else\n currentNode = tempNode;\n }\n // when the node has two childNodes, \n // use in-order way to find the minimum node in its subrighttree, called rightMinNode\n // set tempNode = rightMinNode, and currentNode's ID = tempNode.ID\n // do recursion to update the subrighttree with currentNode's rightChild and tempNode's Id\n else {\n BSTNode<K> rightMinNode = currentNode.getRightChild();\n while (rightMinNode.getLeftChild() != null)\n rightMinNode = rightMinNode.getLeftChild();\n \n tempNode = rightMinNode;\n currentNode.setId(tempNode.getId());\n \n currentNode.setRightChild(deleteNode(currentNode.getRightChild(), tempNode.getId()));\n }\n }\n // since currentNode == null means currentNode has no childNode, return null to its ancestor\n if (currentNode == null) \n return currentNode; \n // since currentNode != null, we have to update its balance\n int balanceValue = getNodeBalance(currentNode);\n if (balanceValue < -1) { // balanceValue < -1 means sublefttree is longer than subrighttree\n if (getNodeBalance(currentNode.getLeftChild()) < 0) { // Left Left Case \n return rotateRight(currentNode);\n }\n else if (getNodeBalance(currentNode.getLeftChild()) >= 0) { // Left Right Case \n currentNode.setLeftChild(rotateLeft(currentNode.getLeftChild()));\n return rotateRight(currentNode);\n }\n }\n else if (balanceValue > 1) { // balanceValue < -1 means subrighttree is longer than sublefttree\n if ((getNodeBalance(currentNode.getRightChild()) > 0)) { // Right Right Case \n return rotateLeft(currentNode);\n }\n else if ((getNodeBalance(currentNode.getRightChild()) <= 0)) {// Right Left Case \n currentNode.setRightChild(rotateRight(currentNode.getRightChild()));\n return rotateLeft(currentNode);\n }\n }\n return currentNode;\n }",
"static Node deleteNode(Node root, int k) {\n\n // Base case\n if (root == null)\n return root;\n\n // Recursive calls for ancestors of\n // node to be deleted\n if (root.key > k) {\n root.left = deleteNode(root.left, k);\n return root;\n } else if (root.key < k) {\n root.right = deleteNode(root.right, k);\n return root;\n }\n\n // We reach here when root is the node\n // to be deleted.\n\n // If one of the children is empty\n if (root.left == null) {\n Node temp = root.right;\n return temp;\n } else if (root.right == null) {\n Node temp = root.left;\n return temp;\n }\n\n // If both children exist\n else {\n Node succParent = root;\n\n // Find successor\n Node succ = root.right;\n\n while (succ.left != null) {\n succParent = succ;\n succ = succ.left;\n }\n\n // Delete successor. Since successor\n // is always left child of its parent\n // we can safely make successor's right\n // right child as left of its parent.\n // If there is no succ, then assign\n // succ->right to succParent->right\n if (succParent != root)\n succParent.left = succ.right;\n else\n succParent.right = succ.right;\n\n // Copy Successor Data to root\n root.key = succ.key;\n\n return root;\n }\n }",
"Node deleteNode(Node root, int key) {\n if (root == null) {\n return root;\n }\n\n // If the key to be deleted is smaller than the root's key,\n // then it lies in left subtree\n if (key < root.key) {\n root.left = deleteNode(root.left, key);\n }\n\n // If the key to be deleted is greater than the root's key,\n // then it lies in right subtree\n else if (key > root.key) {\n root.right = deleteNode(root.right, key);\n }\n\n // if key is same as root's key, then this is the node\n // to be deleted\n else {\n\n // node with only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // No child case\n if (temp == null) {\n temp = root;\n root = null;\n } else // One child case\n {\n root = temp; // Copy the contents of the non-empty child\n }\n } else {\n\n // node with two children: Get the inorder successor (smallest\n // in the right subtree)\n Node temp = minValueNode(root.right);\n\n // Copy the inorder successor's data to this node\n root.key = temp.key;\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, temp.key);\n }\n }\n\n // If the tree had only one node then return\n if (root == null) {\n return root;\n }\n\n // STEP 2: UPDATE HEIGHT OF THE CURRENT NODE\n root.height = max(height(root.left), height(root.right)) + 1;\n // STEP 3: GET THE BALANCE FACTOR OF THIS NODE (to check whether\n // this node became unbalanced)\n int balance = getBalance(root);\n\n // If this node becomes unbalanced, then there are 4 cases\n // Left Left Case\n if (balance > 1 && getBalance(root.left) >= 0) {\n return rightRotate(root);\n }\n\n // Left Right Case\n if (balance > 1 && getBalance(root.left) < 0) {\n root.left = leftRotate(root.left);\n return rightRotate(root);\n }\n\n // Right Right Case\n if (balance < -1 && getBalance(root.right) <= 0) {\n return leftRotate(root);\n }\n\n // Right Left Case\n if (balance < -1 && getBalance(root.right) > 0) {\n root.right = rightRotate(root.right);\n return leftRotate(root);\n }\n\n return root;\n }",
"public Node deleteNode(Node root, int key) {\n if (root == null)\n return root;\n\n /* Otherwise, recur down the tree */\n if (key < root.data)\n root.left = deleteNode(root.left, key);\n else if (key > root.data)\n root.right = deleteNode(root.right, key);\n\n // if key is same as root's\n // key, then This is the\n // node to be deleted\n else {\n // node with only one child or no child\n if (root.left == null)\n return root.right;\n else if (root.right == null)\n return root.left;\n\n // node with two children: Get the inorder\n // successor (smallest in the right subtree)\n root.data = minValue(root.right);\n\n // Delete the inorder successor\n root.right = deleteNode(root.right, root.data);\n }\n\n return root;\n }",
"private BSTnode<K> actualDelete(BSTnode<K> n, K key) {\n\t\tif (n == null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (key.equals(n.getKey())) {\n\t\t\t// n is the node to be removed\n\t\t\tif (n.getLeft() == null && n.getRight() == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (n.getLeft() == null) {\n\t\t\t\treturn n.getRight();\n\t\t\t}\n\t\t\tif (n.getRight() == null) {\n\t\t\t\treturn n.getLeft();\n\t\t\t}\n\n\t\t\t// if we get here, then n has 2 children\n\t\t\tK smallVal = smallest(n.getRight());\n\t\t\tn.setKey(smallVal);\n\t\t\tn.setRight(actualDelete(n.getRight(), smallVal));\n\t\t\treturn n;\n\t\t}\n\n\t\telse if (key.compareTo(n.getKey()) < 0) {\n\t\t\tn.setLeft(actualDelete(n.getLeft(), key));\n\t\t\treturn n;\n\t\t}\n\n\t\telse {\n\t\t\tn.setRight(actualDelete(n.getRight(), key));\n\t\t\treturn n;\n\t\t}\n\t}",
"public void delete(int key){\n\t\tBSTNode currentNode = root;\n\t\tBSTNode parent = null;\n\t\twhile (currentNode != null && currentNode.getKey() != key){\n\t\t\tparent = currentNode;\n\t\t\tif (key < currentNode.getKey()){\n\t\t\t\tcurrentNode = currentNode.getLeft();\n\t\t\t}else{\n\t\t\t\tcurrentNode = currentNode.getRight();\n\t\t\t}\n\t\t}\n\t\tif (currentNode == null){\n\t\t\tSystem.out.println(\"No such key is found in the tree\");\n\t\t\treturn;\n\t\t}\n\t\tif (currentNode.getLeft() == null && currentNode.getRight() == null){\n\t\t\t//Leaf Node\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(null);\n\t\t\t}else{\n\t\t\t\tparent.setLeft(null);\n\t\t\t}\n\t\t}else if (currentNode.getLeft() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getRight());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getRight());\n\t\t\t}\n\t\t}else if(currentNode.getRight() == null){\n\t\t\tif (currentNode.getKey() > parent.getKey()){\n\t\t\t\tparent.setRight(currentNode.getLeft());\n\t\t\t}else{\n\t\t\t\tparent.setLeft(currentNode.getLeft());\n\t\t\t}\n\t\t}else{\n\t\t\t// this is case where this node has two children\n\t\t\tBSTNode node = currentNode.getLeft();\n\t\t\tBSTNode parentTemp = currentNode;\n\t\t\twhile (node.getRight() != null){\n\t\t\t\tparentTemp = node;\n\t\t\t\tnode = node.getRight();\n\t\t\t}\n\t\t\t// switch the value with the target node we are deleting.\n\t\t\tcurrentNode.setKey(node.getKey());\n\t\t\t// remove this node but don't forget about its left tree\n\t\t\tparentTemp.setRight(node.getLeft());\n\t\t}\n\t}",
"private Node delete(Node h, int key) {\n if (key - h.key < 0) {\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n h.left = delete(h.left, key);\n } else {\n if (isRed(h.left))\n h = rotateRight(h);\n if (key - h.key == 0 && (h.right == null))\n return null;\n if (!isRed(h.right) && !isRed(h.right.left))\n h = moveRedRight(h);\n if (key - h.key == 0) {\n Node x = min(h.right);\n h.key = x.key;\n h.val = x.val;\n h.right = deleteMin(h.right);\n } else\n h.right = delete(h.right, key);\n }\n return balance(h);\n }",
"public static void delete(Node node){\n // There should be 7 cases here\n if (node == null) return;\n\n if (node.left == null && node.right == null) { // sub-tree is empty case\n if (node.key < node.parent.key) { // node น้อยกว่าข้างบน\n node.parent.left = null;\n }\n else {\n node.parent.right = null;\n }\n\n return;\n }\n\n else if (node.left != null && node.right == null) { // right sub-tree is empty case\n if (node.left.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.left.parent = node.parent;\n node.parent.left = node.left;\n }\n else {\n node.left.parent = node.parent;\n node.parent.right = node.left;\n }\n return;\n }\n else if (node.right != null && node.left == null) { // left sub-tree is empty case\n if (node.right.key < node.parent.key) { // sub-tree อยู่ทางซ้ายของ parent\n node.right.parent = node.parent;\n node.parent.left = node.right;\n }\n else {\n node.right.parent = node.parent;\n node.parent.right = node.right;\n }\n return;\n }\n else { // full node case\n // หา min ของ right-subtree เอา key มาเขียนทับ key ของ node เลย\n Node n = findMin(node.right);\n node.key = n.key;\n delete(n);\n }\n }",
"private Node<Value> delete(Node<Value> x, String key, int d)\r\n {\r\n if (x == null) return null;\r\n char c = key.charAt(d);\r\n if (c > x.c) x.right = delete(x.right, key, d);\r\n else if (c < x.c) x.left = delete(x.left, key, d);\r\n else if (d < key.length()-1) x.mid = delete(x.mid, key, d+1);\r\n else if (x.val != null) { x.val = null; --N; }\r\n if (x.mid == null && x.val == null)\r\n {\r\n if (x.left == null) return x.right;\r\n if (x.right == null) return x.left;\r\n Node<Value> t;\r\n if (StdRandom.bernoulli()) // to keep balance\r\n { t = min(x.right); x.right = delMin(x.right); }\r\n else\r\n { t = max(x.left); x.left = delMax(x.left); }\r\n t.right = x.right;\r\n t.left = x.left;\r\n return t;\r\n }\r\n return x;\r\n }",
"public Tree<K, V> delete(K key) {\n\t\tif (key.compareTo(this.key) == 0) {\n\t\t\ttry {\n\t\t\t\tthis.key = left.max();\n\t\t\t\tthis.value = left.lookup(left.max());\n\t\t\t\tleft = left.delete(this.key); \n\t\t\t} catch (EmptyTreeException e) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.key = right.min();\n\t\t\t\t\tthis.value = right.lookup(right.min());\n\t\t\t\t\tright = right.delete(this.key);\n\t\t\t\t} catch (EmptyTreeException f) {\n\t\t\t\t\treturn EmptyTree.getInstance();\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key.compareTo(this.key) < 0) {\n\t\t\tleft = left.delete(key);\n\t\t} else {\n\t\t\tright = right.delete(key);\n\t\t}\n\t\treturn this;\n\t}",
"static Node deleteBst(Node tmp,int v)\n { // if the tree is empty nothing to delete\n \n if(tmp==null)\n {\n System.out.println(\"Tree is empty\");\n return null;\n }\n // otherwise it will find out the node needs to be deleted\n \n if(tmp.val<v)\n tmp.right=deleteBst(tmp.right,v);\n else if(tmp.val>v)\n tmp.left=deleteBst(tmp.left,v);\n \n else {\n //deleting leaf node\n \n if(tmp.left==null && tmp.right==null)\n {tmp=null;\n return tmp;\n }\n // the target node has only one child\n \n else if(tmp.left!=null && tmp.right==null)\n return tmp.left;\n else if(tmp.left==null && tmp.right!=null)\n return tmp.right;\n \n else //the target node has two children replace the node value with it's predecessor //and then delete the predessor node\n {\n tmp.val=findpredecessor(tmp.left);\n tmp.left=deleteBst(tmp.left,tmp.val);\n }\n }\n return tmp;\n \n }",
"public boolean delete(Integer key){\n\n TreeNode parent=null;\n TreeNode curr=root;\n\n while (curr!=null && (Integer.compare(key,curr.data)!=0)){\n parent=curr;\n curr=Integer.compare(key,curr.data)>0?curr.right:curr.left;\n }\n\n if(curr==null){ // node does not exist\n\n return false;\n }\n\n TreeNode keyNode=curr;\n\n if(keyNode.right!=null){ //has right subtree\n\n // Find the minimum of Right Subtree\n\n TreeNode rKeyNode=keyNode.right;\n TreeNode rParent=keyNode;\n\n while (rKeyNode.left!=null){\n rParent=rKeyNode;\n rKeyNode=rKeyNode.left;\n }\n\n keyNode.data=rKeyNode.data;\n\n // Move Links to erase data\n\n if(rParent.left==rKeyNode){\n\n rParent.left=rKeyNode.right;\n }else{\n\n rParent.right=rKeyNode.right;\n }\n rKeyNode.right=null;\n\n }else{ // has only left subtree\n\n if(root==keyNode){ // if node to be deleted is root\n\n root=keyNode.left; // making new root\n keyNode.left=null; // unlinking initial root's left pointer\n }\n else{\n\n if(parent.left==keyNode){ // if nodes to be deleted is a left child of it's parent\n\n parent.left=keyNode.left;\n }else{ // // if nodes to be deleted is a right child of it's parent\n\n parent.right=keyNode.left;\n }\n\n }\n\n }\n return true;\n }",
"public Node deleteBST(Node root, int key) {\n if (root == null) {\n return root;\n }\n if (key < root.key) {\n root.left = deleteBST(root.left, key);\n } else if (key > root.key) {\n root.right = deleteBST(root.right, key);\n } // deletes the target key node\n else {\n // condition if node has only one child or no child\n if ((root.left == null) || (root.right == null)) {\n Node temp = null;\n if (temp == root.left) {\n temp = root.right;\n } else {\n temp = root.left;\n }\n\n // Condition if there's no child\n if (temp == null) {\n temp = root;\n root = null;\n // else if there's one child\n } else\n {\n root = temp;\n }\n } else {\n // Gets the Inorder traversal inlined with the node w/ two children\n Node temp = minNode(root.right);\n // Stores the inorder successor's node to this node\n root.key = temp.key;\n // Delete the inorder successor\n root.right = deleteBST(root.right, temp.key);\n }\n }\n // Condition if there's only one child then returns the root\n if (root == null) {\n return root;\n }\n // Gets the updated height of the BST\n root.height = maxInt(heightBST(root.left), heightBST(root.right)) + 1;\n int balance = getBalance(root); \n \n // If this node becomes unbalanced, then there are 4 cases \n // Left Left Case \n if (balance > 1 && getBalance(root.left) >= 0) \n return rightRotate(root); \n\n // Left Right Case \n if (balance > 1 && getBalance(root.left) < 0) \n { \n root.left = leftRotate(root.left); \n return rightRotate(root); \n } \n\n // Right Right Case \n if (balance < -1 && getBalance(root.right) <= 0) \n return leftRotate(root); \n\n // Right Left Case \n if (balance < -1 && getBalance(root.right) > 0) \n { \n root.right = rightRotate(root.right); \n return leftRotate(root); \n } \n return root;\n\n }",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n // base case: the key is not found in the tree\n if (root == null) {\n return null;\n }\n\n // if the key is less than the root node, recur for the left subtree\n if (key < root.data) {\n root.left = deleteNode(root.left, key);\n }\n\n // if the key is more than the root node, recur for the right subtree\n else if (key > root.data) {\n root.right = deleteNode(root.right, key);\n }\n\n // if the key is found\n else {\n // Case 1: node to be deleted has no children (it is a leaf node)\n if (root.left == null && root.right == null)\n {\n // deallocate the memory and update root to null\n root = null;\n }\n\n // Case 2: node to be deleted has two children\n else if (root.left != null && root.right != null)\n {\n // if the left child has less priority than the right child\n if (root.left.priority < root.right.priority)\n {\n // call `rotateLeft()` on the root\n root = rotateLeft(root);\n\n // recursively delete the left child\n root.left = deleteNode(root.left, key);\n }\n else {\n // call `rotateRight()` on the root\n root = rotateRight(root);\n\n // recursively delete the right child\n root.right = deleteNode(root.right, key);\n }\n }\n\n // Case 3: node to be deleted has only one child\n else {\n // choose a child node\n TreapNode child = (root.left != null)? root.left: root.right;\n root = child;\n }\n }\n\n return root;\n }",
"public TreeNode deleteNode1(TreeNode root, int key) {\n if (root == null) {\n return root;\n }\n\n // delete current node if root is the target node\n if (root.val == key) {\n // replace root with root->right if root->left is null\n if (root.left == null) {\n return root.right;\n }\n\n // replace root with root->left if root->right is null\n if (root.right == null) {\n return root.left;\n }\n\n // replace root with its successor if root has two children\n TreeNode p = findSuccessor(root);\n root.val = p.val;\n root.right = deleteNode1(root.right, p.val);\n return root;\n }\n if (root.val < key) {\n // find target in right subtree if root->val < key\n root.right = deleteNode1(root.right, key);\n } else {\n // find target in left subtree if root->val > key\n root.left = deleteNode1(root.left, key);\n }\n return root;\n }",
"private void deleteNode(Cat valueToDelete, Node root){\n Node temp = findNode(valueToDelete, root);\n if(temp.getRight()==null){\n Node parent = temp.getParent();\n if(temp.getLeft()==null){\n temp.setParent(null);\n if(temp==parent.getRight()){\n parent.setRight(null);\n fixBalanceValues(parent,-1);\n }\n else{\n parent.setLeft(null);\n fixBalanceValues(parent,1);\n }\n \n }\n else{\n //copy value of leftchild into the node to deletes data and delete it's leftchild\n temp.setData(temp.getLeft().getData());\n temp.setLeft(null);\n fixBalanceValues(temp, 1);\n }\n }\n Node nodeToDelete = temp.getRight();\n if(nodeToDelete.getLeft()==null){\n temp.setData(nodeToDelete.getData());\n temp.setRight(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(temp,-1);\n }\n else{\n while(nodeToDelete.getLeft()!=null){\n nodeToDelete=nodeToDelete.getLeft(); \n } \n temp.setData(nodeToDelete.getData());\n Node parent = nodeToDelete.getParent();\n parent.setLeft(null);\n nodeToDelete.setParent(null);\n fixBalanceValues(parent,1);\n }\n \n \n }",
"public static TreeNode delete(TreeNode t, String target)\n {\n \n if(t == null)\n return null;\n \n else if(target.compareTo((String)t.getValue()) < 0)\n t.setLeft(delete(t.getLeft(), target));\n else if(target.compareTo((String)t.getValue()) > 0)\n t.setRight(delete(t.getRight(), target));\n else\n {\n //t.getValue() == v\n //ndoe thats leaf or one child\n if(t.getLeft() == null)\n return t.getRight();\n else if (t.getRight() == null)\n return t.getLeft();\n \n \n //if node has 2 children\n t.setValue(min(t.getRight()));\n \n //recursive call \n t.setRight(delete(t.getRight(), (String)t.getValue()));\n }\n return t;\n \n }",
"public void delete(int key) {\n\n\n // There should be 6 cases here\n // Non-root nodes should be forwarded to the static function\n if (root == null) System.out.println(\"Empty Tree!!!\"); // ไม่มี node ใน tree\n else {\n\n Node node = find(key);\n\n if (node == null) System.out.println(\"Key not found!!!\"); //ไม่เจอ node\n\n\n else if(node == root){ //ตัวที่ลบเป็น root\n if (root.left == null && root.right == null) { //ใน tree มีแค่ root ตัสเดียว ก็หายไปสิ จะรอไร\n root = null;\n }\n else if (root.left != null && root.right == null) { //่ root มีลูกฝั่งซ้าย เอาตัวลูกขึ้นมาแทน\n root.left.parent = null;\n root = root.left;\n }\n else { //่ root มีลูกฝั่งขวา เอาตัวลูกขึ้นมาแทน\n Node n = findMin(root.right);\n root.key = n.key;\n delete(n);\n }\n\n }\n\n\n else { //ตัวที่ลบไม่ใช่ root\n delete(node);\n }\n }\n }",
"Node deleteNode(Node root, int key) {\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\tif (key < root.data)\n\t\t\troot.left = deleteNode(root.left, key);\n\t\telse if (key > root.data)\n\t\t\troot.right = deleteNode(root.right, key);\n\t\telse {\n\n\t\t\t// if node to be deleted has 1 or 0 child\n\t\t\tif (root.left == null)\n\t\t\t\treturn root.right;\n\t\t\telse if (root.right == null)\n\t\t\t\treturn root.left;\n\n\t\t\t// Get the inorder successor (smallest\n\t\t\t// in the right subtree)\n\t\t\tNode minkey = minValueNode(root.right);\n\t\t\troot.data = minkey.data;\n\t\t\troot.right = deleteNode(root.right, minkey.data);\n\n\t\t}\n\n\t\t// now Balance tree operation perform just like we did in insertion\n\t\tif (root == null)\n\t\t\treturn root;\n\n\t\troot.height = max(height(root.left), height(root.right)) + 1;\n\n\t\tint balance = getBalance(root);\n\n\t\t// If this node becomes unbalanced, then there are 4 cases\n\t\t// Left Left Case\n\t\tif (balance > 1 && getBalance(root.left) >= 0)\n\t\t\treturn rightRotate(root);\n\n\t\t// Left Right Case\n\t\tif (balance > 1 && getBalance(root.left) < 0) {\n\t\t\troot.left = leftRotate(root.left);\n\t\t\treturn rightRotate(root);\n\t\t}\n\n\t\t// Right Right Case\n\t\tif (balance < -1 && getBalance(root.right) <= 0)\n\t\t\treturn leftRotate(root);\n\n\t\t// Right Left Case\n\t\tif (balance < -1 && getBalance(root.right) > 0) {\n\t\t\troot.right = rightRotate(root.right);\n\t\t\treturn leftRotate(root);\n\t\t}\n\n\t\treturn root;\n\t}",
"public static TreapNode deleteNode(TreapNode root, int key)\n {\n if (root == null)\n return root;\n\n if (key < root.key)\n root.left = deleteNode(root.left, key);\n else if (key > root.key)\n root.right = deleteNode(root.right, key);\n\n // IF KEY IS AT ROOT\n\n // If left is null\n else if (root.left == null)\n {\n TreapNode temp = root.right;\n root = temp; // Make right child as root\n }\n\n // If Right is null\n else if (root.right == null)\n {\n TreapNode temp = root.left;\n root = temp; // Make left child as root\n }\n\n // If key is at root and both left and right are not null\n else if (root.left.priority < root.right.priority)\n {\n root = leftRotate(root);\n root.left = deleteNode(root.left, key);\n }\n else\n {\n root = rightRotate(root);\n root.right = deleteNode(root.right, key);\n }\n\n return root;\n }",
"private Node<Integer, Integer> delete(Node<Integer, Integer> node, int value) {\n\t\tif (node.getKey() == value && !node.hasChildren()) {\n\t\t\treturn null;\n\t\t} else if (node.getKey() == value && node.hasChildren()) {\n\t\t\tif (node.getLeft() == null && node.getRight() != null) {\n\t\t\t\treturn node.getRight();\n\t\t\t} else if (node.getLeft() != null && node.getRight() == null) {\n\t\t\t\treturn node.getLeft();\n\t\t\t} else {\n\t\t\t\treturn deleteRotateRight(node);\n\t\t\t}\n\t\t} else {\n\t\t\tif (node.getKey() > value) {\n\t\t\t\tnode.left = delete(node.getLeft(), value);\n\t\t\t\treturn node;\n\t\t\t} else {\n\t\t\t\tnode.right = delete(node.getRight(), value);\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t}",
"private Node removeVn(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) {\n node.right = removeVn(node.right, k);\n }else if(k.compareTo(node.k) < 0){\n node.left = removeVn(node.left, k);\n }else{ //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }\n else if(node.right!=null) { // had right child, use min of right child to replace this node\n node.copyValue(min(node.right));\n node.right = removeMin(node.right);\n }\n else if(node.left!=null) {// left child only , use left child to replace this node\n decDepth(node.left); //maintain depth when chain in left tree\n node = node.left;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n // update size of node and its parent nodes\n if (node != null && deleting) node.size--;\n return node;\n }",
"AVLNode delete(AVLNode node, int key) {\n if (node == null) \n return node; \n \n // If the key to be deleted is smaller than \n // the root's key, then it lies in left subtree \n if (key < node.key) \n node.left = delete(node.left, key); \n \n // If the key to be deleted is greater than the \n // root's key, then it lies in right subtree \n else if (key > root.key) \n node.right = delete(node.right, key); \n \n // if key is same as root's key, then this is the node \n // to be deleted \n else\n { \n \n // node with only one child or no child \n if ((node.left == null) || (node.right == null)) \n { \n AVLNode temp = null; \n if (temp == node.left) \n temp = node.right; \n else\n temp = node.left; \n \n if (temp == null) \n { \n temp = node; \n node = null; \n } \n else \n node = temp; \n } \n else\n { \n AVLNode temp = getSucc(node.right); \n node.key = temp.key; \n node.right = delete(node.right, temp.key); \n } \n } \n \n if (node== null) \n return node; \n \n node.height = max(height(node.left), height(node.right)) + 1; \n \n int balance = getBF(node); \n \n if (balance > 1 && getBF(node.left) >= 0) \n return rightrot(node); \n \n if (balance > 1 && getBF(node.left) < 0) \n { \n node.left = leftrot(node.left); \n return rightrot(node); \n } \n \n if (balance < -1 && getBF(node.right) <= 0) \n return leftrot(node); \n\n if (balance < -1 && getBF(node.right) > 0) \n { \n node.right = rightrot(node.right); \n return leftrot(node); \n } \n return node;\n }",
"private void delete(Node curr, int ID, AtomicReference<Node> rootRef) {\n\t\tif(curr == null || curr.isNull) {\n return;\n }\n if(curr.ID == ID) {\n if(curr.right.isNull || curr.left.isNull) {\n deleteDegreeOneChild(curr, rootRef);\n } else {\n Node n = findSmallest(curr.right);\n \tcurr.ID = n.ID;\n curr.count = n.count;\n delete(curr.right, n.ID, rootRef);\n }\n }\n if(curr.ID < ID) {\n delete(curr.right, ID, rootRef);\n } else {\n delete(curr.left, ID, rootRef);\n }\n\t}",
"public int delete(int k){\n\t WAVLNode x = treePosForDel(this, k); // find the node to delete\r\n\t int cnt = 0; // rebalance operations counter\r\n\t if(x.key!=k) { // if a node with a key of k doesnt exist in the tree there is nothing to delete, return -1\r\n\t\t return -1;\r\n\t }\r\n\t if(this.root.key==x.key&&this.root.rank==0) {//root is a leaf\r\n\t\t this.root=EXT_NODE;// change the root pointer to EXT_NODE\r\n\t\t return 0;\r\n\t }\r\n\t else if(this.root.key==x.key&&(this.root.right==EXT_NODE||this.root.left==EXT_NODE)) {//root is onary\r\n\t\t if(x.left!=EXT_NODE) { // x is a root with a left child\r\n\t\t\t x.left.parent = null;\r\n\t\t\t this.root = x.left; // change the root pointer to the root's left child\r\n\t\t\t x.left.sizen=1;\r\n\t\t\t return 0;\r\n\t\t }\r\n\t\t x.right.parent = null; // x is a root with a right child \r\n\t\t x.right.sizen=1;\r\n\t\t this.root = x.right; // change the root pointer to the root's right child\r\n\t\t return 0;\r\n\t }\r\n\t WAVLNode z;\r\n\t if(isInnerNode(x)) {// x is an inner node, requires a call for successor and swap\r\n\t\t z = successorForDel(x); // find the successor of x\r\n\t\t x = swap(x,z); // put x's successor instead of x and delete successor \r\n\t }\r\n\t\t if(x.rank == 0) {//x is a leaf\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.left = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.left;\r\n\t\t\t }\r\n\t\t\telse { // x is a right child of it's parent, requires change in pointers \r\n\t\t\t\t x.parent.right = EXT_NODE;\r\n\t\t\t\t z = x.parent;\r\n\t\t\t\t x = x.parent.right; \r\n\t\t\t }\r\n\t\t }\r\n\t\t else {//x is onary\r\n\t\t\t boolean onaryside = onaryLeft(x); // check if x is onary with a left child\r\n\t\t\t WAVLNode x_child = EXT_NODE;\r\n\t\t\t if (onaryside) {\r\n\t\t\t\t x_child=x.left; // get a pointer for x child\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t x_child=x.right;\r\n\t\t\t }\r\n\t\t\t if(parentside(x.parent, x).equals(\"left\")) { // x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.left=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {// x is a left child of its parent, change pointers for delete and rebalance loop\r\n\t\t\t\t x.parent.right=x_child;\r\n\t\t\t\t x_child.parent=x.parent;\r\n\t\t\t\t z=x.parent;\r\n\t\t\t\t x=x_child;\r\n\t\t\t }\r\n\t\t }\r\n\t if (z.left.rank==-1&&z.right.rank==-1) {//special case, z becomes a leaf, change pointers and demote\r\n\t\t demote(z);\r\n\t\t x=z;\r\n\t\t z=z.parent;\r\n\t\t cnt++;\r\n\t }\r\n\t \r\n\t while(z!=null&&z.rank-x.rank==3) { // while the tree is not balanced continue to balance the tree\r\n\t\t if(parentside(z, x).equals(\"left\")) { // x is z's left son\r\n\t\t\t if(z.rank-z.right.rank==2) {//condition for demote\r\n\r\n\t\t\t\t demote(z);\r\n\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.right.rank-z.right.left.rank==2&&z.right.rank-z.right.right.rank==2) {//condition for doubledemote left\r\n\t\t\t\t\t doubleDemoteLeft(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t\t \r\n\t\t\t\t }\r\n\t\t\t\t else if((z.right.rank-z.right.left.rank==1||z.right.rank-z.right.left.rank==2)&&z.right.rank-z.right.right.rank==1) {// condition for rotate left for del\r\n\t\t\t\t\t rotateLeftDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t\t else {//condition for doublerotate left for del\r\n\t\t\t\t\t doubleRotateLeftDel(z);\r\n\t\t\t\t\t \r\n\t\t\t\t\t cnt=cnt+5;\r\n\t\t\t\t\t break; // tree is balanced\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t }\r\n\t\t else { // x is z's right son, conditions are symmetric to left side\r\n\t\t\t if(z.rank-z.left.rank==2) {\r\n\t\t\t\t demote(z);\r\n\t\t\t\t x=z;\r\n\t\t\t\t z=z.parent;\r\n\t\t\t\t cnt++;\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t\t else {\r\n\t\t\t\t if(z.left.rank-z.left.right.rank==2&&z.left.rank-z.left.left.rank==2) {\r\n\t\t\t\t\t doubleDemoteright(z);\r\n\t\t\t\t\t x=z;\r\n\t\t\t\t\t z=z.parent;\r\n\t\t\t\t\t cnt+=2;\r\n\t\t\t\t }\r\n\t\t\t\t else if((z.left.rank-z.left.right.rank==1||z.left.rank-z.left.right.rank==2)&&z.left.rank-z.left.left.rank==1) {\r\n\t\t\t\t\t rotateRightDel(z);\r\n\t\t\t\t\t cnt+=3;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t else {\r\n\r\n\t\t\t\t\t doubleRotateRightDel(z);\r\n\t\t\t\t\t cnt+=5;\r\n\t\t\t\t\t break;\r\n\t\t\t\t }\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t }\r\n\t }\r\n\t return cnt;\r\n }",
"private Node deleteMin(Node h) {\n if (h.left == null)\n return null;\n\n if (!isRed(h.left) && !isRed(h.left.left))\n h = moveRedLeft(h);\n\n h.left = deleteMin(h.left);\n return balance(h);\n }",
"private BinarySearchTree deleteTree(BinarySearchTree tree, Comparable key){\r\n\t\t\r\n\t\t//If it is a leaf\r\n\t\tif(tree.getLeftChild() == null && tree.getRightChild() == null){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t//Tree has only 1 leaf\r\n\t\telse if( (tree.getLeftChild() == null && tree.getRightChild() != null) ||\r\n\t\t\t\t (tree.getLeftChild() != null && tree.getRightChild() == null)){\r\n\t\t\t\r\n\t\t\t//Make a new tree out of the leaf and make it the new root\r\n\t\t\tif(tree.getLeftChild() != null){\r\n\t\t\t\treturn tree.getLeftChild();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\treturn tree.getRightChild();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Has two leaves. This case is slightly more complicated\r\n\t\telse{\r\n\t\t\t//get the leftmost item in the right child subtree. This becomes the \r\n\t\t\t//new root. This allows the BinarySearchTree to stay a valid \r\n\t\t\t//BinarySearchTree\r\n\t\t\tKeyedItem replacementItem = findLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//Delete the tree with that item so it can be moved to the new root\r\n\t\t\tBinarySearchTree replacementTree = deleteLeftMost(tree.getRightChild());\r\n\t\t\t\r\n\t\t\t//change the root to the new item\r\n\t\t\ttree.setRootItem(replacementItem);\r\n\t\t\t\r\n\t\t\t//Set the new roots right tree to the replacement tree\r\n\t\t\ttree.attachRightSubtree(replacementTree);\r\n\t\t\treturn tree;\r\n\t\t}\r\n\t}",
"public boolean delete(int m) {\r\n \r\n System.out.println(\"We are deleting \" + m);\r\n\tbtNode current = root;\r\n btNode parent = root;\r\n boolean LeftChild = true;\r\n\r\n while(current.getData() != m) \r\n {\r\n parent = current;\r\n if(m < current.getData()) \r\n {\r\n LeftChild = true;\r\n current = current.left;\r\n }\r\n else { \r\n LeftChild = false;\r\n current = current.right;\r\n }\r\n if(current == null) \r\n return false; \r\n } // end while\r\n // found node to delete\r\n\r\n // if no children, simply delete it\r\n if(current.left==null && current.right==null)\r\n {\r\n if(current == root) // if root,\r\n root = null; // tree is empty\r\n else if(LeftChild)\r\n parent.left = null; // disconnect\r\n else // from parent\r\n parent.right = null;\r\n }\r\n\r\n // if no right child, replace with left subtree\r\n else if(current.right==null)\r\n if(current == root)\r\n root = current.left;\r\n else if(LeftChild)\r\n parent.left = current.left;\r\n else\r\n parent.right = current.left;\r\n\r\n // if no left child, replace with right subtree\r\n else if(current.left==null)\r\n if(current == root)\r\n root = current.right;\r\n else if(LeftChild)\r\n parent.left = current.right;\r\n else\r\n parent.right = current.right;\r\n\r\n else // two children, so replace with inorder successor\r\n {\r\n // get successor of node to delete (current)\r\n btNode successor = getNext(current);\r\n\r\n // connect parent of current to successor instead\r\n if(current == root)\r\n root = successor;\r\n else if(LeftChild)\r\n parent.left = successor;\r\n else\r\n parent.right = successor;\r\n\r\n // connect successor to current's left child\r\n successor.left = current.left;\r\n } // end else two children\r\n // (successor cannot have a left child)\r\n return true; // success\r\n }",
"private Node removeVx(Node node, K k){\n if(node == null)\n return null;\n\n if(k.compareTo(node.k) >0) { //value is greater, then looking right node\n node.right = removeVx(node.right, k);\n }else if(k.compareTo(node.k) < 0){ //value is smaller, then looking left node\n node.left = removeVx(node.left, k);\n }else { //(e.compareTo(node.e) == 0) found value matched node\n deleting = true;\n if(node.count!=0) { // if multiple value in one node, just decrease count\n node.count--;\n }else if (node.left != null) { //had left children use max of left children to replace this node\n node.copyValue(max(node.left));\n node.left = removeMax(node.left);\n }\n else if(node.right!=null) { //only had right child, use right child to replace this node\n decDepth(node.right); //maintain depth when chain in right tree\n node = node.right;\n }\n else {\n node = null; // no children, delete this node\n }\n }\n if (node != null && deleting) node.size--;\n return node;\n }",
"public int delete(int k) {\n\t\tif (this.empty()) {// empty tree, nothing to erase\n\t\t\treturn -1;\n\t\t}\n\t\tAVLNode root = (AVLNode) this.root;\n\t\tAVLNode node = (AVLNode) root.delFindNode(k);\n\t\tif (node == null) {// no node with key==k in this tree\n\t\t\treturn -1;\n\t\t}\n\t\tchar side = node.parentSide();\n\t\tboolean rootTerm = (node.getLeft().getKey() != -1 && node.getRight().getKey() != -1);\n\t\tif (side == 'N' && (rootTerm == false)) {\n\t\t\treturn this.deleteRoot(node);\n\t\t}\n\t\tif (side == 'L') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 1 && rightEdge == 2) {\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tnode.parent.setLeft(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.left != null && node.right == null) || (node.left == null && node.right != null)) {// node is //\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// unary\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.parent.getRight().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 2)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==2&&rightEdge==1\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif (side == 'R') {\n\t\t\tif (node.isLeaf()) {\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tAVLNode parent = (AVLNode) node.parent;\n\t\t\t\tif (leftEdge == 1 && rightEdge == 1) {// first case (\"easy one\", just delete)\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.updateSize();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\tif (leftEdge == 2 && rightEdge == 1) {\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\tparent.setHeight(parent.getHeight() - 1);\n\t\t\t\t\tparent.setSize();\n\t\t\t\t\treturn this.delRecTwos(parent);\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tnode.parent.setRight(new AVLNode());\n\t\t\t\t\tnode.setParent(null);\n\t\t\t\t\treturn this.delRecTriOne(parent, side);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((node.getLeft().getHeight() != -1 && node.getRight().getHeight() == -1)\n\t\t\t\t\t|| (node.getLeft().getHeight() == -1 && node.getRight().getHeight() != -1)) {// node is unary\n\t\t\t\tint rightEdge = node.parent.getHeight() - node.getHeight();\n\t\t\t\tint leftEdge = node.parent.getHeight() - node.parent.getLeft().getHeight();\n\t\t\t\tif ((leftEdge == 1 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\tAVLNode parent = node.delUnaryLeft();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\tAVLNode parent = node.delUnaryRight();\n\t\t\t\t\t\tparent.updateSize();\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ((leftEdge == 2 && rightEdge == 1)) {\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryLeft());\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTwos(node.delUnaryRight());\n\t\t\t\t\t}\n\t\t\t\t} else {// leftEdge==1&&rightEdge==2\n\t\t\t\t\tif (node.left != null) {\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryLeft(), side);\n\t\t\t\t\t} else {// node.right!=null\n\t\t\t\t\t\treturn this.delRecTriOne(node.delUnaryRight(), side);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t// we get here only if node is binary, and thus not going through any other\n\t\t// submethod\n\t\tAVLNode successor = this.findSuccessor(node); // successor must be unary/leaf\n\t\tif (node.checkRoot()) {\n\t\t\tthis.root = successor;\n\t\t}\n\t\tint numOp = this.delete(successor.key);\n\t\tsuccessor.setHeight(node.getHeight());\n\t\tsuccessor.size = node.getSize();\n\t\tsuccessor.setRight(node.getRight());\n\t\tnode.right.setParent(successor);\n\t\tnode.setRight(null);\n\t\tsuccessor.setLeft(node.getLeft());\n\t\tnode.left.setParent(successor);\n\t\tnode.setLeft(null);\n\t\tsuccessor.setParent(node.getParent());\n\t\tif (node.parentSide() == 'L') {\n\t\t\tnode.parent.setLeft(successor);\n\t\t} else if (node.parentSide() == 'R') {// node.parentSide()=='R'\n\t\t\tnode.parent.setRight(successor);\n\t\t}\n\t\tnode.setParent(null);\n\t\treturn numOp;\n\n\t}",
"public boolean delete(int key) {\n Node current = root;\n Node parent = root;\n boolean isLeftChild = true;\n while (current.iData != key) {\n parent = current;\n if (key < current.iData) {\n // go left\n isLeftChild = true;\n current = current.leftChild;\n } else {\n isLeftChild = false;\n current = current.rightChild;\n }\n if (current == null)\n // end of the line, didn't find it\n return false;\n } //end while\n\n // found node to delete\n\n if (current.leftChild == null && current.rightChild == null) {\n // if no children, simply delete it\n if (current == root)\n // if root, tree is empty\n root = null;\n else if (isLeftChild)\n parent.leftChild = null;\n else\n parent.rightChild = null;\n } else if (current.rightChild == null) {\n // if no right child, replace with left subtree\n if (current == root)\n root = current.leftChild;\n else if (isLeftChild)\n parent.leftChild = current.leftChild;\n else\n parent.rightChild = current.leftChild;\n } else if (current.leftChild == null) {\n // if no left child, replace with right subtree\n if (current == root)\n root = current.rightChild;\n else if (isLeftChild)\n parent.leftChild = current.rightChild;\n else\n parent.rightChild = current.rightChild;\n } else {\n // two children, so replace with inorder successor\n // get successor of node to delete\n Node successor = getSuccessor(current);\n\n // connect parent of current to successor instead\n if (current == root)\n root = successor;\n else if (isLeftChild)\n parent.leftChild = successor;\n else\n parent.rightChild = successor;\n\n // connect successor to current's left child\n successor.leftChild = current.leftChild;\n } // end else two children\n // succssor cannot have a left child\n return true;\n }",
"private Node removeHelper(Node n, K key) {\n if (n == null) {\n return n;\n } else if (key.compareTo(n.key) < 0) {\n n.leftChild = removeHelper(n.leftChild, key);\n return n;\n } else if (key.compareTo(n.key) > 0) {\n n.rightChild = removeHelper(n.rightChild, key);\n return n;\n } else {\n if (n.leftChild == null && n.rightChild == null) {\n // It is a leaf node.\n return null;\n } else if (n.leftChild == null) {\n // It has only right child.\n return n.rightChild;\n } else if (n.rightChild == null) {\n // It has only left child.\n return n.leftChild;\n } else {\n // Swap the predecessor with root n and delete predecessor.\n Node predecessor = findLargestNodeIn(n.leftChild);\n n.key = predecessor.key;\n n.value = predecessor.value;\n n.leftChild = removeHelper(n.leftChild, predecessor.key);\n return n;\n }\n }\n }",
"public Node deleteMin() {\n\t\t// if the heap is empty\n\t\t// return MAXINT as output\n\t\tNode min = new Node(Integer.MAX_VALUE);\n\t\tif(this.head == null)\n\t\t\treturn min;\n\t\t\n\t\t\n\t\tNode prevMin = null;\n\t\tNode curr = this.head;\n\t\tNode prev = null;\n\t\t\n\t\t// find the smallest node\n\t\t// keep track of node who points to this minimum node\n\t\twhile(curr!=null) {\n\t\t\tif(curr.key<min.key) {\n\t\t\t\tmin = curr;\n\t\t\t\tprevMin = prev;\n\t\t\t}\n\t\t\tprev = curr;\n\t\t\tcurr = curr.rightSibling;\n\t\t}\n\t\t\n\t\t// if its the head then move one pointer ahead\n\t\tif(prevMin == null)\n\t\t\tthis.head = min.rightSibling;\n\t\telse {\n\t\t\t// else attach the previous node to the rightSibling of min\n\t\t\tprevMin.rightSibling = min.rightSibling;\n\t\t}\n\t\tmin.rightSibling = null;\n\t\t\n\t\t//return min node\n\t\treturn min;\n\t}",
"public boolean Delete(int num) {\r\n\t\t//initialize boolean field, set to true if value found in tree\r\n\t\tboolean found;\r\n\t\t//initialize the parent node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper p = new TreeNodeWrapper();\r\n\t\t//initialize the child node using the TreeNodeWrapper\r\n\t\tTreeNodeWrapper c = new TreeNodeWrapper();\r\n\t\t//initialize largest field to re-allocate parent/child nodes\r\n\t\tTreeNode largest;\r\n\t\t//initialize nextLargest field to re-allocate parent/child nodes\r\n\t\tTreeNode nextLargest;\r\n\t\t//found set to true if FindNode methods locates value in the tree\r\n\t\tfound = FindNode(num, p, c);\r\n\t\t//if node not found return false\r\n\t\tif(found == false)\r\n\t\t\treturn false;\r\n\t\telse //identify the case number\r\n\t\t{\r\n\t\t\t//case 1: deleted node has no children\r\n\t\t\t//if left and right child nodes of value are both null node has no children\r\n\t\t\tif(c.Get().Left == null && c.Get().Right == null)\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t\tp.Get().Left = null;\r\n\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\tp.Get().Right = null;\r\n\t\t\t//case 2: deleted node has 1 child\r\n\t\t\t//if deleted node only has 1 child node\r\n\t\t\telse if(c.Get().Left == null || c.Get().Right == null)\r\n\t\t\t{\r\n\t\t\t\t//if parent left node is equal to child node then deleted node is a left child\r\n\t\t\t\tif(p.Get().Left == c.Get())\r\n\t\t\t\t{\r\n\t\t\t\t\t//if deleted node is a left child then set deleted node child node as child to parent node\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Left = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t\telse //if deleted node is a right child then set deleted node child node as child to parent node\r\n\t\t\t\t{\r\n\t\t\t\t\tif(c.Get().Left != null) //deleted node has a left child\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Left;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tp.Get().Right = c.Get().Right;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//case 3: deleted node has two children\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//set the nextLargest as the left child of deleted node\r\n\t\t\t\tnextLargest = c.Get().Left;\r\n\t\t\t\t//set the largest as the right node of the nextLargest node\r\n\t\t\t\tlargest = nextLargest.Right;\r\n\t\t\t\t//if right node is not null then left child has a right subtree\r\n\t\t\t\tif(largest != null) \r\n\t\t\t\t{\r\n\t\t\t\t\t//while loop to move down the right subtree and re-allocate after node is deleted\r\n\t\t\t\t\twhile(largest.Right != null) //move down right subtree\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextLargest = largest;\r\n\t\t\t\t\t\tlargest = largest.Right;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//overwrite the deleted node\r\n\t\t\t\t\tc.Get().Data = largest.Data; \r\n\t\t\t\t\t// save the left subtree\r\n\t\t\t\t\tnextLargest.Right = largest.Left; \r\n\t\t\t\t}\r\n\t\t\t\telse //left child does not have a right subtree\r\n\t\t\t\t{\r\n\t\t\t\t\t//save the right subtree\r\n\t\t\t\t\tnextLargest.Right = c.Get().Right; \r\n\t\t\t\t\t//deleted node is a left child\r\n\t\t\t\t\tif(p.Get().Left == c.Get()) \r\n\t\t\t\t\t\t//jump around deleted node\r\n\t\t\t\t\t\tp.Get().Left = nextLargest; \r\n\t\t\t\t\telse //deleted node is a right child\r\n\t\t\t\t\t\tp.Get().Right = nextLargest; //jump around deleted node\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return true is delete is successful\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"private void deleteNode(Node<K> p) {\n // If strictly internal, copy successor's element to p and then make p\n // point to successor.\n if (p.left != null && p.right != null) {\n Node<K> s = successor(p); // 节点有 2 个子节点时,找到实际删除的后继节点\n p.key = s.key; // 将后继节点的值复制到原来节点上,原来的节点只是值被删除,节点本身不删除\n p = s; // 将实际要删除的节点位置指向后继节点位置\n } // p has 2 children //\n // //////////////////////////////////////////////////////////////////\n // Start fixup at replacement node, if it exists. //\n Node<K> replacement = (p.left != null ? p.left : p.right); // 实际删除的节点最多只有一个子节点,并且一定是红色子节点\n if (replacement != null) { // 如果有一个红色子节点\n // Link replacement to parent //\n replacement.parent = p.parent; // 将此节点上移\n if (p.parent == null) //\n root = replacement; //\n else if (p == p.parent.left) // 实际被删除的节点 p 为左子\n p.parent.left = replacement; //\n else // 实际被删除的节点 p 为右子\n p.parent.right = replacement; //\n // //\n // Null out links so they are OK to use by fixAfterDeletion. //\n p.left = p.right = p.parent = null; //\n // //\n // Fix replacement //////////////////////////////////////////////////////////////////\n if (p.color == BLACK) // 删除情形 5. 因为 replacement 是红节点,所以这里 p 的颜色一定是黑色的\n fixAfterDeletion(replacement); // 修复只要将此红节点上移并置黑就完成了\n } else if (p.parent == null) { // return if we are the only node. //////////////////////////////////////////////////////////////////\n root = null; // 根节点被删除\n } else { // No children. Use self as phantom replacement and unlink. // 被删除的节点没有子节点时\n if (p.color == BLACK) // 如果是红色的节点,直接删除就完成\n fixAfterDeletion(p); // 如果被删除的是黑色节点,则会破坏红黑树性质 5,需要修复红黑树\n\n if (p.parent != null) {\n if (p == p.parent.left)\n p.parent.left = null;\n else if (p == p.parent.right)\n p.parent.right = null;\n p.parent = null;\n }\n }\n }",
"public void delete(Integer data) {\n ArrayList<Node> parents = new ArrayList<>();\n Node nodeDel = this.root;\n Node parent = this.root;\n Node imBalance;\n Integer balanceFactor;\n boolean isLeftChild = false;\n if (nodeDel == null) {\n return;\n }\n while (nodeDel != null && !nodeDel.getData().equals(data)) {\n parent = nodeDel;\n if (data < nodeDel.getData()) {\n nodeDel = nodeDel.getLeftChild();\n isLeftChild = true;\n } else {\n nodeDel = nodeDel.getRightChild();\n isLeftChild = false;\n }\n parents.add(nodeDel);\n }\n\n if (nodeDel == null) {\n return;\n// delete a leaf node\n } else if (nodeDel.getLeftChild() == null && nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = null;\n } else {\n if (isLeftChild) {\n parent.setLeftChild(null);\n } else {\n parent.setRightChild(null);\n }\n }\n }\n// deleting a node with degree of one\n else if (nodeDel.getRightChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getLeftChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getLeftChild());\n } else {\n parent.setRightChild(nodeDel.getLeftChild());\n }\n } else if (nodeDel.getLeftChild() == null) {\n if (nodeDel == root) {\n root = nodeDel.getRightChild();\n } else if (isLeftChild) {\n parent.setLeftChild(nodeDel.getRightChild());\n } else {\n parent.setRightChild(nodeDel.getRightChild());\n }\n }\n // deleting a node with degree of two\n else {\n Integer minimumData = minimumData(nodeDel.getRightChild());\n delete(minimumData);\n nodeDel.setData(minimumData);\n }\n parent.setHeight(maximum(height(parent.getLeftChild()), height(parent.getRightChild())));\n balanceFactor = getBalance(parent);\n if (balanceFactor <= 1 && balanceFactor >= -1) {\n for (int i = parents.size() - 1; i >= 0; i--) {\n imBalance = parents.get(i);\n balanceFactor = getBalance(imBalance);\n if (balanceFactor > 1 || balanceFactor < -1) {\n if (imBalance.getData() > parent.getData()) {\n parent.setRightChild(rotateCase(imBalance, data, balanceFactor));\n } else\n parent.setLeftChild(rotateCase(imBalance, data, balanceFactor));\n break;\n }\n }\n }\n }",
"public void delete(Node<T> x) {\n decreaseKey(x, min.key);\n extractMin();\n }",
"private Node<T> delete(Node<T> node,Comparable<T> item) {\r\n if (node == null) { // this is the base case\r\n return null;\r\n }\r\n if (node.data.compareTo((T) item) < 0) {\r\n node.right = delete(node.right, item);\r\n return node;\r\n }\r\n else if (node.data.compareTo((T) item) > 0) {\r\n node.left = delete(node.left, item);\r\n return node;\r\n }\r\n else { // the item == node.data\r\n if (node.left == null) { // no left child\r\n return node.right;\r\n }\r\n else if (node.right == null) { // no right child\r\n return node.left;\r\n }\r\n else { // 2 children: find in-order successor\r\n if (node.right.left == null) { // if right child does not have a left child of its own\r\n node.data = node.right.data;\r\n node.right = node.right.right;\r\n }\r\n else {\r\n node.data = (Comparable<T>) removeSmallest(node.right); // if the right child has two children, or has a left subtree\r\n }\r\n return node;\r\n }\r\n }\r\n }",
"private static BstDeleteReturn deleteHelper(BinarySearchTreeNode<Integer> root, int x) {\n if (root == null) {\n return new BstDeleteReturn(null, false);\n }\n\n if (root.data < x) {\n BstDeleteReturn outputRight = deleteHelper(root.right, x);\n root.right = outputRight.root;\n outputRight.root = root;\n return outputRight;\n }\n\n if (root.data > x) {\n BstDeleteReturn outputLeft = deleteHelper(root.left, x);\n root.left = outputLeft.root;\n outputLeft.root = root;\n return outputLeft;\n }\n\n // 0 children\n if (root.left == null && root.right == null) {\n return new BstDeleteReturn(null, true);\n }\n\n // only left child\n if (root.left != null && root.right == null) {\n return new BstDeleteReturn(root.left, true);\n }\n\n // only right child\n if (root.right != null && root.left == null) {\n return new BstDeleteReturn(root.right, true);\n }\n\n // both children are present\n int minRight = minimum(root.right);\n root.data = minRight;\n BstDeleteReturn output = deleteHelper(root.right, minRight);\n root.right = output.root;\n return new BstDeleteReturn(root, true);\n }",
"public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public void deleteNode(int key){\n\t\t//System.out.println(\" in delete Node \");\n\t\tNode delNode = search(key);\n\t\tif(delNode != nil){\n\t\t\t//System.out.println(\" del \" + delNode.id);\n\t\t\tdelete(delNode);\n\t\t}else{\n\t\t\tSystem.out.println(\" Node not in RB Tree\");\n\t\t}\n\t}",
"private bstNode<K, E> removehelp(bstNode<K, E> rt, K k)\n\t{\n\t\tif (rt == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tif (rt.key().compareTo(k) > 0)\n\t\t{\n\t\t\trt.setLeft(removehelp(rt.left(), k));\n\t\t}\n\t\telse if (rt.key().compareTo(k) < 0)\n\t\t{\n\t\t\trt.setRight(removehelp(rt.right(), k));\n\t\t}\n\t\telse\n\t\t{ // Found it, remove it\n\t\t\tif (rt.left() == null)\n\t\t\t{\n\t\t\t\treturn rt.right();\n\t\t\t}\n\t\t\telse if (rt.right() == null)\n\t\t\t{\n\t\t\t\treturn rt.left();\n\t\t\t}\n\t\t\telse\n\t\t\t{ // Two children\n\t\t\t\tbstNode<K, E> temp = getmin(rt.right());\n\t\t\t\trt.setElement(temp.element());\n\t\t\t\trt.setKey(temp.key());\n\t\t\t\trt.setRight(deletemin(rt.right()));\n\t\t\t}\n\t\t}\n\t\treturn rt;\n\t}",
"private Node<E> delete(Node<E> localRoot, E item) {\r\n\t\tif(localRoot == null) {\r\n\t\t\t// item is not in the tree.\r\n\t\t\tdeleteReturn = null;\r\n\t\t\treturn localRoot;\r\n\t\t}\t\r\n\t\t// Search for item to delete\r\n\t\tint compResult = item.compareTo(localRoot.data);\r\n\t\tif(compResult < 0) {\r\n\t\t\t// item is smaller than localRoot.data\r\n\t\t\tlocalRoot.left = delete(localRoot.left, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse if(compResult > 0) {\r\n\t\t\t// item is larger than localRoot.data\r\n\t\t\tlocalRoot.right = delete(localRoot.right, item);\r\n\t\t\treturn localRoot;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// item is at the local root\r\n\t\t\tdeleteReturn = localRoot.data;\r\n\t\t\tif(localRoot.left == null) {\r\n\t\t\t\t// if there is no left child, return the right child which can also be null\r\n\t\t\t\treturn localRoot.right;\r\n\t\t\t}\r\n\t\t\telse if(localRoot.right == null) {\r\n\t\t\t\t// if theres no right child, return the left child\r\n\t\t\t\treturn localRoot.left;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//Node being deleted has two children, replace the data with inorder predecessor\r\n\t\t\t\tif(localRoot.left.right == null) {\r\n\t\t\t\t\t// the left child has no right child\r\n\t\t\t\t\t//replace the data with the data in the left child\r\n\t\t\t\t\tlocalRoot.data = localRoot.left.data;\r\n\t\t\t\t\t// replace the left child with its left child\r\n\t\t\t\t\tlocalRoot.left = localRoot.left.left;\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t//Search for in order predecessor(IP) and replace deleted nodes data with IP\r\n\t\t\t\t\tlocalRoot.data = findLargestChild(localRoot.left);\r\n\t\t\t\t\treturn localRoot;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public Node delete(Node x, Key key) {\n if (x == null) return null;\n if (key.equals(x.key)) {\n n--;\n return x.next;\n }\n x.next = delete(x.next, key);\n return x;\n }",
"public BSTNode delete(int key) {\n BSTNode node = (BSTNode)search(key); \n if (node != null) { \n \tif (node.getLeft() != null && node.getRight() != null) {\n \t\tBSTNode left = (BSTNode)max(node.getLeft()), leftParent = left.getParent();\n \t\treplace(node, left);\n \t\tif (left.getColor() == Color.BLACK) {\n \t\t\tif (node.getColor() == Color.RED)\n \t\t\t\tleft.setColor(Color.RED);\n \t\t\tif (leftParent != node) {\n \t\t\t\tif (leftParent.getRight() != null)\n \t\t\t\t\tleftParent.getRight().setColor(Color.BLACK);\n \t\t\t\telse\n \t\t\t\t\tadjustColorsRemoval(leftParent, false);\n \t\t\t}\n \t\t\telse {\n \t\t\t\tif (left.getLeft() != null)\n \t\t\t\t\tleft.getLeft().setColor(Color.BLACK);\n \t\t\t\telse\n \t\t\t\t\tadjustColorsRemoval(left, true);\n \t\t\t}\n \t\t}\n \t\telse if (node.getColor() == Color.BLACK)\n \t\t\tleft.setColor(Color.BLACK);\n \t}\n \telse if (node.getLeft() == null && node.getRight() == null) {\n \tremove(node, null); \n \tif (root != null && node.getColor() == Color.BLACK)\n \t\tadjustColorsRemoval(node.getParent(), node.getKey() < node.getParent().getKey());\n }\n \telse if (node.getLeft() != null && node.getRight() == null) {\n \t\tremove(node, node.getLeft());\n \t\tnode.getLeft().setColor(Color.BLACK);\n \t}\n\t else {\n\t \tremove(node, node.getRight()); \n\t \tnode.getRight().setColor(Color.BLACK);\n\t }\n }\n return node;\n }",
"private TSTNode<E> deleteNodeRecursion(TSTNode<E> currentNode) {\n \n if(currentNode == null) return null;\n if(currentNode.relatives[TSTNode.EQKID] != null || currentNode.data != null) return null; // can't delete this node if it has a non-null eq kid or data\n\n TSTNode<E> currentParent = currentNode.relatives[TSTNode.PARENT];\n\n // if we've made it this far, then we know the currentNode isn't null, but its data and equal kid are null, so we can delete the current node\n // (before deleting the current node, we'll move any lower nodes higher in the tree)\n boolean lokidNull = currentNode.relatives[TSTNode.LOKID] == null;\n boolean hikidNull = currentNode.relatives[TSTNode.HIKID] == null;\n\n ////////////////////////////////////////////////////////////////////////\n // Add by Cheok. To resolve java.lang.NullPointerException\n // I am not sure this is the correct solution, as I have not gone\n // through this sourc code in detail.\n if (currentParent == null && currentNode == this.rootNode) {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n // Add by Cheok. To resolve java.lang.NullPointerException\n ////////////////////////////////////////////////////////////////////////\n\n // now find out what kind of child current node is\n int childType;\n if(currentParent.relatives[TSTNode.LOKID] == currentNode) {\n childType = TSTNode.LOKID;\n } else if(currentParent.relatives[TSTNode.EQKID] == currentNode) {\n childType = TSTNode.EQKID;\n } else if(currentParent.relatives[TSTNode.HIKID] == currentNode) {\n childType = TSTNode.HIKID;\n } else {\n // if this executes, then current node is root node\n rootNode = null;\n return null;\n }\n\n if(lokidNull && hikidNull) {\n // if we make it to here, all three kids are null and we can just delete this node\n currentParent.relatives[childType] = null;\n return currentParent;\n }\n\n // if we make it this far, we know that EQKID is null, and either HIKID or LOKID is null, or both HIKID and LOKID are NON-null\n if(lokidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.HIKID];\n currentNode.relatives[TSTNode.HIKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n if(hikidNull) {\n currentParent.relatives[childType] = currentNode.relatives[TSTNode.LOKID];\n currentNode.relatives[TSTNode.LOKID].relatives[TSTNode.PARENT] = currentParent;\n return currentParent;\n }\n\n int deltaHi = currentNode.relatives[TSTNode.HIKID].splitchar - currentNode.splitchar;\n int deltaLo = currentNode.splitchar - currentNode.relatives[TSTNode.LOKID].splitchar;\n int movingKid;\n TSTNode<E> targetNode;\n \n // if deltaHi is equal to deltaLo, then choose one of them at random, and make it \"further away\" from the current node's splitchar\n if(deltaHi == deltaLo) {\n if(Math.random() < 0.5) {\n deltaHi++;\n } else {\n deltaLo++;\n }\n }\n\n\tif(deltaHi > deltaLo) {\n movingKid = TSTNode.HIKID;\n targetNode = currentNode.relatives[TSTNode.LOKID];\n } else {\n movingKid = TSTNode.LOKID;\n targetNode = currentNode.relatives[TSTNode.HIKID];\n }\n\n while(targetNode.relatives[movingKid] != null) targetNode = targetNode.relatives[movingKid];\n \n // now targetNode.relatives[movingKid] is null, and we can put the moving kid into it.\n targetNode.relatives[movingKid] = currentNode.relatives[movingKid];\n\n // now we need to put the target node where the current node used to be\n currentParent.relatives[childType] = targetNode;\n targetNode.relatives[TSTNode.PARENT] = currentParent;\n\n if(!lokidNull) currentNode.relatives[TSTNode.LOKID] = null;\n if(!hikidNull) currentNode.relatives[TSTNode.HIKID] = null;\n\n // note that the statements above ensure currentNode is completely dereferenced, and so it will be garbage collected\n return currentParent;\n }",
"private static <K extends Comparable<? super K>, V> @Nullable Node<K, V> removeAndCopy0(\n K key, @Var Node<K, V> current) {\n\n @Var int comp = key.compareTo(current.getKey());\n\n if (comp < 0) {\n // key < current.data\n if (current.left == null) {\n // Target key is not in map.\n return current;\n }\n\n // Go down leftwards, keeping a red node.\n\n if (!Node.isRed(current.left) && !Node.isRed(current.left.left)) {\n // Push red to left if necessary.\n current = makeLeftRed(current);\n }\n\n // recursive descent\n Node<K, V> newLeft = removeAndCopy0(key, current.left);\n current = current.withLeftChild(newLeft);\n\n } else {\n // key >= current.data\n if ((comp > 0) && (current.right == null)) {\n // Target key is not in map.\n return current;\n }\n\n if (Node.isRed(current.left)) {\n // First chance to push red to right.\n current = rotateClockwise(current);\n\n // re-update comp\n comp = key.compareTo(current.getKey());\n assert comp >= 0;\n }\n\n if ((comp == 0) && (current.right == null)) {\n assert current.left == null;\n // We can delete the node easily, it's a leaf.\n return null;\n }\n\n if (!Node.isRed(current.right) && !Node.isRed(current.right.left)) {\n // Push red to right.\n current = makeRightRed(current);\n\n // re-update comp\n comp = key.compareTo(current.getKey());\n assert comp >= 0;\n }\n\n if (comp == 0) {\n // We have to delete current, but is has children.\n // We replace current with the smallest node in the right subtree (the \"successor\"),\n // and delete that (leaf) node there.\n\n @Var Node<K, V> successor = current.right;\n while (successor.left != null) {\n successor = successor.left;\n }\n\n // Delete the successor\n Node<K, V> newRight = removeMininumNodeInTree(current.right);\n // and replace current with it\n current =\n new Node<>(\n successor.getKey(),\n successor.getValue(),\n current.left,\n newRight,\n current.getColor());\n\n } else {\n // key > current.data\n // Go down rightwards.\n\n Node<K, V> newRight = removeAndCopy0(key, current.right);\n current = current.withRightChild(newRight);\n }\n }\n\n return restoreInvariants(current);\n }",
"private Node deleteRec(T val, Node node, boolean[] deleted) {\n if (node == null) {\n return null;\n }\n\n int comp = val.compareTo(node.val);\n if (comp == 0) {\n // This is the node to delete\n deleted[0] = true;\n if (node.left == null) {\n // Just slide the right child up\n return node.right;\n } else if (node.right == null) {\n // Just slide the left child up\n return node.left;\n } else {\n // Find next inorder node and replace deleted node with it\n T nextInorder = minValue(node.right);\n node.val = nextInorder;\n node.right = deleteRec(nextInorder, node.right, deleted);\n }\n } else if (comp < 0) {\n node.left = deleteRec(val, node.left, deleted);\n } else {\n node.right = deleteRec(val, node.right, deleted);\n }\n\n return node;\n }",
"public void delete(Node x) {\n if (!redoDone)\n redoStack.clear();\n else\n redoDone = false;\n BSTTrackingData log = new BSTTrackingData(x, x.left, x.right, x.parent, null, 'd');\n Boolean isRoot = x == root;\n Node toRemove = x;\n Node succ = null;\n if (x.left != null & x.right != null) { //if Case 3 - PartA change toRemove to the successor and remove it from the tree\n succ = successorForDelete(x); //use side function to get the successor (adjusted to improve retrack runtime)\n toRemove = succ;\n log.setSuccParent(succ.parent); //update log accordingly\n }\n stack.push(log);\n deleteUpToChild(toRemove); //function to handle removal of node with up to 1 child.\n if (succ != null) { //Case 3 part B - Place the successor in x's location in the tree.\n //update parent\n succ.parent = x.parent;\n if (isRoot) {\n root = succ;\n } else {\n if (x.parent.right == x) x.parent.right = succ;\n else x.parent.left = succ;\n }\n //update both children\n succ.right = x.right;\n if (x.right != null)\n x.right.parent = succ;\n succ.left = x.left;\n if (x.left != null)\n x.left.parent = succ;\n }\n\n }",
"private int deleteMax() {\n int ret = heap[0];\n heap[0] = heap[--size];\n\n // Move root back down\n int pos = 0;\n while (pos < size / 2) {\n int left = getLeftIdx(pos), right = getRightIdx(pos);\n\n // Compare left and right child elements and swap accordingly\n if (heap[pos] < heap[left] || heap[pos] < heap[right]) {\n if (heap[left] > heap[right]) {\n swap(pos, left);\n pos = left;\n } else {\n swap(pos, right);\n pos = right;\n }\n } else {\n break;\n }\n }\n\n return ret;\n }",
"public void delete(int val){\n Node parent = this.root;\n Node current = this.root;\n boolean isLeftChild = false;\n \n while (current.val != val){\n parent = current;\n if (current.val > val){\n isLeftChild = true;\n current = current.left;\n } else {\n isLeftChild = false;\n current = current.right;\n }\n \n if (current == null){\n return;\n }\n }\n \n // If we are here it means we have found the node\n // Case 1. leaf node\n if (current.left == null && current.right == null){\n if (current == this.root){\n this.root = null;\n }\n \n if (isLeftChild){\n parent.left = null;\n } else {\n parent.right = null;\n }\n }\n \n // Case 2. one child\n else if (current.left == null){\n if (current == this.root){\n this.root = current.right;\n } else if (isLeftChild){\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n } else if (current.right == null){\n if (current == this.root){\n this.root = current.left;\n } else if (isLeftChild){\n parent.left = current.left;\n } else {\n parent.right = current.left;\n }\n }\n \n // Case 3. two children. successor is the smallest node in the right subtree\n else if (current.left != null && current.right != null){\n Node successor = getSuccessor(current);\n if (current == this.root){\n root = successor;\n } else if (isLeftChild){\n parent.left = successor;\n } else {\n parent.right = successor;\n }\n }\n \n }",
"@Override\n /*\n * Delete an element from the binary tree. Return true if the element is\n * deleted successfully Return false if the element is not in the tree\n */\n public boolean delete(E e) {\n TreeNode<E> parent = null;\n TreeNode<E> current = root;\n while (current != null) {\n if (e.compareTo(current.element) < 0) {\n parent = current;\n current = current.left;\n } else if (e.compareTo(current.element) > 0) {\n parent = current;\n current = current.right;\n } else {\n break; // Element is in the tree pointed at by current\n }\n }\n if (current == null) {\n return false; // Element is not in the tree\n }// Case 1: current has no left children\n if (current.left == null) {\n// Connect the parent with the right child of the current node\n if (parent == null) {\n root = current.right;\n } else {\n if (e.compareTo(parent.element) < 0) {\n parent.left = current.right;\n } else {\n parent.right = current.right;\n }\n }\n } else {\n// Case 2: The current node has a left child\n// Locate the rightmost node in the left subtree of\n// the current node and also its parent\n TreeNode<E> parentOfRightMost = current;\n TreeNode<E> rightMost = current.left;\n while (rightMost.right != null) {\n parentOfRightMost = rightMost;\n rightMost = rightMost.right; // Keep going to the right\n }\n// Replace the element in current by the element in rightMost\n current.element = rightMost.element;\n// Eliminate rightmost node\n if (parentOfRightMost.right == rightMost) {\n\n parentOfRightMost.right = rightMost.left;\n } else // Special case: parentOfRightMost == current\n {\n parentOfRightMost.left = rightMost.left;\n }\n }\n size--;\n return true; // Element inserted\n }",
"@Override\n public boolean delete(E e) {\n TreeNode<E> curr = root;\n while(curr!= null){\n if(e.compareTo(curr.element)<0){\n curr = curr.left;\n }else if (e.compareTo(curr.element)>0){\n curr = curr.right;\n }else{\n break; // we found the element to delete\n }\n }\n \n if(curr == null){\n return false; // we did not found the element\n }else{\n \n if(curr.left == null){\n transplant(curr, curr.right);\n }else if(curr.right == null){\n transplant(curr, curr.left);\n }else{\n TreeNode<E> min = minimum(curr);\n if(min.parent != curr){\n transplant(min, min.right);\n min.right = curr.right;\n min.right.parent = min;\n }\n transplant(curr, min);\n min.left = curr.left;\n min.left.parent = min;\n }\n return true;\n }\n }",
"public boolean delete(Integer searchKey) {\n\t\tif(root == null) {\n\t\t\t// Empty BST\n\t\t\treturn false; \n\t\t} else if(root.getData() == searchKey) {\t\t\t\t\t\t\t\t\t\t// the root is the item we are looking to delete\n\t\t\tif(root.getLeftChild() == null && root.getRightChild() == null) { \t\t\t// root has no children \n\t\t\t\troot = null;\n\t\t\t\tlength--;\n\t\t\t\treturn true;\n\t\t\t} else if(root.getLeftChild() == null) {\t\t\t\t\t\t\t\t\t// root jut has right child\n\t\t\t\troot = root.getRightChild();\n\t\t\t\tlength--;\n\t\t\t\treturn true;\n\t\t\t} else if(root.getRightChild() == null) { \t\t\t\t\t\t\t\t\t// root just has left child\n\t\t\t\troot = root.getLeftChild();\n\t\t\t\tlength--;\n\t\t\t\treturn true; \n\t\t\t} else { \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// has two children, replace root with its successor\n\t\t\t\tTreeNode successorParent = root.getRightChild();\n\t\t\t\tif(successorParent.getLeftChild() == null) { \t\t\t\t\t\t\t// the successor is the roots right child\n\t\t\t\t\tTreeNode successor = successorParent;\n\t\t\t\t\tsuccessor.setLeftChild(root.getLeftChild());\n\t\t\t\t\troot = successor;\n\t\t\t\t\tlength--;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Go down the tree until we have located the successor and its parent\n\t\t\t\twhile(successorParent.getLeftChild().getLeftChild() != null) {\n\t\t\t\t\tsuccessorParent = successorParent.getLeftChild();\n\t\t\t\t}\n\t\t\t\tTreeNode successor = successorParent.getLeftChild();\n\t\t\t\t\n\t\t\t\tsuccessorParent.setLeftChild(successor.getRightChild());\t\t\t\t// make sure successors parent points to the correct place\n\n\t\t\t\t// Replace the current root with successor \n\t\t\t\tsuccessor.setLeftChild(root.getLeftChild());\n\t\t\t\tsuccessor.setRightChild(root.getRightChild());\n\t\t\t\troot = successor;\n\t\t\t\tlength--;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the item we are looking to delete is not the root, it is somewhere else in the tree or it doesn't exist at all\n\t\t\tTreeNode current = root; \n\n\t\t\t// Find the parent of the child to delete, or potentially find out that data does not exist in the tree and return false\n\t\t\twhile((current.getLeftChild() == null || current.getLeftChild().getData() != searchKey) && (current.getRightChild() == null || current.getRightChild().getData() != searchKey)) {\n\t\t\t\tif(searchKey > current.getData()) {\n\t\t\t\t\tif(current.getRightChild() == null) {\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent = current.getRightChild();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(current.getLeftChild() == null) {\n\t\t\t\t\t\treturn false; \n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent = current.getLeftChild();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the program has reached this point in the code, we know that either its left child or its right child must be \n\t\t\t// the node that we are looking to delete\n\t\t\tTreeNode parent = current;\n\t\t\tTreeNode child; \n\t\t\tboolean isRightChild; \n\t\t\t\n\t\t\t// Figure out if child is on the left or right\n\t\t\tif(searchKey > parent.getData()) {\n\t\t\t\tchild = parent.getRightChild();\n\t\t\t\tisRightChild = true; \n\t\t\t} else {\n\t\t\t\tchild = parent.getLeftChild();\n\t\t\t\tisRightChild = false; \n\t\t\t}\n\t\t\t\n\t\t\tif(child.getLeftChild() == null && child.getRightChild() == null) {\t\t\t// child has no children\n\t\t\t\treturn setChild(parent ,null ,isRightChild);\n\t\t\t} else if(child.getLeftChild() == null) {\t\t\t\t\t\t\t\t\t// child just has a right child \n\t\t\t\treturn setChild(parent, child.getRightChild(), isRightChild);\n\t\t\t} else if(child.getRightChild() == null) {\t\t\t\t\t\t\t\t\t// child just has a left child \n\t\t\t\treturn setChild(parent, child.getLeftChild(), isRightChild);\n\t\t\t} else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// has two children, replace child with its successor\n\t\t\t\tTreeNode successorParent = child.getRightChild();\n\t\t\t\tif(successorParent.getLeftChild() == null) {\t\t\t\t\t\t\t// the successor is the roots right child\n\t\t\t\t\treturn setChild(parent, child.getRightChild(), isRightChild);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Go down the tree until we have located the successor and its parent\n\t\t\t\twhile(successorParent.getLeftChild().getLeftChild() != null) {\n\t\t\t\t\tsuccessorParent = successorParent.getLeftChild();\n\t\t\t\t}\n\t\t\t\tTreeNode successor = successorParent.getLeftChild();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tsuccessorParent.setLeftChild(successor.getRightChild());\t\t\t\t// make sure successors parent points to the correct place\n\n\t\t\t\tsuccessor.setLeftChild(child.getLeftChild());\n\t\t\t\tsuccessor.setRightChild(child.getRightChild());\n\t\t\t\treturn setChild(parent, successor, isRightChild);\n\t\t\t}\n\t\t}\n\t}",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"public void deleteMin() {\n root = deleteMin(root);\n }",
"private NodeTest delete(NodeTest root, int data)\n\t{\n\t\t//if the root is null then there's no tree\n\t\tif (root == null)\n\t\t{\n\t\t\tSystem.out.println(\"There was no tree.\");\n\t\t\treturn null;\n\t\t}\n\t\t//if the data is less go to the left\n\t\telse if (data < root.data)\n\t\t{\n\t\t\troot.left = delete(root.left, data);\n\t\t}\n\t\t//otherwise go to the right\n\t\telse if (data > root.data)\n\t\t{\n\t\t\troot.right = delete(root.right, data);\n\t\t}\n\t\t//else, we have a hit, so find out how we are going to delete it\n\t\telse\n\t\t{\n\t\t\t//if there are no children then return null\n\t\t\t//because we can delete the NodeTest without worries\n\t\t\tif (root.left == null && root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no children NodeTests\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t//if there is no right-child then return the left\n\t\t\t//\n\t\t\telse if (root.right == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no right-children NodeTests\");\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t//if there is no left child return the right\n\t\t\telse if (root.left == null)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Delete, no left-children NodeTests\");\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if it is a parent NodeTest, we need to find the max of the lowest so we can fix the BST\n\t\t\t\troot.data = findMax(root.left);\n\t\t\t\troot.left = delete(root.left, root.data);\n\t\t\t}\n\t\t}\n\n\t\treturn root;\n\t}",
"private Node<Value> delMin(Node<Value> x)\r\n {\r\n if (x.left == null) return x.right;\r\n x.left = delMin(x.left);\r\n return x;\r\n }",
"private BinaryNode<E> _delete(BinaryNode<E> node, E e) {\n\t\tif (node == null) {\n\t\t\treturn null;\n\t\t}\n\t\tif (comparator.compare(e, node.getData()) < 0) // <, so go left\n\t\t\tnode.setLeftChild(_delete(node.getLeftChild(), e));// recursive call\n\t\telse if (comparator.compare(e, node.getData()) > 0) // >, so go right\n\t\t\tnode.setRightChild(_delete(node.getRightChild(), e));// recursive call\n\t\telse { // FOUND THE NODE\n\t\t\tfoundNode = true;\n\t\t\tnode = _deleteNode(node);\n\t\t}\n\t\treturn node;\n\t}",
"public void delete() {\n this.root = null;\n }",
"void deleteTree(TreeNode node) \n {\n root = null; \n }",
"public void deleteMin()\t\t\t\t//delete smallest key\n\t{\n\t\troot=deleteMin(root);\n\t}",
"public String remove()\n\t{\n\t\tString result = null;\n\t\tif (pointer > 0)\n\t\t{\n\t\t\tif (pointer == 1)\n\t\t\t{\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tString oldRoot = data[0];\n\t\t\t\tString oldLast = data[pointer - 1];\n\t\t\t\tdata[0] = oldLast;\n\t\t\t\tdata[pointer - 1] = oldRoot;\n\t\t\t\tpointer--;\n\t\t\t\tresult = data[pointer];\n\t\t\t\tint parent = 0;\n\t\t\t\t//left child\n\t\t\t\tint childLeft = parent * 2 + 1;\n\n\t\t\t\twhile (childLeft < pointer)\n\t\t\t\t{\n\t\t\t\t\t//right child\n\t\t\t\t\tint childRight = parent * 2 + 2;\n\t\t\t\t\t//assume the mininum of the two children is left child\n\t\t\t\t\tint childMin = childLeft;\n\t\t\t\t\tif (childRight < pointer)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (smallerThan(childRight, childLeft))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildMin = childRight;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (smallerThan(childMin, parent))\n\t\t\t\t\t{\n\t\t\t\t\t\t//downheap\n\t\t\t\t\t\tswap(childMin, parent);\n\t\t\t\t\t\tparent = childMin;\n\t\t\t\t\t\tchildLeft = parent * 2 + 1;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"public void binomialHeapDelete(Node x) {\n\t\tthis.binomialHeapDecreaseKey(x, Integer.MIN_VALUE);\n\t\tthis.binomialHeapExtractMin();\n\t}",
"public void delete(Item<K,V> i) {\n if (i.getL() == null && i.getR() == null) {\n if (i.getP() != null) {\n declineChild(i, null);\n } else {\n root = null;\n }\n } else if (i.getL() != null && i.getR() != null) {\n Item<K,V> s = successor(i);\n declineChild(s, s.getR());\n i.setK(s.getK());\n i.setV(s.getV());\n } else {\n Item<K,V> x = i.getL();\n if (x == null) {\n x = i.getR();\n }\n if (i.getP() != null) {\n declineChild(i, x);\n } else {\n root = x;\n x.setP(null);\n }\n }\n size -= 1;\n }",
"@Override\n @SuppressWarnings(\"Duplicates\")\n public V remove(K key) {\n TreeNode<KeyValuePair<K, V>> previous = root;\n TreeNode<KeyValuePair<K, V>> current = root;\n boolean smaller = false;\n V value = null;\n TreeNode<KeyValuePair<K, V>> result = null;\n int iter = 0;\n while(true) {\n if(current == null) {\n break;\n }\n// System.out.println(\"Iteration #\" + iter);\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(key.compareTo(current.getValue().getKey()) < 0) {\n// System.out.println(\"Less\");\n smaller = true;\n previous = current;\n current = current.getLeft();\n } else if(key.compareTo(current.getValue().getKey()) > 0) {\n// System.out.println(\"Larger\");\n smaller = false;\n previous = current;\n current = current.getRight();\n } else if (key.equals(current.getValue().getKey())) {\n if(current.getValue().getKey() == previous.getValue().getKey()) {\n if(current.getLeft() == null && current.getRight() == null) root = null;\n else if(current.getLeft() == null && current.getRight() != null) root = root.getRight();\n else if(current.getLeft() != null && current.getRight() == null) root = root.getLeft();\n else if(current.getRight() != null && current.getLeft() != null) current.setValue(minVal(current));\n }\n// System.out.println(\"Found the value! key:val = \" + current.getValue().getKey()+\":\"+current.getValue().getValue());\n// System.out.println(\"Previous = \" + previous.getValue());\n result = current;\n break;\n }\n iter++;\n }\n if(result != null) {\n// System.out.println(\"not null result\");\n value = result.getValue().getValue();\n if(current.getLeft() == null && current.getRight() == null) {\n if(smaller) previous.setLeft(null);\n else previous.setRight(null);\n } else if(current.getLeft() != null && current.getRight() == null) {\n if(smaller) previous.setLeft(current.getLeft());\n else previous.setRight(current.getLeft());\n } else if(current.getLeft() == null && current.getRight() != null) {\n// System.out.println(\"Right not null\");\n// System.out.println(\"Previous = \" + previous.getValue());\n// System.out.println(\"Current = \" + current.getValue());\n if(smaller) previous.setLeft(current.getRight());\n else previous.setRight(current.getRight());\n } else {\n// System.out.println(\"Else\");\n current.setValue(minVal(current));\n }\n size--;\n return value;\n }\n return null;\n }",
"public void delete(Key key) {\n\troot = delete(root, key);\t\n}",
"private Node deleteMin(Node n)\n {\n if (n.left == null) \n return n.right;\n n.left = deleteMin(n.left); \n n.count= 1 + size(n.left)+ size(n.right); \n return n;\n }",
"private Node removeHelper(K key, V value, Node p, Node saveRemove){\n if(p == null){\n saveRemove.value = null;\n return null;\n }\n int cmp = key.compareTo(p.key);\n if(cmp < 0){\n p.left = removeHelper(key, value, p.left, saveRemove);\n }else if(cmp > 0){\n p.right = removeHelper(key, value, p.right, saveRemove);\n }else if(p.value == value){\n // found the key\n size--;\n // found the key, consider 3 case of remove\n saveRemove.value = p.value;\n if(p.left == null && p.right == null){\n // case 0: no children\n return null;\n }\n if(p.left == null && p.right != null){\n // case 1: one children\n return p.right;\n }\n if(p.left != null && p.right == null){\n // case 1: one children\n return p.left;\n }\n if(p.left !=null && p.right != null) {\n // case 2: two children\n /** find the parent of left largest node of the tree */\n Node left_largest = largest(p.left);\n // move to p as new root\n p.key = left_largest.key;\n p.value = left_largest.value;\n // remove the left largest node, belongs to case 0\n p.left = removeHelper(left_largest.key, left_largest.value, p.left, new Node(null, null));\n // the size will -1 after remove the left largest, so we need to +1\n size++;\n return p;\n }\n }\n return p; // just to avoid missing return argument error\n }",
"private A deleteLargest(int subtree) {\n return null; \n }",
"private Node removeHelper(K key, Node p, Node saveRemove){\n if(p == null){\n saveRemove.value = null;\n return null;\n }\n int cmp = key.compareTo(p.key);\n if(cmp < 0){\n p.left = removeHelper(key, p.left, saveRemove);\n }else if(cmp > 0){\n p.right = removeHelper(key, p.right, saveRemove);\n }else{\n // found the key\n size--;\n // found the key, consider 3 case of remove\n saveRemove.value = p.value;\n if(p.left == null && p.right == null){\n // case 0: no children\n return null;\n }\n if(p.left == null && p.right != null){\n // case 1: one children\n return p.right;\n }\n if(p.left != null && p.right == null){\n // case 1: one children\n return p.left;\n }\n if(p.left !=null && p.right != null) {\n // case 2: two children\n /** find the parent of left largest node of the tree */\n Node left_largest = largest(p.left);\n // move to p as new root\n p.key = left_largest.key;\n p.value = left_largest.value;\n // remove the left largest node, belongs to case 0\n p.left = removeHelper(left_largest.key, p.left, new Node(null, null));\n // the size will -1 after remove the left largest, so we need to +1\n size++;\n return p;\n }\n }\n return p; // just to avoid missing return argument error\n }",
"public void delete(int index) {\n\t\tNode node = getNode(index+1);\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tnode.data = parentOfLast.right != null ? parentOfLast.right.data : parentOfLast.left.data;\n\t\tif (parentOfLast.right != null) {\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t}",
"public void delete(E e) {\n\t\tNode node = getNode(root, e);\n\t\tif (node == null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tNode parentOfLast = getNode(size >> 1);\n\t\tif (parentOfLast.right != null) {\n\t\t\tnode.data = parentOfLast.right.data;\n\t\t\tparentOfLast.right = null;\n\t\t}\n\t\telse {\n\t\t\tnode.data = parentOfLast.left.data;\n\t\t\tparentOfLast.left = null;\n\t\t}\n\t\tsize--;\n\t}",
"public NodeBinaryTree deleteNode(NodeBinaryTree node, int value)\n {\n if(node == null)\n {\n return null;\n }\n\n if(value < node.data)\n {\n node.leftNode = deleteNode(node.leftNode, value);\n }\n else if(value > node.data)\n {\n node.rightNode = deleteNode(node.rightNode, value);\n }\n else\n {\n // it is the condition where the the ndoe value is itself\n if(node.leftNode == null)\n {\n return node.rightNode;\n }\n else if(node.rightNode == null)\n {\n return node.leftNode;\n }\n\n // we traverse right part of tree for minimum value\n node.data = minimumValueOfRight(node.rightNode);\n node.rightNode = deleteNode(node.rightNode, node.data);\n }\n return node;\n }",
"private Node<E> delete(E item, Node<E> root){\n\t\t/** the item to delete does not exist */\n\t\tif(root == null){\n\t\t\tdeleteReturn = null;\n\t\t\treturn root;\n\t\t}\n\t\t\n\t\tint comparison = item.compareTo(root.item);\n\t\t\n\t\t/** delete from the left subtree */\n\t\tif(comparison < 0){\n\t\t\troot.left = delete(item, root.left);\n\t\t\treturn root;\n\t\t}\n\t\t/** delete from the right subtree */\n\t\telse if(comparison > 0){\n\t\t\troot.right = delete(item, root.right);\n\t\t\treturn root;\n\t\t}\n\t\t/** the node to delete is found */\n\t\telse{\n\t\t\tdeleteReturn = root.item;\n\t\t\t\n\t\t\t/** the node is a leaf */\n\t\t\tif(root.left == null && root.right == null){\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t/** the node has one left child */\n\t\t\telse if(root.left != null && root.right == null){\n\t\t\t\treturn root.left;\n\t\t\t}\n\t\t\t/** the node has one right child */\n\t\t\telse if(root.left == null && root.right != null){\n\t\t\t\treturn root.right;\n\t\t\t}\n\t\t\t/** the node has two children */\n\t\t\telse{\n\t\t\t\t/**\n\t\t\t\t* the left child becomes the local root\n\t\t\t\t*/\n\t\t\t\tif(root.left.right == null){\n\t\t\t\t\troot.item = root.left.item;\n\t\t\t\t\troot.left = root.left.left;\n\t\t\t\t\treturn root;\n\t\t\t\t}\n\t\t\t\t/**\n\t\t\t\t* find the left-rightmost node and replace the local root's\n\t\t\t\t* item with that of left-rightmost node.\n\t\t\t\t*/\n\t\t\t\telse{\n\t\t\t\t\troot.item = findRightmost(root.left);\n\t\t\t\t\treturn root;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }",
"public boolean Delete(int v_key){\n\tTree current_node ;\n\tTree parent_node ;\n\tboolean cont ;\n\tboolean found ;\n\tboolean is_root ;\n\tint key_aux ;\n\tboolean ntb ;\n\n\tcurrent_node = this ;\n\tparent_node = this ;\n\tcont = true ;\n\tfound = false ;\n\tis_root = true ;\n\twhile (cont){\n\t key_aux = current_node.GetKey();\n\t if (v_key < key_aux)\n\t\tif (current_node.GetHas_Left()){\n\t\t parent_node = current_node ;\n\t\t current_node = current_node.GetLeft() ;\n\t\t}\n\t\telse cont = false ;\n\t else \n\t\tif (key_aux < v_key)\n\t\t if (current_node.GetHas_Right()){\n\t\t\tparent_node = current_node ;\n\t\t\tcurrent_node = current_node.GetRight() ;\n\t\t }\n\t\t else cont = false ;\n\t\telse { \n\t\t if (is_root) \n\t\t\tif ((!current_node.GetHas_Right()) && \n\t\t\t (!current_node.GetHas_Left()) )\n\t\t\t ntb = true ;\n\t\t\telse \n\t\t\t ntb = this.Remove(parent_node,current_node); \n\t\t else ntb = this.Remove(parent_node,current_node);\n\t\t found = true ;\n\t\t cont = false ;\n\t\t}\n\t is_root = false ;\n\t}\n\treturn found ;\n }"
] | [
"0.7675434",
"0.75811046",
"0.7570921",
"0.75618756",
"0.7546824",
"0.7541166",
"0.7463868",
"0.7448523",
"0.7337411",
"0.7274061",
"0.72609407",
"0.7227596",
"0.7159877",
"0.7148806",
"0.71485376",
"0.71426237",
"0.714034",
"0.7094529",
"0.7063404",
"0.7030857",
"0.7023375",
"0.695774",
"0.6949588",
"0.69283766",
"0.69268256",
"0.69221115",
"0.69064444",
"0.68893516",
"0.688059",
"0.685675",
"0.6844989",
"0.68140095",
"0.6809316",
"0.67933595",
"0.6762522",
"0.6759343",
"0.67588633",
"0.6757468",
"0.6751184",
"0.6747782",
"0.6736532",
"0.6714875",
"0.6713471",
"0.67048204",
"0.6667282",
"0.66569036",
"0.663935",
"0.6630282",
"0.6623923",
"0.6614159",
"0.66119236",
"0.6600757",
"0.6581314",
"0.65725267",
"0.6561387",
"0.65599734",
"0.6555994",
"0.6547466",
"0.6546214",
"0.6546214",
"0.6540401",
"0.65375525",
"0.65374756",
"0.65246993",
"0.649677",
"0.6480474",
"0.6479905",
"0.6471887",
"0.64715964",
"0.644621",
"0.6443853",
"0.64323866",
"0.64290655",
"0.6423602",
"0.6417247",
"0.64091235",
"0.6398073",
"0.63959455",
"0.6389725",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846",
"0.63869846"
] | 0.63974595 | 77 |
Scanner in = new Scanner(System.in); int noOfInputs = Integer.parseInt(in.nextLine()); int[] numbers = new int[100]; numbers[0] = 8; // 3, 10, 1, 6, 14 }; //, 4, 7, 13, 20, 30, 25, 100, 90, 5, 35}; Heap heap = new Heap(numbers, 7); heap.buildHead(); heap.printHeap(); heap.replace(5); heap.printHeap(); | public static void main(String[] args) {
// heap.replace(5);
// heap.printHeap();
int[] numbers = {5, 3, 50, 2, 16, 1};
BinaryTreeNode binaryTreeHead = BuildBinarySearchTree.buildBinarySearchTree(numbers);
BinaryTreeTraversals.printLevelOrder(binaryTreeHead);
System.out.println("\n\n");
BinaryTreeTraversals.printInorderNonRecursive(binaryTreeHead);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Heap(int mx) // constructor\n{\nmaxSize = mx;\ncurrentSize = 0;\nheapArray = new Node[maxSize]; // create array\n}",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tPriorityQueue<Integer>heap=new PriorityQueue<Integer>(new comparison());\n\t\tPriorityQueue<Integer>heap1=new PriorityQueue<Integer>();\n\t\tint num=sc.nextInt();\n\t\tint k=sc.nextInt();\n\t\tfor(int i=0;i<num;i++)\n\t\t{\n\t\t\tint value=sc.nextInt();\n\t\t\theap.add(value);\n\t\t\theap1.add(value);\n\t\t\tif(heap.size()>k)\n\t\t\t{\n\t\t\t\theap.remove();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(heap.peek());\n\t\tfor(int i=0;i<k-1;i++)\n\t\t{\n\t\t\theap.remove();\n\t\t}\n\t\tSystem.out.println(heap.peek());\n\t}",
"public static void heapify() {\n //배열을 heap 자료형으로 만든다.\n // 1d 2d 2d 3d 3d 3d 3d 4d\n// int[] numbers = {9, 12, 1, 3, 6, 2, 8, 4};\n // 1depth의 자식노드 numbers[2i], numbers[2i+1]\n int[] numbers = {4, 1, 3, 2, 16, 9, 10, 14, 8, 7};\n int i = 1;\n while (true) {\n int target = numbers[i-1];\n int left = numbers[2*i-1];\n\n if (2*i == numbers.length) {\n if (left > target){\n numbers[i-1] = left;\n numbers[2*i-1] = target;\n }\n print(numbers);\n break;\n }\n int right =numbers[2*i];\n\n if (left > right) {\n if(left > target) {\n numbers[i-1] = left;\n numbers[2*i-1] = target;\n }\n }else if (right > left) {\n if (right > target) {\n numbers[i-1] = right;\n numbers[2*i] = target;\n }\n }\n i++;\n\n print(numbers);\n }\n\n }",
"public static void main(String[] args) {\n\r\n\t\tint [][] arr = new int[][] {\r\n\t\t\t{8,9,10,12},\r\n\t\t\t{2,5,9,12},\r\n\t\t\t{3,6,10,11},\r\n\t\t\t{1,4,7,8}\r\n\t\t};\t\t\r\n\t\t\r\n\t\tPriorityQueue<HeapNode> heap = new PriorityQueue<>();\r\n\t\tfor(int i=0;i<arr.length;i++)\r\n\t\t{\r\n\t\t\theap.offer(new HeapNode(arr[i][0], i, 0));\r\n\t\t}\r\n\t\tint count=0;\r\n\t\twhile(count<16)\r\n\t\t{\r\n\t\t\tHeapNode min = heap.poll();\r\n\t\t\tSystem.out.println(min.value);\r\n\t\t\tcount++;\r\n\t\t\tint value=0;\r\n\t\t\tint nextIndex=min.index+1;\r\n\t\t\tif(nextIndex < arr[min.k].length)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tvalue=arr[min.k][nextIndex];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tvalue=Integer.MAX_VALUE;\r\n\t\t\t}\r\n\t\t\theap.offer(new HeapNode(value, min.k, nextIndex));\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n int[] numeros = new int[20];\n Random rand = new Random();\n\n for (int i = 0; i < 20; i++){\n numeros[i] = rand.nextInt();\n }\n\n Sorter sort = new Sorter();\n sort.heapSort(numeros);\n\n for (int i = 0; i < 20; i++){\n System.out.println(numeros[i]+\" \");\n }\n\n }",
"public PriorityQueue(int size){\n heap = new Element[size];\n }",
"public static void main(String[] args) {\n\n\t\tHeap hp = new Heap();\n\t\thp.add(20);\n\t\thp.add(10);\n\t\thp.add(70);\n\t\thp.add(80);\n\t\thp.add(1);\n//\t\thp.display();\n//\n//\t\twhile (hp.size() != 0) {\n//\t\t\tSystem.out.println(hp.remove());\n//\t\t}\n\n\t\tint[] arr = { 1, 5, 2, 3, 10, 20, 2, 1, 6, 7 };\n\n\t\tKthLargest(arr, 3);\n\t}",
"public Heap12()\n {\n arrayList = new ArrayList<E>(5);\n size = 0;\n isMax = false;\n cap = 5;\n }",
"public Heap() {\n this.arr = new ArrayList<>();\n this.isMax = false;\n }",
"public static void heap(int[] data, int number){\n for(int i=1; i<number; i++){\n int child = i;\n while(child>0){\n int parent = child/2;\n if(data[child] > data[parent]){\n int temp=data[parent];\n data[parent]=data[child];\n data[child]=temp;\n }\n child=parent;\n }\n }\n }",
"public static void main(String[] args) {\n\t\tBufferedReader br = new BufferedReader(new InputStreamReader(System.in));\r\n\t\ttry {\r\n\t\t\tint T = Integer.parseInt(br.readLine());\r\n\t\t\tfor (int t = 0; t < T; t++) {\r\n\t\t\t\tint N = Integer.parseInt(br.readLine());\r\n\t\t\t\tint[] A = new int[N]; // 수열 저장\r\n\t\t\t\tint cnt = 0;\r\n\r\n\t\t\t\tfor (int i = 0; i < N / 10 + 1; i++) {\r\n\t\t\t\t\tString[] arr = br.readLine().split(\" \");\r\n\t\t\t\t\tfor (int j = 0; j < arr.length; j++) {\r\n\t\t\t\t\t\tA[cnt] = Integer.parseInt(arr[j]);\r\n\t\t\t\t\t\tcnt++;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tArrayList<Integer> result = new ArrayList<Integer>();\r\n\t\t\t\tPriorityQueue<Integer> maxheap = new PriorityQueue<Integer>(Collections.reverseOrder());\r\n\t\t\t\tPriorityQueue<Integer> minheap = new PriorityQueue<Integer>();\r\n\r\n\t\t\t\tfor (int i = 0; i < A.length; i++) {\r\n\t\t\t\t\tif (maxheap.size() == minheap.size())\r\n\t\t\t\t\t\tmaxheap.offer(A[i]);\r\n\t\t\t\t\telse if (maxheap.size() > minheap.size())\r\n\t\t\t\t\t\tminheap.offer(A[i]);\r\n\r\n\t\t\t\t\tif (!maxheap.isEmpty() && !minheap.isEmpty() && minheap.peek() < maxheap.peek()) {\r\n\t\t\t\t\t\tint max = maxheap.poll();\r\n\t\t\t\t\t\tint min = minheap.poll();\r\n\r\n\t\t\t\t\t\tminheap.offer(max);\r\n\t\t\t\t\t\tmaxheap.offer(min);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (i % 2 == 0) {\r\n\t\t\t\t\t\tresult.add(maxheap.peek());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tSystem.out.println(result.size());\r\n\t\t\t\tfor (int i = 0; i < result.size(); i++) {\r\n\t\t\t\t\tSystem.out.print(result.get(i) + \" \");\r\n\t\t\t\t\tif (i % 10 == 9)\r\n\t\t\t\t\t\tSystem.out.println();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public static void buildHeap(int[]data){\n for (int i = data.length-1; i>=0; i--){\n pushDown(data, data.length, i);\n }\n }",
"private static <T extends Comparable<T>> void buildHeap(T[] table)\n {\n int n = 1;\n while (n < table.length)\n {\n n++;\n int child = n-1;\n int parent = (child - 1) / 2;\n while (parent >=0 && table[parent].compareTo(table[child]) < 0)\n {\n swap (table, parent, child);\n child = parent;\n parent = (child - 1) / 2;\n }//end while\n }//end while\n }",
"public static void main(String[] args) {\n\t\tMaxHeap mh = new MaxHeap(10);\n\t\tmh.insert(12);\n\t\tmh.insert(7);\n\t\tmh.insert(6);\n\t\tmh.insert(10);\n\t\tmh.insert(8);\n\t\tmh.insert(20);\n\t\t\n\t\tmh.print();\n\t}",
"static void heapSort(int[] input){\n int len = input.length;\n for(int i=(len/2)-1;i>=0;i--){\n heapify(input,i,len);\n }\n for(int i = len-1;i>=0;i--){\n int temp = input[0];\n input[0] = input[i];\n input[i] = temp;\n heapify(input,0,i);\n }\n }",
"public Heap12( boolean isMaxHeap)\n {\n arrayList = new ArrayList<E>(5);\n size = 0;\n isMax = isMaxHeap;\n cap = 5;\n }",
"void buildHeap() {\n\tfor(int i=parent(size-1); i>=0; i--) {\n\t percolateDown(i);\n\t}\n }",
"public Heap(boolean isMin, Collection<ValueType> data) {\r\n // TODO\r\n }",
"public static void main(String[] args) {\n \n int swap = 0;\n \n Scanner scan = new Scanner(System.in);\n System.out.print(\"Kaç elemanlı = \");\n int max = scan.nextInt();\n\n int[] toSortArray = new int[max];\n\n toSortArray[0] = 0;\n\n for (int i = 1; i < max; i++) {\n\n toSortArray[i] = (int) (Math.random() * 100);\n toSortArray[0]++; //holds the number of values in the array;\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp;\n index = index / 2;\n\n }\n\n\t\t\t//Hence the heap is created!\n }\n\n System.out.println(\"The array to be sorted is:\");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n\n }\n\n System.out.println(\" | \");\n\n\t\t//Start\n\t\t//Let's Sort it out now!\n while (toSortArray[0] > 0) {\n\n int temp = toSortArray[1];\n toSortArray[1] = toSortArray[toSortArray[0]];\n toSortArray[toSortArray[0]] = temp;\n\n for (int i = 1; i < toSortArray[0]; i++) {\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp1 = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp1;\n index = index / 2;\n swap = swap+1;\n\n }\n\n }\n\n toSortArray[0]--;\n\n }\n\n\t\t//End\n System.out.println(\"The sorted array is: \");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n }\n\n System.out.println(\" | \");\n System.out.println(max + \" eleman için \"+ swap + \" adet eleman yerdeğiştirildi. \" );\n\n }",
"public void makeHeap() {\r\n\t\t//for (int i = (theHeap.size() >> 1) - 1; i >= 0; i--) {\r\n\t\tfor (int i = (theHeap.size() - 1) >> 1; i >= 0; i--) {\r\n\t\t\tsiftDown(i);\r\n\t\t}\r\n\t}",
"private static void buildHeap(int arr[], int n) \n\t\t{\n\t\t\tfor(int i=n;i>=0;i++)\n\t\t\t\theapify(arr,n,i);\n\t\t\t\n\t\t}",
"public Program2(int numStudents) {\n minHeap = new Heap();\n students = new ArrayList<Student>();\n }",
"public Heap(int maxSize, int[] _dist, int[] _hPos) \r\n {\r\n N = 0;\r\n h = new int[maxSize + 1];\r\n dist = _dist;\r\n hPos = _hPos;\r\n }",
"public HeapPriorityQueue(int size)\n\t{\n\t\tstorage = new Comparable[size + 1];\n\t\tcurrentSize = 0;\n\t}",
"void buildHeap() {\n for (int i = parent(size - 1); i >= 0; i--) {\n percolateDown(i);\n }\n }",
"private void heapifyAdd() {\n // TODO. The general idea of this method is that we are checking whether the \n // most recently added item, which has been put at the end of the array, \n //needs to be swapped with its parent. We do this in a loop, until a swap isn’t needed or we reach the root. This is not recursive.\n\n // Pseudocode:\n // assign newly added item to a temp var.\n // use an index variable to keep track of the index where that value was added\n // while the index isn’t pointing at the root, and while the node at this index is greater than the node at its parent:\n // copy the parent node to the index location (move parent node down the heap)\n // set the index to the parent index\n // when we are at the root, or the parent of current index isn’t bigger, we are done\n // copy the temp variable to the location of the current index. \n T temp;\n int next = count - 1;\n\n temp = heap[next];\n\n while ((next != 0) && (((Comparable) temp).compareTo(heap[(next - 1) / 2]) > 0)) {\n heap[next] = heap[(next - 1) / 2];\n next = (next - 1) / 2;\n }\n heap[next] = temp;\n }",
"public void buildMaxHeap(){\n\t\tfor(int i = (n-2)/2 ; i >= 0; i--){\n\t\t\tmaxHeapfy(i);\n\t\t}\n\t}",
"@Test\n public void canHeapSort(){\n int[] array = {5, 6, 3, 7, 9, 1};\n heapSort(array);\n for (int elem : array) {\n System.out.println(elem + \" \");\n }\n }",
"Heap(int[] arr){\n\t\tthis.heap = new int[arr.length+1];\n\t\tfor(int i=1; i<arr.length+1; i++) {\n\t\t\tthis.heap[i] = arr[i-1];\n\t\t}\n\t}",
"private void heapify() {\n for (int i=N/2; i>=1; i--)\n sink(i);\n }",
"@Test\n public void test() {\n List<Integer> list = Arrays.asList(48, 12, 24, 7, 8, -5, 24, 391, 24, 56, 2, 6, 8, 41);\n Heap minHeap = new Heap(Heap.MIN_HEAP, list);\n List<Integer> expected = Arrays.asList(-5, 2, 6, 7, 8, 8, 24, 391, 24, 56, 12, 24, 48, 41);\n Assert.assertArrayEquals(expected.toArray(), minHeap.heap.toArray());\n Heap maxHeap = new Heap(Heap.MAX_HEAP, list);\n Assert.assertArrayEquals(expected.toArray(), maxHeap.heap.toArray());\n }",
"private static void Heapify(int[] A, int i, int size)\n {\n // get left and right child of node at index i\n int left = LEFT(i);\n int right = RIGHT(i);\n\n int smallest = i;\n\n // compare A[i] with its left and right child\n // and find smallest value\n if (left < size && A[left] < A[i]) {\n smallest = left;\n }\n\n if (right < size && A[right] < A[smallest]) {\n smallest = right;\n }\n\n // swap with child having lesser value and\n // call heapify-down on the child\n if (smallest != i) {\n swap(A, i, smallest);\n Heapify(A, smallest, size);\n }\n }",
"public Sorter()\n {\n this.largestSize = largestSize;\n this.size = 0;\n this.heap = new ArrayList<Node>();\n\n }",
"public static void main(String[] args) {\n\t\tint A[] = { 17, 15, 13, 9, 6, 5, 10, 4, 8, 3, 1 };\t\t// max-heap structure\n\t\t//index\t\t0 1 2 3 4 5 6 7 8 9 10\n\t\t\n\t\tdeleteMax(A);\n\t\tSystem.out.println(Arrays.toString(A));\n\t}",
"void MaxInsert(int x)\n {\n if (size == capacity) {\n return;\n }\n size++;\n arr[size - 1] = x;\n for (int i = size - 1; i != 0 && arr[MyHeap.parent(i)] < arr[i]; )\n {\n swap(i,MyHeap.parent(i));\n i = MyHeap.parent(i);\n }\n }",
"public Heap(){\n super();\n }",
"public MinHeap() {\n\tdata = new ArrayList<Integer>();\n\t}",
"private void heapify(T[] array) \n\t{\n\t\tfor (int i=0; i < array.length; i++)\n\t\t{\n\t\t\tinsert(array[i], i);\n\t\t}\n\t}",
"@Test\n\tpublic void testHeap() {\n\t\t// merely a suggestion \n\t}",
"public static void insertHeap(int x)\n {\n if(s.isEmpty()){\n s.add(x);\n }\n else if(x>s.peek()){\n g.add(x);\n }\n else if(g.isEmpty()){\n g.add(s.poll());\n s.add(x);\n }\n else {\n s.add(x);\n }\n balanceHeaps();\n \n }",
"public static void main(String[] args) {\n\t\tQueue<Integer> queue = new LinkedList<Integer>();\r\n Scanner s = new Scanner(System.in);\r\n int n = s.nextInt();\r\n while (n-- > 0)\r\n queue.add(s.nextInt());\r\n sort(queue);\r\n\t}",
"public MinHeap(){\r\n nextAvail = 1;\r\n }",
"public static void main(String args[])\n {\n boolean debug = false; \n\n Scanner sc = new Scanner(System.in); \n ArrayList<Integer> arraylist = new ArrayList<Integer>();\n while (sc.hasNextInt()) \n {\n arraylist.add(sc.nextInt());\n }\n\n Tree<Integer> tree = new Tree<>(arraylist, debug);\n List<Integer> it = tree.sort(); \n \n for (int i = 0; i < it.size(); i++)\n {\n System.out.println(it.get(i));\n }\n }",
"void Minheap()\n {\n for(int i= (size-2)/2;i>=0;i--)\n {\n minHeapify(i);\n }\n }",
"public static void main(String[] args) {\n\t\tScanner sc=new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint item;\n\t\tpriority c=new priority();\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\titem=sc.nextInt();\n\t\t\tc.add(item);\n\t\t\t\n\t\t}\n\t\t//c.highestremove();\n\t\tc.hightest();\n\tc.display();\n\t\t//c.display();\n\n\t}",
"public static void main(String[] args) {\n\t\tint[] arr = \n\t\t\t{18, 30, 21, -1, 53, 65, 70, -1, -1, 25, 46, -1, 35, 61, 32, -1, 15, 8, 17, -1, 55};\n\t\t\n\t\tSystem.out.println(\"\\nArray before buliding heap:\");\n\t\tfor(int i=0; i<arr.length; i++) {\n\t\t\tSystem.out.print(arr[i] + \" \");\n\t\t}\n\t\tSystem.out.print(\"\\n\");\n\t\t\n\t\tHeap h = new Heap(arr);\n\t\t\n\t\th.buildHeap();\n\t\tSystem.out.println(\"\\nFirst element indicates size of heap:\\nHeap after applying build heap:\");\n\t\th.printHeap();\n\t\t\n\t\th.heapsort();\n\t\tSystem.out.println(\"\\nHeap after applying heap sort:\");\n\t\th.printHeap();\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"enter the size of array\");\r\n\t\tScanner console = new Scanner(System.in);\r\n\t\tint n = console.nextInt();\r\n\t\tint arr[] = new int[n];\r\n\t\tfor (int x = 0; x < arr.length; x++) {\r\n\t\t\tSystem.out.println(\"Enter the value to be inserted into array\");\r\n\t\t\tarr[x] = console.nextInt();\r\n\t\t}\r\n\t\tconsole.close();\r\n\t\tfor(int i=0;i<n-1;i++){\r\n\t\t\tint min=i;\r\n\t\t\tfor(int j=i+1;j<n;j++){\r\n\t\t\t\tif (arr[j]<arr[min])\r\n\t\t\t\t{\r\n\t\t\t\t\tmin=j;\r\n\t\t\t\t\tint temp=arr[min];\r\n\t\t\t\t\tarr[min]=arr[i];\r\n\t\t\t\t\tarr[i]=temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int x:arr){\r\n\t\t\tSystem.out.print(x+\" \");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"@Test\n\tpublic void testHeapify() {\n\t\tHeap heap = new Heap(testArrayList);\n\t\theap.heapify(0);\n\t\tArrayList<Integer> expected = new ArrayList<>(\n\t\t\t\tArrays.asList(3, 5, 33, 36, 15, 70, 24, 47, 7, 27, 38, 48, 53, 32, 93));\n\t\tassertEquals(expected, heap.getHeapArray());\n\t}",
"public static void makeHeap(char[] heap, int size, CharComparator c) {\n/* 124 */ int i = size >>> 1;\n/* 125 */ while (i-- != 0)\n/* 126 */ downHeap(heap, size, i, c); \n/* */ }",
"public FourCacheHeap(ArrayList<HuffManEntry> input) {\n\t\tthis(input.size());\n\t\taddAll(input);\n\t}",
"private void heapify(int idx) {\r\n // TODO\r\n }",
"public void buildHeap() {\n\t\tthis.makeComplete();\n\t\tfor(int i = this.size/2; i >= 1; i--)\n\t\t\tthis.heapify(i);\n\t}",
"public static void main(String[] args)\r\n {\r\n ArrayHeapClass testClass = new ArrayHeapClass();\r\n String testValue;\r\n int index;\r\n\r\n for( index = 0; index < 25; index++ )\r\n {\r\n testValue = testClass.createHeapDataItem();\r\n\r\n System.out.println( \"Adding data Value: \"\r\n + testValue + \", Priority: \"\r\n + testClass.getPriority( testValue ) );\r\n\r\n testClass.addItem( testValue );\r\n }\r\n\r\n for( index = 0; index < 25; index++ )\r\n {\r\n testValue = testClass.removeItem();\r\n\r\n System.out.println( \"Data value removed: \" + testValue );\r\n }\r\n\r\n testClass.setDisplayFlag( true );\r\n\r\n for( index = 0; index < 25; index++ )\r\n {\r\n testValue = testClass.createHeapDataItem();\r\n\r\n testClass.addItem( testValue );\r\n }\r\n\r\n for( index = 0; index < 25; index++ )\r\n {\r\n testValue = testClass.removeItem();\r\n }\r\n }",
"public static void heapify(Integer arr[])\n {\n N = arr.length-1;\n for (int i = N/2; i >= 0; i--)\n maxheap(arr, i);\n }",
"public HeapIntPriorityQueue() {\n elementData = new int[10];\n size = 0;\n }",
"void insert(int ele){\n if(heapLen>=A.length)\n {\n System.out.println(\"Heap is full\");\n }\n else\n {\n A[heapLen] = 1<< 31;\n heapLen++;\n increaseKey(heapLen, ele);\n \n \n }\n }",
"public void binomialHeapInsert(Node x) {\n\t\tBinomialHeap h = new BinomialHeap();\n\t\th.head = x;\n\t\tBinomialHeap hPrime = this.binomialHeapUnion(h);\n\t\tthis.head = hPrime.head;\t\t\n\t}",
"public BinHeap(int maxSize)\n {\n // allocate heap to hold maxSize elements\n arr = (T[]) new Comparable[maxSize];\n // set size of heap to 0\n size = 0;\n }",
"public ArrayHeap() {\r\n capacity = 10;\r\n length = 0;\r\n heap = makeArrayOfT(capacity);\r\n }",
"public void heapify(int parent) { \t\n \tint largest = parent;\n \tint lchild = 2*parent;\n int rchild = 2*parent + 1;\n if (lchild <= this.size && this.heap[lchild] > this.heap[largest]) \n largest = lchild; \n \n if (rchild <= this.size && this.heap[rchild] > this.heap[largest]) \n largest = rchild; \n \n if (largest != parent) \n { \n int temp = this.heap[parent]; \n this.heap[parent] = this.heap[largest]; \n this.heap[largest] = temp;\n this.heapify(largest);\n } \n }",
"public static void main(String[] args) {\n Queue<Integer> values=new PriorityQueue<>();\r\n values.add(87);\r\n\t values.add(97);\r\n\t values.add(34);\r\n\t values.add(92);\r\n\t System.out.println(values);\r\n\t}",
"public static void heapSort(int arr[]) {\n int n = arr.length;\n\n //Creating heap\n for (int i = n / 2 - 1; i >= 0; i--)\n heapify(arr, n, i);\n\n //Taking elements from heap one by one\n for (int i = n - 1; i > 0; i--) {\n //Place current root to end\n int temp = arr[0];\n arr[0] = arr[i];\n arr[i] = temp;\n\n //Call max heapify\n heapify(arr, i, 0);\n }\n }",
"void buildMaxHeap(int[] array, int heapSize) {\n for (int i = heapSize / 2 - 1; i >= 0; i--) heapify(array, i, heapSize);\n }",
"public PriorityQueue()\n {\n // initialise instance variables\n heap = new PriorityCustomer[100];\n size = 0;\n }",
"public void insert(int data) {\n if (this.size < this.maxsize) {\n // Insert\n Heap[++size] = data;\n\n // Heap properties can get violated\n int current = this.size;\n while (Heap[current] > Heap[parent(current)]) {\n swap(current, parent(current));\n current = parent(current);\n }\n }\n }",
"public static void main(String[] args) \n\t{\n\t\tScanner sc = new Scanner(System.in);\n\t\tint T;\n\t\t//show(10000);\n\n\t\tT=sc.nextInt();\n\t\tint N;\n\t\tint[] P;\n\t\tint[] Pa;\n\n\t\t/*\n\t\t 여러 개의 테스트 케이스가 주어지므로, 각각을 처리합니다.\n\t\t */\n\n\t\tfor(int test_case = 1; test_case <= T; test_case++)\n\t\t{\n\t\t\tanswer=0;\n\t\t\t//tree = new HashMap<Integer,Integer>();\n\t\t\t//Q=new LinkedList<Integer>();\n\n\t\t\tN=sc.nextInt();\n\t\t\tP=new int[N];\n\t\t\tPa=new int[N];\n\n\t\t\t//tree.put(0, 0);\n\t\t\t//System.out.println(Pa[124]);\n\t\t\tPa[0]=0;\n\t\t\tP[0]=0;\n\t\t\tfor(int i=1;i<N;i++) {\n\t\t\t\tP[i] = sc.nextInt()-1;\n\t\t\t\t//tree.put(i, (tree.get(P[i]))+1);\n\t\t\t\t\n\t\t\t\tPa[i]=Pa[P[i]]+1;\n\t\t\t}\n\t\t\tenQueue(N,P,0,0,0,Pa);\n\t\t\t//answer=dfs(0,P);\n\n\t\t\tSystem.out.println(\"#\"+test_case+\" \"+answer);\n\t\t}\n\t}",
"public void insert(int value) {\r\n\t\tif (this.empty) {\r\n\t\t\tthis.empty = false;\r\n\t\t\tthis.size++;\r\n\t\t\tHeapTreesArray[0] = new HeapNode(value);\r\n\t\t\tthis.min = HeapTreesArray[0];\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tHeapNode hN = new HeapNode(value);\r\n\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\tbH.insert(value);\r\n\t\tthis.meld(bH);\r\n\t\tif (this.min.value > value) {\r\n\t\t\tthis.min = hN;\r\n\t\t}\r\n\t}",
"public void printHeap() {\n \tSystem.out.println(\"Binomial heap Representation:\");\n \tNode x = this.head;\n if (x != null)\n x.print(0);\n }",
"public Heap(int capacity) {\n\t\t this.capacity = capacity;\n\t\t data = new Integer[this.capacity];\t\n\t\t size = 0;\n\t }",
"public static void sort(Comparable[] pq) {\n int n = pq.length;\n \n /*\n * Fill in this method! Use the code on p. 324 of the book as a model,\n * but change it so each node in the heap has 3 children instead of 2.\n */\n }",
"public interface IHeap<T extends Comparable<T>> {\n\n void display();\n\n void initOriginList(List<T> orginList);\n\n void makeHeap(int first, int last);\n\n void popHeap(int first, int last);\n\n void pushHeap(int first, int last);\n\n List<T> getHeap();\n\n}",
"public void buildHeap(int[] arr) {\n int size = arr.length;\n\n for (int i = getParentIndex(size); i >= 0; i--) {\n minHeapify(i);\n }\n }",
"@Before\n public void setUpBinaryMinHeaps() {\n empty = new BinaryMinHeap<>();\n emptyArr = new ArrayList<>();\n \n multipleElements = new BinaryMinHeap<>();\n multipleElements.insert(7);\n multipleElements.insert(8);\n multipleElements.insert(5);\n multipleElements.insert(3);\n multipleElements.insert(2);\n multipleElements.insert(6);\n \n multiArr = new ArrayList<>();\n multiArr.add(2);\n multiArr.add(3);\n multiArr.add(6);\n multiArr.add(8);\n multiArr.add(5);\n multiArr.add(7);\n \n }",
"public FibonacciHeap() {}",
"public static void main(String[] args) {\nSystem.out.println(\"enter n\");\n\t\tScanner sc =new Scanner(System.in);\n\t\tint n=sc.nextInt();\n\t\tint arr[]=new int[n]; \n\t\tproblem2 pb=new problem2(arr,n);\n\t\tpb.read();\n\t\tpb.display();\n\t\tpb.sort();\n\t\tpb.search();\n\t\t\n\t}",
"private static void buildMaxHeapify(int arr[]) {\n // Build heap (Re-Arrange the @array).\n System.out.print(\"=> Building Max-Heapified array.........\");\n for (int i = arr.length / 2 - 1; i >= 0; i--) {\n maxHeapify(arr, arr.length, i);\n }\n System.out.println(\"Success !!!\");\n }",
"public Heap() {\r\n\t\tthis(DEFAULT_INITIAL_CAPACITY, null);\r\n\t}",
"public void read(int value) {\n if (maxHeap.isEmpty() || value <= maxHeap.peek()) {\n maxHeap.add(value);\n } else {\n minHeap.add(value);\n }\n // re-order\n if (maxHeap.size() - minHeap.size() >= 2) {\n minHeap.add(maxHeap.poll());\n } else if (minHeap.size() > maxHeap.size()) {\n maxHeap.add(minHeap.poll());\n }\n }",
"public BinHeap()\n {\n // allocate heap to hold 100 items\n arr = (T[]) new Comparable[100];\n // set size of heap to 0\n size = 0;\n }",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = null;\n while (!(line = br.readLine()).equals(\"#\")){\n String[] l = line.split(\" \");\n register(Integer.parseInt(l[1]),Integer.parseInt(l[2]));\n }\n\n int K = Integer.parseInt(br.readLine());\n int size = K * s.size();\n pq = new PriorityQueue<pair<Long, Integer>>(size, new Comparator<pair<Long, Integer>>() {\n @Override\n public int compare(pair<Long, Integer> o1, pair<Long, Integer> o2) {\n return (int)(o1.x- o2.x);\n }\n });\n// System.out.println(K);\n List<Long> list = new ArrayList<Long>();\n for(pair<Integer, Integer> p: s){\n long idx = p.y;\n long limit = (K+1)* (p.y);\n// System.out.println(idx+\"-\"+K);\n while(idx < limit){\n// System.out.println(idx+\"--\"+p.x);\n pq.add(new pair<Long, Integer>(idx, p.x));\n idx += p.y;\n }\n }\n for(int ix = K; ix>0; ix--){\n System.out.println(pq.poll().y);\n }\n // print K times. each time may have differenet queue numbers\n\n// for(pair<Integer, Integer> p: pq){\n// System.out.println(p.toString());\n// }\n }",
"private void grow() {\n int oldCapacity = heap.length;\n // Double size if small; else grow by 50%\n int newCapacity = oldCapacity + ((oldCapacity < 64) ?\n (oldCapacity + 2) :\n (oldCapacity >> 1));\n Object[] newQueue = new Object[newCapacity];\n for (int i = 0; i < heap.length; i++) {\n newQueue[i] = heap[i];\n }\n heap = newQueue;\n }",
"public Heap12( int capacity, boolean isMaxHeap)\n {\n arrayList = new ArrayList<E>(capacity);\n size = 0;\n isMax = isMaxHeap;\n cap = capacity;\n }",
"private static void Heapify(int[] A , int i , int size){\r\n\t\t\r\n\t\tint left = LEFT(i);\r\n\t\tint right = RIGHT(i);\r\n\t\tint smallest =i;\r\n\t\t\r\n\t\t// get left and right child of node at index i \r\n\t\t//& compare A[i] with its left and right child\r\n\t\t\r\n\t\tif(left<size && A[left] < A[i]){\r\n\t\t\tsmallest = left;\r\n\t\t}\r\n\t\tif(right<size && A[right] < A[smallest]){\r\n\t\t\tsmallest = right;\r\n\t\t}\r\n\t\t// swap with child having lesser value and\r\n\t\t// call heapify-down on the child\r\n\t\tif(smallest !=i){\r\n\t\t\tswap(A,i,smallest);\r\n\t\t\tHeapify(A,smallest,size);\r\n\t\t}\r\n\t\t\r\n\t}",
"void MinInsert(int x)\n {\n if (size == capacity) {\n return;\n }\n size++;\n arr[size - 1] = x;\n for (int i = size - 1; i != 0 && arr[MyHeap.parent(i)] > arr[i]; )\n {\n swap(i,MyHeap.parent(i));\n i = MyHeap.parent(i);\n }\n }",
"public HeapPriorityQueue () \n\t{\n\t\tthis(DEFAULT_SIZE);\n\t}",
"private void setMinHeap() {\n // parentIndex is the last leaf node parentIndex\n int parentIndex = (array.length - 2) / 2;\n // from last parentIndex down on the depth path to the root\n // convert to minHeap\n while (parentIndex >= 0) { // when parentIndex = 0, the root\n minHeapify(parentIndex, array.length);\n // go to next index(parentIndex) on that level\n parentIndex--;\n }\n }",
"public static int insertIntoMaxHeap(Heap<Integer> heap, int data) {\n\t\tint i;\n\t\tif (heap.count == heap.capacity) {\n\t\t\tresizeHeap(heap);\n\t\t}\n\t\theap.count++;\n\t\ti = heap.count - 1;\n\t\twhile (i > 0 && data > heap.elements[(i - 1) / 2]) {\n\t\t\theap.elements[i] = heap.elements[(i - 1) / 2];\n\t\t\ti = (i - 1) / 2;\n\t\t}\n\t\theap.elements[i] = data;\n\t\treturn i;\n\t}",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tSystem.out.print(\"Number of input: \");\n\t\tint input = scan.nextInt();\n\t\tint[] initialSet = new int[input];\n\t\t\n\t\t//input user numbers into set array\n\t\tSystem.out.print(\"Enter \" + input + \" numbers: \");\n\t\tfor(int i = 0; i < input; i++){\n\t\t\tinitialSet[i] = scan.nextInt();\n\t\t}\n\t\t\n\t\t//find partition\n\t\tpartition(initialSet, input);\n\t\t\n\t}",
"public BinaryHeap(int maxCapacity) {\n\tpq = new Comparable[maxCapacity];\n\tsize = 0;\n }",
"public static void heapify(int arr[]) {\n N = arr.length - 1;\n for (int i = N / 2; i >= 0; i--)\n maxheap(arr, i);\n }",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"--------------------------------Binary search Tree---------------------------------------\");\n\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\n\t\tBSTTree bstTree = new BSTTree();\n\t\t\n\t\tinput = new Scanner(System.in);\n\t\tSystem.out.println(\"Enter the list of nodes(Integer) to insert into tree with comma seperated (eg: 1,2,3): \");\n\t\t\n\t\t//Code for getting user node as Input value\n\t\t/*\n\t\t * String treeNodes = input.nextLine(); String[] nodes = treeNodes.split(\",\");\n\t\t * for (String value : nodes) { bstTree.insert(Integer.parseInt(value.trim()));\n\t\t * }\n\t\t */\n\t\t\n\t\t\t\t\n\t\t/*\n\t\t * bstTree.insert(25); bstTree.insert(20); bstTree.insert(15);\n\t\t * bstTree.insert(27); bstTree.insert(30); bstTree.insert(29);\n\t\t * bstTree.insert(26); bstTree.insert(22); bstTree.insert(32);\n\t\t * bstTree.insert(17);\n\t\t */\n\t\t\n\t\t\n\t\tbstTree.insert(100);\n\t\tbstTree.insert(58); \n\t\tbstTree.insert(30); \n\t\tbstTree.insert(47); \n\t\tbstTree.insert(25);\n\t\tbstTree.insert(39);\n\t\tbstTree.insert(125);\n\t\tbstTree.insert(111);\n\t\tbstTree.insert(137);\n\t\tbstTree.insert(110);\n\t\tbstTree.insert(120);\n\t\tbstTree.insert(130);\n\t\tbstTree.insert(140);\n\t\tbstTree.insert(109);\n\t\tbstTree.insert(121);\n\t\tbstTree.insert(119);\n\t\t\n\t\tSystem.out.println(\"Nodes are inserted into the tree\");\t\t\n\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\n\t\tfor(;;) {\n\t\t\tSystem.out.println(\"1. Insert Node into Tree\");\n\t\t\tSystem.out.println(\"2. In order Traversal\");\n\t\t\tSystem.out.println(\"3. Pre order Traversal\");\n\t\t\tSystem.out.println(\"4. Post order Traversal\");\n\t\t\tSystem.out.println(\"5. Find minimum value of tree\");\n\t\t\tSystem.out.println(\"6. Find maximum value of the tree\");\n\t\t\tSystem.out.println(\"7. Height of the tree\");\n\t\t\tSystem.out.println(\"8. Search Node in tree\");\n\t\t\tSystem.out.println(\"9. Delete Node in tree\");\n\t\t\tSystem.out.println(\"10. Find path between root and node\");\n\t\t\tSystem.out.println(\"Exit\");\n\t\t\tSystem.out.println(\"Enter your option : \");\t\t\t\n\t\t\tint inputOption = Integer.parseInt(input.nextLine());\t\t\t\n\t\t\tswitch(inputOption) {\n\t\t\tcase 1:\n\t\t\t\tSystem.out.println(\"Enter the node value to insert into tree : \");\n\t\t\t\tString value = input.nextLine();\n\t\t\t\tbstTree.insert(Integer.parseInt(value.trim()));\n\t\t\tcase 2:\n\t\t\t\tSystem.out.print(\"In Order Traversal : \");\n\t\t\t\tbstTree.traverseInOrderNode();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tSystem.out.print(\"Pre Order Traversal : \");\n\t\t\t\tbstTree.traversePreOrderNode();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tSystem.out.print(\"Post Order Traversal : \");\n\t\t\t\tbstTree.traversePostOrderNode();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tSystem.out.println(bstTree != null && bstTree.getMinimum()!=null ? \"Minimum value in the tree : \" + bstTree.getMinimum().getData() : \"Empty Tree\");\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 6:\t\t\t\t\n\t\t\t\tSystem.out.println(bstTree != null && bstTree.getMaximum()!= null ? \"Maximum value in the tree : \" + bstTree.getMaximum().getData() : \"Empty tree\");\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tSystem.out.println(\"Height of the Binary Search Tree : \" + bstTree.getHeight());\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tSystem.out.println(\"Enter the node o search in the tree : \");\n\t\t\t\tint searchNode = Integer.parseInt(input.nextLine());\t\n\t\t\t\tif(null!=bstTree.getNode(searchNode)) {\n\t\t\t\t\tSystem.out.println(\"Data \" + bstTree.getNode(searchNode) +\" is available\");\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(\"Data \" + searchNode + \" is not available\");\n\t\t\t\t}\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tSystem.out.println(\"Enter the node to be deleted\");\n\t\t\t\tint deleteNode = Integer.parseInt(input.nextLine());\n\t\t\t\tbstTree.delete(deleteNode);\n\t\t\t\tSystem.out.println(\"Node Deleted Successfully\");\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\tSystem.out.println(\"Enter the node to get the path : \");\n\t\t\t\tint node = Integer.parseInt(input.nextLine());\n\t\t\t\tbstTree.getPath(node);\n\t\t\t\tSystem.out.println();\n\t\t\tdefault:\n\t\t\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\"\\t\\t\\t\\tThank you!\");\n\t\t\t\tSystem.out.println(\"-----------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n N = Integer.parseInt(br.readLine());\n PriorityQueue<Integer> maxQueue = new PriorityQueue<>(Comparator.reverseOrder());\n for (int i = 0; i < N; i++) {\n int num = Integer.parseInt(br.readLine());\n if(num == 0){\n if(maxQueue.isEmpty())\n System.out.println(0);\n else{\n int tmp = maxQueue.poll();\n System.out.println(tmp);\n }\n }else{\n maxQueue.add(num);\n }\n }\n }",
"public Heap(){\n data = new Vector();\n }",
"public Heap() {\n heap = new Vector<E>();\n }",
"public Heap(Comparator<? super E> comp){\n super(7, comp);\n }",
"public void deleteMin() {\r\n\t\tif (empty())\r\n\t\t\treturn;\r\n\t\telse {\r\n\t\t\tif (this.size > 0) {\r\n\t\t\t\tthis.size--;\r\n\t\t\t}\r\n\t\t\tif (this.size == 0) {\r\n\t\t\t\tthis.empty = true;\r\n\t\t\t}\r\n\r\n\t\t\tHeapNode hN = this.min;\r\n\t\t\tint rnkCount = 0;\r\n\t\t\tHeapNode hNIterator = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\trnkCount++;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t}\r\n\t\t\tthis.HeapTreesArray[rnkCount] = null;\r\n\t\t\tif (hN != null) {\r\n\t\t\t\thNIterator = hN.theMostLeftChild;\r\n\t\t\t}\r\n\t\t\trnkCount--;\r\n\t\t\tBinomialHeap bH = new BinomialHeap();\r\n\t\t\tif (hNIterator != null) {\r\n\t\t\t\tbH.empty = false;\r\n\t\t\t}\r\n\t\t\twhile (hNIterator != null) {\r\n\t\t\t\tbH.HeapTreesArray[rnkCount] = hNIterator;\r\n\t\t\t\thNIterator = hNIterator.rightBrother;\r\n\t\t\t\tbH.HeapTreesArray[rnkCount].rightBrother = null;\r\n\t\t\t\tif (hNIterator != null) {\r\n\t\t\t\t\thNIterator.leftBrother = null;\r\n\t\t\t\t}\r\n\t\t\t\trnkCount = rnkCount - 1;\r\n\t\t\t}\r\n\t\t\tthis.min = null;\r\n\t\t\tfor (int i = 0; i < this.HeapTreesArray.length; i++) {\r\n\t\t\t\tif (this.min == null) {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\tif (this.HeapTreesArray[i].value < this.min.value) {\r\n\t\t\t\t\t\t\tthis.min = this.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!bH.empty()) {\r\n\t\t\t\tfor (int i = 0; i < bH.HeapTreesArray.length; i++) {\r\n\t\t\t\t\tif (bH.min == null) {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (bH.HeapTreesArray[i] != null) {\r\n\t\t\t\t\t\t\tif (bH.HeapTreesArray[i].value < bH.min.value) {\r\n\t\t\t\t\t\t\t\tbH.min = bH.HeapTreesArray[i];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.meld(bH);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public MedianFinder() {\n maxHeap = new PriorityQueue<Integer>((x, y) -> (y - x));\n minHeap = new PriorityQueue<Integer>();\n size = 0;\n }",
"public static void main(String[] args) {\n Integer arr[] = {12, 11, 13, 5, 6, 7};\n heapSort(arr);\n }",
"private static <T> void heapify (HeapSet<T> heap) {\r\n\t\tfor (int i = heap.size () - 1; i >= 0; --i) {\r\n\t\t\tsiftDown (heap, i, heap.size ());\r\n\t\t}\r\n\t}",
"private <E extends Comparable<E>> void heapify(E[] array){\n\t\tif(array.length > 0){\n\t\t\tint n = 1;\n\t\t\twhile( n < array.length){\t//for each value in the array\n\t\t\t\tn++;\n\t\t\t\t\n\t\t\t\tint child = n-1;\n\t\t\t\tint parent = (child-1)/2;\n\t\t\t\twhile(parent >= 0 && array[parent].compareTo(array[child]) < 0){\t//if the heap property isn't observed between the parent and child, swap them and readjust parent/child values until it is\n\t\t\t\t\tabstractSorter.swap(array, parent, child);\n\t\t\t\t\tchild = parent;\n\t\t\t\t\tparent = (child-1)/2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.7178301",
"0.7124219",
"0.7039443",
"0.70290124",
"0.69516176",
"0.68326837",
"0.67590964",
"0.6758423",
"0.672931",
"0.6713687",
"0.66370034",
"0.660146",
"0.6577156",
"0.6570645",
"0.65557545",
"0.65058875",
"0.6473639",
"0.6410793",
"0.638982",
"0.63807887",
"0.63756895",
"0.63672036",
"0.6314863",
"0.63019645",
"0.629837",
"0.62705946",
"0.6240542",
"0.6231832",
"0.6213772",
"0.6212787",
"0.62124896",
"0.61911356",
"0.61783737",
"0.61587554",
"0.6156289",
"0.61506605",
"0.61451495",
"0.61400294",
"0.61396325",
"0.6137131",
"0.6119738",
"0.61178917",
"0.6115458",
"0.6110332",
"0.60976857",
"0.6090509",
"0.6087829",
"0.6083297",
"0.6081725",
"0.6077445",
"0.6075485",
"0.6070558",
"0.60679835",
"0.60648483",
"0.6047464",
"0.6040541",
"0.60399085",
"0.6031159",
"0.6024873",
"0.60197943",
"0.6016848",
"0.6014506",
"0.6012371",
"0.6008194",
"0.6005811",
"0.60038114",
"0.5997415",
"0.5996379",
"0.5986745",
"0.59842646",
"0.59811556",
"0.59801555",
"0.5966639",
"0.59588176",
"0.5958071",
"0.5954721",
"0.59538746",
"0.5953445",
"0.5949396",
"0.594868",
"0.5947808",
"0.59475213",
"0.5944219",
"0.5939809",
"0.59363306",
"0.59358865",
"0.59158355",
"0.59084463",
"0.59042406",
"0.5903573",
"0.59034574",
"0.59019",
"0.59009755",
"0.5893505",
"0.5877528",
"0.5871211",
"0.5870489",
"0.58699405",
"0.586784",
"0.58547854"
] | 0.668726 | 10 |
TODO Autogenerated method stub | public static void main(String[] args) throws IOException {
InputStream in = new FileInputStream("bitmap.inp");
//Scanner sc = new Scanner(in);
FileWriter fw = new FileWriter("bitmap.out");
PrintWriter pw = new PrintWriter(fw);
char type;
int numRows, numCols;
type=(char) in.read();
System.out.println(type);
in.read();
numRows=in.read()-48;
System.out.println(numRows);
in.read();
numCols=in.read()-48;
System.out.println(numCols);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Created on 20190124 22:18 | public interface TaskCallback extends RunningTaskCallback {
/**
* Calling when the task is preparing to start .
*/
void onTaskStart();
@Override
void onTaskRunning(PreTaskResult preTaskResult, int numerator, int denominator);
/**
* Calling while the task is completed.
*
* @param taskResult TaskResult bean
*/
void onTaskCompleted(TaskResult taskResult);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private stendhal() {\n\t}",
"public final void mo51373a() {\n }",
"@Override\n public void func_104112_b() {\n \n }",
"public Pitonyak_09_02() {\r\n }",
"public void mo38117a() {\n }",
"public void mo6081a() {\n }",
"protected MetadataUGWD() {/* intentionally empty block */}",
"zzang mo29839S() throws RemoteException;",
"@Override\n public void perish() {\n \n }",
"zzafe mo29840Y() throws RemoteException;",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"private void m50366E() {\n }",
"public void mo4359a() {\n }",
"private static void cajas() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n public int describeContents() { return 0; }",
"protected void mo6255a() {\n }",
"public void mo21877s() {\n }",
"zzana mo29855eb() throws RemoteException;",
"public void mo12628c() {\n }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"public void mo55254a() {\n }",
"private Rekenhulp()\n\t{\n\t}",
"public void mo12930a() {\n }",
"public void mo1531a() {\n }",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"public final void mo91715d() {\n }",
"public abstract void mo56925d();",
"private MetallicityUtils() {\n\t\t\n\t}",
"public abstract void mo70713b();",
"private final zzgy zzgb() {\n }",
"public void mo115190b() {\n }",
"@Override\n\tpublic void create() {\n\t\t\n\t}",
"public void mo21878t() {\n }",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"private TMCourse() {\n\t}",
"private CompareDB () {\n\t\tthrow new UnsupportedOperationException();\n\t}",
"@Override\n\tpublic void create () {\n\n\t}",
"private ReportGenerationUtil() {\n\t\t\n\t}",
"@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}",
"public abstract void mo6549b();",
"public void mo3376r() {\n }",
"public void mo21825b() {\n }",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"Petunia() {\r\n\t\t}",
"protected boolean func_70814_o() { return true; }",
"void m1864a() {\r\n }",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"private void m50367F() {\n }",
"@Override\n public void init() {\n\n }",
"private void init() {\n\n\t}",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"@Override\n protected void initialize() {\n }",
"public void mo23813b() {\n }",
"public void mo21779D() {\n }",
"CreationData creationData();",
"private MApi() {}",
"private void kk12() {\n\n\t}",
"public final void mo8775b() {\n }",
"public void mo9848a() {\n }",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"public void mo21783H() {\n }",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n protected void initialize() {\n\n \n }",
"@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }",
"public void m23075a() {\n }",
"public void create() {\n\t\t\n\t}",
"@Override\n public void init() {\n }",
"@Override public int describeContents() { return 0; }",
"@Override\n public int getSize() {\n return 1;\n }",
"@Override\n\tpublic void create() {\n\n\t}",
"public abstract String mo118046b();",
"public void mo21794S() {\n }",
"@Override\n void init() {\n }",
"public abstract Object mo1771a();",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\n public int getVersion() {\n return 0;\n }",
"private Singletion3() {}",
"public void mo21785J() {\n }",
"public C23317d() {\n }",
"private void poetries() {\n\n\t}",
"void mo60893b();",
"public void mo21793R() {\n }",
"public void mo21782G() {\n }",
"public int getVersion() { return 1; }",
"public void mo21787L() {\n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}"
] | [
"0.5496459",
"0.54423517",
"0.5395961",
"0.53918755",
"0.5387137",
"0.5383337",
"0.53610194",
"0.532526",
"0.5300649",
"0.5231452",
"0.52298677",
"0.52298677",
"0.52298677",
"0.52298677",
"0.52298677",
"0.52298677",
"0.52298677",
"0.5205497",
"0.51660615",
"0.5164232",
"0.5163775",
"0.516311",
"0.51375204",
"0.51241565",
"0.5117531",
"0.51040214",
"0.5088058",
"0.50835925",
"0.50762516",
"0.5070095",
"0.5062419",
"0.50580895",
"0.50580895",
"0.505298",
"0.5048493",
"0.5036419",
"0.50316113",
"0.5022901",
"0.5015062",
"0.5008529",
"0.50071263",
"0.5005833",
"0.5001065",
"0.49915385",
"0.49910524",
"0.4983118",
"0.4982264",
"0.49770296",
"0.49764135",
"0.49754152",
"0.49623945",
"0.49610662",
"0.4949414",
"0.494617",
"0.4945638",
"0.49447164",
"0.4931142",
"0.4928069",
"0.49259394",
"0.49259394",
"0.49259394",
"0.49259394",
"0.49259394",
"0.49259394",
"0.49147117",
"0.49104652",
"0.49098042",
"0.49087638",
"0.49017677",
"0.48991093",
"0.48980308",
"0.48977405",
"0.48948112",
"0.48946726",
"0.48888674",
"0.48857647",
"0.48848602",
"0.48843294",
"0.48824364",
"0.48763686",
"0.48761648",
"0.48752126",
"0.4873448",
"0.48731476",
"0.4870096",
"0.48694697",
"0.4863627",
"0.48620632",
"0.48619533",
"0.48589894",
"0.48586458",
"0.4854584",
"0.4848566",
"0.48483494",
"0.484812",
"0.48475865",
"0.4843595",
"0.48433462",
"0.4842335",
"0.48393583",
"0.4838045"
] | 0.0 | -1 |
Calling when the task is preparing to start . | void onTaskStart(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void taskStarting() {\n\n }",
"void onTaskPrepare();",
"public void startTask() {\n\t}",
"@Override\r\n\tpublic void PreExecute(TaskConfig config){\n\t}",
"@Override\n public void onInitializeTasks() {\n }",
"@Override\n\tpublic void onTaskPreExecute() {\n\t\tLog.i(TAG, \"pre executing\");\n\t}",
"@Override\n\tpublic void preExecuteTask(Task t,Map context) {\n\t\tlog.info(\"Task Id:\"+t.getTaskId()+\"--Task Name:\"+t.getTaskName()+\"--Task begin execute!\");\n\t}",
"@Override\n\t\tpublic void beginTask(String arg0, int arg1) {\n\n\t\t}",
"void PrepareRun() {\n }",
"public void beginTask(String tr) {\n\t\t\n\t}",
"@Override\n public void start(int totalTasks) {\n }",
"@Override\n public void init() {\n this.log.pri1(LoggingInterface.INIT_START, \"\");\n // Any task initialization code goes here.\n this.log.pri1(LoggingInterface.INIT_END, \"\");\n }",
"@Override\n\t\t\tpublic void onPreExecute() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t protected void onPreExecute() {\n\t }",
"public void prepare() {\n this.taskHandler.run(this::inlinePrepare);\n }",
"@Override\n\t\tprotected void onPreExecute() \n\t\t{\n\t\t}",
"public void startExecuting()\n {\n super.startExecuting();\n this.breakingTime = 0;\n }",
"public void startExecuting() {}",
"@Override\n\t\t\tpublic void beginTask(String name, int totalWork) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\tprotected void onPreExecute() {\n\t\t}",
"@Override\n\t\t\tprotected void onPreExecute()\n\t\t\t{\n\n\t\t\t}",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n protected void onPreExecute()\n {\n }",
"@Override\n\tpublic void onPreExecute()\n\t{\n\t\t\n\t}",
"@Override\n protected void onPreExecute(){\n //do before task doing in background\n }",
"public void onPreExecute() {\n\t\t}",
"@Override\n protected void onPreExecute() {\n\n }",
"@Override\n protected void onPreExecute() {\n\n }",
"@Override\n protected void onPreExecute() {\n\n }",
"@Override\n protected void onPreExecute() {\n\n }",
"protected void onPreExecute() {\n\t\t}",
"protected void setupTask(Task task) {\n }",
"@Override\r\n\t\tprotected void onPreExecute() {\n\t\t}",
"@Override\n protected void onPreExecute() {\n }",
"@Override\n protected void onPreExecute() {\n }",
"@Override\n protected void onPreExecute() {\n }",
"@Override\n protected void onPreExecute() {\n }",
"@Override\n protected void onPreExecute() {\n }",
"@Override\n public void start() {\n\n }",
"@Override\n public void start() {\n\n }",
"@Override\n public void start() {\n\n }",
"@Override\r\n\tprotected void onPreExecute() {\n\t}",
"public abstract void started();",
"void doManualStart();",
"@Override\n public void start() {}",
"@Override\r\n\tpublic void start() {\n\t\t\r\n\t}",
"@Override\n public void start() {\n }",
"@Override\n protected void onPreExecute() {\n \n }",
"@Override\r\n protected void onPreExecute() {\n }",
"@Override\n\tvoid startWork() {\n\t\t\n\t}",
"@Override\n\tvoid startWork() {\n\t\t\n\t}",
"private void start() {\n\n\t}",
"@Override\r\n public void start() {\r\n }",
"@Override\n public void start() { }",
"public void start(){\n }",
"protected void start() {\n }",
"@Override\n\tprotected void onPreExecute() {\t\t\n\t\t// setup dialog\n\t\tif (dialog!=null){\n\t\t\tdialog.setProgress(0);\n\t\t\tdialog.setMessage(\"Initialized\");\n\t\t}\n\t\t\n\t\tif (callback!=null){\n\t\t\tcallback.onTaskUpdate(null, 0);\n\t\t}\n\t}",
"public final void execute() {\n\t\tLogUtils.i(TAG, \"execute\");\n\t\tpurelySetState(TaskState.Preparing);\n\t\tTaskQueue.addTask(this);\n\t}",
"@Override\n protected void onPreExecute() {\n\n\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"@Override\n public void start() {\n }",
"public void startExecuting()\n {\n super.startExecuting();\n }",
"@Override\n\tpublic void start() {\n\n\t}",
"public void start() { \t\n try {\n \tTask task = new FileTask(fileScanner);\n \tTaskDescription taskDescription = new TaskDescription();\n \ttaskDescription.setName(name + \"-FILE-EP\");\n \ttaskDescription.setTaskGroup(\"FILE-EP\");\n \ttaskDescription.setInterval(interval);\n \ttaskDescription.setIntervalInMs(true);\n \ttaskDescription.addResource(TaskDescription.INSTANCE, task);\n \ttaskDescription.addResource(TaskDescription.CLASSNAME, task.getClass().getName());\n \tstartUpController = new StartUpController();\n \tstartUpController.setTaskDescription(taskDescription);\n \tstartUpController.init(synapseEnvironment);\n\n } catch (Exception e) {\n log.error(\"Could not start File Processor. Error starting up scheduler. Error: \" + e.getLocalizedMessage());\n }\n }",
"public void start() {\n\n }",
"protected abstract void preRun();",
"@Override\n protected void onPreExecute() {\n }",
"public void taskStarted(BuildEvent event) {\n }",
"@Override\n\tpublic void initTask() {\n\t\tRankTempInfo rankInfo = RankServerManager.getInstance().getRankTempInfo(player.getPlayerId());\n\t\tif(rankInfo!=null){\n\t\t\tgetTask().getTaskInfo().setProcess((int)rankInfo.getSoul());\n\t\t}\n\t}",
"@Override\n\t\t\t\tprotected void onPreExecute()\n\t\t\t\t{\n\t\t\t\t\tsuper.onPreExecute();\n\t\t\t\t}",
"protected void onBegin() {}",
"public void start() {}",
"public void start() {}",
"@Override\n protected void startUp() {\n }",
"@Override\n\tpublic void start() {\n\t}",
"@Override\n\tpublic void start() {\n\t}",
"@Override\n public void preRun() {\n super.preRun();\n }",
"protected void onPreExecute() {\r\n\r\n }",
"@Override public void start() {\n }",
"public void startExecuting() {\n this.taskOwner.setAttackTarget(this.target);\n super.startExecuting();\n }",
"@Override\n protected void onPreExecute() {\n }",
"@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.count = 0L;\n// this.me = this.me + \"_\" + getRuntimeContext().getIndexOfThisSubtask();\n new Thread(this::receive).start();\n }",
"public void start() {\n\n\t}",
"public void start() {\n\r\n }",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"@Override\n\tpublic void start() {\n\t\t\n\t}",
"public void start() {\n }"
] | [
"0.82624954",
"0.8081739",
"0.7894834",
"0.7493277",
"0.72733533",
"0.7246118",
"0.7240474",
"0.7225652",
"0.71614784",
"0.69067705",
"0.68900543",
"0.6887408",
"0.6885717",
"0.68676317",
"0.6833563",
"0.6833119",
"0.6811021",
"0.6804932",
"0.67953706",
"0.67940676",
"0.6774273",
"0.677162",
"0.677162",
"0.677162",
"0.677162",
"0.677162",
"0.677162",
"0.677162",
"0.677162",
"0.6768851",
"0.6765027",
"0.6757554",
"0.6740395",
"0.6740395",
"0.6740395",
"0.6740395",
"0.67330766",
"0.6730355",
"0.67255",
"0.6703879",
"0.6703879",
"0.6703879",
"0.6703879",
"0.6703879",
"0.6696328",
"0.6696328",
"0.6696328",
"0.66818756",
"0.6671905",
"0.6665034",
"0.66595167",
"0.6659307",
"0.66583455",
"0.6644032",
"0.66353124",
"0.66348135",
"0.66348135",
"0.6633858",
"0.66300076",
"0.66189563",
"0.6617552",
"0.6616282",
"0.660957",
"0.66067255",
"0.65988433",
"0.65936035",
"0.65936035",
"0.65936035",
"0.65936035",
"0.65936035",
"0.65936035",
"0.65936035",
"0.6587865",
"0.65822345",
"0.6581996",
"0.6575025",
"0.6572191",
"0.6568942",
"0.65560913",
"0.655325",
"0.65448016",
"0.65395606",
"0.65382826",
"0.65382826",
"0.65302044",
"0.6525269",
"0.6525269",
"0.652489",
"0.6523981",
"0.65158623",
"0.6515373",
"0.65095764",
"0.65070707",
"0.65005714",
"0.6500309",
"0.6482386",
"0.6482386",
"0.6482386",
"0.6482386",
"0.64536285"
] | 0.73849195 | 4 |
Calling while the task is completed. | void onTaskCompleted(TaskResult taskResult); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void finishTask() {\n\t\t\n\t}",
"public void completeTask() {\n completed = true;\n }",
"public void finish() {\n\t\ttask.run();\n\t\ttask.cancel();\n\t}",
"void TaskFinished(Task task) {\n\n repository.finishTask(task);\n }",
"public void done() {\n try {\n C1000c.this.mo5101e(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occurred while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n C1000c.this.mo5101e(null);\n } catch (Throwable th) {\n throw new RuntimeException(\"An error occurred while executing doInBackground()\", th);\n }\n }",
"@Override\r\n public void tasksFinished()\r\n {\n }",
"public void CompleteTask() {\n\t\tCompletionDate = new Date();\n\t}",
"protected void execute() {\n finished = true;\n }",
"public void taskComplete() {\n mTasksLeft--;\n if ((mTasksLeft==0) & mHasCloRequest){\n onAllTasksCompleted();\n }\n }",
"public void done() {\n try {\n AsyncTask.this.a(get());\n } catch (InterruptedException e) {\n Log.w(\"AsyncTask\", e);\n } catch (ExecutionException e2) {\n throw new RuntimeException(\"An error occured while executing doInBackground()\", e2.getCause());\n } catch (CancellationException unused) {\n AsyncTask.this.a(null);\n }\n }",
"public void done() {\n AppMethodBeat.i(98166);\n try {\n AsyncTask.this.a(get());\n AppMethodBeat.o(98166);\n } catch (InterruptedException e) {\n AppMethodBeat.o(98166);\n } catch (ExecutionException e2) {\n RuntimeException runtimeException = new RuntimeException(\"An error occured while executing doInBackground()\", e2.getCause());\n AppMethodBeat.o(98166);\n throw runtimeException;\n } catch (CancellationException e3) {\n AsyncTask.this.a(null);\n AppMethodBeat.o(98166);\n }\n }",
"public void complete() {\n\t}",
"@Override\r\n\tpublic boolean finishCurrentTask() {\r\n\t\treturn finished;\r\n\t}",
"public void done() {\n isDone = true;\n }",
"public void done() {\n\t\t}",
"@Override\n public void run() {\n task.run();\n }",
"void endTask();",
"@Override\r\n\tpublic void done() {\n\t\t\r\n\t}",
"public void complete()\n {\n isComplete = true;\n }",
"@Override\n\tpublic void onComplete() {\n\t\tSystem.out.println(\"Its Done!!!\");\n\t}",
"void finish(Task task);",
"@Override\n\tpublic void complete()\n\t{\n\t}",
"@Override\n public boolean completed() {\n return false;\n }",
"public final void run() {\n\t\ttask();\n\t\t_nextTaskHasRan = true;\n\t}",
"@Override\n\t\tpublic void done() {\n\n\t\t}",
"protected void done() {\n\t\ttry {\n\t\t\t// get the result of doInBackground and display it\n\t\t\tresultJLabel.setText(get().toString());\n\t\t} // end try\n\t\tcatch (InterruptedException ex) {\n\t\t\tresultJLabel.setText(\"Interrupted while waiting for results.\");\n\t\t} // end catch\n\t\tcatch (ExecutionException ex) {\n\t\t\tresultJLabel.setText(\"Error encountered while performing calculation.\");\n\t\t} // end catch\n\t}",
"@Override\n public boolean isDone()\n {\n return false;\n }",
"public void checkOffTask() {\n isDone = true;\n }",
"@Override\n public void done() {\n }",
"@Override\n public void done() {\n }",
"@Override\n public boolean isDone() {\n return false;\n }",
"@Override\n\t\tpublic void run() {\n\t\t\ttask();\n\t\t}",
"public void done() {\n if (!isCancelled()) {\n try {\n C0637h.this.mo7991a(get());\n } catch (InterruptedException | ExecutionException e) {\n C0637h.this.mo7992a(e.getCause());\n }\n } else {\n C0637h.this.mo7992a((Throwable) new CancellationException());\n }\n }",
"@Override\n\t\tpublic void onCompleted() {\n\t\t}",
"@Override\r\n\tpublic void complete() {\n\r\n\t}",
"@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t Toast.makeText(getBaseContext(),\"Task Completed\",Toast.LENGTH_LONG).show();\n\t progressStatus=0; \n\t myProgress=0;\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public void done() {\n done = true;\n }",
"@Override\n\tpublic void onTaskDone(String result) {\n\t\t\n\t}",
"@Override\n\t\tpublic void onComplete() {\n\t\t\tSystem.out.println(\"onComplete\");\n\t\t}",
"@Override\n\t\t\t\t\tpublic void onComplete() {\n\t\t\t\t\t}",
"public void done() {\n \t\t\t\t\t\t}",
"public void handleFinish()\n {\n }",
"@Override\n protected boolean isFinished() {\n return true;\n }",
"public boolean done() {\n return false;\n }",
"@Override\r\n\tpublic void done() {\n\t\tSystem.out.println(\"done\");\r\n\t}",
"@Override\r\n\t\t\tpublic void onCompleted() {\n\r\n\t\t\t}",
"@Override\n public void run() {\n runTask();\n\n }",
"public void finish(){\n\t\tnotfinish = false;\n\t}",
"public void finished() {\n Object obj = get();\n if (obj instanceof Exception)\n mCallback.run(null, (Exception)obj, mRock);\n else\n mCallback.run(obj, null, mRock);\n }",
"public void finish() {\n if (!isFinishing) {\n performFnishWithRequest(true);\n }\n }",
"public void finish() {}",
"void onTaskComplete(T result);",
"@Override\n\tpublic boolean done() {\n\t\treturn true;\n\t}",
"@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void onComplete() {\n\t\t\t\t\r\n\t\t\t}",
"public void afterDone() {\n }",
"public void afterDone() {\n }",
"@Override\n public void onFinished() {\n }",
"@Override\n public void onFinished() {\n }",
"@Override\n public boolean isFinished() {\n return true;\n }",
"private void handleNow() {\n Log.d(TAG, \"Short lived task is done.\");\n }",
"private void handleNow() {\n Log.d(TAG, \"Short lived task is done.\");\n }",
"public void finished();",
"@Override\n protected boolean isFinished() {\n return true;\n }",
"protected void synchronizationDone() {\n }",
"protected void finishExecution() {\r\n\r\n\t}",
"@Override\n \tpublic void finished()\n \t{\n \t}",
"void whenComplete();",
"protected void handleCompletedTask(Future<Task> task)\n {\n m_RunningTasks.remove(task);\n\n }",
"private void onComplete(int duration) {\n\t\t\n\t\tservice = Executors.newSingleThreadExecutor();\n\n\t\ttry {\n\t\t Runnable r = new Runnable() {\n\t\t @Override\n\t\t public void run() {\n\t\t // Database task\n\t\t \tcontrollerVars.setPlays(false);\n\t\t }\n\t\t };\n\t\t Future<?> f = service.submit(r);\n\n\t\t f.get(duration, TimeUnit.MILLISECONDS); // attempt the task for two minutes\n\t\t}\n\t\tcatch (final InterruptedException e) {\n\t\t // The thread was interrupted during sleep, wait or join\n\t\t}\n\t\tcatch (final TimeoutException e) {\n\t\t // Took too long!\n\t\t}\n\t\tcatch (final ExecutionException e) {\n\t\t // An exception from within the Runnable task\n\t\t}\n\t\tfinally {\n\t\t service.shutdown();\n\t\t}\t\t\n\t}",
"public abstract Task markAsDone();",
"@Override\n\tpublic boolean done() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean done() {\n\t\treturn false;\n\t}",
"@Override\n public void onFinished() {\n\n }",
"@Override\n\tpublic void handleDone(Player player, Task task, Game game) {\n\t\t\n\t}",
"@Override\n public boolean complete(boolean succeed) {\n if (completed.compareAndSet(false, true)) {\n onTaskCompleted(task, succeed);\n return true;\n }\n return false;\n }",
"@Override\n public void onFinished() {\n\n }",
"@Override\n public void onComplete() {\n System.out.println (\"Suree onComplete\" );\n }",
"void complete();",
"void complete();",
"@Override\n public void onCompleted() {\n }",
"@Override\n public void onCompleted() {\n }",
"@Override\n\tprotected void done()\n\t{\n\t\tgetController().done();\n\t}",
"public void notifyAsyncTaskDone();",
"public void onComplete() {\r\n\r\n }",
"private void finish() {\n }",
"@Override\n public boolean isFinished() {\n return true;\n }",
"public boolean isDone() { return true; }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"@Override\n public void onComplete() {\n }",
"protected void end() {\n isFinished();\n }"
] | [
"0.7885877",
"0.78304267",
"0.7634333",
"0.753126",
"0.74086493",
"0.73232275",
"0.72683716",
"0.72677726",
"0.7263888",
"0.7192047",
"0.7170748",
"0.71110106",
"0.70781535",
"0.70283586",
"0.7011773",
"0.69686824",
"0.69675064",
"0.6951501",
"0.6941595",
"0.6940131",
"0.69274396",
"0.69189703",
"0.68934757",
"0.68727607",
"0.6871121",
"0.68336105",
"0.6826354",
"0.6818608",
"0.6813119",
"0.6813119",
"0.68085665",
"0.6798817",
"0.67843074",
"0.67815495",
"0.67799777",
"0.67768884",
"0.67639107",
"0.674776",
"0.674312",
"0.6739816",
"0.6739336",
"0.6738443",
"0.67143226",
"0.6698152",
"0.66959333",
"0.66787255",
"0.66717696",
"0.6670094",
"0.6669689",
"0.66680104",
"0.66533923",
"0.66527975",
"0.66485786",
"0.66484433",
"0.66484433",
"0.6645448",
"0.6645448",
"0.6642982",
"0.6642982",
"0.66349417",
"0.66306305",
"0.66306305",
"0.66279763",
"0.66276175",
"0.6622739",
"0.6620212",
"0.66170776",
"0.66128516",
"0.6612008",
"0.6610742",
"0.66099143",
"0.66034937",
"0.66034937",
"0.6602954",
"0.6599512",
"0.6586448",
"0.65851575",
"0.65849274",
"0.6575157",
"0.6575157",
"0.6570289",
"0.6570289",
"0.6566761",
"0.65647376",
"0.6564164",
"0.65582913",
"0.65553474",
"0.65495723",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65334904",
"0.65306556"
] | 0.0 | -1 |
Storage implementation based on files | public AppendOnlyStoreFile(String path) throws AppendOnlyStoreException {
File dir = new File(path);
if (!dir.isDirectory()) {
throw new AppendOnlyStoreException("The directory is required.");
}
this.data = new DataFile(Paths.get(path, DATA_FILE));
this.index = new IndexFile(Paths.get(path, INDEX_FILE));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"OStorage getStorage();",
"public interface Files \n{\n\t/**\n\t * Enum describing the three file types, internal, external\n\t * and absolut. Internal files are located in the asset directory\n\t * on Android and are relative to the applications root directory\n\t * on the desktop. External files are relative to the SD-card on Android\n\t * and relative to the home directory of the current user on the Desktop.\n\t * Absolut files are just that, absolut files that can point anywhere.\n\t * @author mzechner\n\t *\n\t */\n\tpublic enum FileType\n\t{\n\t\tInternal,\n\t\tExternal,\n\t\tAbsolut\n\t}\n\t\n\tpublic File getlastFile();\n\t\n\t/**\n\t * Returns an InputStream to the given file. If type is equal\n\t * to FileType.Internal an internal file will be opened. On Android\n\t * this is relative to the assets directory, on the desktop it is \n\t * relative to the applications root directory. If type is equal to\n\t * FileType.External an external file will be opened. On Android this\n\t * is relative to the SD-card, on the desktop it is relative to the\n\t * current user's home directory. If type is equal to FileType.Absolut\n\t * the filename is interpreted as an absolut filename. \n\t * \n\t * @param fileName the name of the file to open.\n\t * @param type the type of file to open.\n\t * @return the InputStream or null if the file couldn't be opened.\n\t */\n\t\n\tpublic InputStream readFile( String fileName, FileType type );\t\n\t\n\t/**\n\t * Returns and OutputStream to the given file. If\n\t * the file does not exist it is created. If the file\n\t * exists it will be overwritten. If type is equal\n\t * to FileType.Internal null will be returned as on Android assets can not be written. If type is equal to\n\t * FileType.External an external file will be opened. On Android this\n\t * is relative to the SD-card, on the desktop it is relative to the\n\t * current user's home directory. If type is equal to FileType.Absolut\n\t * the filename is interpreted as an absolut filename.\n\t * \n\t * @param filename the name of the file to open\n\t * @param type the type of the file to open\n\t * @return the OutputStream or null if the file couldn't be opened.\n\t */\n\tpublic OutputStream writeFile( String filename, FileType type );\n\t\t\n\t/**\n\t * Creates a new directory or directory hierarchy on the external\n\t * storage. If the directory parameter contains sub folders and \n\t * the parent folders don't exist yet they will be created. If type is equal\n\t * to FileType.Internal false will be returned as on Android new directories in the asset directory can not be created. If type is equal to\n\t * FileType.External an external directory will be created. On Android this\n\t * is relative to the SD-card, on the desktop it is relative to the\n\t * current user's home directory. If type is equal to FileType.Absolut\n\t * the directory is interpreted as an absolut directory name.\n\t * \n\t * @param directory the directory\n\t * @param type the type of the directory\n\t * @return true in case the directory could be created, false otherwise\n\t */\n\tpublic boolean makeDirectory( String directory, FileType type );\n\t\n\t\n\t/**\n\t * Lists the files and directories in the given directory. If type is equal\n\t * to FileType.Internal an internal directory will be listed. On Android\n\t * this is relative to the assets directory, on the desktop it is \n\t * relative to the applications root directory. If type is equal to\n\t * FileType.External an external directory will be listed. On Android this\n\t * is relative to the SD-card, on the desktop it is relative to the\n\t * current user's home directory. If type is equal to FileType.Absolut\n\t * the filename is interpreted as an absolut directory.\n\t * \n\t * @param directory the directory\n\t * @param type the type of the directory\n\t * @return the files and directories in the given directory or null if the directory is none existant\n\t */\n\tpublic String[] listDirectory( String directory, FileType type );\n\t\n\t\n\t/**\n\t * Returns a {@link FileDescriptor} object for a file. If type is equal\n\t * to FileType.Internal an internal file will be opened. On Android\n\t * this is relative to the assets directory, on the desktop it is \n\t * relative to the applications root directory. If type is equal to\n\t * FileType.External an external file will be opened. On Android this\n\t * is relative to the SD-card, on the desktop it is relative to the\n\t * current user's home directory. If type is equal to FileType.Absolut\n\t * the filename is interpreted as an absolut filename. \n\t * \n\t * @param filename the name of the file\n\t * @param type the type of the file\n\t * @return the FileDescriptor or null if the descriptor could not be created\n\t */\n\tpublic FileHandle getFileHandle( String filename, FileType type );\t\t\n}",
"public Storage(String filePath) {\n File file = new File(filePath);\n this.file = file;\n }",
"public interface FileStoreInterface {\r\n boolean isAuthenticated();\r\n @Nullable\r\n List<String> get(String path);\r\n void archive(String path, List<String> lines);\r\n void startLogin(Activity caller, int i);\r\n void deauthenticate();\r\n void browseForNewFile(Activity act, String path, FileSelectedListener listener, boolean txtOnly);\r\n void modify(String mTodoName, List<String> original,\r\n List<String> updated,\r\n List<String> added,\r\n List<String> removed);\r\n int getType();\r\n void setEol(String eol);\r\n boolean isSyncing();\r\n public boolean initialSyncDone();\r\n void invalidateCache();\r\n void sync();\r\n String readFile(String file);\r\n boolean supportsSync();\r\n public interface FileSelectedListener {\r\n void fileSelected(String file);\r\n }\r\n}",
"public interface DistributeStorage<T> {\n public void store(String path, T t, boolean create) throws StorageException;\n\n public T get(String path, Class<T> tClass) throws StorageException;\n\n public void del(String path) throws StorageException;\n\n public boolean exist(String path) throws StorageException;\n}",
"public Storage(String filePath) {\n this.filePath = filePath;\n }",
"public Storage(String filePath) {\n this.filePath = filePath;\n }",
"public interface FileRepository {\n /**\n * Create a file and write the object in the given format (json or xml)\n * @param data The data that will be written to the file\n * @param fileName The name of the file without any path or extension\n * @param fileFormat The file format enum (json or xml)\n * @return The file's absolute path\n */\n String saveToFile(Object data, String fileName, FileFormat fileFormat) throws IOException;\n\n /**\n * Retrieve a file from its absolute path\n * @param absolutePath The file's location (absolute path returned by the saveToFile method)\n * @return The actual file\n */\n File retrieveFile(String absolutePath);\n}",
"public interface NamedStorage extends Iterable<String>, AutoCloseable {\n\n /**\n * Gets data stored by specified key and puts it to the provided stream.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to process data\n * @return true if data was found, false otherwise\n */\n boolean getInto(String key, OutputStream stream);\n\n /**\n * Saves data from stream using provided key. If there was data for this key it will be overwritten with new data.\n * Does not close given stream.\n * @param key data key\n * @param stream stream to get data from\n */\n void saveFrom(String key, InputStream stream);\n\n /**\n * Checks that there is data stored for provided key\n * @param key data key\n * @return true if there is data for this key, false otherwise\n */\n boolean contains(String key);\n\n /**\n * Deletes key and associated data from storage. Does nothing if there is no such key in storage\n * @param key\n */\n void delete(String key);\n\n /**\n *\n * @return iterator for all keys. Order of keys is unknown.\n */\n Iterator<String> iterator();\n\n /**\n * Closes storage and flushes all changes on disk.\n */\n void close();\n\n /**\n * Copies all data to the specified storage\n * @param storage\n */\n void cloneTo(NamedStorage storage);\n}",
"public interface FilesContainer {\n\n\t/**\n\t * Returns a {@link FileWrapper} that point the relative path.\n\t * \n\t * @param fileRelativePath\n\t * @return\n\t */\n\tpublic FileWrapper newFile(String fileRelativePath);\n\t\n\t/**\n\t * Returns the public key identifier of the key pair used to \n\t * encrypt files in this container.\n\t * \n\t * @return\n\t */\n\tpublic String getPublicKeyIdentifier();\n}",
"public FileStorage(File path) {\n dataFolder = path;\n }",
"public interface SerializableStorage {\n\n /**\n * Method to save the binary data\n *\n * @param uuid identifier for the data\n * @param context binary data to save\n * @throws FailedToStoreDataInStorage in case when storage has failed to save the data\n */\n void store(UUID uuid, byte[] context) throws FailedToStoreDataInStorage;\n\n /**\n * Method to retrieve stored data\n *\n * @param uuid identifier for the data\n * @return binary data\n * @throws FailedToRetrieveStorageData in case when storage has faile to retrieve the data\n * @throws DataNotFoundInStorage in case when data has not been found\n */\n byte[] retrieve(UUID uuid) throws FailedToRetrieveStorageData, DataNotFoundInStorage;\n\n /**\n * Method to delete stored data from storage\n *\n * @param uuid identifier for the data\n * @throws DataNotFoundInStorage in case when data has not been found\n * @throws FailedToDeleteDataInStorage in case when storage has failed to delete the data\n */\n void delete(UUID uuid) throws DataNotFoundInStorage, FailedToDeleteDataInStorage;\n\n /**\n * Method to retrieve an occupied data size. Lets suppose it measured in bytes\n * @return occupied place size in bytes\n */\n long getOccupiedSize();\n}",
"public interface Storage extends ClientListStorage, UserPrefsStorage, PolicyListStorage {\n\n @Override\n Optional<UserPrefs> readUserPrefs() throws DataConversionException, IOException;\n\n @Override\n void saveUserPrefs(ReadOnlyUserPrefs userPrefs) throws IOException;\n\n @Override\n Path getClientListFilePath();\n\n @Override\n Optional<ReadOnlyClientList> readClientList() throws DataConversionException, IOException;\n\n @Override\n void saveClientList(ReadOnlyClientList clientList) throws IOException;\n\n @Override\n Path getPolicyListFilePath();\n\n @Override\n Optional<PolicyList> readPolicyList() throws DataConversionException, IOException;\n\n @Override\n void savePolicyList(PolicyList policyList) throws IOException;\n}",
"public interface SCStorage\r\n{\r\n\t/**\r\n\t * The server will register a driver before making any method calls\r\n\t *\r\n\t * @param driver the driver\r\n\t */\r\n\tpublic void setStorageServerDriver(SCStorageServerDriver driver);\r\n\r\n\t/**\r\n\t * Open the storage at the given path\r\n\t *\r\n\t * @param path path to the storage\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void\topen(File path) throws IOException;\r\n\r\n\t/**\r\n\t * Return the object associated with the given key\r\n\t *\r\n\t * @param key the key\r\n\t * @return the object or null if not found\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic SCDataSpec get(String key) throws IOException;\r\n\r\n\t/**\r\n\t * Add an object to the storage\r\n\t *\r\n\t * @param key key\r\n\t * @param data object\r\n\t * @param groups associated groups or null\r\n\t */\r\n\tpublic void put(String key, SCDataSpec data, SCGroupSpec groups);\r\n\r\n\t/**\r\n\t * Close the storage. The storage instance will be unusable afterwards.\r\n\t *\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void close() throws IOException;\r\n\r\n\t/**\r\n\t * Return the keys that match the given regular expression\r\n\t *\r\n\t * @param regex expression\r\n\t * @return matching keys\r\n\t */\r\n\tpublic Set<String> regexFindKeys(String regex);\r\n\r\n\t/**\r\n\t * Remove the given object\r\n\t *\r\n\t * @param key key of the object\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void remove(String key) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method deletes all objects\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to delete\r\n\t * @return list of keys deleted.\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> removeGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * sccache supports associative keys via {@link SCGroup}. This method lists all keys\r\n\t * associated with the given group.\r\n\t *\r\n\t * @param group the group to list\r\n\t * @return list of keys\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> listGroup(SCGroup group) throws IOException;\r\n\r\n\t/**\r\n\t * Returns storage statistics\r\n\t *\r\n\t * @param verbose if true, verbose stats are returned\r\n\t * @return list of stats\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic List<String> dumpStats(boolean verbose) throws IOException;\r\n\r\n\t/**\r\n\t * Write a tab delimited file with information about the key index\r\n\t *\r\n\t * @param f the file to write to\r\n\t * @throws IOException errors\r\n\t */\r\n\tpublic void writeKeyData(File f) throws IOException;\r\n}",
"public Storage(String s){\n this.path=s;\n }",
"public interface SimpleFile {// extends IFile { \n /**\n * Open the file\n * @param path path to the file\n * @param readOnly if file is readonly\n * @param noFlush whther synchronous flush is needed\n */\n void open(String path, boolean readOnly, boolean noFlush)throws IOException;\n \n /**\n * Delete file\n * @param path path to the file\n */\n void delete(String path);\n \n boolean isOpened();\n String readString()throws IOException;\n void truncate(int nSize)throws IOException;\n InputStream getInputStream()throws IOException;\n OutputStream getOutStream();\n OutputStream getOutStreamEx(long pos)throws IOException; \n long length();\n \n /**\n * \n * @param path\n * @return\n */\n String getDirPath(String path) throws IOException;\n\n /**\n * @param fromClass\n * @param path\n * @return\n */\n public abstract InputStream getResourceAsStream(Class fromClass, String path);\n \n public abstract void renameOverwrite(String oldName, String newName);\n \n public abstract void copyJarFileToMemory(String strFileName, InputStream jarStream)throws IOException;\n \n void write(long pos, byte[] buf)throws IOException;\n\n /**\n * Read data from the file\n * @param pos offset in the file\n * @param buf array to receive readen data (size is always equal to database page size)\n * @return number of bytes actually readen\n */\n int read(long pos, byte[] buf)throws IOException;\n\n /**\n * Flush all fiels changes to the disk\n */\n void sync()throws IOException;\n\n /**\n * Close file\n */\n void close()throws IOException;\n\n /**\n * Length of the file\n */\n //long length();\n \n}",
"public interface IStorageManager {\n\n\tpublic String getStorageType();\n\n\tpublic String getStorageId();\n\n\tpublic void initialize(String configFile) throws Exception;\n}",
"@Override\n public void process(Path path, FileStorage storage) {\n }",
"public Storage() {\n\t\tstorageReader = new StorageReader();\n\t\tstorageWriter = new StorageWriter();\n\t\tdirectoryManager = new DirectoryManager();\n\n\t\tFile loadedDirectory = storageReader.loadDirectoryConfigFile(FILENAME_DIRCONFIG);\n\t\tif (loadedDirectory != null) {\n\t\t\tif (directoryManager.createDirectory(loadedDirectory) == true) {\n\t\t\t\tdirectory = loadedDirectory;\n\t\t\t\tSystem.out.println(\"{Storage} Directory loaded | \" + directory.getAbsolutePath());\n\t\t\t} else { //loaded directory was invalid or could not be created\n\t\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t\t}\n\t\t} else { //directory config file was not found\n\t\t\tdirectoryManager.createDirectory(DEFAULT_DIRECTORY);\n\t\t\tdirectory = DEFAULT_DIRECTORY;\n\t\t}\n\t}",
"public interface IStorage extends Serializable {\n\n /**\n * Removes all stored values.\n */\n void clear();\n\n /**\n * Removes the value stored under the given key (if one exists).\n *\n * @return {@code true} if a successful.\n */\n StoragePrimitive remove(String key);\n\n /**\n * Adds all mappings in {@code val} to this storage object, overwriting any existing values.\n *\n * @see #addAll(String, IStorage)\n */\n void addAll(IStorage val);\n\n /**\n * Adds all mappings in {@code val} to this storage object, where all keys are prefixed with\n * {@code prefix}. Any existing values are overwritten.\n */\n void addAll(String prefix, IStorage val);\n\n /**\n * @return All stored keys.\n * @see #getKeys(String)\n */\n Collection<String> getKeys();\n\n /**\n * @return A collection of all stored keys matching the given prefix, or all stored keys if the prefix is\n * {@code null}.\n */\n Collection<String> getKeys(@Nullable String prefix);\n\n /**\n * @return {@code true} if this storage object contains a mapping for the given key.\n */\n boolean contains(String key);\n\n /**\n * Returns raw value stored under the given key.\n */\n StoragePrimitive get(String key);\n\n /**\n * Returns value stored under the given key converted to a boolean.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n boolean getBoolean(String key, boolean defaultValue);\n\n /**\n * Convenience method for retrieving a 32-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to int.\n *\n * @see #getDouble(String, double)\n */\n int getInt(String key, int defaultValue);\n\n /**\n * Convenience method for retrieving a 64-bit signed integer. This is equivalent to calling\n * {@link IStorage#getDouble(String, double)} and casting the result to long.\n *\n * @see #getDouble(String, double)\n */\n long getLong(String keyTotal, long defaultValue);\n\n /**\n * Returns value stored under the given key converted to a double.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key, or if\n * the value couldn't be converted to the desired return type.\n * @see #getString(String, String)\n */\n double getDouble(String key, double defaultValue);\n\n /**\n * Returns value stored under the given key converted to a string.\n *\n * @param defaultValue This value is returned instead if no value was stored under the given key.\n */\n String getString(String key, String defaultValue);\n\n /**\n * Stores a value under the given key. If {@code null}, removes any existing mapping for the given key\n * instead.\n */\n void set(String key, @Nullable StoragePrimitive val);\n\n /**\n * Stores a boolean value under the given key.\n *\n * @see #setString(String, String)\n */\n void setBoolean(String key, boolean val);\n\n /**\n * Convenience method for storing an integer. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setInt(String key, int val);\n\n /**\n * Convenience method for storing a long. All values are stored as double-precision floating point\n * internally.\n *\n * @see #setDouble(String, double)\n */\n void setLong(String key, long val);\n\n /**\n * Stores a double-precision floating point value under the given key.\n *\n * @see #setString(String, String)\n */\n void setDouble(String key, double val);\n\n /**\n * Stores a string value under the given key.\n *\n * @param val The value to store. If {@code null}, removes any existing mapping for the given key instead.\n */\n void setString(String key, String val);\n\n}",
"public interface IStorageManager {\n public IStorageBook getValue(String key);\n\n public void addStorageBook(String key, IStorageBook book);\n\n public void clear();\n\n public boolean isEmpty();\n\n public void remove(String key);\n}",
"public interface StorageService {\n\n /**\n * Return the ReplicatSet configuration (list of services able to pin a file)\n * @return ReplicaSet List of PinningService\n */\n Set<PinningService> getReplicaSet();\n \n /**\n * Write content on the storage layer\n * @param content InputStream\n * @param noPin Disable persistence, require to pin/persist asynchrounsly (can improve the writing performance)\n * @return Content ID (hash, CID)\n */\n String write(InputStream content, boolean noPin);\n\n /**\n * Write content on the storage layer\n * @param content Byte array\n * @param noPin Disable persistence, require to pin/persist asynchrounsly (can improve the writing performance)\n * @return Content ID (hash, CID)\n */\n String write(byte[] content, boolean noPin);\n\n /**\n * Read content from the storage layer and write it in a ByteArrayOutputStream\n * @param id Content ID (hash, CID\n * @return content\n */\n OutputStream read(String id);\n \n /**\n * Read content from the storage layer and write it the OutputStream provided\n * @param id Content ID (hash, CID\n * @param output OutputStream to write content to\n * @return Outputstream passed as argument\n */\n OutputStream read(String id, OutputStream output);\n}",
"Storage(String filepath) {\n this.filepath = filepath;\n tasks = new ArrayList<>();\n parser = new Parser();\n }",
"public File getFile();",
"public File getFile();",
"public File getFileValue();",
"public Storage(String filePath) {\n this.filePath = filePath;\n this.ui = new Ui();\n }",
"public interface BlockFileSystem {\n\n \n /**\n * The size of a block in bytes.\n */\n int BLOCK_SIZE = 512;\n\n\n /**\n * Returns the root entry of the file system. Subfiles and directories\n * can be found by searching the returned entry.\n * \n * @return the root entry\n * @throws IOException if an IO error occurs\n */\n public abstract Entry getRoot() throws IOException;\n\n \n /**\n * Returns the number of the block that follows the given block.\n * The internal block allocation tables are consulted to determine the\n * next block. A return value that is less than zero indicates that\n * there is no next block.\n * \n * @param block the number of block whose successor to return\n * @return the successor of that block\n * @throws IOException if an IO error occurs\n */\n public abstract int getNextBlock(int block) throws IOException;\n\n\n /**\n * Returns the raw input stream for this file system. \n * Typically this will be the random access file containing the .doc.\n * \n * @return the raw input stream for this file system\n */\n public abstract SeekInputStream getRawInput();\n\n}",
"@Override\n public StorageInputStream open(File file) throws FileNotFoundException {\n\treturn null;\n }",
"public Files files();",
"public interface Storage {\n String SPLITTER = \" &&& \";\n\n /**\n * Gets the list of tasks held by the storage.\n * @return the list of tasks\n */\n TaskList getList();\n\n /**\n * Writes the task to the storage file.\n * @param task the task that is to be written in the task\n * @throws InvalidCommandException should never been thrown unless the file path is not working\n */\n void addToList(Task task) throws InvalidCommandException;\n\n /**\n * Re-writes the storage file because of deletion or marking-as-done executed.\n * @param list the new task list used for updating the storage file\n * @throws InvalidCommandException should never been thrown unless the file path is not working\n */\n void reWrite(TaskList list) throws InvalidCommandException;\n}",
"public abstract FlowNodeStorage instantiateStorage(MockFlowExecution exec, File storageDirectory);",
"public File getFile ();",
"public interface IWritableStorage extends IStorage {\n\n\tpublic void setContents(InputStream source, IProgressMonitor monitor) throws CoreException;\n\t\n\tpublic IStatus validateEdit(Object context);\n}",
"public interface FileInterface {\n\t/**\n\t * Operation that allows to read an input file to a data structure.\n\t */\n\tpublic void readFile();\n\t/**\n\t * Operation that allows to read an input file and select a specific fraction into a string array.\n\t * @return Array of strings containing a specific fraction of the file.\n\t */\n\tpublic String[] readClasses();\n}",
"@Override\n public StorageOutputStream create(File file) throws IOException {\n\treturn null;\n }",
"public DataStorage getDataStorage();",
"public interface CameraStorage {\n\n /**\n * Lists all of support storage's type\n */\n public static enum STORAGE_TYPE {\n LOCAL_DEFAULT,\n REMOTE_DEFAULT //not implemented\n }\n\n /**\n * Sets the root path which can be a file description, uri, url for storage accessing\n *\n * @param root\n */\n public void setRoot(String root);\n\n /**\n * Gets the root path which is a file path, uri, url etc.\n *\n * @return\n */\n public String getRoot();\n\n /**\n * Saves a record to storage\n *\n * @param record\n * @return\n */\n public boolean save(CameraRecord record);\n\n /**\n * Gets a list of thumbnails which are used to represent the record that accessing from storage\n *\n * @return\n */\n public List<CameraRecord> loadThumbnail();\n\n /**\n * Loads a resource of record which can be a image or video\n *\n * @param record\n * @return\n */\n public Object loadResource(CameraRecord record);\n\n}",
"public interface IFileService {\n\n\tpublic List<String> load(String fileName);\n}",
"public interface FileService {\n//todo\n\n}",
"public interface ExternalBlobIO {\n /**\n * Write data to blob store\n * @param in: InputStream containing data to be written\n * @param actualSize: size of data in stream, or -1 if size is unknown. To be used by implementor for optimization where possible\n * @param mbox: Mailbox which contains the blob. Can optionally be used by store for partitioning\n * @return locator string for the stored blob, unique identifier created by storage protocol\n * @throws IOException\n * @throws ServiceException\n */\n String writeStreamToStore(InputStream in, long actualSize, Mailbox mbox) throws IOException, ServiceException;\n\n /**\n * Create an input stream for reading data from blob store\n * @param locator: identifier string for the blob as returned from write operation\n * @param mbox: Mailbox which contains the blob. Can optionally be used by store for partitioning\n * @return InputStream containing the data\n * @throws IOException\n */\n InputStream readStreamFromStore(String locator, Mailbox mbox) throws IOException;\n\n /**\n * Delete a blob from the store\n * @param locator: identifier string for the blob\n * @param mbox: Mailbox which contains the blob. Can optionally be used by store for partitioning\n * @return true on success false on failure\n * @throws IOException\n */\n boolean deleteFromStore(String locator, Mailbox mbox) throws IOException;\n}",
"public interface FileService extends PublicService {\n\n /**\n * Retrieves reference to a file by fileName\n */\n FileReference getFile(String fileName);\n \n /**\n * Creates a reference for a new file.\n * Use FileReference.getOutputStream() to set content for the file.\n * Requires user to be a member of a contributer or full roles.\n * @param fileName\n * @param toolId - optional parameter\n * @return\n */\n FileReference createFile(String fileName, String toolId);\n \n /**\n * Deletes the file.\n * Requires user to be a member of a contributer or full roles.\n * @param fileReferece\n */\n void deleteFile(FileReference fileReferece);\n \n /**\n * Returns a url to the file\n * Property WebSecurityUtil.DBMASTER_URL (dbmaster.url) is used as a prefix\n */\n URL toURL(FileReference fileReferece);\n}",
"public interface OssFileService {\n Result putFile(String fileName, InputStream inputStream, String key, String token);\n}",
"public Storage(String path) throws IOException {\n assert path != null : \"Path for file storage cannot be null.\";\n file = new File(path);\n if (!file.getParentFile().exists()) {\n file.getParentFile().mkdir();\n file.createNewFile();\n }\n }",
"@Override\n\tpublic File getStorageFile(Link link) {\n\t\tif (link == null) {\n\t\t\tthrow new NullPointerException();\n\t\t}\n\n\t\tIStorageResolver resolver = storageRules.getFirstMatch(link);\n\t\tFile file = resolver.getStorageFile(link);\n\n\t\t// Verify the resolver's work\n\t\tif (file.isAbsolute()) {\n\t\t\tlogger.error(\n\t\t\t\t\t\"You must specify storage locations in relative paths. Got absolute path for {} -- This preferred location will be ignored.\",\n\t\t\t\t\tfile);\n\t\t}\n\t\treturn file;\n\t}",
"FileStore getFile(String fileRefId);",
"public interface FileSystemEntry {\n public long getCount();\n public long getSize();\n public String getName();\n}",
"public Storage getStorage() {\n return this.storage;\n }",
"public interface IMemoriaFile {\r\n \r\n public void append(byte[] data);\r\n \r\n /**\r\n * Releases the write-lock\r\n */\r\n public void close();\r\n \r\n /**\r\n * Returns a stream starting at position 0.\r\n * \r\n * Attention: The stream must be closed!\r\n * \r\n * @return Stream for reading the whole content of the file.\r\n */\r\n public InputStream getInputStream();\r\n \r\n /**\r\n * Returns a stream starting at the given <tt>position</tt>.\r\n * \r\n * Attention: The stream must be closed!\r\n * \r\n * @param position\r\n * @return Stream for reading the whole content of the file.\r\n */\r\n public InputStream getInputStream(long position);\r\n \r\n public long getSize();\r\n\r\n public boolean isEmpty();\r\n\r\n \r\n public void sync();\r\n\r\n /**\r\n * The given offset plus the size of the given byte-array must not exceed the file-site.\r\n * @param data\r\n * @param offset\r\n */\r\n public void write(byte[] data, long offset);\r\n}",
"public interface FileService {\n\n void saveDistinct(File file, MultipartFile fileData);\n\n String saveHeadImage(User user, MultipartFile file) throws Exception;\n\n\n}",
"protected abstract RegistryStorage storage();",
"public interface IFileAdapter {\n /**\n * The method is uses to read file\n *\n * @return List lines\n */\n List readFile(String pathToFile);\n\n /**\n * The method is uses to write file\n *\n * @param values List contains a lines for writing\n */\n void write(List<StringBuilder> values);\n\n /**\n * This method is used to move files from one directory to another\n *\n * @param pathToFile contains the path to the file that you want to move\n * @param pathDirectory contains the path to the directory where you want to put the file\n */\n void moveFile(String pathToFile, String pathDirectory);\n\n /**\n * The method is used to get the file paths from the directory\n * along the path specified in app.properties\n */\n List<String> getListPaths();\n\n /**\n * This method is used to move a file to a directory with non-valid files\n */\n void moveFileToDirectoryNotValidFiles(String pathToFile);\n\n /**\n * This method is used to move a file to a directory with converted files\n */\n void moveFileToDirectoryWithConvertedFiles(String pathToFile);\n}",
"public interface StorageModel {\n}",
"File getFile();",
"File getFile();",
"public interface FileSystem {\n\n /**\n * Add the specified file system entry (file or directory) to this file system\n *\n * @param entry - the FileSystemEntry to add\n */\n public void add(FileSystemEntry entry);\n\n /**\n * Return the List of FileSystemEntry objects for the files in the specified directory path. If the\n * path does not refer to a valid directory, then an empty List is returned.\n *\n * @param path - the path of the directory whose contents should be returned\n * @return the List of FileSystemEntry objects for all files in the specified directory may be empty\n */\n public List listFiles(String path);\n\n /**\n * Return the List of filenames in the specified directory path. The returned filenames do not\n * include a path. If the path does not refer to a valid directory, then an empty List is\n * returned.\n *\n * @param path - the path of the directory whose contents should be returned\n * @return the List of filenames (not including paths) for all files in the specified directory\n * may be empty\n * @throws AssertionError - if path is null\n */\n public List listNames(String path);\n\n /**\n * Delete the file or directory specified by the path. Return true if the file is successfully\n * deleted, false otherwise. If the path refers to a directory, it must be empty. Return false\n * if the path does not refer to a valid file or directory or if it is a non-empty directory.\n *\n * @param path - the path of the file or directory to delete\n * @return true if the file or directory is successfully deleted\n * @throws AssertionError - if path is null\n */\n public boolean delete(String path);\n\n /**\n * Rename the file or directory. Specify the FROM path and the TO path. Throw an exception if the FROM path or\n * the parent directory of the TO path do not exist; or if the rename fails for another reason.\n *\n * @param fromPath - the source (old) path + filename\n * @param toPath - the target (new) path + filename\n * @throws AssertionError - if fromPath or toPath is null\n * @throws FileSystemException - if the rename fails.\n */\n public void rename(String fromPath, String toPath);\n\n /**\n * Return the formatted directory listing entry for the file represented by the specified FileSystemEntry\n *\n * @param fileSystemEntry - the FileSystemEntry representing the file or directory entry to be formatted\n * @return the the formatted directory listing entry\n */\n public String formatDirectoryListing(FileSystemEntry fileSystemEntry);\n\n //-------------------------------------------------------------------------\n // Path-related Methods\n //-------------------------------------------------------------------------\n\n /**\n * Return true if there exists a file or directory at the specified path\n *\n * @param path - the path\n * @return true if the file/directory exists\n * @throws AssertionError - if path is null\n */\n public boolean exists(String path);\n\n /**\n * Return true if the specified path designates an existing directory, false otherwise\n *\n * @param path - the path\n * @return true if path is a directory, false otherwise\n * @throws AssertionError - if path is null\n */\n public boolean isDirectory(String path);\n\n /**\n * Return true if the specified path designates an existing file, false otherwise\n *\n * @param path - the path\n * @return true if path is a file, false otherwise\n * @throws AssertionError - if path is null\n */\n public boolean isFile(String path);\n\n /**\n * Return true if the specified path designates an absolute file path. What\n * constitutes an absolute path is dependent on the file system implementation.\n *\n * @param path - the path\n * @return true if path is absolute, false otherwise\n * @throws AssertionError - if path is null\n */\n public boolean isAbsolute(String path);\n\n /**\n * Build a path from the two path components. Concatenate path1 and path2. Insert the file system-dependent\n * separator character in between if necessary (i.e., if both are non-empty and path1 does not already\n * end with a separator character AND path2 does not begin with one).\n *\n * @param path1 - the first path component may be null or empty\n * @param path2 - the second path component may be null or empty\n * @return the path resulting from concatenating path1 to path2\n */\n public String path(String path1, String path2);\n\n /**\n * Returns the FileSystemEntry object representing the file system entry at the specified path, or null\n * if the path does not specify an existing file or directory within this file system.\n *\n * @param path - the path of the file or directory within this file system\n * @return the FileSystemEntry containing the information for the file or directory, or else null\n */\n public FileSystemEntry getEntry(String path);\n\n /**\n * Return the parent path of the specified path. If <code>path</code> specifies a filename,\n * then this method returns the path of the directory containing that file. If <code>path</code>\n * specifies a directory, the this method returns its parent directory. If <code>path</code> is\n * empty or does not have a parent component, then return an empty string.\n * <p/>\n * All path separators in the returned path are converted to the system-dependent separator character.\n *\n * @param path - the path\n * @return the parent of the specified path, or null if <code>path</code> has no parent\n * @throws AssertionError - if path is null\n */\n public String getParent(String path);\n\n}",
"public interface IFileSystem {\n\n /** */\n String TOP_DIRECTORY_ONLY = \"TopDirectoryOnly\";\n /** */\n String ALL_DIRECTORIES = \"AllDirectories\";\n\n /**\n * Gets a value indicating whether the file system is read-only or\n * read-write.\n *\n * @return true if the file system is read-write.\n */\n boolean canWrite();\n\n /**\n * Gets a value indicating whether the file system is thread-safe.\n */\n boolean isThreadSafe();\n\n /**\n * Gets the root directory of the file system.\n */\n DiscDirectoryInfo getRoot();\n\n /**\n * Copies an existing file to a new file.\n *\n * @param sourceFile The source file.\n * @param destinationFile The destination file.\n */\n void copyFile(String sourceFile, String destinationFile) throws IOException;\n\n /**\n * Copies an existing file to a new file, allowing overwriting of an\n * existing file.\n *\n * @param sourceFile The source file.\n * @param destinationFile The destination file.\n * @param overwrite Whether to permit over-writing of an existing file.\n */\n void copyFile(String sourceFile, String destinationFile, boolean overwrite) throws IOException;\n\n /**\n * Creates a directory.\n *\n * @param path The path of the new directory.\n */\n void createDirectory(String path) throws IOException;\n\n /**\n * Deletes a directory.\n *\n * @param path The path of the directory to delete.\n */\n void deleteDirectory(String path) throws IOException;\n\n /**\n * Deletes a directory, optionally with all descendants.\n *\n * @param path The path of the directory to delete.\n * @param recursive Determines if the all descendants should be deleted.\n */\n void deleteDirectory(String path, boolean recursive) throws IOException;\n\n /**\n * Deletes a file.\n *\n * @param path The path of the file to delete.\n */\n void deleteFile(String path) throws IOException;\n\n /**\n * Indicates if a directory exists.\n *\n * @param path The path to test.\n * @return true if the directory exists.\n */\n boolean directoryExists(String path) throws IOException;\n\n /**\n * Indicates if a file exists.\n *\n * @param path The path to test.\n * @return true if the file exists.\n */\n boolean fileExists(String path) throws IOException;\n\n /**\n * Indicates if a file or directory exists.\n *\n * @param path The path to test.\n * @return true if the file or directory exists.\n */\n boolean exists(String path) throws IOException;\n\n /**\n * Gets the names of subdirectories in a specified directory.\n *\n * @param path The path to search.\n * @return list of directories.\n */\n List<String> getDirectories(String path) throws IOException;\n\n /**\n * Gets the names of subdirectories in a specified directory matching a\n * specified search pattern.\n *\n * @param path The path to search.\n * @param searchPattern The search string to match against.\n * @return list of directories matching the search pattern.\n */\n List<String> getDirectories(String path, String searchPattern) throws IOException;\n\n /**\n * Gets the names of subdirectories in a specified directory matching a\n * specified search pattern, using a value to determine whether to search\n * subdirectories.\n *\n * @param path The path to search.\n * @param searchPattern The search string to match against.\n * @param searchOption Indicates whether to search subdirectories.\n * @return list of directories matching the search pattern.\n */\n List<String> getDirectories(String path, String searchPattern, String searchOption) throws IOException;\n\n /**\n * Gets the names of files in a specified directory.\n *\n * @param path The path to search.\n * @return list of files.\n */\n List<String> getFiles(String path) throws IOException;\n\n /**\n * Gets the names of files in a specified directory.\n *\n * @param path The path to search.\n * @param searchPattern The search string to match against.\n * @return list of files matching the search pattern.\n */\n List<String> getFiles(String path, String searchPattern) throws IOException;\n\n /**\n * Gets the names of files in a specified directory matching a specified\n * search pattern, using a value to determine whether to search\n * subdirectories.\n *\n * @param path The path to search.\n * @param searchPattern The search string to match against.\n * @param searchOption Indicates whether to search subdirectories.\n * @return list of files matching the search pattern.\n */\n List<String> getFiles(String path, String searchPattern, String searchOption) throws IOException;\n\n /**\n * Gets the names of all files and subdirectories in a specified directory.\n *\n * @param path The path to search.\n * @return list of files and subdirectories matching the search pattern.\n */\n List<String> getFileSystemEntries(String path) throws IOException;\n\n /**\n * Gets the names of files and subdirectories in a specified directory\n * matching a specified search pattern.\n *\n * @param path The path to search.\n * @param searchPattern The search string to match against.\n * @return list of files and subdirectories matching the search pattern.\n */\n List<String> getFileSystemEntries(String path, String searchPattern) throws IOException;\n\n /**\n * Moves a directory.\n *\n * @param sourceDirectoryName The directory to move.\n * @param destinationDirectoryName The target directory name.\n */\n void moveDirectory(String sourceDirectoryName, String destinationDirectoryName) throws IOException;\n\n /**\n * Moves a file.\n *\n * @param sourceName The file to move.\n * @param destinationName The target file name.\n */\n void moveFile(String sourceName, String destinationName) throws IOException;\n\n /**\n * Moves a file, allowing an existing file to be overwritten.\n *\n * @param sourceName The file to move.\n * @param destinationName The target file name.\n * @param overwrite Whether to permit a destination file to be overwritten.\n */\n void moveFile(String sourceName, String destinationName, boolean overwrite) throws IOException;\n\n /**\n * Opens the specified file.\n *\n * @param path The full path of the file to open.\n * @param mode The file mode for the created stream.\n * @return The new stream.\n */\n SparseStream openFile(String path, FileMode mode) throws IOException;\n\n /**\n * Opens the specified file.\n *\n * @param path The full path of the file to open.\n * @param mode The file mode for the created stream.\n * @param access The access permissions for the created stream.\n * @return The new stream.\n */\n SparseStream openFile(String path, FileMode mode, FileAccess access) throws IOException;\n\n /**\n * Gets the attributes of a file or directory.\n *\n * @param path The file or directory to inspect.\n * @return The attributes of the file or directory.\n */\n Map<String, Object> getAttributes(String path) throws IOException;\n\n /**\n * Sets the attributes of a file or directory.\n *\n * @param path The file or directory to change.\n * @param newValue The new attributes of the file or directory.\n */\n void setAttributes(String path, Map<String, Object> newValue) throws IOException;\n\n /**\n * Gets the creation time (in local time) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @return The creation time.\n */\n long getCreationTime(String path) throws IOException;\n\n /**\n * Sets the creation time (in local time) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @param newTime The new time to set.\n */\n void setCreationTime(String path, long newTime) throws IOException;\n\n /**\n * Gets the creation time (in UTC) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @return The creation time.\n */\n long getCreationTimeUtc(String path) throws IOException;\n\n /**\n * Sets the creation time (in UTC) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @param newTime The new time to set.\n */\n void setCreationTimeUtc(String path, long newTime) throws IOException;\n\n /**\n * Gets the last access time (in local time) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @return The last access time.\n */\n long getLastAccessTime(String path) throws IOException;\n\n /**\n * Sets the last access time (in local time) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @param newTime The new time to set.\n */\n void setLastAccessTime(String path, long newTime) throws IOException;\n\n /**\n * Gets the last access time (in UTC) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @return The last access time.\n */\n long getLastAccessTimeUtc(String path) throws IOException;\n\n /**\n * Sets the last access time (in UTC) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @param newTime The new time to set.\n */\n void setLastAccessTimeUtc(String path, long newTime) throws IOException;\n\n /**\n * Gets the last modification time (in local time) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @return The last write time.\n */\n long getLastWriteTime(String path) throws IOException;\n\n /**\n * Sets the last modification time (in local time) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @param newTime The new time to set.\n */\n void setLastWriteTime(String path, long newTime) throws IOException;\n\n /**\n * Gets the last modification time (in UTC) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @return The last write time.\n */\n long getLastWriteTimeUtc(String path) throws IOException;\n\n /**\n * Sets the last modification time (in UTC) of a file or directory.\n *\n * @param path The path of the file or directory.\n * @param newTime The new time to set.\n */\n void setLastWriteTimeUtc(String path, long newTime) throws IOException;\n\n /**\n * Gets the length of a file.\n *\n * @param path The path to the file.\n * @return The length in bytes.\n */\n long getFileLength(String path) throws IOException;\n\n /**\n * Gets an object representing a possible file.\n *\n * The file does not need to exist.\n *\n * @param path The file path.\n * @return The representing object.\n */\n DiscFileInfo getFileInfo(String path) throws IOException;\n\n /**\n * Gets an object representing a possible directory.\n *\n * The directory does not need to exist.\n *\n * @param path The directory path.\n * @return The representing object.\n */\n DiscDirectoryInfo getDirectoryInfo(String path) throws IOException;\n\n /**\n * Gets an object representing a possible file system object (file or\n * directory).\n *\n * The file system object does not need to exist.\n *\n * @param path The file system path.\n * @return The representing object.\n */\n DiscFileSystemInfo getFileSystemInfo(String path) throws IOException;\n\n /**\n * Reads the boot code of the file system into a byte array.\n *\n * @return The boot code, or {@code null} if not available.\n */\n byte[] readBootCode() throws IOException;\n\n /**\n * Size of the Filesystem in bytes\n */\n long getSize() throws IOException;\n\n /**\n * Used space of the Filesystem in bytes\n */\n long getUsedSpace() throws IOException;\n\n /**\n * Available space of the Filesystem in bytes\n */\n long getAvailableSpace() throws IOException;\n\n}",
"public interface Saveable {\n void save( String key,File file,Context context);\n}",
"public String getStorageLocation() {\n\t\treturn io.getFile();\n\t}",
"abstract public void store( String content, String path )\r\n throws Exception;",
"public interface VFSFile extends VFSEntry {\n /**\n * Get current length of this file.\n *\n * @return current length of file\n * @throws IOException I/O exception happened during operation\n */\n int getLength() throws IOException;\n\n /**\n * Set current read/write pointer of file relative to file start.\n *\n * @param offsetFromStart offset from beginning of file\n */\n void seek(int offsetFromStart);\n\n /**\n * Read block of data from file. Read operation starts from current pointer in file, then pointer advances to next\n * byte after last successfully read byte.\n *\n * @param buffer destination buffer to read into\n * @param bufferOffset offset in destination buffer where read bytes must be placed\n * @param length length of bytes to read from file\n * @return amount of successfully read bytes, -1 if there are no more bytes left in file\n * @throws IOException I/O exception happened during operation\n */\n int read(byte[] buffer, int bufferOffset, int length) throws IOException;\n\n /**\n * Write block of data to file, expanding it if necessary. Write operation starts from current pointer in file, then pointer advances to next\n * byte after last successfully written byte. File must be opened for write for this method to succeed.\n *\n * @param buffer source buffer to read bytes from\n * @param bufferOffset offset in source buffer from where bytes must be written to file\n * @param length length of bytes to write to file\n * @throws IOException I/O exception happened during operation\n */\n void write(byte[] buffer, int bufferOffset, int length) throws IOException;\n}",
"public interface UploadFileService {\n boolean saveFile(MultipartFile file);\n boolean readFile(String type);\n}",
"public abstract String getFileLocation();",
"private InternalStorage() {}",
"public File getDataFile();",
"public interface ClasspathFileInterface \r\n{\r\n \r\n public boolean exists ();\r\n public String getName ();\r\n public String getAbsolutePath ();\r\n public InputStream openInputStream () throws IOException;\r\n \r\n}",
"public Storage(String filePath, String fileDirectory, Ui ui) {\r\n this.filePath = filePath;\r\n this.fileDirectory = fileDirectory;\r\n this.ui = ui;\r\n }",
"ContentStorage getContentStorage(TypeStorageMode mode) throws FxNotFoundException;",
"@Override\n public void setFile(File f) {\n \n }",
"public void createStorageFile() throws IoDukeException {\n PrintWriter writer = null;\n try {\n writer = getStorageFile();\n } catch (IOException e) {\n throw new IoDukeException(\"Error opening task file for reading\");\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }",
"interface Storage {\n String getStorageSize() ;\n}",
"public String getStoragePath() {\n return this.storagePath;\n }",
"public interface Storage {\n\n String getId();\n}",
"public interface UploadFileService {\n\tpublic String saveFile(MultipartFile file);\n\tResource findFileByName(String nameFile);\n\tpublic String saveFileVer(MultipartFile file, String pathToSave);\n}",
"public DefaultStorage() {\n }",
"FileObject getFile();",
"FileObject getFile();",
"public interface FileService {\n\n\t/**\n\t * Reads a file identified by its path, and returns its contents line by line as\n\t * a string\n\t * \n\t * @param filePath\n\t * @return\n\t * @throws APIException\n\t */\n\tpublic List<String> readFileContents(String filePath) throws APIException;\n\n}",
"public FileIOManager() {\n\t\tthis.reader = new Reader(this);\n\t\tthis.writer = new Writer(this);\n\t}",
"private FileOperations() throws FileNotFoundException {\r\n\t\tbiddingPersistence = new BiddingPersistence(Constants.biddingsFilePath, \r\n\t\t\t\tConstants.indexBiddingsPath);\r\n\t\tusersPersistence = new UsersPersistence(Constants.usersFilePath,\r\n\t\t\t\tConstants.indexUsersPath);\t\t\r\n\t}",
"TreeStorage getTreeStorage();",
"public IFile getIFile ();",
"public interface ConfigFileLoader {\n\n /**\n * Save the map of the node instance,\n * to the file instance.\n *\n * @throws IOException When it fails to save {@see IOException}.\n */\n void save() throws IOException;\n\n /**\n * Load the map of the file instance,\n * in the node instance.\n *\n * @throws IOException When it fails to load {@see IOException}.\n */\n void load() throws IOException;\n\n /**\n * Change the file instance to new file instance.\n *\n * @param file new file instance.\n */\n void setNewFile(File file);\n\n}",
"public interface StorageFactory {\n\n\t<T> List<T> createList();\n\t\n\t<T> Set<T> createSet();\n\t\n\t<V> Map<Character, V> createMap();\n\t\n}",
"public File getFile()\n {\n return file;\n }",
"public File getFile() { return file; }",
"public StorageManager() {\n makeDirectory();\n }",
"public FilePersistence(String file) {\n this.file = file;\n }",
"public interface IDocumentStorage<L> {\n\t/**\n\t * Returns the current location (of the current document).\n\t * @return the current location\n\t */\n\tpublic L getDocumentLocation();\n\n\t/**\n\t * Sets the current location (of the current document), can be used by a save-as action.\n\t * @param documentLocation\n\t */\n\tpublic void setDocumentLocation(L documentLocation);\n\n\t/**\n\t * Adds an IDocumentStorageListener that will be notified when the current location changes.\n\t * @param documentStorageListener\n\t */\n\n\tpublic void addDocumentStorageListener(IDocumentStorageListener<L> documentStorageListener);\n\t/**\n\t * Removes an IDocumentStorageListener.\n\t * @param documentStorageListener\n\t */\n\tpublic void removeDocumentStorageListener(IDocumentStorageListener<L> documentStorageListener);\n\n\t/**\n\t * Creates a new documents and sets it as the current one, can be used by a new action.\n\t */\n\tpublic void newDocument();\n\n\t/**\n\t * Loads a documents from the provided location and sets it as the current one, can be used by an open action.\n\t */\n\tpublic void openDocument(L documentLocation) throws IOException;\n\n\t/**\n\t * Saves the current document (to the current location), can be used by a save action.\n\t */\n\tpublic void saveDocument() throws IOException;\n\n\t/**\n\t * Returns the set of IDocumentImporters, can be used by an import action.\n\t * @return\n\t */\n\tpublic Collection<IDocumentImporter> getDocumentImporters();\n}",
"public interface StorageService {\n\t\n\t/**\n\t * Storage.\n\t *\n\t * @param storage the storage\n\t * @return the storage state\n\t */\n\tpublic StorageState storage(ArrayList<StorageVO> storage);\n\t\n}",
"public HashMap<String, T> getStorage();",
"public File() {\n\t\tthis.name = \"\";\n\t\tthis.data = \"\";\n\t\tthis.creationTime = 0;\n\t}",
"private FileManager() {}",
"private FileManager()\n {\n bookFile.open(\"bookdata.txt\");\n hisFile.open(\"history.txt\");\n idFile.open(\"idpassword.txt\");\n createIDMap();\n createHisMap(Customer.getInstance());\n }",
"private void uploadFromDataStorage() {\n }",
"@Override\n\tpublic File getFile() {\n\t\treturn file;\n\t}",
"public Storage() {\n\n }",
"private void configStorage(){\n try {\n final StorageReference storageReference = FirebaseStorage.getInstance()\n .getReference(\"motolost/\"+ String.valueOf(Math.random()) + getFileExtension(filePath));\n storageReference.putFile(filePath)\n .continueWithTask(new Continuation<UploadTask.TaskSnapshot, Task<Uri>>() {\n @Override\n public Task<Uri> then(@NonNull Task<UploadTask.TaskSnapshot> task) throws Exception {\n if (!task.isSuccessful()) {\n throw task.getException();\n }\n return storageReference.getDownloadUrl();\n }\n }).addOnCompleteListener(new OnCompleteListener<Uri>() {\n @Override\n public void onComplete(@NonNull Task<Uri> task) {\n if (task.isSuccessful()) {\n Uri downloadUri = task.getResult();\n saveRegistry(downloadUri.toString());\n }\n }\n });\n } catch (Exception ex) {\n Constant.showMessage(\"Exception\", ex.getMessage(), this);\n }\n }",
"public Storage(String filePath) {\n file = new File(filePath);\n try {\n file.getParentFile().mkdir();\n file.createNewFile();\n } catch (IOException e) {\n System.err.println(\"Unable to create file\");\n }\n }",
"public void setStorage(Storage storage) {\n this.storage = storage;\n }",
"public interface FileConnection {\r\n\r\n\t/**\r\n\t * Execute a SFTP get and write the file to the passed output stream.\r\n\t * \r\n\t * @param path\r\n\t * @param stream\r\n\t * @throws IOException \r\n\t */\r\n\tvoid getFile(String path, OutputStream stream) throws NotFoundException, IOException;\r\n\t\r\n\t/**\r\n\t * Request a range of bytes from the given file.\r\n\t * \r\n\t * @param path\r\n\t * @param stream\r\n\t * @param startByteIndex The index of the start of the byte range to be read.\r\n\t * @param endByteIndex The index of the end of the byte range to be read.\r\n\t * @return True if the end of the file was reached with this read.\r\n\t * \r\n\t * @throws NotFoundException\r\n\t * @throws IOException \r\n\t */\r\n\tboolean getFileRange(String path, OutputStream stream, long startByteIndex, long endByteIndex) throws NotFoundException, IOException;\r\n\r\n\t/**\r\n\t * Get the size of a given file.\r\n\t * @param path\r\n\t * @return\r\n\t */\r\n\tlong getFileSize(String path) throws NotFoundException;\r\n\t\r\n\t/**\r\n\t * Get the last modified date of the file in UTC.\r\n\t * @param path\r\n\t * @return\r\n\t * @throws NotFoundException\r\n\t */\r\n\tlong getLastModifiedDate(String path) throws NotFoundException;\r\n}"
] | [
"0.6940494",
"0.6899238",
"0.6896201",
"0.68414205",
"0.68365324",
"0.67878866",
"0.67878866",
"0.67486954",
"0.67064315",
"0.67049855",
"0.6656071",
"0.66354764",
"0.6626644",
"0.6529552",
"0.6520491",
"0.65067625",
"0.64389706",
"0.6350237",
"0.634683",
"0.63438576",
"0.63328755",
"0.63059735",
"0.62883824",
"0.62766",
"0.62766",
"0.6275394",
"0.6269508",
"0.61979496",
"0.61831874",
"0.61691403",
"0.61685",
"0.6166831",
"0.6159466",
"0.6157937",
"0.6142565",
"0.6140183",
"0.61394733",
"0.6135618",
"0.6135235",
"0.6129316",
"0.6116649",
"0.61112183",
"0.6107937",
"0.6105894",
"0.61000097",
"0.6087291",
"0.60782766",
"0.6075767",
"0.6071186",
"0.6065341",
"0.6056519",
"0.6046192",
"0.6043019",
"0.602877",
"0.602877",
"0.59967643",
"0.59960485",
"0.59902775",
"0.59896666",
"0.5985781",
"0.598379",
"0.5971521",
"0.5955451",
"0.5946786",
"0.59460616",
"0.5933471",
"0.5925014",
"0.59186834",
"0.5911708",
"0.5904011",
"0.5897906",
"0.58870935",
"0.5881454",
"0.5881286",
"0.58661914",
"0.58645743",
"0.58645743",
"0.5846597",
"0.584265",
"0.5842322",
"0.58416206",
"0.5835716",
"0.58324444",
"0.583013",
"0.58215666",
"0.5821508",
"0.58190274",
"0.58133507",
"0.5810938",
"0.57980543",
"0.57776093",
"0.5774479",
"0.57731414",
"0.5770052",
"0.5750878",
"0.5748055",
"0.5737134",
"0.5736977",
"0.57191306",
"0.5713537",
"0.5709807"
] | 0.0 | -1 |
Public interface to our dependency graph | @ApplicationScope
@Component(modules = {ContextModule.class,ServiceModule.class}) // tell which modules to use in order to generate this instance
public interface ApplicationComponent {
SharedPreferencesClass getSharedPrefs();
RequestManager getGlide();
void injectRepo(ProjectRepository repository);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract DependencyGraph getDependencyGraph();",
"public interface Dependable {\n\n /**\n * This method is called by the Dependency Manager when the\n * Dependable object should be updated.\n * This method is called when the actual definition or dependencies of \n * an object change. Expressions need to be rebuilt.\n *\n * @param updatingObjects a set of all the objects that have been\n *\t\t\t or will be updated\n */\n public void dependencyUpdateDef(Set updatingObjects);\n\n /**\n * This method is called by the Dependency Manager when the\n * Dependable object should be updated.\n * This method is called when only a value changes, and the type\n * of the value does not change. An example of this kind of update\n * is when the value of a variable changes, but the definition of\n * it does not. Expressions do not have to be rebuilt.\n *\n * @param updatingObjects a set of all the objects that have been\n *\t\t\t or will be updated\n */\n public void dependencyUpdateVal(Set updatingObjects);\n\n /**\n * @return the depdenency graph node for this class\n */\n public DependencyNode dependencyNode();\n\n}",
"public void connectDependencies();",
"Dependency createDependency();",
"Dependency createDependency();",
"public IManagedDependencyGenerator getDependencyGenerator();",
"abstract void depComponent(DepComponent depComponent);",
"public interface Dependency extends Relationship , java.io.Serializable\n{\n // declare/define something only in the code\n // please fill in/modify the following section\n // -beg- preserve=no 327A646F00E6 detail_begin \"Dependency\"\n\n // -end- 327A646F00E6 detail_begin \"Dependency\"\n\n // -beg- preserve=no 3E423DBE00A1 head327A646F00E6 \"changeClient\"\n public void changeClient(ModelElement oldClient, ModelElement newClient)\n // -end- 3E423DBE00A1 head327A646F00E6 \"changeClient\"\n // declare any checked exceptions\n // please fill in/modify the following section\n // -beg- preserve=no 3E423DBE00A1 throws327A646F00E6 \"changeClient\"\n\n // -end- 3E423DBE00A1 throws327A646F00E6 \"changeClient\"\n ; // empty\n\n // -beg- preserve=no 3E423DCA0134 head327A646F00E6 \"changeSupplier\"\n public void changeSupplier(ModelElement oldSupplier, ModelElement newSupplier)\n // -end- 3E423DCA0134 head327A646F00E6 \"changeSupplier\"\n // declare any checked exceptions\n // please fill in/modify the following section\n // -beg- preserve=no 3E423DCA0134 throws327A646F00E6 \"changeSupplier\"\n\n // -end- 3E423DCA0134 throws327A646F00E6 \"changeSupplier\"\n ; // empty\n\n /** add a Client.\n * \n * @see #removeClient\n * @see #containsClient\n * @see #iteratorClient\n * @see #clearClient\n * @see #sizeClient\n */\n // -beg- preserve=no 33FFE57B03B3 add_head327A646F00E6 \"Dependency::addClient\"\n public void addClient(ModelElement client1)\n // -end- 33FFE57B03B3 add_head327A646F00E6 \"Dependency::addClient\"\n ; // empty\n\n /** disconnect a Client.\n * @see #addClient\n */\n // -beg- preserve=no 33FFE57B03B3 remove_head327A646F00E6 \"Dependency::removeClient\"\n public ModelElement removeClient(ModelElement client1)\n // -end- 33FFE57B03B3 remove_head327A646F00E6 \"Dependency::removeClient\"\n ; // empty\n\n /** tests if a given Client is connected.\n * @see #addClient\n */\n // -beg- preserve=no 33FFE57B03B3 test_head327A646F00E6 \"Dependency::containsClient\"\n public boolean containsClient(ModelElement client1)\n // -end- 33FFE57B03B3 test_head327A646F00E6 \"Dependency::containsClient\"\n ; // empty\n\n /** used to enumerate all connected Clients.\n * @see #addClient\n */\n // -beg- preserve=no 33FFE57B03B3 get_all_head327A646F00E6 \"Dependency::iteratorClient\"\n public java.util.Iterator iteratorClient()\n // -end- 33FFE57B03B3 get_all_head327A646F00E6 \"Dependency::iteratorClient\"\n ; // empty\n\n /** disconnect all Clients.\n * @see #addClient\n */\n // -beg- preserve=no 33FFE57B03B3 remove_all_head327A646F00E6 \"Dependency::clearClient\"\n public void clearClient()\n // -end- 33FFE57B03B3 remove_all_head327A646F00E6 \"Dependency::clearClient\"\n ; // empty\n\n /** returns the number of Clients.\n * @see #addClient\n */\n // -beg- preserve=no 33FFE57B03B3 size_head327A646F00E6 \"Dependency::sizeClient\"\n public int sizeClient()\n // -end- 33FFE57B03B3 size_head327A646F00E6 \"Dependency::sizeClient\"\n ; // empty\n\n /** DONT USE; link management internal\n */\n // -beg- preserve=no 33FFE57B03B3 _link_body327A646F00E6 \"Dependency::_linkClient\"\n public void _linkClient(ModelElement client1);\n // -end- 33FFE57B03B3 _link_body327A646F00E6 \"Dependency::_linkClient\"\n\n /** DONT USE; link management internal\n */\n // -beg- preserve=no 33FFE57B03B3 _unlink_body327A646F00E6 \"Dependency::_unlinkClient\"\n public void _unlinkClient(ModelElement client1);\n // -end- 33FFE57B03B3 _unlink_body327A646F00E6 \"Dependency::_unlinkClient\"\n\n /** add a Supplier.\n * \n * @see #removeSupplier\n * @see #containsSupplier\n * @see #iteratorSupplier\n * @see #clearSupplier\n * @see #sizeSupplier\n */\n // -beg- preserve=no 335C0D7A02E4 add_head327A646F00E6 \"Dependency::addSupplier\"\n public void addSupplier(ModelElement supplier1)\n // -end- 335C0D7A02E4 add_head327A646F00E6 \"Dependency::addSupplier\"\n ; // empty\n\n /** disconnect a Supplier.\n * @see #addSupplier\n */\n // -beg- preserve=no 335C0D7A02E4 remove_head327A646F00E6 \"Dependency::removeSupplier\"\n public ModelElement removeSupplier(ModelElement supplier1)\n // -end- 335C0D7A02E4 remove_head327A646F00E6 \"Dependency::removeSupplier\"\n ; // empty\n\n /** tests if a given Supplier is connected.\n * @see #addSupplier\n */\n // -beg- preserve=no 335C0D7A02E4 test_head327A646F00E6 \"Dependency::containsSupplier\"\n public boolean containsSupplier(ModelElement supplier1)\n // -end- 335C0D7A02E4 test_head327A646F00E6 \"Dependency::containsSupplier\"\n ; // empty\n\n /** used to enumerate all connected Suppliers.\n * @see #addSupplier\n */\n // -beg- preserve=no 335C0D7A02E4 get_all_head327A646F00E6 \"Dependency::iteratorSupplier\"\n public java.util.Iterator iteratorSupplier()\n // -end- 335C0D7A02E4 get_all_head327A646F00E6 \"Dependency::iteratorSupplier\"\n ; // empty\n\n /** disconnect all Suppliers.\n * @see #addSupplier\n */\n // -beg- preserve=no 335C0D7A02E4 remove_all_head327A646F00E6 \"Dependency::clearSupplier\"\n public void clearSupplier()\n // -end- 335C0D7A02E4 remove_all_head327A646F00E6 \"Dependency::clearSupplier\"\n ; // empty\n\n /** returns the number of Suppliers.\n * @see #addSupplier\n */\n // -beg- preserve=no 335C0D7A02E4 size_head327A646F00E6 \"Dependency::sizeSupplier\"\n public int sizeSupplier()\n // -end- 335C0D7A02E4 size_head327A646F00E6 \"Dependency::sizeSupplier\"\n ; // empty\n\n /** DONT USE; link management internal\n */\n // -beg- preserve=no 335C0D7A02E4 _link_body327A646F00E6 \"Dependency::_linkSupplier\"\n public void _linkSupplier(ModelElement supplier1);\n // -end- 335C0D7A02E4 _link_body327A646F00E6 \"Dependency::_linkSupplier\"\n\n /** DONT USE; link management internal\n */\n // -beg- preserve=no 335C0D7A02E4 _unlink_body327A646F00E6 \"Dependency::_unlinkSupplier\"\n public void _unlinkSupplier(ModelElement supplier1);\n // -end- 335C0D7A02E4 _unlink_body327A646F00E6 \"Dependency::_unlinkSupplier\"\n\n /** add a Presentation.\n * \n * @see #removePresentation\n * @see #containsPresentation\n * @see #iteratorPresentation\n * @see #clearPresentation\n * @see #sizePresentation\n */\n // -beg- preserve=no 362409A9000A add_head327A646F00E6 \"ModelElement::addPresentation\"\n public void addPresentation(PresentationElement presentation1)\n // -end- 362409A9000A add_head327A646F00E6 \"ModelElement::addPresentation\"\n ; // empty\n\n /** disconnect a Presentation.\n * @see #addPresentation\n */\n // -beg- preserve=no 362409A9000A remove_head327A646F00E6 \"ModelElement::removePresentation\"\n public PresentationElement removePresentation(PresentationElement presentation1)\n // -end- 362409A9000A remove_head327A646F00E6 \"ModelElement::removePresentation\"\n ; // empty\n\n /** tests if a given Presentation is connected.\n * @see #addPresentation\n */\n // -beg- preserve=no 362409A9000A test_head327A646F00E6 \"ModelElement::containsPresentation\"\n public boolean containsPresentation(PresentationElement presentation1)\n // -end- 362409A9000A test_head327A646F00E6 \"ModelElement::containsPresentation\"\n ; // empty\n\n /** used to enumerate all connected Presentations.\n * @see #addPresentation\n */\n // -beg- preserve=no 362409A9000A get_all_head327A646F00E6 \"ModelElement::iteratorPresentation\"\n public java.util.Iterator iteratorPresentation()\n // -end- 362409A9000A get_all_head327A646F00E6 \"ModelElement::iteratorPresentation\"\n ; // empty\n\n /** disconnect all Presentations.\n * @see #addPresentation\n */\n // -beg- preserve=no 362409A9000A remove_all_head327A646F00E6 \"ModelElement::clearPresentation\"\n public void clearPresentation()\n // -end- 362409A9000A remove_all_head327A646F00E6 \"ModelElement::clearPresentation\"\n ; // empty\n\n /** returns the number of Presentations.\n * @see #addPresentation\n */\n // -beg- preserve=no 362409A9000A size_head327A646F00E6 \"ModelElement::sizePresentation\"\n public int sizePresentation()\n // -end- 362409A9000A size_head327A646F00E6 \"ModelElement::sizePresentation\"\n ; // empty\n\n /** DONT USE; link management internal\n */\n // -beg- preserve=no 362409A9000A _link_body327A646F00E6 \"ModelElement::_linkPresentation\"\n public void _linkPresentation(PresentationElement presentation1);\n // -end- 362409A9000A _link_body327A646F00E6 \"ModelElement::_linkPresentation\"\n\n /** DONT USE; link management internal\n */\n // -beg- preserve=no 362409A9000A _unlink_body327A646F00E6 \"ModelElement::_unlinkPresentation\"\n public void _unlinkPresentation(PresentationElement presentation1);\n // -end- 362409A9000A _unlink_body327A646F00E6 \"ModelElement::_unlinkPresentation\"\n\n // declare/define something only in the code\n // please fill in/modify the following section\n // -beg- preserve=no 327A646F00E6 detail_end \"Dependency\"\n\n // -end- 327A646F00E6 detail_end \"Dependency\"\n\n}",
"public interface IRelationService<DependenciesBean, AssociationTreeBean> {\n\n /**\n * Method to obtain a list of dependencies.\n *\n * @param path the resource path.\n *\n * @return the list of dependencies.\n * @throws RegistryException if the operation failed.\n */\n DependenciesBean getDependencies(String path) throws RegistryException;\n\n /**\n * Method to add an association (or dependency).\n *\n * @param path the resource path.\n * @param type the type of association. If the type of association is 'depends' a\n * dependency will be created.\n * @param associationPaths the list of associations to be added.\n *\n * @throws RegistryException if the operation failed.\n */\n void addAssociation(String path, String type, String associationPaths,\n String operation) throws RegistryException;\n\n // TODO: FIXME: The operation parameter is not required. Get rid of that and fix the\n // addAssociation method on the BE service.\n\n /**\n * Method to obtain a list of associations.\n * \n * @param path the resource path.\n * @param type the type of association.\n *\n * @return the list of associations.\n * @throws RegistryException if the operation failed.\n */\n AssociationTreeBean getAssociationTree(String path, String type) throws RegistryException;\n}",
"protected void setDependencies() {\n\t\t\n\t}",
"public interface DependenciesHandler {\n\n /**\n * Configures dependency management for the dependency identified by the given {@code id}. The id is a string\n * of the form {@code group:name:version}.\n *\n * @param id the id of the dependency\n */\n void dependency(String id);\n\n /**\n * Configures dependency management for the dependency identified by the given {@code id}. The id is a map with\n * {@code group}, {@code name}, and {@code version} entries.\n *\n * @param id the id of the dependency\n */\n void dependency(Map<String, String> id);\n\n /**\n * Configures dependency management for the dependency identified by the given {@code id}. The dependency\n * management can be further configured using the given {@code closure} that is called with a {@link\n * DependencyHandler} as its delegate. The id is a string of the form {@code group:name:version}.\n *\n * @param id the id of the dependency\n * @param closure the closure used to further configure the dependency management\n * @see DependencyHandler\n */\n void dependency(String id, Closure closure);\n\n /**\n * Configures dependency management for the dependency identified by the given {@code id}. The dependency\n * management can be further configured using the given {@code action}. The id is a string of the form\n * {@code group:name:version} or a map with {@code group}, {@code name}, and {@code version} entries.\n *\n * @param id the id of the dependency\n * @param action the action used to further configure the dependency management\n * @see DependencyHandler\n */\n void dependency(String id, Action<DependencyHandler> action);\n\n /**\n * Configures dependency management for the dependency identified by the given {@code id}. The dependency\n * management can be further configured using the given {@code closure} that is called with a {@link\n * DependencyHandler} as its delegate. The id is a map with {@code group}, {@code name}, and {@code version}\n * entries.\n *\n * @param id the id of the dependency\n * @param closure the closure used to further configure the dependency management\n * @see DependencyHandler\n */\n void dependency(Map<String, String> id, Closure closure);\n\n /**\n * Configures dependency management for the dependency identified by the given {@code id}. The dependency\n * management can be further configured using the given {@code action}. The id is a map with {@code group},\n * {@code name}, and {@code version} entries.\n *\n * @param id the id of the dependency\n * @param action the action used to further configure the dependency management\n * @see DependencyHandler\n */\n void dependency(Map<String, String> id, Action<DependencyHandler> action);\n\n /**\n * Configures dependency management for a set of dependencies with the same {@code group} and {@code version}\n * as specified by the given {@code setId}. The id is a string of the form {@code group:version}. Entries are added\n * to the set using the given {@code closure} that is called with a {@link DependencySetHandler} as its delegate.\n *\n * @param setId the id of the set\n * @param closure the closure used to configure the entries\n * @see DependencySetHandler\n */\n void dependencySet(String setId, Closure closure);\n\n /**\n * Configures dependency management for a set of dependencies with the same {@code group} and {@code version}\n * as specified by the given {@code setId}. The id is a string of the form {@code group:version}. Entries are added\n * to the set using the given {@code action}.\n *\n * @param setId the id of the set\n * @param action the action used to configure the entries\n * @see DependencySetHandler\n */\n void dependencySet(String setId, Action<DependencySetHandler> action);\n\n /**\n * Configures dependency management for a set of dependencies with the same {@code group} and {@code version} as\n * specified by the given {@code setId}. The id is a map with {@code group} and {@code version} entries. Entries\n * are added to the set using the given {@code closure} that is called with a {@link DependencySetHandler} as its\n * delegate.\n *\n * @param setId a map containing the {@code group} and {@code version} of the set of dependencies\n * @param closure the closure used to configure the entries\n * @see DependencySetHandler\n */\n void dependencySet(Map<String, String> setId, Closure closure);\n\n /**\n * Configures dependency management for a set of dependencies with the same {@code group} and {@code version} as\n * specified by the given {@code setId}. The id is a map with {@code group} and {@code version} entries. Entries\n * are added to the set using the given {@code action}.\n *\n * @param setId a map containing the {@code group} and {@code version} of the set of dependencies\n * @param action the action used to configure the entries\n * @see DependencySetHandler\n */\n void dependencySet(Map<String, String> setId, Action<DependencySetHandler> action);\n\n}",
"RelationalDependency createRelationalDependency();",
"public interface NameServiceDependencies\n extends ServiceDependencies\n {\n /**\n * Return the AcceptorDependencies.\n *\n * @return AcceptorDependencies\n */\n public AcceptorDependencies getAcceptorDependencies();\n }",
"void onDependencyRelation( DependencyRelation relation );",
"public interface ProgramDependenceGraph extends MutableEdgeLabelledDirectedGraph {\n\n\t/**\n\t * @return A List of weak regions, generated by RegionAnalysis for the corresponding\n\t * control flow graph (These are Regions and not PDGRegions.)\n\t */\n\tpublic List<Region> getWeakRegions();\n\t/**\n\t * @return A List of strong regions, generated when constructing the program dependence graph\n\t * (These are Regions and not PDGRegions.)\n\t */\n\tpublic List<Region> getStrongRegions();\n\t/**\n\t * This method returns the list of PDGRegions computed by the construction method.\n\t * @return The list of PDGRegions\n\t */\n\tpublic List<PDGRegion> getPDGRegions();\n\t/**\n\t * @return The root region of the PDG.\n\t */\n\tpublic IRegion GetStartRegion();\n\n\t/**\n\t * @return The root node of the PDG, which is essentially the same as the start region\n\t * but packaged in its PDGNode, which can be used to traverse the graph, etc.\n\t */\n\tpublic PDGNode GetStartNode();\n\n\t/**\n\t * This method determines if node1 is control-dependent on node2 in this PDG.\n\t * @param node1\n\t * @param node2\n\t * @return returns true if node1 is dependent on node2\n\t */\n\tpublic boolean dependentOn(PDGNode node1, PDGNode node2);\n\t/**\n\t * This method returns the list of all dependents of a node in the PDG.\n\t * @param node is the PDG node whose dependents are desired.\n\t * @return a list of dependent nodes\n\t */\n\t@SuppressWarnings(\"unchecked\")\n\tpublic List getDependents(PDGNode node);\n\n\n\t/**\n\t * This method returns the PDGNode in the PDG corresponding to the given\n\t * CFG node. Note that currently the CFG node has to be a Block.\n\t * @param cfgNode is expected to be a node in CFG (currently only Block).\n\t * @return The node in PDG corresponding to cfgNode.\n\t */\n\n\tpublic PDGNode getPDGNode(Object cfgNode);\n\n\t/**\n\t *\n\t * @return A human readable description of the PDG.\n\t */\n\tpublic String toString();\n\n}",
"public static void initializeDiContainer() {\n addDependency(new CamelCaseConverter());\n addDependency(new JavadocGenerator());\n addDependency(new TemplateResolver());\n addDependency(new PreferenceStoreProvider());\n addDependency(new CurrentShellProvider());\n addDependency(new ITypeExtractor());\n addDependency(new DialogWrapper(getDependency(CurrentShellProvider.class)));\n addDependency(new PreferencesManager(getDependency(PreferenceStoreProvider.class)));\n addDependency(new ErrorHandlerHook(getDependency(DialogWrapper.class)));\n\n addDependency(new BodyDeclarationOfTypeExtractor());\n addDependency(new GeneratedAnnotationPredicate());\n addDependency(new GenericModifierPredicate());\n addDependency(new IsPrivatePredicate(getDependency(GenericModifierPredicate.class)));\n addDependency(new IsStaticPredicate(getDependency(GenericModifierPredicate.class)));\n addDependency(new IsPublicPredicate(getDependency(GenericModifierPredicate.class)));\n addDependency(new GeneratedAnnotationContainingBodyDeclarationFilter(getDependency(GeneratedAnnotationPredicate.class)));\n addDependency(new PrivateConstructorRemover(getDependency(IsPrivatePredicate.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class)));\n addDependency(new BodyDeclarationOfTypeExtractor());\n addDependency(new BuilderClassRemover(getDependency(BodyDeclarationOfTypeExtractor.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class),\n getDependency(IsPrivatePredicate.class),\n getDependency(IsStaticPredicate.class),\n getDependency(PreferencesManager.class)));\n addDependency(new JsonDeserializeRemover(getDependency(PreferencesManager.class)));\n addDependency(new StagedBuilderInterfaceRemover(getDependency(BodyDeclarationOfTypeExtractor.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class)));\n addDependency(new StaticBuilderMethodRemover(getDependency(IsStaticPredicate.class), getDependency(IsPublicPredicate.class),\n getDependency(GeneratedAnnotationContainingBodyDeclarationFilter.class)));\n addDependency(new BuilderAstRemover(getDependencyList(BuilderRemoverChainItem.class)));\n\n addDependency(new BuilderRemover(getDependency(PreferencesManager.class), getDependency(ErrorHandlerHook.class),\n getDependency(BuilderAstRemover.class)));\n addDependency(new CompilationUnitSourceSetter());\n addDependency(new HandlerUtilWrapper());\n addDependency(new WorkingCopyManager());\n addDependency(new WorkingCopyManagerWrapper(getDependency(HandlerUtilWrapper.class)));\n addDependency(new CompilationUnitParser());\n addDependency(new GeneratedAnnotationPopulator(getDependency(PreferencesManager.class)));\n addDependency(new MarkerAnnotationAttacher());\n addDependency(new ImportRepository());\n addDependency(new ImportPopulator(getDependency(PreferencesManager.class), getDependency(ImportRepository.class)));\n addDependency(new BuilderMethodNameBuilder(getDependency(CamelCaseConverter.class),\n getDependency(PreferencesManager.class),\n getDependency(TemplateResolver.class)));\n addDependency(new PrivateConstructorAdderFragment());\n addDependency(new JsonPOJOBuilderAdderFragment(getDependency(PreferencesManager.class), getDependency(ImportRepository.class)));\n addDependency(new EmptyBuilderClassGeneratorFragment(getDependency(GeneratedAnnotationPopulator.class),\n getDependency(PreferencesManager.class),\n getDependency(JavadocGenerator.class),\n getDependency(TemplateResolver.class),\n getDependency(JsonPOJOBuilderAdderFragment.class)));\n addDependency(new BuildMethodBodyCreatorFragment());\n addDependency(new BuildMethodDeclarationCreatorFragment(getDependency(PreferencesManager.class),\n getDependency(MarkerAnnotationAttacher.class),\n getDependency(TemplateResolver.class)));\n addDependency(new JavadocAdder(getDependency(JavadocGenerator.class), getDependency(PreferencesManager.class)));\n addDependency(new BuildMethodCreatorFragment(getDependency(BuildMethodDeclarationCreatorFragment.class),\n getDependency(BuildMethodBodyCreatorFragment.class)));\n addDependency(new FullyQualifiedNameExtractor());\n addDependency(new StaticMethodInvocationFragment());\n addDependency(new OptionalInitializerChainItem(getDependency(StaticMethodInvocationFragment.class), getDependency(PreferencesManager.class)));\n addDependency(new BuiltInCollectionsInitializerChainitem(getDependency(StaticMethodInvocationFragment.class), getDependency(PreferencesManager.class)));\n addDependency(new FieldDeclarationPostProcessor(getDependency(PreferencesManager.class), getDependency(FullyQualifiedNameExtractor.class),\n getDependency(ImportRepository.class), getDependencyList(FieldDeclarationPostProcessorChainItem.class)));\n addDependency(new BuilderFieldAdderFragment(getDependency(FieldDeclarationPostProcessor.class)));\n addDependency(new WithMethodParameterCreatorFragment(getDependency(PreferencesManager.class), getDependency(MarkerAnnotationAttacher.class)));\n addDependency(new RegularBuilderWithMethodAdderFragment(getDependency(PreferencesManager.class),\n getDependency(JavadocAdder.class),\n getDependency(MarkerAnnotationAttacher.class),\n getDependency(BuilderMethodNameBuilder.class),\n getDependency(WithMethodParameterCreatorFragment.class)));\n addDependency(new BuilderFieldAccessCreatorFragment());\n addDependency(new TypeDeclarationToVariableNameConverter(getDependency(CamelCaseConverter.class)));\n addDependency(new FieldSetterAdderFragment(getDependency(BuilderFieldAccessCreatorFragment.class)));\n addDependency(new IsRegularBuilderInstanceCopyEnabledPredicate(getDependency(PreferencesManager.class)));\n addDependency(new RegularBuilderCopyInstanceConstructorAdderFragment(getDependency(TypeDeclarationToVariableNameConverter.class),\n getDependency(IsRegularBuilderInstanceCopyEnabledPredicate.class)));\n addDependency(new PublicConstructorWithMandatoryFieldsAdderFragment());\n addDependency(new RegularBuilderClassCreator(getDependency(PrivateConstructorAdderFragment.class),\n getDependency(EmptyBuilderClassGeneratorFragment.class),\n getDependency(BuildMethodCreatorFragment.class),\n getDependency(BuilderFieldAdderFragment.class),\n getDependency(RegularBuilderWithMethodAdderFragment.class),\n getDependency(JavadocAdder.class),\n getDependency(RegularBuilderCopyInstanceConstructorAdderFragment.class),\n getDependency(PublicConstructorWithMandatoryFieldsAdderFragment.class)));\n addDependency(new StaticBuilderMethodSignatureGeneratorFragment(getDependency(GeneratedAnnotationPopulator.class), getDependency(PreferencesManager.class)));\n addDependency(new BuilderMethodDefinitionCreatorFragment(getDependency(TemplateResolver.class),\n getDependency(PreferencesManager.class),\n getDependency(JavadocAdder.class), getDependency(StaticBuilderMethodSignatureGeneratorFragment.class)));\n addDependency(new BlockWithNewBuilderCreationFragment());\n addDependency(\n new RegularBuilderBuilderMethodCreator(getDependency(BlockWithNewBuilderCreationFragment.class),\n getDependency(BuilderMethodDefinitionCreatorFragment.class)));\n addDependency(new PrivateConstructorMethodDefinitionCreationFragment(getDependency(PreferencesManager.class),\n getDependency(GeneratedAnnotationPopulator.class),\n getDependency(CamelCaseConverter.class)));\n addDependency(new SuperFieldSetterMethodAdderFragment(getDependency(BuilderFieldAccessCreatorFragment.class)));\n addDependency(new PrivateConstructorBodyCreationFragment(getDependency(TypeDeclarationToVariableNameConverter.class),\n getDependency(FieldSetterAdderFragment.class),\n getDependency(BuilderFieldAccessCreatorFragment.class),\n getDependency(SuperFieldSetterMethodAdderFragment.class)));\n addDependency(new ConstructorInsertionFragment());\n addDependency(new PrivateInitializingConstructorCreator(\n getDependency(PrivateConstructorMethodDefinitionCreationFragment.class),\n getDependency(PrivateConstructorBodyCreationFragment.class),\n getDependency(ConstructorInsertionFragment.class)));\n addDependency(new FieldPrefixSuffixPreferenceProvider(getDependency(PreferenceStoreProvider.class)));\n addDependency(new FieldNameToBuilderFieldNameConverter(getDependency(PreferencesManager.class),\n getDependency(FieldPrefixSuffixPreferenceProvider.class),\n getDependency(CamelCaseConverter.class)));\n addDependency(new TypeDeclarationFromSuperclassExtractor(getDependency(CompilationUnitParser.class),\n getDependency(ITypeExtractor.class)));\n addDependency(new BodyDeclarationVisibleFromPredicate());\n addDependency(new ApplicableFieldVisibilityFilter(getDependency(BodyDeclarationVisibleFromPredicate.class)));\n addDependency(new ClassFieldCollector(getDependency(FieldNameToBuilderFieldNameConverter.class),\n getDependency(PreferencesManager.class), getDependency(TypeDeclarationFromSuperclassExtractor.class),\n getDependency(ApplicableFieldVisibilityFilter.class)));\n addDependency(new RecordFieldCollector(getDependency(FieldNameToBuilderFieldNameConverter.class)));\n addDependency(new BodyDeclarationFinderUtil(getDependency(CamelCaseConverter.class)));\n addDependency(new SuperConstructorParameterCollector(getDependency(FieldNameToBuilderFieldNameConverter.class),\n getDependency(PreferencesManager.class), getDependency(TypeDeclarationFromSuperclassExtractor.class),\n getDependency(BodyDeclarationVisibleFromPredicate.class),\n getDependency(BodyDeclarationFinderUtil.class)));\n addDependency(new SuperClassSetterFieldCollector(getDependency(PreferencesManager.class),\n getDependency(TypeDeclarationFromSuperclassExtractor.class),\n getDependency(CamelCaseConverter.class),\n getDependency(BodyDeclarationFinderUtil.class)));\n addDependency(new ApplicableBuilderFieldExtractor(Arrays.asList(\n getDependency(SuperConstructorParameterCollector.class),\n getDependency(ClassFieldCollector.class),\n getDependency(SuperClassSetterFieldCollector.class),\n getDependency(RecordFieldCollector.class))));\n addDependency(new ActiveJavaEditorOffsetProvider());\n addDependency(new ParentITypeExtractor());\n addDependency(new IsTypeApplicableForBuilderGenerationPredicate(getDependency(ParentITypeExtractor.class)));\n addDependency(new CurrentlySelectedApplicableClassesClassNameProvider(getDependency(ActiveJavaEditorOffsetProvider.class),\n getDependency(IsTypeApplicableForBuilderGenerationPredicate.class),\n getDependency(ParentITypeExtractor.class)));\n addDependency(new BuilderOwnerClassFinder(getDependency(CurrentlySelectedApplicableClassesClassNameProvider.class),\n getDependency(PreferencesManager.class), getDependency(GeneratedAnnotationPredicate.class)));\n addDependency(new BlockWithNewCopyInstanceConstructorCreationFragment());\n addDependency(new CopyInstanceBuilderMethodDefinitionCreatorFragment(getDependency(TemplateResolver.class),\n getDependency(PreferencesManager.class),\n getDependency(JavadocAdder.class), getDependency(StaticBuilderMethodSignatureGeneratorFragment.class)));\n addDependency(new RegularBuilderCopyInstanceBuilderMethodCreator(getDependency(BlockWithNewCopyInstanceConstructorCreationFragment.class),\n getDependency(CopyInstanceBuilderMethodDefinitionCreatorFragment.class),\n getDependency(TypeDeclarationToVariableNameConverter.class),\n getDependency(IsRegularBuilderInstanceCopyEnabledPredicate.class)));\n addDependency(new JsonDeserializeAdder(getDependency(ImportRepository.class)));\n addDependency(new GlobalBuilderPostProcessor(getDependency(PreferencesManager.class), getDependency(JsonDeserializeAdder.class)));\n addDependency(new DefaultConstructorAppender(getDependency(ConstructorInsertionFragment.class), getDependency(PreferencesManager.class),\n getDependency(GeneratedAnnotationPopulator.class)));\n addDependency(new RegularBuilderCompilationUnitGenerator(getDependency(RegularBuilderClassCreator.class),\n getDependency(RegularBuilderCopyInstanceBuilderMethodCreator.class),\n getDependency(PrivateInitializingConstructorCreator.class),\n getDependency(RegularBuilderBuilderMethodCreator.class), getDependency(ImportPopulator.class),\n getDependency(BuilderRemover.class),\n getDependency(GlobalBuilderPostProcessor.class),\n getDependency(DefaultConstructorAppender.class)));\n addDependency(new RegularBuilderUserPreferenceDialogOpener(getDependency(CurrentShellProvider.class)));\n addDependency(new RegularBuilderDialogDataConverter());\n addDependency(new RegularBuilderUserPreferenceConverter(getDependency(PreferencesManager.class)));\n addDependency(new RegularBuilderUserPreferenceProvider(getDependency(RegularBuilderUserPreferenceDialogOpener.class),\n getDependency(PreferencesManager.class),\n getDependency(RegularBuilderDialogDataConverter.class),\n getDependency(RegularBuilderUserPreferenceConverter.class)));\n addDependency(new RegularBuilderCompilationUnitGeneratorBuilderFieldCollectingDecorator(getDependency(ApplicableBuilderFieldExtractor.class),\n getDependency(RegularBuilderCompilationUnitGenerator.class),\n getDependency(RegularBuilderUserPreferenceProvider.class)));\n addDependency(new IsEventOnJavaFilePredicate(getDependency(HandlerUtilWrapper.class)));\n\n // staged builder dependencies\n addDependency(new StagedBuilderInterfaceNameProvider(getDependency(PreferencesManager.class),\n getDependency(CamelCaseConverter.class),\n getDependency(TemplateResolver.class)));\n addDependency(new StagedBuilderWithMethodDefiniationCreatorFragment(getDependency(PreferencesManager.class),\n getDependency(BuilderMethodNameBuilder.class),\n getDependency(MarkerAnnotationAttacher.class),\n getDependency(StagedBuilderInterfaceNameProvider.class),\n getDependency(WithMethodParameterCreatorFragment.class)));\n addDependency(new StagedBuilderInterfaceTypeDefinitionCreatorFragment(getDependency(JavadocAdder.class)));\n addDependency(new StagedBuilderInterfaceCreatorFragment(getDependency(StagedBuilderWithMethodDefiniationCreatorFragment.class),\n getDependency(StagedBuilderInterfaceTypeDefinitionCreatorFragment.class),\n getDependency(StagedBuilderInterfaceTypeDefinitionCreatorFragment.class),\n getDependency(BuildMethodDeclarationCreatorFragment.class),\n getDependency(JavadocAdder.class),\n getDependency(GeneratedAnnotationPopulator.class)));\n addDependency(new StagedBuilderCreationBuilderMethodAdder(getDependency(BlockWithNewBuilderCreationFragment.class),\n getDependency(BuilderMethodDefinitionCreatorFragment.class)));\n addDependency(new NewBuilderAndWithMethodCallCreationFragment());\n addDependency(new StagedBuilderCreationWithMethodAdder(getDependency(StagedBuilderWithMethodDefiniationCreatorFragment.class),\n getDependency(NewBuilderAndWithMethodCallCreationFragment.class), getDependency(JavadocAdder.class)));\n addDependency(new StagedBuilderStaticBuilderCreatorMethodCreator(getDependency(StagedBuilderCreationBuilderMethodAdder.class),\n getDependency(StagedBuilderCreationWithMethodAdder.class),\n getDependency(PreferencesManager.class)));\n addDependency(new StagedBuilderWithMethodAdderFragment(\n getDependency(StagedBuilderWithMethodDefiniationCreatorFragment.class),\n getDependency(MarkerAnnotationAttacher.class)));\n addDependency(new InterfaceSetter());\n addDependency(new StagedBuilderClassCreator(getDependency(PrivateConstructorAdderFragment.class),\n getDependency(EmptyBuilderClassGeneratorFragment.class),\n getDependency(BuildMethodCreatorFragment.class),\n getDependency(BuilderFieldAdderFragment.class),\n getDependency(StagedBuilderWithMethodAdderFragment.class),\n getDependency(InterfaceSetter.class),\n getDependency(MarkerAnnotationAttacher.class)));\n addDependency(new StagedBuilderStagePropertyInputDialogOpener(getDependency(CurrentShellProvider.class)));\n addDependency(new StagedBuilderStagePropertiesProvider(getDependency(StagedBuilderInterfaceNameProvider.class),\n getDependency(StagedBuilderStagePropertyInputDialogOpener.class)));\n addDependency(new StagedBuilderCompilationUnitGenerator(getDependency(StagedBuilderClassCreator.class),\n getDependency(PrivateInitializingConstructorCreator.class),\n getDependency(StagedBuilderStaticBuilderCreatorMethodCreator.class),\n getDependency(ImportPopulator.class),\n getDependency(StagedBuilderInterfaceCreatorFragment.class),\n getDependency(BuilderRemover.class),\n getDependency(GlobalBuilderPostProcessor.class),\n getDependency(DefaultConstructorAppender.class)));\n addDependency(new StagedBuilderCompilationUnitGeneratorFieldCollectorDecorator(\n getDependency(StagedBuilderCompilationUnitGenerator.class),\n getDependency(ApplicableBuilderFieldExtractor.class),\n getDependency(StagedBuilderStagePropertiesProvider.class)));\n\n // Generator chain\n addDependency(new GenerateBuilderExecutorImpl(getDependency(CompilationUnitParser.class),\n getDependencyList(BuilderCompilationUnitGenerator.class),\n getDependency(IsEventOnJavaFilePredicate.class), getDependency(WorkingCopyManagerWrapper.class),\n getDependency(CompilationUnitSourceSetter.class),\n getDependency(ErrorHandlerHook.class),\n getDependency(BuilderOwnerClassFinder.class)));\n addDependency(new GenerateBuilderHandlerErrorHandlerDecorator(getDependency(GenerateBuilderExecutorImpl.class),\n getDependency(ErrorHandlerHook.class)));\n addDependency(new StatefulBeanHandler(getDependency(PreferenceStoreProvider.class),\n getDependency(WorkingCopyManagerWrapper.class), getDependency(ImportRepository.class)));\n addDependency(\n new StateInitializerGenerateBuilderExecutorDecorator(\n getDependency(GenerateBuilderHandlerErrorHandlerDecorator.class),\n getDependency(StatefulBeanHandler.class)));\n }",
"void depComponent(DepComponent depComponent);",
"public Dependency() \r\n {\r\n }",
"public interface NerdMartGraph {\n void inject(NerdMartAbstractFragment fragment);\n}",
"GraphFactory getGraphFactory();",
"static public Collection<TypedDependency> dependencies(Tree thisTree)\n\t{\n\t\tGrammaticalStructure thisStructure = Analyzer.theGrammaticalStructureFactory.newGrammaticalStructure(thisTree);\n\t\treturn theFactory.make(thisStructure);\n\t}",
"void registerParent( DefinitionDependency dependency );",
"@Override\n protected void injectDependencies(Context context) {\n }",
"ISChangePropagationDueToInterfaceDependencies createISChangePropagationDueToInterfaceDependencies();",
"public LibraryDependencyGraph createLibraryDependencyGraph(DependencyTypeSet dependencySet)\n {\n // Get the compilation units from the swcs.\n List<ISWC> swcs = getLibraries();\n Workspace w = getWorkspace();\n List<IRequest<IOutgoingDependenciesRequestResult, ICompilationUnit>> requests =\n new ArrayList<IRequest<IOutgoingDependenciesRequestResult, ICompilationUnit>>();\n \n // For each swc, get the compilation units. Request the semantic problems\n // for each compilation unit to cause the dependency graph to be built.\n Set<ICompilationUnit> swcUnits = new HashSet<ICompilationUnit>();\n \n for (ISWC swc : swcs)\n {\n String path = swc.getSWCFile().getAbsolutePath();\n Collection<ICompilationUnit> units = w.getCompilationUnits(path, this);\n swcUnits.addAll(units);\n \n for (ICompilationUnit unit : units)\n requests.add(unit.getOutgoingDependenciesRequest());\n }\n \n // Iterate over the requests to cause the dependency graph to be\n // populated.\n for (IRequest<IOutgoingDependenciesRequestResult, ICompilationUnit> request : requests)\n {\n try\n {\n request.get();\n }\n catch (InterruptedException e)\n {\n assert false : \"Unexpected interruption\";\n return null;\n }\n }\n \n // Now that the dependency tree of compilation units is populated, \n // build a graph of library dependencies.\n DependencyGraph unitGraph = getDependencyGraph();\n LibraryDependencyGraph libraryGraph = new LibraryDependencyGraph();\n \n for (ICompilationUnit unit : swcUnits)\n {\n Set<Edge> dependencies = unitGraph.getOutgoingEdges(unit);\n \n // If a unit has no dependencies then make sure we add the swc to\n // the graph to make sure no swcs are missing.\n if (dependencies.size() == 0)\n libraryGraph.addLibrary(unit.getAbsoluteFilename());\n \n // For each edge look to see it the dependency is external to the swc since\n // we only care about external dependencies. \n // If it is an external dependency then filter based of the dependency types\n // we care about.\n for (Edge dependency : dependencies)\n {\n // Test if the edge is between different swcs\n ICompilationUnit from = dependency.getFrom();\n ICompilationUnit to = dependency.getTo();\n\n /* Check if the compilation units live in different\n * swcs. If so, add a dependency between the swcs.\n */\n if (isInterSWCDependency(from, to))\n {\n if (dependencySet == null || \n dependency.typeInSet(dependencySet) ||\n dependencySet.isEmpty())\n {\n libraryGraph.addLibrary(from.getAbsoluteFilename());\n libraryGraph.addLibrary(to.getAbsoluteFilename());\n libraryGraph.addDependency(from.getAbsoluteFilename(), to.getAbsoluteFilename(),\n dependency.getNamedDependencies());\n }\n }\n }\n }\n \n return libraryGraph;\n }",
"public IPath[] getAdditionalDependencies();",
"@Override\n\tpublic Collection<Class<? extends IFloodlightService>> getModuleDependencies() {\n\t\tCollection<Class<? extends IFloodlightService>> l =\n\t\t new ArrayList<Class<? extends IFloodlightService>>();\n\t\t l.add(IFloodlightProviderService.class);\n\t\t l.add(ITopologyService.class);\n\t\t return l;\n\t}",
"@Override\n\tpublic void checkDependencies() throws Exception\n\t{\n\t\t\n\t}",
"void addDependsOnMe(DependencyItem dependency);",
"TaskDependency createTaskDependency();",
"Requires getRequires();",
"public interface DirectedGraph {\n\n /**\n * Set a graph label\n * @param label a graph label\n */\n void setGraphLabel(String label);\n\n /**\n * @return the graph label\n */\n String getGraphLabel();\n\n /**\n * Add a node in graph\n * @param node\n * @throws IllegalArgumentException if node is negative\n */\n void addNode(int node);\n\n /**\n * Associating metadata to node\n * @param node the node id\n * @param key the metadata key\n * @param value the metadata value\n */\n void addNodeMetadata(int node, String key, String value);\n\n /**\n * Get the value of the metadata associated with the given node\n * @param node the node to get metadata for\n * @param key the metadata key\n * @return the value or null if not found\n */\n String getNodeMetadataValue(int node, String key);\n\n /**\n * @return the node given the label or -1 if not found\n */\n int getNodeFromMetadata(String metadata);\n\n /**\n * Add an edge in graph from tail to head and return its index\n * @param tail predecessor node\n * @param head successor node\n * @return the edge id or -1 if already exists\n */\n int addEdge(int tail, int head);\n\n /**\n * Set an edge label\n * @param edge a edge id\n * @param label a node label\n */\n void setEdgeLabel(int edge, String label);\n\n /**\n * @return the edge label\n */\n String getEdgeLabel(int edge);\n\n /**\n * @return an array of graph nodes\n */\n int[] getNodes();\n\n /**\n * @return an array of graph edges\n */\n int[] getEdges();\n\n /**\n * @return the edge id from end points or -1 if not found\n */\n int getEdge(int tail, int head);\n\n /**\n * Get the incoming and outcoming edges for the given nodes\n * @param nodes the nodes\n * @return edge indices\n */\n int[] getEdgesIncidentTo(int... nodes);\n\n /**\n * Get the incoming edges to the given nodes\n * @param nodes the nodes\n * @return edge indices\n */\n int[] getInEdges(int... nodes);\n\n /**\n * Get the outcoming edges from the given nodes\n * @param nodes the nodes\n * @return edge indices\n */\n int[] getOutEdges(int... nodes);\n\n /**\n * @return the tail node of the given edge or -1 if not found\n */\n int getTailNode(int edge);\n\n /**\n * @return the head node of the given edge or -1 if not found\n */\n int getHeadNode(int edge);\n\n /**\n * @return true if node belongs to graph else false\n */\n boolean containsNode(int node);\n\n /**\n * @return true if edge belongs to graph else false\n */\n boolean containsEdge(int edge);\n\n /**\n * @return true if tail -> head edge belongs to graph else false\n */\n boolean containsEdge(int tail, int head);\n\n /**\n * @return ancestors of the given node\n */\n int[] getAncestors(int node);\n\n /**\n * @return descendants of the given node\n */\n int[] getDescendants(int node);\n\n /**\n * @return descendants of the given node\n */\n int[] getDescendants(int node, int maxDepth);\n\n /**\n * @return true if queryDescendant is a descendant of queryAncestor\n */\n boolean isAncestorOf(int queryAncestor, int queryDescendant);\n\n /**\n * @return the predecessors of the given node\n */\n int[] getPredecessors(int node);\n\n /**\n * @return the successors of the given node\n */\n int[] getSuccessors(int node);\n\n /**\n * @return the number of head ends adjacent to the given node\n */\n int getInDegree(int node);\n\n /**\n * @return the number of tail ends adjacent to the given node\n */\n int getOutDegree(int node);\n\n /**\n * @return the sources (indegree = 0) of the graph\n */\n int[] getSources();\n\n /**\n * @return the sinks (outdegree = 0) of the graph\n */\n int[] getSinks();\n\n /**\n * @return the subgraph of this graph composed of given nodes\n */\n DirectedGraph calcSubgraph(int... nodes);\n\n /**\n * @return the total number of graph nodes\n */\n default int countNodes() {\n\n return getNodes().length;\n }\n\n /**\n * @return the total number of graph edges\n */\n default int countEdges() {\n\n return getEdges().length;\n }\n\n /**\n * @return true if queryDescendant is a descendant of queryAncestor\n */\n default boolean isDescendantOf(int queryDescendant, int queryAncestor) {\n\n return isAncestorOf(queryAncestor, queryDescendant);\n }\n\n default boolean isSource(int node) {\n return getInDegree(node) == 0 && getOutDegree(node) > 0;\n }\n\n default boolean isSink(int node) {\n return getInDegree(node) > 0 && getOutDegree(node) == 0;\n }\n\n /**\n * The height of a rooted tree is the length of the longest downward path to a leaf from the root.\n *\n * @return the longest path from the root or -1 if it is not a tree\n */\n default int calcHeight() throws NotATreeException {\n\n int[] roots = getSources();\n\n if (roots.length == 0) {\n throw new NotATreeException();\n }\n\n class WrappedCalcLongestPath {\n private int calcLongestPath(int node, TIntList path) throws CycleDetectedException {\n\n if (!containsNode(node)) {\n throw new IllegalArgumentException(\"node \"+ node + \" was not found\");\n }\n\n if (isSink(node)) {\n return path.size()-1;\n }\n\n TIntList lengths = new TIntArrayList();\n for (int edge : getOutEdges(node)) {\n\n int nextNode = getHeadNode(edge);\n\n TIntList newPath = new TIntArrayList(path);\n newPath.add(nextNode);\n\n if (path.contains(nextNode)) {\n throw new CycleDetectedException(newPath);\n }\n\n lengths.add(calcLongestPath(nextNode, newPath));\n }\n\n return lengths.max();\n }\n }\n\n // it is ok if there are multiple roots (see example of enzyme-classification-cv where it misses the root that\n // connect children EC 1.-.-.-, EC 2.-.-.-, ..., EC 6.-.-.-)\n /*if (roots.length > 1) {\n throw new NotATreeMultipleRootsException(roots);\n }*/\n\n return new WrappedCalcLongestPath().calcLongestPath(roots[0], new TIntArrayList(new int[] {roots[0]}));\n }\n\n class NotATreeException extends Exception {\n\n public NotATreeException() {\n\n super(\"not a tree\");\n }\n }\n\n class NotATreeMultipleRootsException extends NotATreeException {\n\n private final int[] roots;\n\n public NotATreeMultipleRootsException(int[] roots) {\n\n super();\n this.roots = roots;\n }\n\n @Override\n public String getMessage() {\n\n return super.getMessage() + \", roots=\" + Arrays.toString(this.roots);\n }\n }\n\n class CycleDetectedException extends NotATreeException {\n\n private final TIntList path;\n\n public CycleDetectedException(TIntList path) {\n\n super();\n\n this.path = path;\n }\n\n @Override\n public String getMessage() {\n\n return super.getMessage() + \", path=\" + this.path;\n }\n }\n}",
"Set<ResolvedType> dependencies(ModelContext context);",
"public interface IRepositoryService {\n\n /**\n * Returns the path to an artifact with the given identifier.\n *\n * @param identifier artifact identifier\n * @return the path to an artifact with the given identifier.\n */\n Path getArtifact(String identifier);\n\n /**\n * Returns the set of paths to the artifacts that the artifact with the given identifier depends on. If the given\n * artifact has no dependencies, returns an empty set.\n *\n * @param identifier artifact identifier\n * @param transitive if {@code false}, returns the immediate dependencies of the artifact; otherwise, returns all\n * dependencies, including dependencies of dependencies\n * @return the set of paths to the dependent artifacts\n */\n Set<Path> getArtifactDependencies(String identifier, boolean transitive);\n\n}",
"public Map<ClassName, List<ClassName>> dependenciesMap() { return m_dependenceisMap; }",
"public interface GraphReader {\n\n /**\n * Generate graph from file\n */\n void readGraphFromFile();\n\n /**\n * Get Edges of the graph\n *\n * @return Edge string\n */\n String getEdges();\n\n /**\n * Get graph attributes\n *\n * @return Attribute string\n */\n String getAttributes();\n}",
"@Override\n\tpublic void youNeedToImplementTheStaticFunctionCalled_getExtraDependencyModules() {\n\t\t\n\t}",
"@Override\n\tpublic Collection<Class<? extends IFloodlightService>> getModuleDependencies() {\n\t\tCollection<Class<? extends IFloodlightService>> l =\n\t\t new ArrayList<Class<? extends IFloodlightService>>();\n\t\t l.add(IFloodlightProviderService.class);\n\t\t l.add(IStaticEntryPusherService.class);\n\t\t return l;\n\t}",
"public interface Graph {\n\n /** @return The number of vertices in the graph. */\n int getNumVertices();\n\n /** @return The number of edges in the graph. */\n int getNumEdges();\n\n /** @return A read-only set of all the vertices in the graph. */\n Set<Vertex> getVertices();\n\n /** @return A read-only set of all edges (directed or undirected) in the graph. */\n Set<Edge> getEdges();\n\n /** Removes all vertices and edges from the graph. */\n void clear();\n\n /** Adds a vertex to this graph. */\n void add(Vertex vertex);\n\n /** Adds an edge to the graph. */\n void add(Edge edge);\n\n /** Adds all the vertices and edges in another graph to this graph. */\n void addAll(Graph graph);\n\n /** Removes vertex from the graph and any edges attached to it. */\n void remove(Vertex vertex);\n\n /** Removes an existing edge from the graph. */\n void remove(Edge edge);\n\n /** Checks if the graph contains a given vertex. */\n boolean contains(Vertex vertex);\n\n /** Checks if the graph contains a given edge. */\n boolean contains(Edge edge);\n\n /** @return An unmodifiable set of all directed edges entering vertex. */\n Set<Edge> getInEdges(Vertex vertex);\n\n /** @return An unmodifiable set of all directed edges coming out of vertex. */\n Set<Edge> getOutEdges(Vertex vertex);\n\n /** @return An unmodifiable set of all undirected edges connected to vertex. */\n Set<Edge> getUndirectedEdges(Vertex vertex);\n\n /** @return An unmodifiable set of all edges (directed and undirected) connected to vertex. */\n Set<Edge> getMixedEdges(Vertex vertex);\n\n /** @return The number of undirected edges connected to vertex. */\n int getUndirectedDegree(Vertex vertex);\n\n /** @return The number of directed edges coming into vertex. */\n int getInDegree(Vertex vertex);\n\n /** @return The number of directed edges coming out of vertex. */\n int getOutDegree(Vertex vertex);\n\n /**\n * @return The number of directed and undirected edges connected to this vertex. Equivalent to\n * inDegree + outDegree + undirectedDegree.\n */\n int getMixedDegree(Vertex vertex);\n\n /** Registers a listener for changes in the graph model. */\n void addListener(GraphListener listener);\n\n /** Unregisters a listener for changes in the graph model. */\n void removeListener(GraphListener listener);\n\n /** @return Attributes that apply to the entire graph. */\n Attributes getAttributes();\n\n /** Creates a new vertex, adds it to the graph, and returns a reference to it. */\n Vertex createVertex();\n\n /** Creates a new edge, adds it to the graph, and returns a reference to it. */\n Edge createEdge(Vertex src, Vertex tgt, boolean directed);\n}",
"public abstract void injectDependencies(@SuppressWarnings(\"rawtypes\") Feature feature);",
"public interface DiGraph< VKeyT, VDataT, EDataT > {\n\n // Methods to build the graph\n\n /**\n * Add a vertex to the graph. If the graph already contains a vertex\n * with the given key the old data will be replaced by the new data.\n *\n * @param key the key that identifies the vertex.\n * @param data the data to be associated with the vertex.\n */\n\n public void addVertex( VKeyT key, VDataT data );\n\n /**\n * Add an edge to the graph starting at the vertex identified by\n * fromKey and ending at the vertex identified by toKey. If either of\n * the vertices do not exist a NoSuchVertexException will be thrown.\n * If the graph already contains this edge, the old data will be replaced\n * by the new data.\n *\n * @param fromKey the key associated with the starting vertex of the edge.\n * @param toKey the key associated with the ending vertex of the edge.\n * @param data the data to be associated with the edge.\n *\n * @exception NoSuchVertexException if either end point is not a\n * key associated with a vertex in the graph.\n */\n\n public void addEdge( VKeyT fromKey, VKeyT toKey, EDataT data )\n throws NoSuchVertexException;\n\n // Operations on edges\n\n /**\n * Return true if the edge defined by the given vertices is an\n * edge in the graph. False will be returned if the edge is not\n * in the graph. A NoSuchVertexException will be thrown if either\n * of the vertices do not exist.\n *\n * @param fromKey the key of the vetex where the edge starts.\n * @param toKey the key of the vertex where the edge ends.\n *\n * @return true if the edge defined by the given vertices is in\n * the graph and false otherwise.\n *\n * @exception NoSuchVertexException if either end point is not a\n * key associated with a vertex in the graph.\n */\n\n public boolean isEdge( VKeyT fromKey, VKeyT toKey )\n throws NoSuchVertexException;\n\n /**\n * Return a reference to the data associated with the edge that is \n * defined by the given end points. Null will be returned if the \n * edge is not in the graph. Note that a return value of null does\n * not necessarily imply that the edge is not in the graph. It may\n * be the case that the data associated with the edge is null. A \n * NoSuchVertexException will be thrown if either of the end points \n * do not exist.\n *\n * @param fromKey the key of the vertex where the edge starts.\n * @param toKey the key of the vertex where the edge ends.\n *\n * @return a reference to the data associated with the edge defined by\n * the specified end points. Null is returned if the edge \n * is not in the graph.\n *\n * @exception NoSuchVertexException if either end point is not a\n * key associated with a vertex in the graph.\n */\n\n public EDataT getEdgeData( VKeyT fromKey, VKeyT toKey )\n throws NoSuchVertexException;\n\n // Operations on vertices\n\n /**\n * Returns true if the graph contains a vertex with the associated\n * key.\n *\n * @param key the key of the vertex being looked for.\n *\n * @return true if the key is associated with a vertex in the graph\n * and false otherwise.\n */\n\n public boolean isVertex( VKeyT key );\n\n /**\n * Return a reference to the data associated with the vertex \n * identified by the key. A NoSuchVertexException will be thrown\n * if the key is not associated with a vertex in the graph.\n *\n * @param key the key of the vertex being looked for.\n *\n * @return the data associated with the vertex that is identifed by the\n * key.\n *\n * @exception NoSuchVertexException if the key is not associated\n * with a vertex in the graph.\n */\n\n public VDataT getVertexData( VKeyT key ) throws NoSuchVertexException;\n\n /**\n * Returns a count of the number of vertices in the graph.\n *\n * @return the count of the number of vertices in this graph\n */\n\n public int numVertices();\n\n /**\n * Return the in degree of the vertex that is associated with the\n * given key. Negative 1 is returned if the vertex cannot be found.\n *\n * @param key the key of the vertex being looked for.\n *\n * @return the in degree of the vertex associated with the key or\n * -1 if the vertex is not in the graph.\n */\n\n public int inDegree( VKeyT key );\n\n /**\n * Return the out degree of the vertex that is associated with the\n * given key. Negative 1 is returned if the vertex cannot be found.\n *\n * @param key the key of the vertex being looked for.\n *\n * @return the out degree of the vertex associated with the key or\n * -1 if the vertex is not in the graph.\n */\n\n public int outDegree( VKeyT key );\n\n /**\n * Returns a collection containing the data associated with the\n * neighbors of the vertex identified by the specified key.\n * The collection will be empty if there are no neighbors. A\n * NoSuchVertexException will be thrown if the key is not associated\n * with a vertex in the graph.\n *\n * @param key the key associated with the vertex whose neighbors we\n * wish to obtain.\n *\n * @return a collection containing the data associated with the neighbors\n * of the vertex with the given key. The collection will be\n * empty if the vertex does not have any neighbors.\n *\n * @exception NoSuchVertexException if the key is not associated\n * with a vertex in the graph.\n */\n\n public Collection< VDataT > neighborData( VKeyT key )\n throws NoSuchVertexException;\n\n /**\n * Returns a collection containing the keys associated with the\n * neighbors of the vertex identified by the specified key.\n * The collection will be empty if there are no neighbors. A\n * NoSuchVertexException will be thrown if the key is not associated\n * with a vertex in the graph.\n *\n * @param key the key associated with the vertex whose neighbors we\n * wish to obtain.\n *\n * @return a collection containing the keys associated with the neighbors\n * of the vertex with the given key. The collection will be\n * empty if the vertex does not have any neighbors.\n *\n * @exception NoSuchVertexException if the key is not associated with\n * a vertex in the graph.\n */\n\n public Collection< VKeyT > neighborKeys( VKeyT key )\n throws NoSuchVertexException;\n\n // Utility\n\n /**\n * Returns a collection containing the data associated with all of\n * the vertices in the graph.\n *\n * @return a collection containing the data associated with the\n * vertices in the graph.\n */\n\n public Collection< VDataT > vertexData();\n\n /**\n * Returns a collection containing the keys associated with all of\n * the vertices in the graph.\n *\n * @return a collection containing the keys associated with the\n * vertices in the graph.\n */\n\n public Collection< VKeyT > vertexKeys();\n\n /**\n * Return a collection containing all of the data associated with the\n * edges in the graph.\n *\n * @return a collection containing the data associated with the edges\n * in this graph.\n */\n \n public Collection< EDataT > edgeData();\n\n /**\n * Remove all vertices and edges from the graph.\n */\n\n public void clear();\n\n}",
"public interface DependentFactory {\n Dependent createDependent(String relationToSubscriber);\n}",
"public interface ClasspathComponent {\r\n\r\n /**\r\n * Find a class by name within thsi classpath component.\r\n * @param className the name of the class\r\n * @return the <tt>FindResult</tt> object. <tt>null</tt> if no class could be found.\r\n */\r\n public FindResult findClass(String className);\r\n\r\n /**\r\n * Merge all classes in this classpath component into the supplied tree.\r\n * @param model the tree model.\r\n * @param reset whether this is an incremental operation or part of a reset.\r\n * For a reset, no change events will be fired on the tree model.\r\n */\r\n public void mergeClassesIntoTree(DefaultTreeModel model, boolean reset);\r\n\r\n /**\r\n * Add a <tt>ClasspathChangeListener</tt>.\r\n * @param listener the listener\r\n */\r\n public void addClasspathChangeListener(ClasspathChangeListener listener);\r\n\r\n /**\r\n * Remove a <tt>ClasspathChangeListener</tt>.\r\n * @param listener the listener\r\n */\r\n public void removeClasspathChangeListener(ClasspathChangeListener listener);\r\n}",
"public IConfigurationElement getDependencyGeneratorElement();",
"public interface Graph extends Container {\n\n /**\n * returns how many elements are in the container.\n *\n * @return int = number of elements in the container.\n */\n public int size();\n\n /**\n * returns true if the container is empty, false otherwise.\n *\n * @return boolean true if container is empty\n */\n public boolean isEmpty();\n\n /**\n * return the number of vertices in the graph\n * \n * @return number of vertices in the graph\n */\n public int numVertices();\n\n /**\n * returns the number for edges in the graph\n * \n * @return number of edges in the graph\n */\n public int numEdges();\n\n /**\n * returns an Enumeration of the vertices in the graph\n * \n * @return vertices in the graph\n */\n public Enumeration vertices();\n\n \n /**\n * returns an Enumeration of the edges in the graph\n * \n * @return edges in the graph\n */\n public Enumeration edges();\n\n\n /**\n * Returns an enumeration of the directed edges in the Graph\n * \n * @return an enumeration of the directed edges in the Graph\n */\n public Enumeration directedEdges();\n\n /**\n * Returns an enumeration of the directed edges in the Graph\n * \n * @return an enumeration of the directed edges in the Graph\n */\n public Enumeration undirectedEdges();\n\n /**\n * returns the degree of the passed in Vertex vp\n * \n * @param vp Vertex to return the degree of\n * @return degree of Vertex vp\n * @exception InvalidPositionException\n * thrown when vp is invalid for Vertex container V\n */\n public int degree(Position vp) throws InvalidPositionException;\n\n /**\n * returns the in degree of the passed in Vertex vp\n * \n * @param vp Vertex to return the in degree of\n * @return in degree of Vertex vp\n * @exception InvalidPositionException\n * thrown when vp is invalid for Vertex container V\n */\n public int inDegree(Position vp) throws InvalidPositionException;\n\n /**\n * returns the out degree of the passed in Vertex vp\n * \n * @param vp Vertex to return the out degree of\n * @return out degree of Vertex vp\n * @exception InvalidPositionException\n * thrown when vp is invalid for Vertex container V\n */\n public int outDegree(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an enumeration of vertices adjacent to Vertex vp\n * \n * @param vp Position of Vertex to return the adjacent vertices of\n * @return enumeration of vertices adjacent to Vertex vp\n * @exception InvalidPositionException\n * thrown if vp is not a valid Vertex for this Graph\n */\n public Enumeration adjacentVertices(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an enumeration of vertices in adjacent to Vertex vp\n * \n * @param vp Position of Vertex to return the in adjacent vertices of\n * @return enumeration of vertices in adjacent to Vertex vp\n * @exception InvalidPositionException\n * thrown if vp is not a valid Vertex for this Graph\n */\n public Enumeration inAdjacentVertice(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an enumeration of vertices out adjacent to Vertex vp\n * \n * @param vp Position of Vertex to return the out adjacent vertices of\n * @return enumeration of vertices out adjacent to Vertex vp\n * @exception InvalidPositionException\n * thrown if vp is not a valid Vertex for this Graph\n */\n public Enumeration outAdjacentVertices(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an Enumeration of the edges incident upon the\n * Vertex in Position vp\n * \n * @param vp the Position to holding the Vertex to return the\n * Enumeration of\n * @return the Enumeration of edges incident upon vp\n * @exception InvalidPositionException\n */\n public Enumeration incidentEdges(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an Enumeration of the edges in incident upon the\n * Vertex in Position vp\n * \n * @param vp the Position to holding the Vertex to return the\n * Enumeration of\n * @return the Enumeration of edges in incident upon vp\n * @exception InvalidPositionException\n */\n public Enumeration inIncidentEdges(Position vp) throws InvalidPositionException;\n\n /**\n * Returns an Enumeration of the edges out incident upon the\n * Vertex in Position vp\n * \n * @param vp the Position to holding the Vertex to return the\n * Enumeration of\n * @return the Enumeration of edges out incident upon vp\n * @exception InvalidPositionException\n */\n public Enumeration outIncidentEdges(Position vp) throws InvalidPositionException;\n\n public Position[] endVertices(Position ep) throws InvalidPositionException;\n\n /**\n * Returns the Vertex on Edge ep opposite from Vertex vp\n * \n * @param vp Vertex to find opposite of\n * @param ep Edge containing the vertices\n * @return \n * @exception InvalidPositionException\n */\n public Position opposite(Position vp, Position ep) throws InvalidPositionException;\n\n /**\n * Determine whether or not two vertices are adjacent\n * \n * @param vp Position of one Vertex to check\n * @param wp Position of other Vertex to check\n * @return true if they are adjacent, false otherwise\n * @exception InvalidPositionException\n * thrown if either Position is invalid for this container\n */\n public boolean areAdjacent(Position vp, Position wp) throws InvalidPositionException;\n\n /**\n * Returns the destination Vertex of the given Edge Position\n * \n * @param ep Edge Position to return the destination Vertex of\n * @return the destination Vertex of the given Edge Position\n * @exception InvalidPositionException\n * thrown if the Edge Position is invalid\n */\n public Position destination(Position ep) throws InvalidPositionException;\n\n /**\n * Returns the origin Vertex of the given Edge Position\n * \n * @param ep Edge Position to return the origin Vertex of\n * @return the origin Vertex of the given Edge Position\n * @exception InvalidPositionException\n * thrown if the Edge Position is invalid\n */\n public Position origin(Position ep) throws InvalidPositionException;\n\n /**\n * Returns true if the given Edge Position is directed,\n * otherwise false\n * \n * @param ep Edge Position to check directed on\n * @return true if directed, otherwise false\n * @exception InvalidPositionException\n */\n public boolean isDirected(Position ep) throws InvalidPositionException;\n\n /**\n * Inserts a new undirected Edge into the graph with end\n * Vertices given by Positions vp and wp storing Object o,\n * returns a Position object for the new Edge\n * \n * @param vp Position holding one Vertex endpoint\n * @param wp Position holding the other Vertex endpoint\n * @param o Object to store at the new Edge\n * @return Position containing the new Edge object\n * @exception InvalidPositionException\n * thrown if either of the given vertices are invalid for\n * this container\n */\n public Position insertEdge(Position vp,Position wp, Object o) throws InvalidPositionException;\n\n /**\n * Inserts a new directed Edge into the graph with end\n * Vertices given by Positions vp, the origin, and wp,\n * the destination, storing Object o,\n * returns a Position object for the new Edge\n * \n * @param vp Position holding the origin Vertex\n * @param wp Position holding the destination Vertex\n * @param o Object to store at the new Edge\n * @return Position containing the new Edge object\n * @exception InvalidPositionException\n * thrown if either of the given vertices are invalid for\n * this container\n */\n public Position insertDirectedEdge(Position vp, Position wp, Object o) throws InvalidPositionException;\n\n /**\n * Inserts a new Vertex into the graph holding Object o\n * and returns a Position holding the new Vertex\n * \n * @param o the Object to hold in this Vertex\n * @return the Position holding the Vertex\n */\n public Position insertVertex(Object o);\n\n /**\n * This method removes the Vertex held in the passed in\n * Position from the Graph\n * \n * @param vp the Position holding the Vertex to remove\n * @exception InvalidPositionException\n * thrown if the given Position is invalid for this container\n */\n public void removeVertex(Position vp) throws InvalidPositionException;\n\n /**\n * Used to remove the Edge held in Position ep from the Graph\n * \n * @param ep the Position holding the Edge to remove\n * @exception InvalidPositionException\n * thrown if Position ep is invalid for this container\n */\n public void removeEdge(Position ep) throws InvalidPositionException;\n\n /**\n * This routine is used to change a directed Edge into an\n * undirected Edge\n * \n * @param ep a Position holding the Edge to change from directed to\n * undirected\n * @exception InvalidPositionException\n */\n public void makeUndirected(Position ep) throws InvalidPositionException;\n\n /**\n * This routine can be used to reverse the diretion of a \n * directed Edge\n * \n * @param ep a Position holding the Edge to reverse\n * @exception InvalidPositionException\n * thrown if the given Position is invalid for this container\n */\n public void reverseDirection(Position ep) throws InvalidPositionException;\n\n /**\n * Changes the direction of the given Edge to be out incident\n * upone the Vertex held in the given Position\n * \n * @param ep the Edge to change the direction of\n * @param vp the Position holding the Vertex that the Edge is going\n * to be out incident upon\n * @exception InvalidPositionException\n * thrown if either of the given positions are invalid for this container\n */\n public void setDirectionFrom(Position ep, Position vp) throws InvalidPositionException;\n\n\n /**\n * Changes the direction of the given Edge to be in incident\n * upone the Vertex held in the given Position\n * \n * @param ep the Edge to change the direction of\n * @param vp the Position holding the Vertex that the Edge is going\n * to be in incident upon\n * @exception InvalidPositionException\n * thrown if either of the given positions are invalid for this container\n */\n public void setDirectionTo(Position ep, Position vp) throws InvalidPositionException;\n\n}",
"public interface ResolvableModelicaNode extends ModelicaNode {\n /**\n * Tries to resolve the <b>declaration</b> of the referenced component.\n */\n ResolutionResult getResolutionCandidates();\n}",
"public interface IGraph {\n\t// Adds a new edge between 'from' and 'to' nodes with a cost obeying the\n\t// triangle in-equality\n\tpublic IEdge addEdge(String from, String to, Double cost);\n\t\n\t// Returns a node, creates if not exists, corresponding to the label\n\tpublic INode addOrGetNode(String label);\n\t\n\t// Returns a list of all nodes present in the graph\n\tpublic List<INode> getAllNodes();\n\t\n\t// Returns a list of all edges present in the graph\n\tpublic List<IEdge> getAllEdges();\n\t\n\t// Joins two graphs that operate on the same cost interval and \n\t// disjoint sets of nodes\n\tpublic void joinGraph(IGraph graph);\n\t\n\t// Returns the maximum cost allowed for the edges\n\tpublic Double getCostInterval();\n\t\n\t// Returns a Path with cost between 'from' and 'to' nodes\n\tpublic String getPath(String from, String to, String pathAlgo);\n}",
"Set<String> getDependencies();",
"public interface IGraph extends IGraphRepresentation, IId, ITag, IDisposable, Iterable<IVertex>\n{\n /**\n * get the graph engine\n *\n * @return IGraphEngine\n * @see IGraphEngine\n */\n IGraphEngine getGraphEngine();\n\n /**\n * the graph engine instantiation factory\n *\n * @return a graph engine\n *\n * @see IGraphEngine\n * @see AbstractGraphEngine\n */\n IGraphEngine graphEngineFactory();\n\n /**\n * does this graph support multi edges\n *\n * @return {@code true, false}\n */\n boolean hasMultiEdges();\n\n /**\n * does this graph support self loops\n *\n * @return {@code true, false}\n */\n boolean hasSelfLoops();\n\n void print();\n}",
"public interface ObjectGraph {\n\n\t\n\t/**\n\t * As in neo4j, starts a new transaction and associates it with the current thread.\n\t * @return a transaction from NeoService.\n\t */\n\tTransaction beginTx();\n\n\t/**\n\t * Mirror a java object within the neo4j graph. Only fields annotated with {@code}neo\n\t * will be considered.\n\t * @param o\n\t */\n\t<A> void persist(A... o);\n\n\t/**\n\t * removes all data representing an object from the graph.\n\t * \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t */\n\tvoid delete(Object... o);\n\t\n\t\n\t/**\n\t * Looks up a neo4j graph node using it's java object\n\t * mirror. \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t * @return neo4j node represented by o\n\t */\n\tNode get(Object o);\n\t\n\t/**\n\t * Looks up all instances of {@code}type in the graph.\n\t * \n\t * @param type a type previously stored in the graph\n\t * @return a Collection of {@code}type instances.\n\t */\n\t<T> Collection<T> get(Class<T> type);\n\n\t/**\n\t * Type safe lookup of object given it's neo4j nodeid.\n\t * Your domain classes may use {@link Nodeid#id()} to discover\n\t * their neo4j nodeid. \n\t * \n\t * @param t\n\t * @param key neo4j node id.\n\t * @return\n\t */\n\t<T> T get(Class<T> t, long key);\n\n\t\n\t/**\n\t * Return an object represented by <code>node</code> provided\n\t * the node was created by jo4neo.\n\t * \n\t * @param node\n\t * @return an object that mirrors node.\n\t */\n\tObject get(Node node);\n\t\n\t/**\n\t * Looks up the node representation of a given \n\t * uri. This method may update your graph if no node\n\t * was previously allocated for the uri.\n\t * \n\t * @return the node representation of uri.\n\t */\n\tNode get(URI uri);\n\n\n\t/**\n\t * Unmarshal a collections of nodes into objects.\n\t * \n\t */\n\t<T> Collection<T> get(Class<T> type, Iterable<Node> nodes);\n\n\t/**\n\t * Closes this ObjectGraph after which it will be unavailable \n\t * for use. Calling close is necessary, and should be called even\n\t * if the application is halted suddenly. ObjectGraph's maintain \n\t * a lucene index which may become corrupt without proper shutdown.\n\t * \n\t */\n\tvoid close();\n\n\t/**\n\t * Begin fluent interface find. <code>a</code> should be \n\t * a newly constructed instance as it's contents will be modified/initialized\n\t * by this call.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * </code>\n\t * </pre>\n\t * \n\t * @param a\n\t * @return\n\t */\n\t<A> Where<A> find(A a);\n\n\t/**\n\t * Counts child entities without loading objects into memory. This is preferable to \n\t * using Collection.size(), which would load the full collection into memory.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * long numOrders = graph.count(customer.orders);\n\t * </code>\n\t * </pre>\n\t * \n\t * @param values a collection value from a jo4neo annotated field.\n\t * @return\n\t */\n\tlong count(Collection<? extends Object> values);\n\n\t/**\n\t * Returns a collection of entities added since <code>d</code>.\n\t * Type <code>t</code> must be annotated with {@link Timeline}\n\t * \n\t * @see Timeline\n\t * \n\t */\n\t<T> Collection<T> getAddedSince(Class<T> t, Date d);\n\n\t/**\n\t * Returns a collection of entities added bewteen dates from and to.\n\t * Type <code>t</code> must be annotated with {@link Timeline}.\n\t * \n\t * @see Timeline\n\t */\n\t<T> Collection<T> getAddedBetween(Class<T> t, Date from,\n\t\t\tDate to);\n\n\t\n\t/**\n\t * Returns up to <code>max</code> most recently added instances of type <code>t</code>\n\t * \n\t * @param max limit the number of instances returned\n\t * @see neo#recency()\n\t */\n\t<T> Collection<T> getMostRecent(Class<T> t, int max);\n\t\n\t\n\t<T> T getSingle(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> get(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> fullTextQuery(Class<T> t, String indexname, Object value);\n\n}",
"void depend(@Nonnull Path path);",
"public interface IGraphElement extends IDotElement {\r\n}",
"public interface IBadgeGraph {\n int root = 0;\n int invalid = -1;\n\n Collection<Badge> badges();\n\n interface Badge{\n int self();\n int parent();\n }\n}",
"public abstract List<Dependency> selectDependencies( Class<?> clazz );",
"public interface IDirectedAcyclicGraph<T> extends Serializable {\n\n /**\n * Adds an edge to the graph.\n *\n * @param from the starting point.\n * @param to the ending point.\n * @return true if the edge was actually added (i.e. not present and didn't\n * create a cycle)\n * @throws NullPointerException if from or to is null\n */\n boolean add(T from, T to) throws NullPointerException;\n\n /**\n * Returns all the nodes that can be reached following the directed edges\n * starting from the selected node. It is guaranteed that the elements are\n * partially ordered by increasing distance from the selected node. If the\n * starting point is not a node in the graph, an empty iterable is returned.\n *\n * @param start the starting point.\n * @return an iterable with all the nodes that can be reached from the\n * starting node.\n * @throws NullPointerException if start is null.\n */\n Iterable<T> followNode(T start) throws NullPointerException;\n\n /**\n * Returns the selected node, followed by all the nodes that can be reached\n * following the directed edges starting from the selected node. It is\n * guaranteed that the elements are partially ordered by increasing distance\n * from the selected node. If the starting point is not a node in the graph,\n * an iterable containing only the starting node is returned.\n *\n * @param start the starting point.\n * @return an iterable which starts with the selected node and is followed\n * by all the connected nodes.\n * @throws NullPointerException if start is null.\n */\n Iterable<T> followNodeAndSelef(T start) throws NullPointerException;\n\n}",
"Set<Path> getDependencies();",
"public abstract NestedSet<Artifact> getTransitiveJackClasspathLibraries();",
"@Override\r\n public void describeTo(Description desc) {\n desc.value(\"of type \" + RootType.DEPENDENCY + \" and path\", dependencyPathMatcher);\r\n }",
"protected abstract void declareVersions();",
"public interface IGraphs {\n\t\n\tpublic boolean createGraphs() throws ParseException;\n\t\n\tpublic Graph getGraph(int gID);\n\t\n\tpublic String getLabel(int gID);\n\n\tpublic int getGraphNum();\n\t//FOR TEST ONLY\n\tpublic int getSupport(int j);\n\n}",
"public abstract NestedSet<Artifact> getTransitiveJackLibrariesToLink();",
"ArithmeticDependency createArithmeticDependency();",
"default Map<DependencyDescriptor, Set<DependencyDescriptor>> getDependencies() {\n return Collections.emptyMap();\n }",
"public DependencyElements getDependencyAccess() {\n\t\treturn pDependency;\n\t}",
"Set<DependencyItem> getIDependOn(Class<?> type);",
"public interface HierarchicalKnowledgeBase {\n\n /**\n * Get the concept with the provided id.\n * @param id Concept ID.\n * @return Concept\n */\n Concept getConcept(String id);\n\n /**\n * Get the instance with the provided id.\n * @param id Instance ID.\n * @return Instance\n */\n Instance getInstance(String id);\n\t/**\n * Get a collection with the subclasses of the provided concept\n * @param concept Concept provided\n * @return collection of subclasses of the concept\n */\n Set<Concept> getSubclasses(Concept concept);\n \n /**\n * Returns a collection containing the superclasses of the provided concept\n * @param concept Concept provided\n * @return collection of subclasses of the concept\n */\n Set<Concept> getSuperclasses(Concept concept);\n \n /**\n * Check if concept x is equivalent to concept y\n * @param x Concept x\n * @param y Concept y\n * @return True if x is equivalent to y\n */\n boolean equivalent(Concept x, Concept y);\n \n /**\n * Check if concept x is subclass of concept y\n * @param x Concept x\n * @param y Concept y\n * @return True if x subclass of y, false in other case.\n */\n boolean isSubclass(Concept x, Concept y);\n \n /**\n * Check if concept x is a subclass of y, false in other case\n * @param x Concept x\n * @param y Concept y\n * @return True if x is a superclass of y\n */\n boolean isSuperclass(Concept x, Concept y);\n \n /**\n * Returns the concept Resource from which this Resource is instance. If\n * the Resource is not an instance, the function returns the same Resource.\n * @param instance Concept or Instance Resource\n * @return Concept parent of the instance.\n */\n Concept resolveInstance(Instance instance);\n \n /**\n * Return all instances of the provided concept.\n * @return {@link Set} with the instances of the concept.\n * If there are no instances, a empty set is returned.\n */\n Set<Instance> getInstances(Concept concept);\n\n /**\n * Return all concepts managed by this KB.\n * @return {@link Set} with all available concepts.\n */\n Set<Concept> getConcepts();\n\n /**\n * Return all instances managed by this KB.\n * @return {@link Set} with all available instances.\n */\n Set<Instance> getInstances();\n}",
"@SuppressWarnings({\"WeakerAccess\", \"unused\"})\npublic interface DiGraph_Interface {\n /*\n Interface: A DIGRAPH will provide this collection of operations:\n\n addNode\n in: unique id number of the node (0 or greater)\n string for name\n you might want to generate the unique number automatically\n but this operation allows you to specify any integer\n both id number and label must be unique\n return: boolean\n returns false if node number is not unique, or less than 0\n returns false if label is not unique (or is null)\n returns true if node is successfully added\n addEdge\n in: unique id number for the new edge,\n label of source node,\n label of destination node,\n weight for new edge (use 1 by default)\n label for the new edge (allow null)\n return: boolean\n returns false if edge number is not unique or less than 0\n returns false if source node is not in graph\n returns false if destination node is not in graph\n returns false is there already is an edge between these 2 nodes\n returns true if edge is successfully added\n\n delNode\n in: string\n label for the node to remove\n out: boolean\n return false if the node does not exist\n return true if the node is found and successfully removed\n delEdge\n in: string label for source node\n string label for destination node\n out: boolean\n return false if the edge does not exist\n return true if the edge is found and successfully removed\n numNodes\n in: nothing\n return: integer 0 or greater\n reports how many nodes are in the graph\n numEdges\n in: nothing\n return: integer 0 or greater\n reports how many edges are in the graph\n topoSort:\n in: nothing\n return: array of node labels (strings)\n if there is no topo sort (a cycle) return null for the array\n if there is a topo sort, return an array containing the node\n labels in order\n */\n\n // ADT operations\n\n boolean addNode(long idNum, String label);\n boolean addEdge(long idNum, String sLabel, String dLabel, long weight, String eLabel);\n boolean delNode(String label);\n boolean delEdge(String sLabel, String dLabel);\n long numNodes();\n long numEdges();\n String[] topoSort();\n}",
"public interface Graph<V> {\n\t/** Return the number of vertices in the graph */\n\tpublic int getSize();\n\n\t/** Return the vertices in the graph */\n\tpublic java.util.List<V> getVertices();\n\n\t/** Return the object for the specified vertex index */\n\tpublic V getVertex(int index);\n\n\t/** Return the index for the specified vertex object */\n\tpublic int getIndex(V v);\n\n\t/** Return the neighbors of vertex with the specified index */\n\tpublic java.util.List<Integer> getNeighbors(int index);\n\n\t/** Return the degree for a specified vertex */\n\tpublic int getDegree(int v);\n\n\t/** Return the adjacency matrix */\n\tpublic int[][] getAdjacencyMatrix();\n\n\t/** Print the adjacency matrix */\n\tpublic void printAdjacencyMatrix();\n\n\t/** Print the edges */\n\tpublic void printEdges();\n\n\t/** Obtain a depth-first search tree */\n\tpublic AbstractGraph<V>.Tree dfs(int v);\n\n\t/** Obtain a breadth-first search tree */\n\tpublic AbstractGraph<V>.Tree bfs(int v);\n\n\t/**\n\t * Return a Hamiltonian path from the specified vertex Return null if the\n\t * graph does not contain a Hamiltonian path\n\t */\n\tpublic java.util.List<Integer> getHamiltonianPath(V vertex);\n\n\t/**\n\t * Return a Hamiltonian path from the specified vertex label Return null if\n\t * the graph does not contain a Hamiltonian path\n\t */\n\tpublic java.util.List<Integer> getHamiltonianPath(int inexe);\n}",
"public interface CycleInGraph<V> {\n boolean hasCycle(Graph<V> graph) ;\n}",
"protected abstract void injectDependencies(ApplicationComponent applicationComponent);",
"public interface GraphListener extends java.util.EventListener {\n /**\n * An edge's head has been changed in a registered\n * graph or one of its subgraphs. The added edge\n * is the \"source\" of the event. The previous head\n * is accessible via e.getOldValue().\n */\n public void edgeHeadChanged(GraphEvent e);\n\n /**\n * An edge's tail has been changed in a registered\n * graph or one of its subgraphs. The added edge\n * is the \"source\" of the event. The previous tail\n * is accessible via e.getOldValue().\n */\n public void edgeTailChanged(GraphEvent e);\n\n /**\n * A node has been been added to the registered\n * graph or one of its subgraphs. The added node\n * is the \"source\" of the event.\n */\n public void nodeAdded(GraphEvent e);\n\n /**\n * A node has been been deleted from the registered\n * graphs or one of its subgraphs. The deleted node\n * is the \"source\" of the event. The previous parent\n * graph is accessible via e.getOldValue().\n */\n public void nodeRemoved(GraphEvent e);\n\n /**\n * The structure of the event's \"source\" graph has\n * been drastically changed in some way, and this\n * event signals the listener to refresh its view\n * of that graph from model.\n */\n public void structureChanged(GraphEvent e);\n}",
"public interface Graph {\n\n\t/**\n\t * Method to add the edge from start to end to the graph.\n\t * Adding self-loops is not allowed.\n\t * @param start start vertex\n\t * @param end end vertex\n\t */\n\tpublic void addEdge(int start, int end);\n\n\t/**\n\t * Method to add the edge with the given weight to the graph from start to end.\n\t * Adding self-loops is not allowed.\n\t * @param start number of start vertex\n\t * @param end number of end vertex\n\t * @param weight weight of edge\n\t */\n\tpublic void addEdge(int start, int end, double weight);\n\n\t/**\n\t * Method to add a vertex to the graph.\n\t */\n\tpublic void addVertex();\n\t\n\t/**\n\t * Method to add multiple vertices to the graph.\n\t * @param n number of vertices to add\n\t */\n\tpublic void addVertices(int n);\n\n\t/**\n\t * Returns all neighbors of the given vertex v (all vertices i with {i,v} in E or (i,v) or (v,i) in E).\n\t * @param v vertex whose neighbors shall be returned\n\t * @return List of vertices adjacent to v\n\t */\n\tpublic List<Integer> getNeighbors(int v);\n\n\t/**\n\t * Returns a list containing all predecessors of v. In an undirected graph all neighbors are returned.\n\t * @param v vertex id\n\t * @return list containing all predecessors of v\n\t */\n\tpublic List<Integer> getPredecessors(int v);\n\n\t/**\n\t * Returns a list containing all successors v. In an undirected graph all neighbors are returned.\n\t * @param v vertex id\n\t * @return list containing all edges starting in v\n\t */\n\tpublic List<Integer> getSuccessors(int v);\n\n\t/**\n\t * Method to get the number of vertices.\n\t * @return number of vertices\n\t */\n\tpublic int getVertexCount();\n\n\t/**\n\t * Method to get the weight of the edge {start, end} / the arc (start, end).\n\t * @param start start vertex of edge / arc\n\t * @param end end vertex of edge / arc\n\t * @return Double.POSITIVE_INFINITY, if the edge does not exist, c_{start, end} otherwise\n\t */\n\tpublic double getEdgeWeight(int start, int end);\n\n\t/**\n\t * Method to test whether the graph contains the edge {start, end} / the arc (start, end).\n\t * @param start start vertex of the edge\n\t * @param end end vertex of the edge\n\t */\n\tpublic boolean hasEdge(int start, int end);\n\n\t/**\n\t * Method to remove an edge from the graph, defined by the vertices start and end.\n\t * @param start start vertex of the edge\n\t * @param end end vertex of the edge\n\t */\n\tpublic void removeEdge(int start, int end);\n\n\t/**\n\t * Method to remove the last vertex from the graph.\n\t */\n\tpublic void removeVertex();\n\n\t/**\n\t * Returns whether the graph is weighted.\n\t * A graph is weighted if an edge with weight different from 1.0 has been added to the graph.\n\t * @return true if the graph is weighted\n\t */\n\tpublic boolean isWeighted();\n\n\t/**\n\t * Returns whether the graph is directed.\n\t * @return true if the graph is directed\n\t */\n\tpublic boolean isDirected();\n\n}",
"public interface Graph\n{\n int getNumV();\n boolean isDirected();\n void insert(Edge edge);\n boolean isEdge(int source, int dest);\n Edge getEdge(int source, int dest);\n Iterator<Edge> edgeIterator(int source);\n}",
"public CPointer<Object> getDepsgraph() throws IOException\n\t{\n\t\tlong __dna__targetAddress;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__targetAddress = __io__block.readLong(__io__address + 120);\n\t\t} else {\n\t\t\t__dna__targetAddress = __io__block.readLong(__io__address + 100);\n\t\t}\n\t\tClass<?>[] __dna__targetTypes = new Class[]{Object.class};\n\t\treturn new CPointer<Object>(__dna__targetAddress, __dna__targetTypes, __io__blockTable.getBlock(__dna__targetAddress, -1), __io__blockTable);\n\t}",
"public interface ArtifactVisitor extends Visitor {\n default void visit(Artifacts artifacts){\n artifacts.accept(this);\n }\n\n default void visit(Artifact artifact){\n artifact.accept(this);\n }\n\n default void visit(Ids ids, Classes classes){\n ids.accept(this);\n classes.accept(this);\n }\n\n /**\n * This method is called when artifacts building phase was failed (failed on reading jar file).\n * @param ids groupId, artifactId, version.\n * @param e exception.\n */\n default void visitFailed(Ids ids, Exception e){\n }\n\n /**\n * This method is called when parsing of class file was failed (illegal class format).\n * \n * @param name class name.\n * @param e exception.\n */\n default void visitFailed(ClassName name, Exception e){\n }\n\n default void visit(Class target){\n target.accept(this);\n }\n}",
"@Override\n public List<Class<? extends ProjectInitializer>> getDependencies()\n {\n return asList(TokenLayerInitializer.class);\n }",
"@Override\n public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {\n return null;\n }",
"public interface GraphInterface {\n\n\t/**\n\t * Finds the shortest path between the start and end vertices.\n\t * @param start -- The starting node\n\t * @param end -- The target node\n\t * @return A list representing the desired path, or NULL if the vertices are not connected.\n\t * @throws GraphException if start and end are not in the graph\n\t */\n\tIterable<Vertex> computePath(Vertex start, Vertex end) throws GraphException;\n\t\n\t/**\n\t * Finds the shortest path between the start and end vertices, given that start is not in the graph\n\t * @param start -- The starting node\n\t * @param end -- The target node\n\t * @return A list representing the desired path, or NULL if the vertices are not connected.\n\t * @throws GraphException if end is not in the graph\n\t */\n\tIterable<Vertex> computePathToGraph(Loc start, Vertex end) throws GraphException;\n\t\n\t/**\n\t * Finds the closest vertex to pos in the graph\n\t * @param pos -- The position not on the graph.\n\t * @return closest vertex to pos in the graph.\n\t */\n\tPair<Vertex, Double> closestVertexToPath(Loc pos);\n\t\n\t/**\n\t * adds a single unconnected vertex v \n\t * @param v -- The vertex to be added\n\t */\n\tvoid addVertex(Vertex v);\n\t\n\t/**\n\t * Adds a single vertex with edges (v, neighbor) for each neighbor\n\t * @param v -- The vertex to be added\n\t * @param neighbors -- The neighbors of v\n\t * @param weights -- The corresponding weights of each (v, neighbor)\n\t * @throws VertexNotInGraphException if neighbors are not in the graph\n\t */\n\tvoid addVertex(Vertex v, ArrayList<Vertex> neighbors, ArrayList<Double> weights) throws VertexNotInGraphException;\n\t\n\t/**\n\t * Removes v from the Graph\n\t * @param v -- The vertex to be removed\n\t * @throws VertexNotInGraphException if v is not in the graph\n\t */\n\tvoid removeVertex(Vertex v) throws GraphException;\n\t\n\t/**\n\t * Adds an edge between v1 and v2 in the graph\n\t * @param v1 -- The first vertex the edge is incident to\n\t * @param v2 -- The second vertex the edge is incident to\n\t * @param w -- The weight of the edge\n\t * @throws VertexNotInGraphException if v1 or v2 are not in the graph\n\t */\n\tvoid addEdge(Vertex v1, Vertex v2, Double w) throws VertexNotInGraphException;\n\t\n\t/**\n\t * Removes the edge (v1, v2) in the graph\n\t * @param v1 -- The first vertex the edge is incident to\n\t * @param v2 -- The second vertex the edge is incident to\n\t * @throws VertexNotInGraphException if v1 or v2 are not in the graph\n\t */\n\tvoid removeEdge(Vertex v1, Vertex v2) throws GraphException;\n}",
"@Override\n public void getDependencies(Set<Binding<?>> getBindings, Set<Binding<?>> injectMembersBindings) {\n injectMembersBindings.add(app);\n injectMembersBindings.add(bus);\n injectMembersBindings.add(service);\n injectMembersBindings.add(supertype);\n }",
"IClassDefinition[] resolveAncestry(ICompilerProject project);",
"public interface IService {\n\n List<BusinessTransaction> getBTs(HttpClientBuilder httpClientBuilder, String endpoint) throws ServiceException;\n\n List<Node> getNodes(HttpClientBuilder httpClientBuilder, String endpoint) throws ServiceException;\n\n}",
"Set<DependencyDescriptor> getDependencyDescriptors() {\n return dependencyDescriptors;\n }",
"@Override\n @SuppressWarnings(\"rawtypes\")\n public void buildDependencyGraph(final AbstractProject owner, final DependencyGraph graph) {\n if ((downstreamProjectNames != null) && (downstreamProjectNames.length() > 0)) {\n for (final Object o : Items.fromNameList(owner.getParent(), downstreamProjectNames, AbstractProject.class)) {\n final AbstractProject downstream = (AbstractProject) o;\n\n if (owner != downstream) {\n graph.addDependency(createDownstreamDependency(owner, downstream));\n } else {\n removeDownstreamTrigger(this, owner, downstream.getName());\n }\n }\n }\n }",
"@Override\n public abstract boolean needsResolving();",
"protected RemoteFactory.Requires<Msg, Ref> requires() {\n assert this.selfComponent != null: \"This is a bug.\";\n if (!this.init) {\n \tthrow new RuntimeException(\"requires() can't be accessed until a component has been created from this implementation, use start() instead of the constructor if requires() is needed to initialise the component.\");\n }\n return this.selfComponent.bridge;\n }",
"private void collectDependencies() throws Exception {\n backupModAnsSumFiles();\n CommandResults goGraphResult = goDriver.modGraph(true);\n String cachePath = getCachePath();\n String[] dependenciesGraph = goGraphResult.getRes().split(\"\\\\r?\\\\n\");\n for (String entry : dependenciesGraph) {\n String moduleToAdd = entry.split(\" \")[1];\n addModuleDependencies(moduleToAdd, cachePath);\n }\n restoreModAnsSumFiles();\n }",
"private void writeClassDependencies(ClassDependencyInfo classDependencyInfo) {\n\n /* Writes all classes depended on plus their packages */\n Vector<String> classesDependedOn = classDependencyInfo.getEfferentClassDependencies();\n writeSpacesCorrespondingToNestedLevel(CLASS_DEPENDENCY_INFO_NEST_LEVEL);\n writer.println(\"uses:\");\n for(String classDependency : classesDependedOn) {\n\n int lastDecimal = classDependency.lastIndexOf(\".\");\n String classDependencyName = classDependency.substring(lastDecimal + 1);\n String pkgOfClassDependency = classDependency.substring(0, lastDecimal);\n\n /* Only writes the class dependency if it does not end with a '$'.\n * Dependency Analyzer tool will return dependencies even for anonymous inner classes which\n * will have a $ appended to the end of the name. These classes are ignored in the analysis.\n */\n if(!classDependencyName.contains(\"$\")) {\n /* Writes class dependency name followed by ':' */\n writeSpacesCorrespondingToNestedLevel(CLASS_DEPENDENCY_NAME_NEST_LEVEL);\n writer.println(classDependencyName + \":\");\n\n /* Writes package the dependency belongs to */\n writeSpacesCorrespondingToNestedLevel(CLASS_DEPENDENCY_NAME_NEST_LEVEL + 1);\n writer.println(\"package: \" + pkgOfClassDependency);\n }\n\n\n }\n\n /* Writes all classes that depend on this class plus their packages */\n Vector<String> classesThatDependOnThisClass = classDependencyInfo.getAfferentClassDependencies();\n writeSpacesCorrespondingToNestedLevel(CLASS_DEPENDENCY_INFO_NEST_LEVEL);\n writer.println(\"usedBy:\");\n for(String classDependency : classesThatDependOnThisClass) {\n\n int lastDecimal = classDependency.lastIndexOf(\".\");\n String classDependencyName = classDependency.substring(lastDecimal + 1);\n String pkgOfClassDependency = classDependency.substring(0, lastDecimal);\n\n /* Only writes the class dependency if it does not end with a '$'.\n * Dependency Analyzer tool will return dependencies even for anonymous inner classes which\n * will have a $ appended to the end of the name. These classes are ignored in the analysis.\n */\n if(!classDependencyName.contains(\"$\")) {\n /* Writes class dependency name followed by ':' */\n writeSpacesCorrespondingToNestedLevel(CLASS_DEPENDENCY_NAME_NEST_LEVEL);\n writer.println(classDependencyName + \":\");\n\n /* Writes package the dependency belongs to */\n writeSpacesCorrespondingToNestedLevel(CLASS_DEPENDENCY_NAME_NEST_LEVEL + 1);\n writer.println(\"package: \" + pkgOfClassDependency);\n }\n }\n }",
"public interface Package extends Container {\n\n /**\n * Returns all top-level--non-recursive-- {@link Package}s contained under this package. allows the\n * \n * @return the top-level {@link Package}s in the package.\n */\n public Collection<Package> getPackages();\n\n \n /**\n * Adds a {@link Package} to the package hierarchy.\n * \n */\n /** adding packages can be done via {@link #addArtifact(Workspace,Artifact)} */\n //@Deprecated\n //public void addPackage(Workspace workspace, Package pack);\n}",
"public interface Graph<V> {\n /**\n * F??gt neuen Knoten zum Graph dazu.\n * @param v Knoten\n * @return true, falls Knoten noch nicht vorhanden war.\n */\n boolean addVertex(V v);\n\n /**\n * F??gt neue Kante (mit Gewicht 1) zum Graph dazu.\n * @param v Startknoten\n * @param w Zielknoten\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist oder Knoten identisch sind.\n * @return true, falls Kante noch nicht vorhanden war.\n */\n boolean addEdge(V v, V w);\n\n /**\n * F??gt neue Kante mit Gewicht weight zum Graph dazu.\n * @param v Startknoten\n * @param w Zielknoten\n * @param weight Gewicht\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist oder Knoten identisch sind.\n * @return true, falls Kante noch nicht vorhanden war.\n */\n boolean addEdge(V v, V w, double weight);\n\n /**\n * Pr??ft ob Knoten v im Graph vorhanden ist.\n * @param v Knoten\n * @return true, falls Knoten vorhanden ist.\n */\n boolean containsVertex(V v);\n\n /**\n * Pr??ft ob Kante im Graph vorhanden ist.\n * @param v Startknoten\n * @param w Endknoten\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist.\n * @return true, falls Kante vorhanden ist.\n */\n boolean containsEdge(V v, V w);\n \n /**\n * Liefert Gewicht der Kante zur??ck.\n * @param v Startknoten\n * @param w Endknoten\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist.\n * @return Gewicht, falls Kante existiert, sonst 0.\n */\n double getWeight(V v, V w);\n\n /**\n * Liefert Anzahl der Knoten im Graph zur??ck.\n * @return Knotenzahl.\n */\n int getNumberOfVertexes();\n\n /**\n * Liefert Anzahl der Kanten im Graph zur??ck.\n * @return Kantenzahl.\n */\n int getNumberOfEdges();\n\n /**\n * Liefert Liste aller Knoten im Graph zur??ck.\n * @return Knotenliste\n */\n List<V> getVertexList();\n \n /**\n * Liefert Liste aller Kanten im Graph zur??ck.\n * @return Kantenliste.\n */\n List<Edge<V>> getEdgeList();\n\n /**\n * Liefert eine Liste aller adjazenter Knoten zu v.\n * Genauer: g.getAdjacentVertexList(v) liefert eine Liste aller Knoten w,\n * wobei (v, w) eine Kante des Graphen g ist.\n * @param v Knoten\n * @throws IllegalArgumentException falls Knoten v\n * nicht im Graph vorhanden ist.\n * @return Knotenliste\n */\n List<V> getAdjacentVertexList(V v);\n\n /**\n * Liefert eine Liste aller inzidenten Kanten.\n * Genauer: g.getIncidentEdgeList(v) liefert\n * eine Liste aller Kanten im Graphen g mit v als Startknoten.\n * @param v Knoten\n * @throws IllegalArgumentException falls Knoten v\n * nicht im Graph vorhanden ist.\n * @return Kantenliste\n */\n List<Edge<V>> getIncidentEdgeList(V v);\n}",
"@Override\n\tpublic Set<Class<? extends IndexingItemHandler>> getDependencies() {\n\t\treturn null;\n\t}",
"public DependencyTree(Project project, String targetName) {\n dependencies = new HashMap<String, Set<String>>();\n Hashtable<?, ?> targets = project.getTargets(); // name -> target\n addDependency(project, targets, targetName);\n flatDependencies = flattenDependencyTree();\n }",
"public static interface Resolver {\n\t\t\n\t\t/**\n\t\t * Registers an injection manager with a resolver.\n\t\t * \n\t\t * The resolver can asynchronously update the relation to modify the\n\t\t * binding.\n\t\t * \n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.addTarget\n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.removeTarget\n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.substituteTarget\n\t\t * \n\t\t */\n\t\tpublic void addInjection(RelationInjectionManager injection);\n\t\t\n\t\t/**\n\t\t * Request to lazily resolve an injection.\n\t\t * \n\t\t * This method is invoked by a injection manager to calculate its initial binding\n\t\t * when it is first accessed.\n\t\t * \n\t\t * The resolver must call back the manager to modify the resolved target.\n\t\t * \n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.addTarget\n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.removeTarget\n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.substituteTarget\n\t\t * \n\t\t */\n\t\tpublic boolean resolve(RelationInjectionManager injection);\n\t\t\n\t\t/**\n\t\t * Request to remove an injection.\n\t\t * \n\t\t * This method is invoked by a injection manager to signify that the\n\t\t * component wants to force the resolution of the relation the next\n\t\t * access\n\t\t * \n\t\t */\n\t\tpublic boolean unresolve(RelationInjectionManager injection);\n\t\t\n\t}",
"public void getDependencies(ScopeInformation scopeInfo,\n\t\tDependencyManager fdm);",
"ISChangePropagationDueToDataDependencies createISChangePropagationDueToDataDependencies();",
"public interface Flow {\n\n\t/**\n\t * Create a Cascading FlowDef for the specified parameters\n\t * \n\t * @param inPath\n\t * A path to be used as input for the flow\n\t * @param outPath\n\t * A path to be used as output for the floe\n\t * @param errorPath\n\t * A path where failed documents will be stored\n\t * @return A Flowdefinition\n\t * @throws Exception On any error during setup of the flow.\n\t */\n\tpublic abstract FlowDef getFlowDefinition(String inPath, String outPath, String errorPath) throws Exception;\n}",
"protected RemoteFactory.Requires<Msg, Ref> eco_requires() {\n assert this.ecosystemComponent != null: \"This is a bug.\";\n return this.ecosystemComponent.bridge;\n }",
"public DependencyManager()\n\t{\n\t\tmap.put(VARIABLES, new ArrayList<>());\n\t\tmap.put(VARSTRATEGY, BASE_STRATEGY);\n\t}",
"public interface ServiceCDepend {\n String getInstrument();\n}",
"public interface ILibraryDependencySpecBuilder extends IDependencySpecBuilder\n{\n\n\tString getProjectPath();\n\n\tvoid setProjectPath( String projectPath );\n\n\tString getLibraryName();\n\n\tvoid setLibraryName( String libraryName );\n\n\t@Override\n\tILibraryDependencySpec build();\n}",
"void depend(@Nonnull String path);",
"public String[] getResolvedDependencies();"
] | [
"0.7977204",
"0.72907156",
"0.7174931",
"0.67521685",
"0.67521685",
"0.65001494",
"0.63345015",
"0.62985665",
"0.6296025",
"0.62124217",
"0.6197201",
"0.6188889",
"0.61887115",
"0.6183371",
"0.6140312",
"0.6032173",
"0.60004896",
"0.5993886",
"0.5983258",
"0.5978974",
"0.59649694",
"0.5913269",
"0.58718807",
"0.58352464",
"0.58201075",
"0.5800438",
"0.57799786",
"0.5776879",
"0.5774739",
"0.5771394",
"0.5767044",
"0.576163",
"0.57570523",
"0.5714147",
"0.57011217",
"0.5694992",
"0.56471014",
"0.56424934",
"0.56372017",
"0.56331956",
"0.56145954",
"0.5587426",
"0.5581246",
"0.5572177",
"0.55472165",
"0.5547216",
"0.55252934",
"0.5525169",
"0.55186427",
"0.55145705",
"0.5513944",
"0.5512274",
"0.5506709",
"0.55062926",
"0.5502171",
"0.5499255",
"0.549871",
"0.5498452",
"0.5488458",
"0.5448372",
"0.54441833",
"0.5422624",
"0.5418155",
"0.5412881",
"0.54066277",
"0.54047585",
"0.5395928",
"0.539164",
"0.53877074",
"0.5383392",
"0.5381228",
"0.5378795",
"0.53741",
"0.537169",
"0.5371609",
"0.536689",
"0.5365218",
"0.53477794",
"0.533573",
"0.533537",
"0.532877",
"0.5328225",
"0.53208625",
"0.53202486",
"0.53191185",
"0.53135926",
"0.5304891",
"0.5281112",
"0.52791107",
"0.52780396",
"0.52776927",
"0.5277654",
"0.5277099",
"0.5272062",
"0.5263549",
"0.52630734",
"0.5261476",
"0.52567",
"0.52561027",
"0.52559954",
"0.5255225"
] | 0.0 | -1 |
Method creates a new user. | public boolean create(String name, String age) {
boolean isCreate = false;
if (this.isNameUnique(name)) {
User user = this.userFactory.getNewUser(name, age);
if (!user.isNull()) {
this.users.add(user);
isCreate = true;
}
}
return isCreate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createUser(User user) {\n\n\t}",
"public void createUser(User user);",
"public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}",
"UserCreateResponse createUser(UserCreateRequest request);",
"CreateUserResult createUser(CreateUserRequest createUserRequest);",
"@POST\n\t@Path(\"/newUser\")\n\t@Consumes({ MediaType.APPLICATION_JSON })\n\t@Produces({ MediaType.APPLICATION_JSON })\n\t@Transactional\n\tpublic Response createUser(User user) {\n\t\tuserDao.createUser(user);\n\n\t\treturn Response.status(201)\n\t\t\t\t.entity(\"A new user has been created\").build();\n\t}",
"boolean create(User user) throws Exception;",
"void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;",
"@Override\n\tpublic int create(Users user) {\n\t\tSystem.out.println(\"service:creating new user...\");\n\t\treturn userDAO.create(user);\n\t}",
"User createUser();",
"@RequestMapping(value=\"\", method=RequestMethod.POST, consumes=MediaType.MULTIPART_FORM_DATA_VALUE, produces = \"application/json\")\n\tpublic @ResponseBody Object createUser(@RequestParam String userName, @RequestParam String userPassword, @RequestParam String userFirstName, \n\t\t\t@RequestParam String userLastName, @RequestParam String userPicURL,@RequestParam String userEmail, @RequestParam String userEmployer,\n\t\t\t@RequestParam String userDesignation, @RequestParam String userCity, @RequestParam String userState, @RequestParam(required=false) String programId, \n\t\t\t@RequestParam long updatedBy, @RequestParam String userExpertise, @RequestParam String userRoleDescription,\n\t\t\t@RequestParam String userPermissionCode, @RequestParam String userPermissionDescription, HttpServletRequest request, HttpServletResponse response) {\n\t\treturn userService.createUser(userName, userPassword, userFirstName, userLastName, userPicURL, userEmail, userEmployer, userDesignation, userCity, userState, programId, updatedBy, userExpertise, userRoleDescription, userPermissionCode, userPermissionDescription, request, response);\n\t}",
"@Override\n\tpublic void create(User user) {\n\t\t\n\t}",
"public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"User createUser(User user);",
"User createUser(UserCreationModel user);",
"public void creatUser(String name, String phone, String email, String password);",
"@PostMapping(\"/user/new/\")\n\tpublic userprofiles createUser(@RequestParam String firstname, @RequestParam String lastname, @RequestParam String username, @RequestParam String password, @RequestParam String pic) {\n\t\treturn this.newUser(firstname, lastname, username, password, pic);\n\t}",
"@Test\n\tpublic void newUser() {\n\n\t\tUser user = new User(\"moviewatcher\", \"$2a$10$37jGlxDwJK4mRpYqYvPmyu8mqQJfeQJVSdsyFY5UNAm9ckThf2Zqa\", \"USER\");\n\t\tuserRepository.save(user);\n\n\t\tassertThat(user).isNotNull();\n\t\tassertThat(user).hasFieldOrPropertyWithValue(\"username\", \"moviewatcher\");\n\t}",
"private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }",
"public void newUser(User user);",
"public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }",
"private void createUser(final String email, final String password) {\n\n }",
"Boolean registerNewUser(User user);",
"@Override\n\tpublic ApplicationResponse createUser(UserRequest request) {\n\t\tUserEntity entity = repository.save(modeltoentity.apply(request));\n\t\tif (entity != null) {\n\t\t\treturn new ApplicationResponse(true, \"Success\", enitytomodel.apply(entity));\n\t\t}\n\t\treturn new ApplicationResponse(false, \"Failure\", enitytomodel.apply(entity));\n\t}",
"User create(final User user) throws DatabaseException;",
"public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}",
"User create(User user);",
"public String createUserAction()throws Exception{\n\t\tString response=\"\";\n\t\tresponse=getService().getUserMgmtService().createNewUser(\n\t\t\t\tgetAuthBean().getUserName(),\n\t\t\t\tgetAuthBean().getFirstName(),\n\t\t\t\tgetAuthBean().getLastName(),\n\t\t\t\tgetAuthBean().getEmailId(),\n\t\t\t\tgetAuthBean().getRole()\n\t\t);\n\t\tgetAuthBean().setResponse(response);\n\t\tinputStream = new StringBufferInputStream(response);\n\t\tinputStream.close();\n\t\treturn SUCCESS;\n\t}",
"public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void create(String userName, String password, String userFullname,\r\n\t\t\tString userSex, int userTel, String role);",
"public void createUser(SignUpDto signupdto) {\n\t\tUser user = new User();\r\n\t\t\r\n\t\tuser.setId(signupdto.getId());\r\n\t\tuser.setPw(signupdto.getPw());\r\n\t\tuser.setNickname(signupdto.getNickname());\r\n\t\t\r\n\t\tuserRepository.save(user);\t\r\n\t}",
"@POST\n public User create(User user) {\n SecurityUtils.getSubject().checkPermission(\"User:Edit\");\n\n userFacade.create(user);\n return user;\n }",
"boolean createUser(String username, String password);",
"int createUser(User data) throws Exception;",
"@PostMapping(\"/users\")\n public UsersResponse createNewUser(@RequestBody NewUserRequest request) {\n User user = new User();\n user.setName(request.getName());\n user.setAge(request.getAge());\n user = userRepository.save(user);\n return new UsersResponse(user.getId(), user.getName() + user.getAge());\n }",
"private User createUser(String username, String name, String email, String password) {\n UserDTO userDTO = new UserDTO();\n userDTO.setEmail(email);\n userDTO.setName(name);\n userDTO.setPassword(password);\n userDTO.setUsername(username);\n\n userService.registerUser(userDTO);\n\n User user = userService.getUserByEmail(email);\n return user;\n }",
"public iUser createUser(int id) {\n iUser user = null;\n String username = getUsername();\n String password = getPassword();\n\n boolean confirmed = confirmed(id, username);\n if (confirmed) {\n user = registerOptions(username, password, id);\n }\n return user;\n }",
"int newUser(String username, String password, Time creationTime);",
"public void createUser(VUser vUser) {\n\t\tUser user = new User();\n\n\t\tboolean match = Pattern.matches(Constants.REGEX_EMAIL, vUser.getEmail());\n\t\tif (!match) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"El email tiene formato incorrecto.\");\n\t\t}\n\n\t\tif (repo.getUserByEmail(vUser.getEmail()) != null) {\n\t\t\tthrow new ResponseStatusException(HttpStatus.BAD_REQUEST, \"Ya hay un usuario con ese email.\");\n\t\t}\n\n\t\tuser.setEmail(vUser.getEmail());\n\t\tuser.setFullName(vUser.getFullName());\n\t\t\n\t\tif(vUser.getFullName() == null || vUser.getFullName().isEmpty()) {\n\t\t\tuser.setFullName(vUser.getEmail());\n\t\t}\n\n\t\t// TODO: hashear password\n\t\tuser.setPasswordHash(vUser.getPassword());\n\n\t\tuser.setRoles(vUser.getRoles());\n\t\tuser.setUserType(vUser.getUserType());\n\n\t\trepo.createUser(user);\n\t}",
"private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"private void createUser(String username) {\n if (TextUtils.isEmpty(username)) {\n Toast.makeText(this, \"Username Field Required!\", Toast.LENGTH_SHORT).show();\n return;\n }else {\n FirebaseUser current_user = FirebaseAuth.getInstance().getCurrentUser();\n String userID = current_user.getUid();\n User user = new User(et_username.getText().toString(), et_gender.getText().toString(), \"Newbie\", \"Online\", \"Active\", userID, \"default_url\");\n mRef.child(mAuth.getCurrentUser().getUid()).setValue(user);\n }\n }",
"public int createUser(Users user) {\n\t\t int result = getTemplate().update(INSERT_users_RECORD,user.getUsername(),user.getPassword(),user.getFirstname(),user.getLastname(),user.getMobilenumber());\n\t\t\treturn result;\n\t\t\n\t\n\t}",
"@Override\n\tpublic User createNewUser(Account account) {\n\t\treturn new User(account);\n\t\t\n\t}",
"@PostMapping\n public User create(@RequestBody final User user) {\n return userService.create(user);\n }",
"@PostMapping(\"/users\")\n\tpublic ResponseEntity<UserDTO> creareUser(@RequestBody(required = true) @Valid UserDTO user) {\n\t\tuser = userService.createUser(user);\n\t\treturn new ResponseEntity<>(user, HttpStatus.CREATED);\n\t}",
"Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);",
"@Override\npublic String createUser(String userAccount, String userPassword,\n\t\tString userSex, String userEmail, String userName) {\n\t\n\tUser user = new User(userAccount, userPassword, userSex , userEmail, userName);\n\tem.persist(user) ;\n\t return \n\t\t\t \"Account: \" + user.getUserAccount() + \"\\n\" +\n\t\t\t\"Password: \" + user.getUserPassword() + \"\\n\" + \n\t\t\t\"Sex: \" + user.getUserSex() + \"\\n\" +\n\t\t\t\"Email: \" + user.getUserEmail() + \"\\n\" +\n\t\t\t\"Name: \" + user.getUserName();\n\n\t\n}",
"private User createUser(org.picketlink.idm.model.User picketLinkUser) {\n User user = new User(picketLinkUser.getLoginName());\n user.setFullName(picketLinkUser.getFirstName() + \" \" + picketLinkUser.getLastName());\n user.setShortName(picketLinkUser.getLastName());\n return user;\n }",
"@Override\r\n\tpublic boolean createUser(Utilisateur u) {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic String createUser(User users) {\n\t\tuserRepository.save(users);\n\t\treturn \"Save Successful\";\n\t}",
"@PostMapping\n @ResponseStatus(HttpStatus.CREATED)\n public UserResponse createUser(@Valid @RequestBody CreateUserRequest createUser) {\n return userMapper.toUserResponse(\n userService.createUser(\n userMapper.toDto(createUser)\n )\n );\n }",
"@POST\n\t@Path(\"/signUp\")\n\t@Consumes(MediaType.APPLICATION_JSON)\n\tpublic String createUser(User user) {\n\t\tUserService.createUser(user);\n\t\treturn \"User \" + user.getUsername() + \" is created successfully\";\n\t}",
"public eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser addNewCreateUser()\n {\n synchronized (monitor())\n {\n check_orphaned();\n eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser target = null;\n target = (eu.aladdin_project.storagecomponent.CreateUserDocument.CreateUser)get_store().add_element_user(CREATEUSER$0);\n return target;\n }\n }",
"@Override\n\tpublic void createUser(User user) {\n\t\tSystem.out.println(\"INSIDE create user function\");\n\t\tem.persist(user);\n\t\t\t\n\t}",
"@Override\n\tpublic User createUser(User user) {\n\t\tem.persist(user);\n\t\tem.flush();\n\t\treturn user;\n\t}",
"@Override\n public void createUser(User user) {\n run(()->{this.userDAO.save(user);});\n\n }",
"public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;",
"public User createUser(User user) {\n\t\treturn userRepository.save(user);\n\t}",
"public User createUser(User user) {\n\t\treturn userRepository.save(user);\n\t}",
"@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)\n @ResponseBody\n public UserResult createUser(@RequestBody UserInput userInput) {\n return userService.create(userInput);\n }",
"void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }",
"@Override\n public User create(User user) {\n user.setPassword(bCryptPasswordEncoder.encode(user.getPassword()));\n if (user.getCreateDate() == null) {\n DateTime dt = new DateTime();\n user.setCreateDate(dt.toDate());\n }\n user.setEnabled(true);\n user.setRoleList(Collections.singletonList(roleDao.findByName(\"ROLE_USER\")));\n\n return dao.create(user);\n }",
"@PostMapping(\"/user\")\n\tpublic ResponseEntity<User> createUser(@RequestBody User user) throws Exception {\n\t\tlog.debug(\"REST request to save User : {}\", user);\n\t\tif (user.getId() != null) {\n\t\t\tthrow new Exception(\"A new user cannot already have an ID\");\n\t\t}\n\t\tUser result = userService.save(user);\n\t\tlog.debug(\"Added new user:: \" + user);\n\t\treturn new ResponseEntity<User>(result, HttpStatus.CREATED);\n\t}",
"private void createUser(Request request, Response response) {\r\n\t\tUserBean userBean = new UserBean();\r\n\t\tRESTfulSession session = null;\r\n\r\n\t\ttry {\r\n\t\t\tBeanHelper.populateUserBeanFromRequest(request, userBean);\r\n\t\t\tString username = userBean.getUsername();\r\n\t\t\tString password = userBean.getPassword();\r\n\t\t\tString email = userBean.getEmail();\r\n\r\n\t\t\tif (StringHelper.isNullOrNullString(username)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(password)\r\n\t\t\t\t\t|| StringHelper.isNullOrNullString(email)) {\r\n\t\t\t\tthrow new InvalidInputException();\r\n\t\t\t}\r\n\r\n\t\t\tsession = userService.createUser(userBean);\r\n\t\t} catch (InvalidInputException e) {\r\n\t\t\tresponse.setStatus(Status.CLIENT_ERROR_BAD_REQUEST, e.getMessage());\r\n\t\t} catch (Exception e) {\r\n\t\t\tresponse.setStatus(Status.SERVER_ERROR_INTERNAL, e.getMessage());\r\n\t\t\te.printStackTrace();\r\n\t\t\tlog.error(e);\r\n\t\t} finally {\r\n\t\t\t// generate response XML\r\n\t\t\txmlSerializationService.generateXMLResponse(request, response,\r\n\t\t\t\t\tsession);\r\n\t\t}\r\n\t}",
"public User createUser(User newUser) {\n if(userRepository.findByUsername(newUser.getUsername()) != null){\n throw new UsernameException(\"The username is already taken please choose another one\");\n }\n newUser.setToken(\"dummy_token\"); //not really needed after registration;\n\n newUser.setStatus(UserStatus.ONLINE);\n userRepository.save(newUser); //userRepository creates User entity for the first time\n\n newUser.setToken(generateToken(newUser));\n userRepository.save(newUser); //userRepository saves the new entity items to existing user\n\n log.debug(\"Created Information for User: {}\", newUser);\n return newUser;\n }",
"private void createUser(String Address, String Phone_number,String needy) {\n // TODO\n // In real apps this userId should be fetched\n // by implementing firebase auth\n if (TextUtils.isEmpty(userId)) {\n userId = mFirebaseDatabase.push().getKey();\n }\n\n com.glitch.annapurna.needy user = new needy(Address,Phone_number,needy);\n\n mFirebaseDatabase.child(userId).setValue(user);\n\n addUserChangeListener();\n }",
"public void createUser(String email, String password) {\n\n if (!validateForm()) {\n return;\n }\n\n signupBtn.setEnabled(false);\n startLoadAnim(getString(R.string.registering_user));\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n Toast.makeText(LoginActivity.this, R.string.registration_failed, Toast.LENGTH_SHORT).show();\n signupBtn.setEnabled(true);\n stopLoadAnim();\n }\n }\n });\n }",
"@Test\n\tpublic void test_create_new_user_success(){\n\t\tUser user = new User(null, \"create_user\", \"[email protected]\", \"12345678\");\n\t\tResponseEntity<User> response = template.postForEntity(REST_SERVICE_URI + ACCESS_TOKEN + token, user, User.class);\n\t\tUser newUser = response.getBody();\n\t\tassertThat(newUser.getName(), is(\"create_user\"));\n\t\tassertThat(response.getStatusCode(), is(HttpStatus.CREATED));\n\t\tvalidateCORSHttpHeaders(response.getHeaders());\n\t}",
"@Override\n protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {\n if (CREATE_USER_REQUEST_CODE == requestCode && RESULT_OK == resultCode){\n if (data != null) {\n String username = data.getStringExtra(UserCreationActivity.BUNDLE_NEW_USER_NAME);\n\n User user = new User(username, User.EMPTY_CASE, User.EMPTY_CASE);\n\n createUser(user);\n }\n }\n }",
"public UserAuthToken createUser(CreateUserRequest request);",
"@PostMapping(path = \"/online-sales-service/registerUser\")\n\tpublic ResponseEntity<?> createUser(@RequestBody final ActiveDirectory user, final HttpServletRequest request,\n\t\t\tfinal HttpServletResponse response) {\n\t\tResponseEntity<?> responseEntity;\n\t\tActiveDirectory thisUser = null;\n\t\ttry {\n\t\t\tthisUser = activeDirectoryService.createNewUser(user);\n\t\t} catch (Exception e) {\n\t\t\tresponseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.NOT_FOUND);\n\t\t}\n\t\tresponseEntity = new ResponseEntity<ActiveDirectory>(thisUser, HttpStatus.OK);\n\t\treturn responseEntity;\n\t}",
"public UserEntity create(String userId) throws CreateException;",
"public void createUserAccount(UserAccount account);",
"public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}",
"public void createUser(User u) {\n\n em.persist(u);\n\n String content = \"new user: \" + u.getName() + \" => \" + u.getPassword();\n\n MailMessage mailMessage = new MailMessage();\n\n mailMessage.addRecipient(\"[email protected]\");\n mailMessage.setContent(content);\n mailMessage.setSubject(\"new user: \" + u.getName());\n mailer.sendAsyncMail(mailMessage);\n\n mailer.sendSyncMail(mailMessage);\n\n }",
"public void setCreateUser(entity.User value) {\n __getInternalInterface().setFieldValue(CREATEUSER_PROP.get(), value);\n }",
"@Override\n\tpublic User Create(User t) {\n\t\tsessionFactory.getCurrentSession().save(t);\n\t\t\n\t\treturn t;\n\t}",
"@Override\n public User signUpUser(String name, String username, String password, String email) throws UsernameExistsException {\n User u = new User(name, username, password, email);\n if (userDataMapper.getUserByUserName(username) != null)\n throw new UsernameExistsException();\n userDataMapper.add(u);\n return u;\n }",
"private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}",
"@PostMapping(\"/users\")\n\tpublic ResponseEntity<Object> createUser(@Valid @RequestBody User user) {\n\t\tUser createUser = userService.save(user);\n\n\t\t// Return Created User URI e.g. users/6\n\t\t// It Will return the status code of 201 created\n\t\tURI uri = ServletUriComponentsBuilder.fromCurrentRequest().path(\"/{id}\").buildAndExpand(createUser.getId())\n\t\t\t\t.toUri();\n\t\treturn ResponseEntity.created(uri).build();\n\n\t}",
"public static User createUser(Integer userId, String firstName, String lastName,\r\n\t\t\tString email, String userName, String companyName) {\r\n\t\tUser user = new User();\r\n\t\tif (userId != null) {\r\n\t\t\tuser.setUserId(userId);\r\n\t\t}\r\n\t\tuser.setFirstName(firstName);\r\n\t\tuser.setLastName(lastName);\r\n\t\tuser.setEmail(email);\r\n\t\tuser.setUserName(userName);\r\n\t\tuser.setCompanyName(companyName); \r\n\t\treturn user;\r\n\t}",
"public User create(final User user) {\n LOG.debug(\"Create User\");\n\n // TODO Put your code here - create (...) Upload photo.\n\n return this.repository.save(user);\n }",
"@Transactional\n public Long createUser(User user) {\n user.setId(null);\n final User createdUser = userRepository.save(user);\n return createdUser.getId();\n }",
"public User createUser(User user) {\r\n user.setPassword(hashPassword(user.getPassword()));\r\n\r\n if(!isLetters(user.getFirstname()) || !isLetters(user.getLastname()) || !isLetters(user.getCity())) {\r\n throw new IllegalArgumentException(\"Firstname, lastname or city did not contain only letters\");\r\n } else if (!user.getEmail().contains(\"@\") || !user.getEmail().contains(\".\")) {\r\n throw new IllegalArgumentException(\"Email must contain @ and .\");\r\n } else if (String.valueOf(user.getBirthyear()).length() != 4) {\r\n throw new IllegalArgumentException(\"Wrong format for birthday\");\r\n } else if (!isValidGender(user.getGender())) {\r\n throw new IllegalArgumentException(\"Wrong format for gender\");\r\n }\r\n if (user.getRating() == null){\r\n Rating rating = new Rating(user);\r\n user.setRating(rating);\r\n }\r\n return userRepo.save(user);\r\n }",
"@PostMapping(value=\"/addUser\")\n\t\t@Consumes({\"application/json\"})\n\t\t@ResponseBody\n\t\tpublic ResponseEntity<User> createUser(@RequestBody User user) throws TaskTrackerException{\n\t\t\tboolean isCreated = false;\n\t\t\ttry {\n\t\t\t\tisCreated = userService.createUser(user);\n\t\t\t} catch (Exception e) {\n\t\t\t\tthrow new TaskTrackerException(\"usernot created, Check if Parent task exists!\",e);\n\t\t\t}\n\t\t\t\n\t\t\tif(isCreated){\n\t\t\t\treturn new ResponseEntity<User>(HttpStatus.CREATED);\n\t\t\t} else {\n//\t\t\t\treturn new ResponseEntity<Product>(HttpStatus.OK);\n\t\t\t\t\n\t\t\t\treturn ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).header(\"message\", \"User not created, Check if User exists!\").build();\n\t\t\t}\n\t\t}",
"public void createUserInFirebase(String name, String email, String Uid) {\n User user = new User();\n user.setName(name);\n user.setEmail(email);\n mDatabase.child(\"users\").child(Uid).setValue(user);\n }",
"@Override\n public ApiResponse createUser(SignupDto signupDto){\n var userRole = this.roleDAO.findByName(RoleEnum.USER);\n Set<Role> userRoles = new HashSet<Role>(Collections.singletonList(userRole.get()));\n\n Person newPerson = new Person();\n newPerson.setEmail(signupDto.getUsername());\n newPerson.setFirstName(signupDto.getFirstName());\n newPerson.setLastName(signupDto.getLastName());\n newPerson.setRoles(userRoles);\n\n // Encriptamos la contraseña que nos mando el usuario\n var encryptedPassword = this.passwordEncoder.encode(signupDto.getPassword());\n newPerson.setPassword(encryptedPassword);\n\n this.personDAO.save(newPerson);\n\n return new ApiResponse(true, \"Usuario creado\");\n\n }",
"public void createUser(String username, String password, String role) {\r\n Optional<User> user = userRepo.findByName(username);\r\n if (!user.isPresent()) {\r\n User newUser = new User();\r\n newUser.setName(username);\r\n newUser.setPassword(password);\r\n newUser.setRole(role);\r\n userRepo.save(newUser);\r\n }\r\n }",
"@Headers({\n \"Content-Type:application/json\"\n })\n @POST(\"administrators\")\n Call<Void> createUser(\n @retrofit2.http.Body UserBody userBody\n );",
"@RequestMapping(value=\"/user\",method=RequestMethod.POST)\n\tpublic @ResponseBody ResponseEntity<User> createUser(@RequestBody User userDetails) throws Exception{\n\t\tUser user=null;\n\t\n\t\t//for checking update user \n\t\tuser=userDAO.findOne(userDetails.getId());\n\t\tif (user==null){\n\t\t\t//insert new user \n\t\t\ttry{\n\t\t\t\tuser=new User(userDetails.getEmail(),userDetails.getName(),userDetails.getContact(),userDetails.getIsActive(), new Date(),new Date());\n\t\t\t\tuserDAO.save(user);\n\t\t\t\t}catch(Exception e){\n\t\t\t\t\tthrow new Exception(\"Exception in saving user details...\",e);\n\t\t\t\t}\n\t\t}else{ \n\t\t\t\tuserDetails.setCreationTime(user.getCreationTime());\n\t\t\t\tuserDetails.setLastModifiedTime(new Date());\n\t\t\t\tuserDAO.save(userDetails);\n\t\t\t}\n\t\t\n\t\t\treturn new ResponseEntity<User>(user, HttpStatus.OK);\n\t}",
"@Override\n public User create( User user ) {\n //- Save user to persistence -//\n final User newUser = this.userRepository.save(user);\n\n //- Check created user -//\n notNull( newUser, \"Cannot save user.\" );\n\n //- Send notification -//\n try {\n //- Prepare content -//\n Template template = this.templateManager.compile( \"security.signup\" );\n\n Context context = Context\n .newBuilder( newUser )\n .combine( \"locale\", LocaleContextHolder.getLocale().toLanguageTag() )\n .build();\n\n //FIXME: get email more safely\n //- Send notification-//\n this.notificationService.send(\n new EmailAddress( \"[email protected]\" ),\n new EmailAddress( newUser.getEmails().get( 0 ).getAddress() ),\n new Email(\n this.messageSource.getMessage(\n \"notification.security.signup.subject\",\n null,\n LocaleContextHolder.getLocale()\n ),\n template.apply( context )\n )\n );\n } catch ( IOException e ) {\n //- Error. Cannot send notification -//\n log.error( \"Cannot prepare or send notification.\", e );\n }\n\n return newUser;\n }",
"@Override\n\tpublic boolean create(User user) {\n\t\treturn false;\n\t}",
"@PostMapping(\"/createUser\")\n\t@ApiOperation(value = \"Create a new user\", notes = \"Creates user by providing valid login credentials\")\n\tpublic ResponseEntity<?> createUser(\n\t\t\t@ApiParam(value = \"User credentials\", required = true) @RequestBody AppUser appUserCredentials) {\n\t\tAppUser createduser = null;\n\t\ttry {\n\t\t\tcreateduser = userRepository.save(appUserCredentials);\n\t\t} catch (Exception e) {\n\t\t\treturn new ResponseEntity<String>(\"Not created\", HttpStatus.NOT_ACCEPTABLE);\n\t\t}\n\t\tlog.info(\"user creation---->{}\", createduser);\n\t\treturn new ResponseEntity<>(createduser, HttpStatus.CREATED);\n\n\t}",
"@Override\n\tpublic User createUser(String username, String password, String role) throws InvalidRegistrationException {\n\t\tUser user = new TeacherUser();\n\t\tsetUserAttributes(user, username, password, role);\n\t\tif (!(\"teacher\".equalsIgnoreCase(user.getRole()))){\n\t\t\tthrow new InvalidRegistrationException();\n\t\t}\n\t\treturn user;\n\t}",
"public static User createUser(String id) {\n\n User user = new User();\n user.setId(id);\n\n return user;\n }",
"public void create() throws DuplicateException, InvalidUserDataException, \n NoSuchAlgorithmException, SQLException {\n\tUserDA.create(this);\n }",
"@PostMapping(value = \"\")\n public User create(@RequestBody User user, HttpServletResponse response) {\n if(StringUtils.isEmpty(user.getUsername())) {\n throw new IllegalArgumentException(\"Invalid username\");\n }\n\n User userCreated = userService.create(user);\n response.setStatus(HttpStatus.CREATED.value());\n return userCreated;\n }",
"@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n\t@RequestMapping(value = \"/users\", method = RequestMethod.POST)\n\tpublic ResponseEntity<AppUser> createUser(@RequestBody AppUser appUser) {\n\t\tif (appUserRepository.findOneByUsername(appUser.getUsername()) != null) {\n\t\t\tthrow new RuntimeException(\"Username already exist\");\n\t\t}\n\t\treturn new ResponseEntity<AppUser>(appUserRepository.save(appUser), HttpStatus.CREATED);\n\t}",
"@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<?> create(@Validated({UserReqDTO.New.class}) @RequestBody UserReqDTO userDTO) {\n log.info(\"Create user {}\", userDTO);\n return new ResponseEntity<>(service.create(userDTO), HttpStatus.CREATED);\n }",
"@PostMapping(value = \"/user\", produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<User> createUser(@Valid @RequestBody User user) {\n\n userRepository.save(user);\n\n return ResponseEntity.ok().body(user);\n }",
"public void createUser(String firstName, String emailAddress) {\n\n this.firstName = firstName;\n this.emailAddress = emailAddress;\n\n }"
] | [
"0.80366886",
"0.7944562",
"0.79227144",
"0.7894155",
"0.77858996",
"0.7638762",
"0.7512252",
"0.7480347",
"0.74410194",
"0.74210197",
"0.74156964",
"0.7381302",
"0.73740286",
"0.7350022",
"0.7273704",
"0.7273113",
"0.72660595",
"0.7263702",
"0.7238507",
"0.7237643",
"0.72307634",
"0.7224542",
"0.72147226",
"0.7193583",
"0.7183636",
"0.71626586",
"0.71613216",
"0.7142397",
"0.7135918",
"0.7130278",
"0.712994",
"0.7125916",
"0.7118242",
"0.7092152",
"0.7077072",
"0.7074288",
"0.7069456",
"0.7055674",
"0.70546645",
"0.7051937",
"0.7051596",
"0.7038532",
"0.7017925",
"0.7013011",
"0.7007383",
"0.7005652",
"0.7000065",
"0.6993328",
"0.69931036",
"0.6988306",
"0.69712657",
"0.69665146",
"0.6966033",
"0.6960529",
"0.69560766",
"0.69518095",
"0.6951035",
"0.69494766",
"0.69494766",
"0.69440705",
"0.6925865",
"0.69234633",
"0.69200426",
"0.6914415",
"0.6910917",
"0.69069105",
"0.6901376",
"0.68826014",
"0.68683875",
"0.6859718",
"0.6851802",
"0.6850823",
"0.68484056",
"0.68447894",
"0.68411213",
"0.68225247",
"0.6806477",
"0.6804879",
"0.680447",
"0.6793962",
"0.67909294",
"0.6779253",
"0.67683244",
"0.67491806",
"0.6739967",
"0.67318016",
"0.67200345",
"0.67167705",
"0.67120117",
"0.6710677",
"0.6708157",
"0.6690597",
"0.66901135",
"0.6689067",
"0.6688956",
"0.66846347",
"0.66812605",
"0.66717833",
"0.6661344",
"0.66599363",
"0.6653808"
] | 0.0 | -1 |
Method finds a user by "id" and sets new values of fields "name", "age". | public boolean edit(String id, String name, String age) {
boolean isEdit = false;
User user = this.findById(id);
if (!user.isNull()) {
if (user.getName() != null && !user.getName().isEmpty() && (user.getName().equals(name) || this.isNameUnique(name))) {
user.edit(name, age);
isEdit = true;
}
}
return isEdit;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setUser(User user, int id) {\n this.user = user;\n this.id = id;\n }",
"public Person selectUpdateUser(String id) {\n\t\tSystem.out.println(\"selectUpdateUser\");\n\t\treturn personDAO.selectUpdateUser(id);\n\t}",
"UpdateUserDto getUserWithId(int id);",
"@Override\n\tpublic ApplicationResponse updateUser(String id, UserRequest request) {\n\t\tUserEntity user = null;\n\t\tOptional<UserEntity> userEntity = repository.findById(id);\n\t\tif (userEntity.isPresent()) {\n\t\t\tuser = userEntity.get();\n\t\t\tif (!StringUtils.isEmpty(request.getFirstName())) {\n\t\t\t\tuser.setFirstName(request.getFirstName());\n\t\t\t}\n\t\t\tif (!StringUtils.isEmpty(request.getSurName())) {\n\t\t\t\tuser.setSurName(request.getSurName());\n\t\t\t}\n\t\t\tif (!StringUtils.isEmpty(request.getDob())) {\n\t\t\t\tuser.setDob(request.getDob());\n\t\t\t}\n\t\t\tif (!StringUtils.isEmpty(request.getTitle())) {\n\t\t\t\tuser.setTitle(request.getTitle());\n\t\t\t}\n\t\t\tuser = repository.save(user);\n\t\t\treturn new ApplicationResponse(true, \"Success\", enitytomodel.apply(user));\n\t\t} else {\n\t\t\tthrow new UserNotFoundException(\"User not found\");\n\t\t}\n\t}",
"int updateUserById( User user);",
"void editUser(String uid, User newUser);",
"@Override\r\n\tpublic User getUserById(int id) {\n\t\treturn userMapper.selById(id);\r\n\t}",
"void updateUserById(String username, User userData);",
"@Override\r\n\tpublic TbUser findUserById(Long id) {\n\t\tTbUser tbUser = tbUserMapper.selectByPrimaryKey(id);\r\n\t\treturn tbUser;\r\n\t}",
"User editUser(User user);",
"public void updateUser(UserModel body, Integer id) {\n UserModel userModelToUpdate = userRepository.getOne(id);\n userModelToUpdate.setFirstname(body.getFirstname());\n if(body.getPassword()!=null) {\n //validate on UserModel entity\n }\n userModelToUpdate.setLastname(body.getLastname());\n userModelToUpdate.setEmail(body.getEmail());\n userModelToUpdate.setPassword(body.getPassword());\n userModelToUpdate.setUsername(body.getUsername());\n userRepository.save(body);\n // wait for best practice\n }",
"public void updateUser() {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"update users set first_name='\" + firstName + \"', \";\n query += \"last_name='\" + lastName + \"', \";\n query += \"phone_number='\" + phoneNumber + \"', \";\n query += \"email='\" + email + \"', \";\n query += \"address='\" + address + \"', \";\n query += \"id_city='\" + idCity + \"' \";\n query += \"where id_user = \" + id;\n stmt.executeUpdate(query);\n\n User updatedUser = findUser(id);\n updatedUser.setFirstName(firstName);\n updatedUser.setLastName(lastName);\n updatedUser.setPhoneNumber(phoneNumber);\n updatedUser.setEmail(email);\n updatedUser.setIdCity(idCity);\n updatedUser.setAddress(address);\n\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n }",
"User getUserById(int id);",
"public void updateUser(int id, User user) {\n\t\tEntityManager entityManager = HandleConnectionToDB.getEntityManager();\n\t\tUser userFind = entityManager.find(User.class, id);\n\n\t\tentityManager.getTransaction().begin();\n\t\tuserFind.setPicture(user.getPicture());\n\t\tuserFind.setPassword(user.getPassword());\n\t\tuserFind.setUsername(user.getUsername());\n\t\tentityManager.getTransaction().commit();\n\t}",
"void setUserId(int newId) {\r\n\t\t\tuserId = newId;\r\n\t\t}",
"@Override\r\n\tpublic User searchUser(Integer id) {\n\t\treturn userReposotory.getById(id);\r\n\t}",
"public User getById(@NotBlank String id){\n System.out.println(\"Sukses mengambil data User.\");\n return null;\n }",
"public User updateUser(User user);",
"@Override\r\n\tpublic User user(int id) {\r\n\t\tMap<String,String> map = getOne(SELECT_USERS+ WHERE_ID, id);\r\n\t\tif(map!= null){\r\n\t\t\treturn IMappable.fromMap(User.class, map);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic User findUserById(int id) {\n\t\treturn userDao.findUserById(id);\n\t}",
"public User updateUser(User user, Long id) {\n\t\tUser existingUser = repository.findById(id).get();\n\t\t\n\t\tRSA rsaUser = rsaRepository.findByIdUser(id);\n\t\t\n\t\tString nameEncript = encript.criptografa(user.getName(), rsaUser.getPublicKey()).toString();\n\t\t\n\t\tString emailEncript = encript.criptografa(user.getEmail(), rsaUser.getPublicKey()).toString();\n\t\t\n\t\tif(existingUser != null) {\n\t\t\texistingUser.setName(nameEncript);\n\t\t\texistingUser.setEmail(emailEncript);\n\t\t}else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\t\t\n\t\trepository.save(existingUser);\n\t\t\n\t\treturn existingUser;\n\t}",
"public User getUserById(int id) {\n System.out.println(id + this.userDao.selectId(id).getUsername());\n\n return this.userDao.selectId(id);\n }",
"@Override\r\n\tpublic Userinfo findbyid(int id) {\n\t\treturn userDAO.searchUserById(id);\r\n\t}",
"public void updateUser(int uid, String name, String phone, String email, String password, int money, int credit);",
"public User getUserData(String id);",
"@Override\n\tpublic User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\n\t}",
"public UserBuilder id(Long id){\r\n this.id =id;\r\n return this;\r\n }",
"public User updateUser(User newUserData, long id) throws AccessException {\r\n User current = userRepo.findById(id);\r\n\r\n BasicUserDetails authenticatedUser = (BasicUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n if(authenticatedUser.getId() != id)\r\n throw new AccessException(\"Cannot update user different than the authenticated user\");\r\n\r\n if ((newUserData.getFirstname() != null) && (!(newUserData.getFirstname().equals(current.getFirstname())))) {\r\n if (isLetters(newUserData.getFirstname())) {\r\n current.setFirstname(newUserData.getFirstname());\r\n } else {\r\n throw new IllegalArgumentException(\"Firstname did not contain only letters\");\r\n }\r\n }\r\n if ((newUserData.getLastname() != null) && !(newUserData.getLastname().equals(current.getLastname()))) {\r\n if (isLetters(newUserData.getLastname())) {\r\n current.setLastname(newUserData.getLastname());\r\n } else {\r\n throw new IllegalArgumentException(\"Lastname did not contain only letters\");\r\n }\r\n }\r\n if ((newUserData.getBirthyear() != 0) && (newUserData.getBirthyear() != current.getBirthyear())) {\r\n if (String.valueOf(newUserData.getBirthyear()).length() == 4) {\r\n current.setBirthyear(newUserData.getBirthyear());\r\n } else {\r\n throw new IllegalArgumentException(\"Wrong format for birthday\");\r\n }\r\n }\r\n if ((newUserData.getEmail() != null) && (!(newUserData.getEmail().equals(current.getEmail())))) {\r\n if (newUserData.getEmail().contains(\"@\") && newUserData.getEmail().contains(\".\")) {\r\n current.setEmail(newUserData.getEmail());\r\n } else {\r\n throw new IllegalArgumentException(\"Email must contain @ and .\");\r\n }\r\n }\r\n if ((newUserData.getGender() != null) && (!(newUserData.getGender().equals(current.getGender())))) {\r\n if (isValidGender(newUserData.getGender())) {\r\n current.setGender(newUserData.getGender());\r\n } else {\r\n throw new IllegalArgumentException(\"Wrong format for gender\");\r\n }\r\n }\r\n //TODO password security\r\n if ((newUserData.getPassword() != null) && ((!hashPassword(newUserData.getPassword()).equals(current.getPassword())))) {\r\n current.setPassword(hashPassword(newUserData.getPassword()));\r\n }\r\n if ((newUserData.getCity() != null) && (!(newUserData.getCity().equals(current.getCity())))) {\r\n if (isLetters(newUserData.getCity())) {\r\n current.setCity(newUserData.getCity());\r\n } else {\r\n throw new IllegalArgumentException(\"City did not contain only letters\");\r\n }\r\n\r\n }\r\n return userRepo.save(current);\r\n }",
"@Override\n\tpublic User getUser(int id) {\n\t\treturn userRepository.findById(id);\n\t}",
"public PrototypeUser getUserById(Long id) {\n\t\treturn userDao.findById(id);\r\n\t}",
"public User updateUser(long id, UserDto userDto);",
"public void setId_user(int id_user) {\r\n this.id_user = id_user;\r\n }",
"@RequestMapping(value = \"{id}\", method = RequestMethod.PUT)\n public User update(@PathVariable Long id, @RequestBody final User user)\n {\n //TODO: Add validation that checks that all attributes are listed in the JSON object. Return 400 bad payload if not\n User existingUser = userRepo.getOne(id);\n BeanUtils.copyProperties(user, existingUser, \"userID\");\n return userRepo.saveAndFlush(user);\n }",
"public User findById(int id) {\n\t\tString sql = \"SELECT * FROM VIDEOGAMESTORES.USERS WHERE ID=\" +id;\n\t\n\t\ttry {\n\t\t\tSqlRowSet srs = jdbcTemplate.queryForRowSet(sql);\n\t\t\twhile(srs.next())\n\t\t\t{\n\t\t\t\t// Add a new User to the list for every row that is returned\n\t\t\t\treturn new User(srs.getString(\"USERNAME\"), srs.getString(\"PASSWORD\"), srs.getString(\"EMAIL\"),\n\t\t\t\t\t\tsrs.getString(\"FIRST_NAME\"), srs.getString(\"LAST_NAME\"), srs.getInt(\"GENDER\"), srs.getInt(\"USER_PRIVILEGE\"), srs.getInt(\"ID\"));\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"@Override\n\tpublic User findByUserid(Serializable id) {\n\t\treturn this.userDao.findById(id);\n\t}",
"public void setId_user(int id_user) {\n this.id_user = id_user;\n }",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn userDAO.findById(id);\r\n\t}",
"public static User selectById(int id) {\n User user = new User();\n\n try (PreparedStatement ps = DBConnection.getConnection().prepareStatement(GET_BY_ID)){\n ps.setInt(1, id);\n ResultSet rs = ps.executeQuery();\n\n while (rs.next()) {\n user.setUserId(rs.getInt(\"User_ID\"));\n user.setUserName(rs.getString(\"User_Name\"));\n user.setPassword(rs.getString(\"Password\"));\n user.setDateCreated(rs.getObject(\"Create_Date\", LocalDateTime.class));\n user.setCreatedBy(rs.getString(\"Created_By\"));\n user.setLastUpdate(rs.getTimestamp(\"Last_Update\"));\n user.setLastUpdatedBy(rs.getString(\"Last_Updated_By\"));\n //\n }\n } catch (SQLException err) {\n err.printStackTrace();\n }\n\n return user;\n }",
"User modifyUser(Long user_id, User user);",
"public Person getUserById(int id);",
"public User getUserById(Long id) throws Exception;",
"User getUserById(Long id);",
"User getUserById(Long id);",
"UserInfo setId(long id);",
"@Override\r\n\tpublic User getUserByID(int id) {\n\t\treturn userMapper.getUserByID(id);\r\n\t}",
"public User(String id, String name, String surname) {\n\t\tsuper();\n\t\tthis.id = id;\n\t\tthis.name = name;\n\t\tthis.surname = surname;\n\t}",
"public Person findUserById(Integer id) {\n\t\treturn null;\n\t}",
"public void updateUser(Person user) {\n\t\t\n\t}",
"@Override\r\n\tpublic User findByIdUser(Integer id) {\n\t\treturn userReposotory.findById(id).get();\r\n\t}",
"@Override\n public UserInfo findById(int id) {\n TypedQuery<UserInfo> query = entityManager.createNamedQuery(\"findUserById\", UserInfo.class);\n query.setParameter(\"id\", id);\n return query.getSingleResult();\n }",
"public void update(User user);",
"public User updateAllInfoUser(User updateUser, Integer id)\n\t{\n\t\t// Create an user -1 for when it isn't in the list\n\t\tUser searchUser = new User();\n\t\t// Index: User's position in the list\n\t\tint index = this.getUserById(id.intValue());\n\t\t// If the user is in the list execute the action\n\t\tif(index != -1)\n\t\t{\n\t\t\t// Update the list with the user's information\n\t\t\tthis.updateList(index, updateUser);\n\t\t\t// Return updated user\n\t\t\tsearchUser = this.usersList.get(index);\n\t\t}\n\t\t\n\t\treturn searchUser;\n\t}",
"public User getUserById(String id) {\n // return userRepo.findById(id);\n\n return null;\n }",
"@Override\r\n public Dorm findById(Integer id) {\n return userMapper.findById(id);\r\n }",
"public User findUserById(int id);",
"public void setAge(String un, int age){\n MongoCollection<Document> collRU = db.getCollection(\"registeredUser\");\n // updating user database\n collRU.findOneAndUpdate(\n eq(\"username\", un),\n Updates.set(\"age\", age)\n );\n }",
"void updateUser(int id, UpdateUserDto updateUserDto);",
"@Test\n public void updateById() {\n User user = new User();\n user.setId(1259474874313797634L);\n user.setAge(30);\n boolean ifUpdate = user.updateById();\n System.out.println(ifUpdate);\n }",
"@Override\n\tpublic User selectUserById(int id) {\n\t\tUser user = null;\n\t\ttry {\n\t\t\tuser = (User) client.queryForObject(\"selectUserById\", id);\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn user;\n\n\t}",
"public User(int aId, String aFirstName, String aLastName){\r\n this.id = aId;\r\n this.firstName = aFirstName;\r\n this.lastName = aLastName;\r\n }",
"private static void updateUserTest(Connection conn) {\n\t\t\n\t\ttry {\n\t\t\tUser existingUser = User.loadUserById(conn, 3); // User user = User.loadUserById(conn, 3);\n\t\t\t// the same id is preserved\n\t\t\texistingUser.setUsername(\"jo\");\n\t\t\texistingUser.setEmail(\"[email protected]\");\n\t\t\texistingUser.setUserGroupId(2);\n\t\t\texistingUser.saveToDB(conn);\n\t\t\t\n\t\t\t/*Następnie\tnależy\tsprawdzić,\tczy:\n\t\t\t\t1.\t Czy\twpis\tw\tbazie\tdanych\tma\twszystkie\n\t\t\t\tdane\todpowiednio\tponastawiane?\n\t\t\t\t2.\t Czy\tobiekt\tma\tnastawione\tpoprawne\tid? - czyli niezmienione, bo nie mamy settera dla id\n\t\t\t\t3.\t Czy\tnie\tdodał\tsię\tnowy\twpis\tw\tbazie?*/\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\n public User getUserById(int id) {\n Session session = this.sessionFactory.getCurrentSession(); \n User u = (User) session.load(User.class, new Integer(id));\n logger.info(\"User loaded successfully, User details=\"+u);\n return u;\n }",
"public User selectoneuser(int id) {\n\t\tUser user = null;\n\t\tuser = new User();\n\t\tSystem.out.println(\"Userdao的id=\" + id);\n\t\tConnection conn = null;\n\t\tString sql = \"select * from users where id=\" + id;\n\t\tResultSet rs = null;\n\t\ttry {\n\t\t\tconn = ConnectDB.getconnect();\n\t\t\tPreparedStatement pstmt = conn.prepareStatement(sql);\n\t\t\trs = pstmt.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tuser.setId(rs.getInt(\"id\"));\n user.setUsername(rs.getString(\"username\"));\n user.setPassword(rs.getString(\"password\"));\n user.setPhonenumber(rs.getString(\"phonenumber\"));\n user.setEmail(rs.getString(\"email\"));\n\t\t\t}\n\t\t\tpstmt.close();\n\t\t\tconn.close();\n\t\t\treturn user;\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(\"bookdao查询当前id结果失败\");\n\t\t}\n\t\treturn user;\n\t}",
"void update(User user);",
"void update(User user);",
"public void editUser(User user) {\n\t\t\n\t}",
"public User(Long id,com.institucion.fm.security.model.User user){\n\t\tthis.id=id;\n\t\tthis.user=user;\n\t}",
"public User read(String id);",
"public User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\r\n\t}",
"@PutMapping(\"/user/{id}\")\n\tpublic ResponseEntity<User> updateUser(@PathVariable(\"id\") int id, @RequestBody User user) {\n\t\tUser currentUser = userDao.getUserById(id);\n\t\tif (currentUser == null) {\n\t\t\treturn new ResponseEntity<User>(HttpStatus.NOT_FOUND);\n\t\t} else {\n\t\t\tcurrentUser.setFullName(user.getFullName());\n\t\t\tcurrentUser.setUserName(user.getUserName());\n\t\t\tcurrentUser.setEmail(user.getEmail());\n\t\t\tuserDao.update(currentUser);\n\t\t\treturn new ResponseEntity<User>(currentUser, HttpStatus.OK);\n\t\t}\n\t}",
"User getUser(Long id);",
"@PUT(\"/api/users/{id}\")\n public void updateUserById(@Path(\"id\") Integer id,@Body User User,Callback<User> callback);",
"@Update({\n \"update user_t\",\n \"set user_name = #{userName,jdbcType=VARCHAR},\",\n \"password = #{password,jdbcType=VARCHAR},\",\n \"age = #{age,jdbcType=INTEGER},\",\n \"ver = #{ver,jdbcType=INTEGER}\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int updateByPrimaryKey(User record);",
"public SUser select(long id) {\n\t\treturn (SUser) super.select(className, id);\n\t}",
"public void updateUser(User oldUser, User newUser) ;",
"User findUserById(int id);",
"public void setUserId(long userId);",
"public void setUserId(long userId);",
"public void setUserId(long userId);",
"public void setUserId(long userId);",
"public User findById(String id) {\n\t\treturn userDao.findById(id);\n\t}",
"public User findById(Long id){\n return userRepository.findOne(id);\n }",
"void setUserId(Long userId);",
"public User selectById(int id) {\n\t\treturn mapper.selectById(id);\n\t}",
"public void setIdUser(int value) {\n this.idUser = value;\n }",
"public static User findUser(int id) {\r\n return null;\r\n }",
"public User user(long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\treturn user.get();\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\n\t}",
"@Override\n\tpublic User selectByPrimaryKey(Integer id) {\n\t\treturn userMapper.selectByPrimaryKey(id);\n\t}",
"User findUserById(Long id) throws Exception;",
"public User(long id, String fistname, String secondname, String username, String password, String mail){\n this.id = id;\n this.firstname = fistname;\n this.secondname = secondname;\n this.username = username;\n this.password = password;\n this.email = mail;\n }",
"public User findById(int id) {\n\t\treturn userRepository.findOne(id);\n\t}",
"User find(long id);",
"@Override\r\n public IUser getUserByUserId(String id)\r\n {\r\n EntityManager em = getEntityManager();\r\n\r\n try\r\n {\r\n return em.find(User.class, id);\r\n }\r\n finally\r\n {\r\n em.close();\r\n }\r\n }",
"public static User findById(final String id) {\n return find.byId(id);\n\n }",
"public void update(User obj) {\n\t\t\n\t}",
"void setName( String username, String name ) throws UserNotFoundException;",
"UserInfo setAge(Integer age);",
"@Override\n public User findById(long id) {\n return dao.findById(id);\n }",
"public User findById(int id) {\n\t\tUser user = getByKey(id);\r\n\t\tif(user != null) {\r\n\t\t\tHibernate.initialize(user.getUserProfiles());\r\n\t\t}\r\n\t\treturn user;\r\n\t}",
"@Override\n\tpublic Usuario updateUsuario(Long id, Usuario usr) {\n\t\treturn null;\n\t}"
] | [
"0.6981618",
"0.68862003",
"0.6838162",
"0.68148345",
"0.6671431",
"0.6656233",
"0.6552229",
"0.64890265",
"0.646718",
"0.64627314",
"0.64536226",
"0.64176804",
"0.6406718",
"0.6388091",
"0.637629",
"0.63729286",
"0.6349628",
"0.63457674",
"0.634083",
"0.6340322",
"0.6339184",
"0.63143635",
"0.63118935",
"0.6308907",
"0.62877023",
"0.6280851",
"0.6278496",
"0.62663853",
"0.62566376",
"0.6237241",
"0.6230889",
"0.6214409",
"0.6214357",
"0.61991626",
"0.6192959",
"0.6190197",
"0.61859846",
"0.61850125",
"0.6176979",
"0.61735386",
"0.6172796",
"0.61720824",
"0.61720824",
"0.61701113",
"0.6164132",
"0.6161893",
"0.614322",
"0.6141733",
"0.6138416",
"0.6132417",
"0.61306125",
"0.6125193",
"0.61136824",
"0.6112144",
"0.61105806",
"0.6108556",
"0.6101895",
"0.6091775",
"0.6086173",
"0.6081186",
"0.6078394",
"0.6077154",
"0.60769373",
"0.6075072",
"0.6075072",
"0.6070428",
"0.60571516",
"0.6044998",
"0.6042734",
"0.6039361",
"0.60316914",
"0.602894",
"0.60275096",
"0.60271347",
"0.6022283",
"0.6016212",
"0.6015702",
"0.6015702",
"0.6015702",
"0.6015702",
"0.60138375",
"0.60108685",
"0.60058135",
"0.6000907",
"0.6000376",
"0.5997178",
"0.5986334",
"0.5981019",
"0.597971",
"0.5979306",
"0.59776294",
"0.597675",
"0.59749305",
"0.5973431",
"0.59725916",
"0.596923",
"0.59660745",
"0.5965317",
"0.5964105",
"0.596301"
] | 0.657559 | 6 |
Method removes user from repository. | public boolean remove(String id) {
User user = this.findById(id);
if(!user.isNull()){
this.userFactory.removeUser(user);
}
return this.users.remove(user);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void delete(User user){\n userRepository.delete(user);\n }",
"@Override\r\n\tpublic void deleteByUser(User user) {\n\t\tuserReposotory.delete(user);\r\n\t}",
"@Override\n\tpublic void remove(User user) throws UserNotFoundException {\n\t\tuserRepo.delete(user);\n\t}",
"public void removeUser(String username);",
"public void delete(User user) {\n repository.delete(user);\n }",
"void removeUser(Long id);",
"Integer removeUserByUserId(Integer user_id);",
"int removeUser(User user);",
"public void removeUser(User user) throws UserManagementException;",
"public void deleteUser(long id){\n userRepository.deleteById(id);\n }",
"void remove(User user) throws SQLException;",
"public void deleteUser(int id) {\r\n userRepo.deleteById(id);\r\n }",
"public void removeUser(){\n googleId_ = User.getDeletedUserGoogleID();\n this.addToDB(DBUtility.get().getDb_());\n }",
"void userRemoved(String username) throws IOException {\n\t\tfor (String repName : getRepositoryNames()) {\n\t\t\tgetRepository(repName).removeUser(username);\n\t\t}\n\t}",
"public void removeUser(Customer user) {}",
"public void removeUser(String userName) {\n\t\tUser userToBeDeleted = new User(userName,\"\",false);\n\t\tusers.remove(userToBeDeleted);\t\n\t}",
"void removeUser(String uid);",
"public String remove(User u) {\n userRepository.delete(u);\n return \"/user-list.xhml?faces-redirect=true\";\n }",
"@Override\r\n\tpublic void deleteByIdUser(int id) {\n\t\tuserReposotory.deleteById(id);\r\n\t}",
"public void removeUser(String username) {\n userList.remove(username);\n }",
"public void deleteUser(User u) {\n\t\tuserRepository.delete(u);\n\t}",
"public long removeUser(String username) {\n return userRepository.deleteByUsername(username);\n }",
"public void deleteUser(User u) {\n em.remove(em.merge(u));\n\n }",
"@Override\n\tpublic void removeUser(int id) {\n\t\t\n\t}",
"@Override\n public void removeUser(int id) {\n Session session = this.sessionFactory.getCurrentSession();\n User u = (User) session.load(User.class, new Integer(id));\n if(null != u){\n session.delete(u);\n }\n logger.info(\"User deleted successfully, User details=\"+u);\n }",
"public void deleteUser(int id) {\n\t\tuserRepository.delete(id);\r\n\t}",
"@ApiMethod(name = \"removeUser\")\n\tpublic void removeUser(@Named(\"id\") Long id) {\n\t\tEntityManager mgr = getEntityManager();\n\t\ttry {\n\t\t\tUser user = mgr.find(User.class, id);\n\t\t\tmgr.remove(user);\n\t\t} finally {\n\t\t\tmgr.close();\n\t\t}\n\t}",
"public void deleteUser(final Long id) {\n userRepository.deleteById(id);\n }",
"@Descriptor(description = \"Removes a user from the notification list.\")\n public void removeUser(@Descriptor(description = \"username\") String user) {\n logger.info(\"Removing {}\", user);\n service.removeUser(user);\n }",
"@Override\r\n public void clientRemoveUser(User user) throws RemoteException, SQLException\r\n {\r\n gameListClientModel.clientRemoveUser(user);\r\n }",
"@Override\n public boolean deleteUser(User user) {\n return controller.deleteUser(user);\n }",
"@Override\n\tpublic boolean removeUser(int userId){\n\t\ttry {\n\t\t\torderService.removeAllOrderOfAnUser(userId);\n\t\t}catch (BookException e) {\n\t\t\t\n\t\t}\n\t\ttry {\n\t\t\tuserRepository.deleteById(userId);\n\t\t\treturn true;\n\t\t}catch(EmptyResultDataAccessException erdae) {\n\t\t\tthrow new BookException(HttpStatus.NOT_FOUND,\"Invalid User\");\n\t\t}\n\t}",
"public void deleteUser(User user) {\r\n\t\tusersPersistence.deleteUser(user);\r\n\t}",
"public void deleteUser(User user) {\n\t\tdelete(user);\r\n\t}",
"@Test\n public void removeUser() {\n userDAO.createUser(new User(\"dummy\", \"dummy\", 1));\n\n assertTrue(userResource.removeUser(\"dummy\"));\n }",
"@Override\r\n\tpublic void delete(User user) {\n\t\tuserDao.delete(user);\r\n\t}",
"public void deleteUser(User user) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().delete(user);\t\r\n\t\t\r\n\t}",
"public void deleteUser(User userToDelete) throws Exception;",
"@Override\n\tpublic void deleteUser(Long userId) {\n\t\tusersRepo.deleteById(userId);\n\n\t}",
"@Override\n\tpublic void deleteUser(User user) {\n\t\topenSession().createQuery(\"DELETE FROM User where userId =\" + user.getUserId()).executeUpdate();\n\t\t\n\t}",
"@Transactional\n public synchronized void removeUser(User user) throws AmbariException {\n UserEntity userEntity = userDAO.findByPK(user.getUserId());\n if (userEntity != null) {\n removeUser(userEntity);\n } else {\n throw new AmbariException(\"User \" + user + \" doesn't exist\");\n }\n }",
"public void deleteUser(User user) {\n update(\"DELETE FROM user WHERE id = ?\",\n new Object[] {user.getId()});\n }",
"@Override\n public void removeUserById(long id) {\n\n Session session = sessionFactory.openSession();\n Transaction tx = session.beginTransaction();\n User user = (User) session.get(User.class, id);\n session.delete(user);\n tx.commit();\n session.close();\n }",
"public void removeuserById(User user) throws SQLException{\n String SQL = \"DELETE FROM user WHERE id = ? \";\n PreparedStatement ps = connection.prepareStatement(SQL);\n ps.setLong(1, user.getId());\n int result = ps.executeUpdate();\n if(result > 0) System.out.println(\"remoção do usuário \\\"\"+\n user.getName() + \"\\\", concluída com sucesso!\");\n else System.out.println(\"ID não cadastrado, verifique novamente...\");\n ps.close();\n }",
"public void deleteUser(String username);",
"@Override\r\n\tpublic boolean delUser(user user) {\n\t\tif(userdao.deleteByPrimaryKey(user.gettUserid())==1){\r\n\t\t\treturn true;}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}",
"@Override\n\tpublic void removeMember(User user) throws Exception {\n\n\t}",
"public void delete(User user) {\n\t\tuserDao.delete(user);\n\t}",
"@Override\n\tpublic void deleteUser(User user) {\n\t\tiUserDao.deleteUser(user);\n\t}",
"@Override\n\tpublic void delete(User user)\n\t{\n\t\tuserDAO.delete(user);\n\t}",
"@DeleteMapping\n public void deleteUserByUsername(Principal principal) { userService.removeUserByUsername(principal.getName());}",
"public void removeUser(String entity)\n\t{\n\t\tUser user = getUser(entity);\n\t\tif (user != null) {\n\t\t\tusersList.remove(user);\n\t\t\tusers.removeChild(user.userElement);\n\t\t}\n\t}",
"public void deleteUser(String username) {\n profile.deleteUser(username);\n }",
"@Override\n\tpublic Boolean deleteUser(User user) {\n\t\treturn null;\n\t}",
"public boolean delete(User user);",
"void deleteUserById(Long id);",
"public void deleteUser(int id) {\n\t\tet.begin();\n\t\tem.remove(em.find(User.class, id));\n\t\tet.commit();\n\t}",
"@Override\n\tpublic void deleteUser(User user)\n\t{\n\n\t}",
"public void removeUser(String username) {\n PreparedStatement stmt;\n\n // SQL code for delete\n String deleteSQL = \"DELETE FROM USERS WHERE username = ?\";\n try {\n connect();\n // Create SQL statement for deleting\n stmt = this.connection.prepareStatement(deleteSQL);\n stmt.setString(1, username);\n stmt.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n } finally {\n close();\n }\n }",
"public void removeUser(int id) throws AdminPersistenceException {\n CallBackManager.invoke(CallBackManager.ACTION_BEFORE_REMOVE_USER, id, null,\n null);\n \n UserRow user = getUser(id);\n if (user == null)\n return;\n \n SynchroReport.info(\"UserTable.removeUser()\", \"Suppression de \" + user.login\n + \" des groupes dans la base\", null);\n GroupRow[] groups = organization.group.getDirectGroupsOfUser(id);\n for (int i = 0; i < groups.length; i++) {\n organization.group.removeUserFromGroup(id, groups[i].id);\n }\n \n SynchroReport.info(\"UserTable.removeUser()\", \"Suppression de \" + user.login\n + \" des rôles dans la base\", null);\n UserRoleRow[] roles = organization.userRole.getDirectUserRolesOfUser(id);\n for (int i = 0; i < roles.length; i++) {\n organization.userRole.removeUserFromUserRole(id, roles[i].id);\n }\n \n SynchroReport.info(\"UserTable.removeUser()\", \"Suppression de \" + user.login\n + \" en tant que manager d'espace dans la base\", null);\n SpaceUserRoleRow[] spaceRoles = organization.spaceUserRole\n .getDirectSpaceUserRolesOfUser(id);\n for (int i = 0; i < spaceRoles.length; i++) {\n organization.spaceUserRole.removeUserFromSpaceUserRole(id,\n spaceRoles[i].id);\n }\n \n SynchroReport.info(\"UserTable.removeUser()\", \"Delete \" + user.login\n + \" from user favorite space table\", null);\n UserFavoriteSpaceDAO ufsDAO = DAOFactory.getUserFavoriteSpaceDAO();\n if (!ufsDAO.removeUserFavoriteSpace(new UserFavoriteSpaceVO(id, -1))) {\n throw new AdminPersistenceException(\"UserTable.removeUser()\",\n SilverpeasException.ERROR, \"admin.EX_ERR_DELETE_USER\");\n }\n \n SynchroReport.debug(\"UserTable.removeUser()\", \"Suppression de \"\n + user.login + \" (ID=\" + id + \"), requête : \" + DELETE_USER, null);\n \n // updateRelation(DELETE_USER, id);\r\n // Replace the login by a dummy one that must be unique\r\n user.login = \"???REM???\" + Integer.toString(id);\n user.accessLevel = \"R\";\n user.specificId = \"???REM???\" + Integer.toString(id);\n updateRow(UPDATE_USER, user);\n }",
"public void removeByUserId(long userId);",
"public void removeByUserId(long userId);",
"public Boolean DeleteUser(User user){\n\t\t\treturn null;\n\t\t}",
"public void removeUser (ChatContext chatContext, User user) {\n if (chatContext.removeUser(user)) {\n removeContext(chatContext);\n }\n }",
"@Override\r\n\tpublic int deleteUser(Users user) {\n\t\treturn 0;\r\n\t}",
"@Override\n public void delete(User user) {\n dao.delete(user);\n }",
"protected void remove(User<PERM> user) {\n\t\tuserMap.remove(user.principal.getName());\n\t}",
"public void deleteUser(Long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\trepository.deleteById(id);\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\t}",
"public void deleteUser(Integer id) {\n UserModel userModel;\n try {\n userModel = userRepository.findById(id).orElseThrow(IOException::new);\n }\n catch (IOException e) {\n System.out.println(\"User not found\");\n userModel = null;\n }\n userRepository.delete(userModel);\n }",
"@Override\r\n\tpublic void delete(int userId) {\n\t\ttheUserRepository.deleteById(userId);\r\n\t}",
"public void deleteUser(String name);",
"void remove(User user) throws AccessControlException;",
"@Override\n\tpublic void delete(User entity) {\n\t\tuserlist.remove(String.valueOf(entity.getDni()));\n\t}",
"@Override\n\tpublic void deleteOne(User u) {\n\t\tdao.deleteOne(u);\n\t}",
"void deleteUser( String username );",
"public void removeUser(String username){\n \t\tString id = username;\n \t\tString query = \"DELETE FROM users WHERE id = '\"+ id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM friends WHERE id1 = id OR id2 = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM achievements WHERE user = id;\";\n \t\tsqlUpdate(query);\n \t\t\n \t\tquery = \"DELETE FROM notes WHERE source = '\" + id + \"' OR dest = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM challenges WHERE source = '\" + id + \"' OR dest = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t\tquery = \"DELETE FROM requests WHERE source = '\" + id + \"' OR dest = '\" + id + \"';\";\n \t\tsqlUpdate(query);\n \t}",
"void deleteUser(User user, String token) throws AuthenticationException;",
"@Override\r\n\tpublic void delete(UserMain user) {\n\t\tusermaindao.delete(user);\r\n\t}",
"void deleteUserById(Integer id);",
"@Override\n\tpublic void deleteUser(user theUser) {\n\t\t\n\t}",
"public void removeUser(Client user) {\n usersConnected.remove(user.getName());\n }",
"private void removeUser(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tPreferenceDB.removePreferencesUser(Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER)));\n\t\t\tif (UserDB.getnameOfUser(Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER))) == null)\n\t\t\t\tout.print(\"ok\");\n\t\t\tUserDB.removeUser(Long.parseLong(req.getParameter(Constants.USER_IDENTIFIER)));\n\t\t\tout.print(\"ok\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}",
"public void deleteUser(String username){\n \t\tif(!DbManager.users.contains(this.getUserByName(username)))\n \t\t\tthrow new NoSuchElementException();\n \t\t\n \t\tUser deleteUser= getUserByName(username);\n \t\t\n \t\tArrayList<Question> updatedQuestions= new ArrayList<Question>();\n \t\tArrayList<Answer> updatedAnswers= new ArrayList<Answer>();\n \t\tArrayList<Comment> updatedComments = new ArrayList<Comment>();\n \t\tusers.remove(deleteUser);\n \t\t\n \t\t// Delete all questions a user added\n \t\tfor (Question q : DbManager.questions) {\n \t\t\tif (!q.getOwner().equals(deleteUser))\n \t\t\t\tupdatedQuestions.add(q);\n \t\t}\n \t\tDbManager.questions.clear();\n \t\tDbManager.questions.addAll(updatedQuestions);\n \n \t\t// Delete all answers a user added\n \t\tfor (Answer a : DbManager.answers) {\n \t\t\tif (!a.getOwner().equals(deleteUser))\n \t\t\t\tupdatedAnswers.add(a);\n \t\t}\n \t\tDbManager.answers.clear();\n \t\tDbManager.answers.addAll(updatedAnswers);\n \n \t\t// Delete all comments a user added\n \t\tfor (Comment c : DbManager.comments) {\n \t\t\tif (!c.getOwner().equals(deleteUser))\n \t\t\t\tupdatedComments.add(c);\n \t\t}\n \t\tDbManager.comments.clear();\n \t\tDbManager.comments.addAll(updatedComments);\n \t}",
"public void destroy(User user);",
"public void deleteUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USER, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }",
"@Override\n\tpublic void deleteUser() {\n\t\tLog.d(\"HFModuleManager\", \"deleteUser\");\n\t}",
"private void removeUser(int index) {\n ensureUserIsMutable();\n user_.remove(index);\n }",
"@Override\n public boolean deleteUser(User user) {\n return false;\n }",
"@Override\n\tpublic int delete(Users user) {\n\t\t\n\t\treturn userDAO.delete(user);\n\t}",
"@Override\n\tpublic void delete_User(String user_id) {\n\t\tuserInfoDao.delete_User(user_id);\n\t}",
"@SuppressWarnings(\"serial\")\n\tpublic void delUser(final String name) throws Exception{\n\t\tUserRegistry ur = UserRegistry.findOrCreate(doc);\n\t\tUsers users = Users.findOrCreate(ur);\n\t\tusers.deleteChildren(User.TAG,new HashMap<String,String>(){{\n\t\t\tput(\"name\",name);\n\t\t}});\n\t\tdelAllMember(name);\n\t}",
"public User delete(String user);",
"public boolean removeUser(String username) {\n return userDAO.removeUser(username);\n }",
"public boolean remove(String username){\n\t\t\n\t\tboolean removed = false;\n\t\t\n\t\tUser removable = this.findUser(username);\t\t\t\t\t\t\t/* ====> Find User that needs to be removed */\n\t\t\n\t\tif(removable != head){\t\t\t\t\t\t\t\t\t\t\t\t/* ====> If the findUser found a match, so the returned User != head */\n\t\t\tif(removable.getNext()!= null){\n\t\t\t\tremovable.getNext().setPrev(removable.getPrev());\t\t\t/* ====> If User is not tail */\n\t\t\t\tremovable.getPrev().setNext(removable.getNext());\n\t\t\t\tremovable.setNext(null);\n\t\t\t\tremovable.setPrev(null);\n }\n else {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* ====> If User is tail */\n \tremovable.getPrev().setNext(null);\n removable.setNext(null);\n removable.setPrev(null);\n }\n \n removed = true;\t\t\t\t\t\t\t\t\t\t\t\t/* ====> User has been deleted */\n\t\t}\n\t\t\n else{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/* ====> If the findUser did not find a match, so the returned User == head */\n \tremoved = false;\t\t\t\t\t\t\t\t\t\t\t\t/* ====> User has not been deleted */\n }\n \n \n return removed; \t\t\t\t\t\t\t\t\t\t\t\t\n\t}",
"void deleteUser(String username) throws UserDaoException;",
"@Override\n\tpublic User deleteUser(Account account) {\n\t\treturn usersHashtable.remove(account);\n\t\t\n\t}",
"@Transactional\n public synchronized void removeUser(UserEntity userEntity) throws AmbariException {\n if (userEntity != null) {\n if (!isUserCanBeRemoved(userEntity)) {\n throw new AmbariException(\"Could not remove user \" + userEntity.getUserName() +\n \". System should have at least one administrator.\");\n }\n userDAO.remove(userEntity);\n }\n }",
"public synchronized void deleteUser(String username) {\r\n\t\tif (!mapping.containsKey(username)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tmapping.remove(username);\r\n\t\tthis.storer.deleteUser(username);\r\n\t}",
"public void deleteUser(String login) {\n userRepository.findOneByLogin(login).ifPresent(user -> {\n userRepository.delete(user);\n log.debug(\"Deleted User: {}\", user);\n });\n }",
"public void delete(int id){\n\t\tuserRepository.delete(id);\n\t}",
"public void deleteUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk deleteUser\");\r\n\t}"
] | [
"0.7453132",
"0.74295026",
"0.7418169",
"0.7364434",
"0.7312969",
"0.73031366",
"0.72826153",
"0.7228972",
"0.71249425",
"0.70796317",
"0.7050405",
"0.7019634",
"0.69941676",
"0.69579893",
"0.69560534",
"0.69142824",
"0.6910119",
"0.6897394",
"0.6885726",
"0.6852698",
"0.6846802",
"0.68447167",
"0.6837894",
"0.67965776",
"0.6788462",
"0.67818266",
"0.6772871",
"0.6770093",
"0.6766658",
"0.67660147",
"0.67484885",
"0.672507",
"0.67226577",
"0.6680529",
"0.66763186",
"0.66741604",
"0.6668883",
"0.6651953",
"0.6646922",
"0.6631031",
"0.6624772",
"0.6623083",
"0.6612694",
"0.66110355",
"0.66018766",
"0.6594026",
"0.65878695",
"0.6576823",
"0.6546136",
"0.6539283",
"0.6538825",
"0.6538213",
"0.6536682",
"0.6527842",
"0.6514465",
"0.65093124",
"0.6502778",
"0.64959925",
"0.64900035",
"0.6482802",
"0.64801025",
"0.64801025",
"0.6473706",
"0.64691573",
"0.6465996",
"0.6460221",
"0.6457148",
"0.6453283",
"0.64495975",
"0.64490074",
"0.64489937",
"0.64424926",
"0.64404935",
"0.64350796",
"0.6425173",
"0.641887",
"0.6407125",
"0.6406151",
"0.639498",
"0.6392754",
"0.6389675",
"0.6387365",
"0.6386945",
"0.6386421",
"0.6382095",
"0.6379691",
"0.63616985",
"0.6360652",
"0.6360526",
"0.63562363",
"0.6355609",
"0.635513",
"0.63503903",
"0.6349264",
"0.6344654",
"0.6342968",
"0.6340008",
"0.6339596",
"0.6335675",
"0.6331198",
"0.6327718"
] | 0.0 | -1 |
Getter for field "gamers" | public List<User> getUsers() {
return Collections.unmodifiableList(this.users);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getGamenumber() {\n\t\treturn this.gamenumber;\n\t}",
"public int getGears();",
"public Gamygdala getGamygdala() {\n return this.gamygdala;\n }",
"public String getGrams() {\n return grams;\n }",
"protected float[] getGenes() {\n\t\t\treturn genes;\n\t\t}",
"public HashMap<String, Game> getGames() {\n return games;\n }",
"public HashMap<String, Game> getGames() {\n return games;\n }",
"public float getG() {\r\n\t\treturn g;\r\n\t}",
"public int getG() {\r\n\t\treturn g;\r\n\t}",
"public Game getGame () {\n return game;\n }",
"public int getG();",
"public Game getGame() {\r\n return game;\r\n }",
"public String getGg() {\n return gg;\n }",
"public Game getGame() {\n return game;\n }",
"public Game getGame() {\n return game;\n }",
"public Game getGame() {\n return game;\n }",
"public Game getGame() {\n return game;\n }",
"public Game getGame()\n {\n return game;\n }",
"@NonNull\n public final List<Genres> getGenres() {\n return this.genres;\n }",
"public Game getGame()\n\t{\n\t\treturn game;\n\t}",
"public double getG();",
"public Game getGame() {\r\n\t\treturn _game;\r\n\t}",
"public Game getGame() {\n\t\treturn game;\n\t}",
"public int getLegs() {\n return legs;\n }",
"public int getGamesPlayed() {\n return gamesPlayed;\n }",
"@Override\n\tpublic ArrayList<GameObject> getGmob() {\n\t\treturn gmob;\n\t}",
"public List<Game> getGameList() {\n return this.games;\n }",
"public int getF_GScored() {\n return f_gScored;\n }",
"public int getGanadas(){\n\t\treturn ganadas;\n\t}",
"public LinkedList<SoccerGames> getGames() {\n return this.games;\n }",
"public byte[] getG() {\n return g;\n }",
"@Override\n public GameField getField(){\n return this.gameField;\n }",
"public Double getGigRanking() {\n return gigRanking;\n }",
"public Fogger getFogger() {\n return fogger_;\n }",
"public Map<String, Gene> getGenes() {\n return genes;\n }",
"protected Game getGame() {\n return game;\n }",
"public HashMap<String, Integer> getGenders() {\n return genders;\n }",
"protected Game getGame(){\n\t\treturn game;\n\t}",
"public double getGpa() {\n return gpa;\n }",
"public int getJams() {\n return jams;\n }",
"public String[] getGhostsInLevel(){\n\t\treturn ghosts_in_level;\n\t}",
"public String[][] getGame() {\n return game;\n }",
"public double getGpa(){\n return this.gpa;\n }",
"public Float getGrsds() {\n return grsds;\n }",
"public int getgNum() {\r\n\t\treturn gNum;\r\n\t}",
"public Game getGame() {\n\t\treturn gbuilder.getGameProduct();\n\t}",
"public double getGy() {\n return mGy;\n }",
"public String getGigName() {\n return gigName;\n }",
"public long getgNum() {\n return gNum;\n }",
"public double getMaxGs()\n {\n return this.max_gs;\n }",
"public synchronized List<Game> getGameList() {\n return games;\n }",
"public ArrayList<ArrayList<Sag>> getSager() {\n return sager;\n }",
"public Ghost[] getGhosts()\n\t{\n\t\treturn ghosts;\n\t}",
"public ArrayList <EggAbstract> getEggs() {\n\t\t//not checking if x is valid because that depends on the coordinate system\n\t\treturn eggs;\n\t}",
"public ArrayList<Flight> legs()\n {\n \t return this.mLegs;\n }",
"public boolean getGarage()\n {\n return m_bGarageLock;\n }",
"public String getGameName() {\n return gameName;\n }",
"public String getGameNumber() {\n return gameNumber;\n }",
"public GUIGameflow getGame() {\n return game;\n }",
"public SignedInGamer getSignedInGamer()\n\t{\n\t\treturn gamer;\n\t}",
"public double getGz() {\n return mGz;\n }",
"public int getGrade() {\n return grade;\n }",
"public String getGh() {\n return gh;\n }",
"public static Game getGame() {\n return game;\n }",
"public Integer getGid() {\r\n return gid;\r\n }",
"public int getGenre() {\n return genre;\n }",
"public GameLogic getGame(){\n\t\treturn game;\n\t}",
"public Float getGwsalary() {\n return gwsalary;\n }",
"public int getGusta() {\r\n\t\treturn gusta;\r\n\t}",
"public String getGearIdProperty() \n {\n return \"gear_id\";\n }",
"public Integer getGid() {\n return gid;\n }",
"public BowlingGame getGame();",
"public int getGrade() { return grade; }",
"public void setGears(int gears);",
"public static Game getGame() {\n\t\treturn game;\n\t}",
"public Genre getGenre() {\n\n return genre;\n }",
"@Override\r\n\tpublic double getStoredGazeScore() {\n\t\treturn this.gazeScore;\r\n\t}",
"public boolean getHaveGame()\n\t{\n\t\treturn this.haveGame;\n\t}",
"public List<Game> getGameList() {\n return gameList;\n }",
"int getG();",
"public static Game getGame() {\r\n\t\treturn game;\r\n\t}",
"public Genre getGenre() {\n return genre;\n }",
"public Genre getGenre() {\n return genre;\n }",
"public boolean isGear() {\n\t\treturn gear;\n\t}",
"public int getGov();",
"public float getGravity()\n {\n return gravity;\n }",
"public GameProperty [] getGameProperties() {\n return this.GameProperties;\n }",
"public int[] getDamage(){\n\t\treturn shipDamage;\n\t}",
"public boolean[][] getGameField()\n\t{\n\t\treturn this.gameField;\n\t}",
"public String[] getGallery() {\n return gallery;\n }",
"public int getGems() {\n\t\treturn gems;\n\t}",
"int getRoaches()\n {\n return roaches;\n }",
"public int getPassengers(){\n return this.passengers;\n }",
"public ArrayList<Game> getGames() {\n\n if (games != null)\n return new ArrayList<>(games.values());\n else\n return new ArrayList<>();\n\n }",
"public int getGold(){\n return this.gold;\n }",
"public int getGameX(){return this.gameX;}",
"public Integer getGameScore() {\n return gameScore;\n }",
"public GradeInfo[] getGradeInfo() {\n return gradeInfo;\n }",
"public static Set<Game> getArcadeGames() {\n\t\treturn gameSet;\n\t}",
"public int getG_number() {\n\t\treturn g_number;\n\t}",
"public int getGrade(){\n return grade;\n }"
] | [
"0.7117053",
"0.6658805",
"0.6653545",
"0.6496903",
"0.6451107",
"0.62261695",
"0.62261695",
"0.6223226",
"0.6213296",
"0.6174957",
"0.6145147",
"0.611461",
"0.6095773",
"0.6087747",
"0.6087747",
"0.6087747",
"0.6087747",
"0.6086786",
"0.607833",
"0.60531414",
"0.6046338",
"0.5979314",
"0.5966223",
"0.59495735",
"0.59493965",
"0.590367",
"0.5861085",
"0.5856313",
"0.5855092",
"0.5845294",
"0.5828511",
"0.5825724",
"0.5812289",
"0.5809152",
"0.5804562",
"0.5803815",
"0.57931846",
"0.57912004",
"0.5783439",
"0.57761925",
"0.57749313",
"0.5766068",
"0.57638997",
"0.575116",
"0.5747861",
"0.5735458",
"0.57173026",
"0.57156783",
"0.5699502",
"0.5696136",
"0.56959283",
"0.5687042",
"0.5685749",
"0.56768996",
"0.5676815",
"0.56639993",
"0.5644548",
"0.56340516",
"0.56190586",
"0.5613185",
"0.5610047",
"0.5605363",
"0.5598902",
"0.5598232",
"0.55977035",
"0.5596452",
"0.55921686",
"0.5588256",
"0.55869985",
"0.55621016",
"0.5549038",
"0.5544637",
"0.55420977",
"0.5538371",
"0.5538193",
"0.55349064",
"0.5534018",
"0.5533037",
"0.55330324",
"0.55323035",
"0.5530758",
"0.55293363",
"0.55293363",
"0.5526652",
"0.5525476",
"0.55210704",
"0.5513995",
"0.5506011",
"0.5501074",
"0.54974127",
"0.549129",
"0.54911727",
"0.548482",
"0.5479047",
"0.54775214",
"0.5472075",
"0.54629457",
"0.5459677",
"0.54557616",
"0.5449757",
"0.5441916"
] | 0.0 | -1 |
Method finds a user by value of identifier. | private User findById(String id) {
User result = new NullUserOfDB();
for (User user : this.users) {
if (user.getId().equals(id)) {
result = user;
break;
}
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String searchForUser() {\n String userId = \"\";\n String response = given().\n get(\"/users\").then().extract().asString();\n List usernameId = from(response).getList(\"findAll { it.username.equals(\\\"Samantha\\\") }.id\");\n if (!usernameId.isEmpty()) {\n userId = usernameId.get(0).toString();\n }\n return userId;\n }",
"public int search_userid(String user_name);",
"public String findUser(String id) throws UserNotFoundException{\n\t\tString userFound = \"\";\n\t\tfor (int i = 0; i < users.size(); i++) {\n\t\t\tif (users.get(i).getDocumentNumber().equals(id)) {\n\t\t\t\tuserFound = \"\\n-------USER-------\\n\"+users.get(i).toString();\n\t\t\t}\n\t\t}\n\t\tif (userFound.equals(\"\")) {\n\t\t\tthrow new UserNotFoundException(id);\n\t\t}\n\t\telse {\n\t\t\treturn userFound;\n\t\t}\n\t}",
"@Override\r\n\tpublic User searchUser(Integer id) {\n\t\treturn userReposotory.getById(id);\r\n\t}",
"public User getSpecificUser(String username);",
"User findUser(String userId);",
"public User getUser(Integer id)\n\t{\n\t\t// Create an user -1 for when it isn't in the list\n\t\tUser searchUser = new User();\n\t\t// Index: User's position in the list\n\t\tint index = this.getUserById(id.intValue());\n\t\t// If the user is in the list execute the action\n\t\tif(index != -1)\n\t\t{\n\t\t\tsearchUser = this.usersList.get(index);\n\t\t}\n\t\t\n\t\treturn searchUser;\n\t}",
"@Override\r\n\tpublic Userinfo findbyid(int id) {\n\t\treturn userDAO.searchUserById(id);\r\n\t}",
"Userinfo selectByPrimaryKey(String userId);",
"UUID getUserId(String userName) throws UserNotFoundException;",
"public User search_userinfo(String user_name);",
"public User getUserById(String id){\n\t\tUser e;\n\t\tfor (int i = 0 ; i < users.size() ; i++){\n\t\t\te = users.get(i);\n\t\t\tif (e.getId().equals(id))\n\t\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n\tpublic AnswerCustom finduser(Integer id) throws Exception {\n\t\treturn null;\n\t}",
"public User findUser(int id) {\n for (int i = 0; i < allUsers.size(); i++) {\n if (allUsers.get(i).getId() == id) {\n return allUsers.get(i);\n }\n }\n return null;\n }",
"public static User findUserById(int id) {\n\n User user = null;\n User targetUser = new User();\n IdentityMap<User> userIdentityMap = IdentityMap.getInstance(targetUser);\n\n String findUserById = \"SELECT * FROM public.member \"\n + \"WHERE id = '\" + id + \"'\";\n\n PreparedStatement stmt = DBConnection.prepare(findUserById);\n\n try {\n ResultSet rs = stmt.executeQuery();\n while(rs.next()) {\n user = load(rs);\n }\n DBConnection.close(stmt);\n rs.close();\n\n } catch (SQLException e) {\n System.out.println(\"Exception!\");\n e.printStackTrace();\n }\n if(user != null) {\n targetUser = userIdentityMap.get(user.getId());\n if(targetUser == null) {\n userIdentityMap.put(user.getId(), user);\n return user;\n }\n else\n return targetUser;\n }\n return user;\n }",
"public UserInformation findInformationById(int id);",
"public User getRegUserFromId(int userId){\n for (int i = 0; i < regUsers.size(); i++){\n if (regUsers.get(i).getUserId() == userId){\n return regUsers.get(i);\n }\n }\n\n return null;\n }",
"public ExternalUser getUser(ExternalUser requestingUser, String userIdentifier);",
"@Override\n\tpublic User findUser(Integer i) {\n\t\treturn this.userservice.find(i);\n\t}",
"public Future<io.remicro.saga.entities.tables.pojos.Person> findOneByUserId(String value) {\n return findOneByCondition(Person.PERSON.USER_ID.eq(value));\n }",
"User getUserById(int id);",
"private int getUserById(int id)\n\t{\n\t\tint index = -1;\n\t\t// Search the user in the list\n\t\tfor(int i = 0; i < this.usersList.size(); i++)\n\t\t{\n\t\t\tif(this.usersList.get(i).getId() == id)\n\t\t\t{\n\t\t\t\tindex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Return the index \n\t\treturn index;\n\t}",
"User find(long id);",
"public User getUserbyUid(Integer uid);",
"SysUser selectByPrimaryKey(Long userId);",
"@Override\n\tpublic String nameFind(String user_id) {\n\t\treturn mapper.nameFind(user_id);\n\t}",
"public Users searchUser(String uidkey) throws Exception {\n\t\tUsers user = null;\n\t\ttry {\n\t\t\tConnection connection = this.getConnection();\n\t\t\tPreparedStatement stmt = connection.prepareStatement(\n\t\t\t\t\t\"SELECT * FROM users WHERE id=(?)\");\n\t\t\tstmt.setString(1,uidkey);\n\t\t\tResultSet rs = stmt.executeQuery();\n\n\t\t\twhile(rs.next()) {\n\t\t\t\tuser = new Users(rs.getString(1),rs.getString(2));\n\t\t\t\tuser.setGender(rs.getString(3).charAt(0));\n\t\t\t\tuser.setHeight(rs.getDouble(4));\n\t\t\t\tuser.setWeight(rs.getDouble(5));\n\t\t\t\tuser.setAge(rs.getInt(6));\n\t\t\t\tuser.setStage(rs.getString(7));\n\t\t\t\tuser.setSubStage(rs.getInt(8));\n\n\t\t\t\tuser.setExercise(rs.getInt(9));\n\t\t \t\tuser.setBodyFat(rs.getDouble(10));\n\t\t \t\tuser.setCalories(rs.getInt(11));\n\t\t \t\tuser.setCarbs(rs.getDouble(12));\n\t\t \t\tuser.setProtein(rs.getDouble(13));\n\t\t \t\tuser.setVegfruit(rs.getDouble(14));\n\t\t \t\tArray a = rs.getArray(15);\n\t\t \t\tBoolean[] b = (Boolean[])a.getArray();\n\t\t \t\tuser.setEatingHabits(b);\n\t\t \t\tuser.setOtherInfo(rs.getString(16));\n\t\t \t\tuser.setAssessmentScore(rs.getInt(17));\n\t\t\t\tuser.setBudget(rs.getDouble(18));\n\t\t\t}\n\t\t\trs.close();\n\t\t\tstmt.close();\n\t\t\tconnection.close();\n\n\n\t\t} catch (Exception e) {\n\t\t\tlog.info(e.getMessage());\n\t\t}\n\t\tfinally {\n\n\t\t}\n\n\n\t\tif(user != null)\t{\n\t\t\treturn user;\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"NOT FOUND\");\n\t\t}\n\t}",
"public int UserNamePresent(String search) {\n\t\tint item = -1;\n\t\tfor (int i = 0; i < CarerAccounts.size(); ++i) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n item = CarerAccounts.get(i).getID();\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}",
"public User findById ( int id) {\n\t\t return users.stream().filter( user -> user.getId().equals(id)).findAny().orElse(null);\n\t}",
"User getUser(Long id);",
"public User findUser(int id)\n\t\t{\n\t\t\tfor (int i = 0; i < users.size(); i++)\n\t\t\t{\n\t\t\t\tif (id == (users.get(i).getId()))\n\t\t\t\t{\n\t\t\t\t\treturn users.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}",
"@Override\r\n\tpublic Userinfo findbyname(String name) {\n\t\treturn userDAO.searchUserByName(name);\r\n\t}",
"public UserEntity findByPrimaryKey(String userId) throws FinderException;",
"public User findUserById(int id);",
"public AlarmUser getUser(String ID) {\n\t\tListIterator<AlarmUser> userList = users.listIterator();\n\t\t\n\t\tlogger.log(\"Looking for User by ID \" + ID, Level.TRACE);\n\t\t\n\t\twhile(userList.hasNext()) {\n\t\t\tAlarmUser theUser = userList.next();\n\t\t\tif(theUser.getID().equals(ID)) {\n\t\t\t\tlogger.log(\"Found User \" + ID, Level.TRACE);\n\t\t\t\treturn theUser;\n\t\t\t}\n\t\t}\n\t\t\n\t\tlogger.log(\"User \" + ID + \" not found! Adding new user of ID: \" + ID, Level.TRACE);\n\t\treturn addUser(ID);\n\t\t\n\t}",
"java.lang.String getUserIdOne();",
"BaseUser selectByPrimaryKey(String userId);",
"User get(Key id);",
"@Override\n\tpublic boolean findUser(String findId) {\n\t\tif(session.selectOne(namespace + \".searchUser\", findId) != null)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public User getUserFromID(String id) {\r\n // Gets the collection of users and creates a query\r\n MongoCollection<Document> users = mongoDB.getCollection(\"Users\");\r\n Document query = new Document(\"_id\", new ObjectId(id));\r\n\r\n // Loops over users found matching the details, returning the first one\r\n for (User user : users.find(query, User.class)) {\r\n return user;\r\n }\r\n\r\n // Returns null if none are found\r\n return null;\r\n }",
"User getUserById(Long id);",
"User getUserById(Long id);",
"public AgtUser findUserByName(String username);",
"public com.ims.dataAccess.tables.pojos.User fetchOneByUserid(Integer value) {\n return fetchOne(User.USER.USERID, value);\n }",
"public User read(String id);",
"public long searchID(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select _id, username from \" + TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n long id = -1;\n String uname;\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(1);\n if (uname.equals(username)) {\n id = cursor.getLong(cursor.getColumnIndex(ROW_ID));\n }\n } while (cursor.moveToNext());\n }\n return id;\n }",
"public User getUserById(Long id) throws Exception;",
"public User getUser(String uid) {\n Enumeration<Object> enumeration = elements();\n while(enumeration.hasMoreElements()){\n User user = (User)enumeration.nextElement();\n if(uid.equals(user.getUid().toString())) {\n return user;\n }\n }\n throw new NoSuchElementException();\n }",
"public List<User> searchUser(String searchValue);",
"User selectByPrimaryKey(Integer uid);",
"public User get(String emailID);",
"public User findUser(int id) {\n\n\t\ttry {\n\t\t\tConnection conn = getConnection();\n\t\t\tPreparedStatement ps = conn.prepareStatement(\"select * from users where id = ?\");\n\t\t\tps.setInt(1, id);\n\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tUser foundUser = new User(id, rs.getString(2), rs.getString(3), rs.getString(5),\n\t\t\t\t\t\trs.getDate(6));\n\t\t\t\tconn.close();\n\t\t\t\treturn foundUser;\n\n\t\t\t}\n\t\t\tconn.close();\n\n\t\t} catch (SQLException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\treturn null;\n\t}",
"public User getUserById(Long userId);",
"public Users findByUserid(String id) {\n\tthis.createConnection();\n\n try {\n Connection con = this.getCon();\n PreparedStatement stmnt = con.prepareStatement(\"select * from user where id=?;\");\n stmnt.setString(1, id);\n ResultSet rs = stmnt.executeQuery();\n return get(rs);\n } catch (SQLException e) {\n System.out.println(\"SQLException: \");\n return new Users();\n }\n }",
"User findUserById(Long id) throws Exception;",
"public User getUserFromId(int userId){\n for (int i = 0; i < regUsers.size(); i++){\n if (regUsers.get(i).getUserId() == userId){\n return regUsers.get(i);\n }\n }\n\n for (int i = 0; i < adminUsers.size(); i++){\n if (adminUsers.get(i).getUserId() == userId){\n return adminUsers.get(i);\n }\n }\n return null;\n }",
"@Override\r\n public IUser getUserByUserId(String id)\r\n {\r\n EntityManager em = getEntityManager();\r\n\r\n try\r\n {\r\n return em.find(User.class, id);\r\n }\r\n finally\r\n {\r\n em.close();\r\n }\r\n }",
"@Override\r\n\tpublic UserMain findId(String id) {\n\t\treturn (UserMain) usermaindao.findbyId(id).get(0);\r\n\t}",
"public User findUser(String username) {\n if (userList.containsKey(username)) {\n return userList.get(username);\n } else {\n throw new NoSuchElementException(\"User Not Found.\");\n }\n }",
"public static User findUserByName(String username) {\n\n User user = null;\n User targetUser = new User();\n IdentityMap<User> userIdentityMap = IdentityMap.getInstance(targetUser);\n\n String findUserByName = \"SELECT * FROM public.member \"\n + \"WHERE name = '\" + username + \"'\";\n\n PreparedStatement stmt = DBConnection.prepare(findUserByName);\n\n try {\n ResultSet rs = stmt.executeQuery();\n while(rs.next()) {\n user = load(rs);\n }\n DBConnection.close(stmt);\n rs.close();\n } catch (SQLException e) {\n System.out.println(\"Exception!\");\n e.printStackTrace();\n }\n if(user != null) {\n targetUser = userIdentityMap.get(user.getId());\n if(targetUser == null) {\n userIdentityMap.put(user.getId(), user);\n return user;\n }\n else\n return targetUser;\n }\n\n return user;\n }",
"UserDetails get(String id);",
"public User getUserById(String userid) {\n return users.stream()\n .filter(e -> e.getUserid().equals(userid))\n .findFirst()\n .orElseThrow(() -> new IllegalArgumentException(\"No such user found with user id: \" + userid));\n }",
"User findByExternalId(String externalId) throws UsernameNotFoundException;",
"User selectByPrimaryKey(String id);",
"User getUser(String userId);",
"public User getUserByUserName(String username);",
"@Override\n\tpublic User findByKey(Integer id) {\n\t\treturn null;\n\t}",
"WbUser selectByPrimaryKey(Integer userId);",
"UserInfo getUserById(Integer user_id);",
"public User getById(String id){\n List<User> users = userRepo.findAll();\n for (User user : users){\n if(user.getGoogleId().equals(id)){\n return user;\n }\n }\n throw new UserNotFoundException(\"\");\n }",
"User getUserByUsername(String username);",
"User getUserByUsername(String username);",
"User getUserByUsername(String username);",
"@Override\n public UserInfo findById(int id) {\n TypedQuery<UserInfo> query = entityManager.createNamedQuery(\"findUserById\", UserInfo.class);\n query.setParameter(\"id\", id);\n return query.getSingleResult();\n }",
"public User user(long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\treturn user.get();\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\n\t}",
"UserDO selectByPrimaryKey(Integer userCode);",
"ROmUsers selectByPrimaryKey(String pkUserid);",
"@Override\r\n\tpublic User getUserById(int id) {\n\t\treturn userMapper.selById(id);\r\n\t}",
"User selectByPrimaryKey(Long userId);",
"public User getUserByUserName(String userName);",
"UUser selectByPrimaryKey(Integer id);",
"@Override\r\n\tpublic SysUser findUserById(String userid) {\n\t\treturn sysUserMapper.findUserById(userid);\r\n\t}",
"public User getUserByID(IUser user){\n for(User u : Users){\n if(u.getUser() == user){\n return u;\n }\n }\n return null;\n }",
"public User findUserById (long id){\n if(userRepository.existsById(id)){\n return this.userRepository.findById(id);\n }else{\n throw new UnknownUserException(\"This user doesn't exist in our database\");\n }\n }",
"public EOSUser findUser(String login) throws EOSNotFoundException;",
"public User getUserData(String id);",
"public User getUserByUsername(String username);",
"java.lang.String getUserId();",
"java.lang.String getUserId();",
"java.lang.String getUserId();",
"User findUserById(int id);",
"User getOne(long id) throws NotFoundException;",
"@Override\r\n\tpublic User user(int id) {\r\n\t\tMap<String,String> map = getOne(SELECT_USERS+ WHERE_ID, id);\r\n\t\tif(map!= null){\r\n\t\t\treturn IMappable.fromMap(User.class, map);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public User getUser(int id){\n \n Session session = HibernateUtil.getSessionFactory().openSession();\n Transaction tx = null;\n User user = null;\n try {\n tx = session.beginTransaction();\n\n // Add restriction to get user with username\n Criterion emailCr = Restrictions.idEq(id);\n Criteria cr = session.createCriteria(User.class);\n cr.add(emailCr);\n user = (User)cr.uniqueResult();\n tx.commit();\n } catch (HibernateException e) {\n if (tx != null)\n tx.rollback();\n log.fatal(e);\n } finally {\n session.close();\n }\n return user;\n }",
"public Future<ExtendedUser> getUserById(\n String identifier,\n SessionData sessionData) {\n Objects.requireNonNull(identifier, \"identifier cannot be null\");\n Objects.requireNonNull(sessionData, \"sessionData cannot be null\");\n log.debug(\"getUserById identifier:{}\", identifier);\n\n final Map<String, String> headers = new HashMap<>();\n headers.put(\"accept\", \"application/json\");\n\n final GetUserByIdentifierRequestData getUserByBarcodeRequestData =\n new GetUserByIdentifierRequestData(identifier, headers, sessionData);\n final Future<IResource> result = resourceProvider.retrieveResource(getUserByBarcodeRequestData);\n\n log.debug(\"Users lookup success is {}\", result.succeeded());\n\n return result\n .otherwise(() -> null)\n .map(IResource::getResource)\n .map(this::getUserFromList)\n .compose(user -> {\n Future<IResource> blResult;\n if (user != null) {\n log.debug(\"Getting extended user info for id {}\", user.getId());\n final GetExtendedUserData getExtendedUserData =\n new GetExtendedUserData(user.getId(), headers, sessionData);\n log.debug(\"Path for extended user lookup is {}\", getExtendedUserData.getPath());\n blResult = resourceProvider.retrieveResource(getExtendedUserData);\n } else {\n blResult = Future.failedFuture(\"Invalid User\");\n }\n return blResult\n .otherwise(() -> null)\n .compose(extendedUserResult -> {\n if (blResult.failed()) {\n return Future.succeededFuture(null);\n } else {\n JsonObject extendedUserJson = extendedUserResult.getResource();\n log.debug(\"Got extended user JSON: {}\", extendedUserJson.encode());\n JsonObject patronGroupJson = extendedUserJson.getJsonObject(\"patronGroup\");\n ExtendedUser extendedUser = new ExtendedUser();\n extendedUser.setUser(user);\n if (patronGroupJson != null) {\n extendedUser.setPatronGroup(\n patronGroupJson.getString(\"group\"),\n patronGroupJson.getString(\"desc\"),\n patronGroupJson.getString(\"id\")\n );\n }\n return Future.succeededFuture(extendedUser);\n }\n });\n });\n }",
"public User getUser(String username);",
"public User findById(int userId);",
"User getUser(String userName) throws UserNotFoundException;",
"public SecurityUser findByName(String username);",
"@Override\n\tpublic AppUser getUserById(int id) {\n\t\tAppUser user = store.get(id);\n return user;\n\t\t\n\t}"
] | [
"0.72420645",
"0.7216658",
"0.70403624",
"0.69992274",
"0.6899173",
"0.6859954",
"0.6827358",
"0.6825434",
"0.67249733",
"0.6717869",
"0.6700821",
"0.6678385",
"0.6676899",
"0.6630751",
"0.65892094",
"0.6554639",
"0.6552344",
"0.65055174",
"0.6503208",
"0.6492552",
"0.64906806",
"0.64847046",
"0.6473737",
"0.6459324",
"0.6450179",
"0.6449306",
"0.64471316",
"0.64432037",
"0.6439816",
"0.6432115",
"0.64313155",
"0.6420699",
"0.64157784",
"0.64150053",
"0.64053464",
"0.6405271",
"0.6397918",
"0.6397649",
"0.63927335",
"0.63845146",
"0.6378587",
"0.6378587",
"0.6370493",
"0.6366811",
"0.6364709",
"0.635653",
"0.63555545",
"0.63517773",
"0.63499683",
"0.6346404",
"0.6346129",
"0.6342948",
"0.6321968",
"0.630838",
"0.63081425",
"0.63079745",
"0.6307278",
"0.6291464",
"0.6283305",
"0.6271242",
"0.6269945",
"0.6266663",
"0.62660956",
"0.6261455",
"0.62492",
"0.6243852",
"0.6242156",
"0.62405163",
"0.6237083",
"0.6230771",
"0.62206453",
"0.62206453",
"0.62206453",
"0.6217476",
"0.62150055",
"0.62103474",
"0.6209256",
"0.6192847",
"0.6190546",
"0.6189411",
"0.6185835",
"0.61840487",
"0.6180133",
"0.61800694",
"0.6176463",
"0.61750805",
"0.6174212",
"0.6171165",
"0.6171165",
"0.6171165",
"0.6171022",
"0.6167701",
"0.61632293",
"0.6160733",
"0.6160246",
"0.6158229",
"0.6157059",
"0.61556745",
"0.6151335",
"0.6151254"
] | 0.6598631 | 14 |
Method checks unique value of name for user. | private boolean isNameUnique(String name) {
boolean isUnique = true;
for (User user : this.users) {
if (user.getName().equals(name)) {
isUnique = false;
break;
}
}
return isUnique;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean checkUserNameIsOccupied(String name) {\n \t\tif (users.size() != 0) {\n \t\t\tfor (int i = 0; i < users.size(); i++) {\n \t\t\t\tif (name.equals(users.get(i).getName())) {\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\treturn false;\n \t}",
"public boolean findUserIsExist(String name) {\n\t\treturn false;\r\n\t}",
"public boolean userNameExist(String username);",
"public boolean checkUsername(String user) {\n\n }",
"private String checkName(String name){\n\n if(name.isBlank()){\n name = \"guest\";\n }\n int i = 1;\n if(users.contains(name)) {\n while (users.contains(name + i)) {\n i++;\n }\n name+=i;\n }\n return name;\n }",
"private boolean checkNameExistModify(String userName, Integer id) {\n\n\t\tUser user = this.userDAO.getUserByName(userName);\n\t\tif (null != user && id != user.getUserId()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"boolean hasUserName();",
"private boolean checkUserame(String name) throws SQLException {\n\t\tcheckUserameStatement.clearParameters();\n\t\tcheckUserameStatement.setString(1, name);\n\t\tResultSet result = checkUserameStatement.executeQuery();\n\t\tresult.next();\n\t\tboolean out = result.getInt(1) == 1;\n\t\tif (DEBUG) {\n\t\t\tSystem.out.println(\"checkUserame: \"+result.getInt(1)+\"\\n\");\n\t\t}\n\t\tresult.close();\n\t\treturn out;\n\t}",
"private int checkUserExists(String name)\r\n\t{\r\n\t\tfor (int i = 0; i < numOfUsers; i++)\r\n\t\t{\r\n\t\t\tif (name.equals(userAccounts[0][i]))\r\n\t\t\t\treturn i;\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"public boolean checkUserName(TextField userName) {\n String userNameSQL = \"SELECT * FROM user WHERE user_name = ? \";\n ResultSet rsUser;\n boolean username_exists = false;\n\n\n try {\n\n PreparedStatement userPST = connection.prepareStatement(userNameSQL);\n userPST.setString(1, userName.getText());\n rsUser = userPST.executeQuery();\n\n if (rsUser.next()) {\n username_exists = true;\n outputText.setStyle(\"-fx-text-fill: #d33232\");\n outputText.setText(\"Username Already Exists\");\n }\n\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n\n return username_exists;\n\n }",
"public boolean isRegisteredUserName(String userName);",
"private boolean checkProfileNameUniqueness(boolean userDialog) {\r\n\t\tboolean duplicateNameOccours = false;\r\n\t\t/**\r\n\t\t * Over the new imported profiles\r\n\t\t */\r\n\t\tfor (int i = 0; i < parsedProfiles.size(); i++) {\r\n\t\t\tCurve p = parsedProfiles.get(i);\r\n\t\t\t/**\r\n\t\t\t * Handle the case that the profile name is not unique\r\n\t\t\t */\r\n\t\t\tif (!controller.isProfileNameGlobalUnique(p.getName())\r\n\t\t\t\t\t&& selectedProfiles.get(i)) {\r\n\t\t\t\t/**\r\n\t\t\t\t * Indicate duplicate profile names\r\n\t\t\t\t */\r\n\t\t\t\tduplicateNameOccours = true;\r\n\t\t\t\t/**\r\n\t\t\t\t * Provide a user interface to change the profile name\r\n\t\t\t\t */\r\n\t\t\t\tif (userDialog) {\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * In the other case ask the user for a different name\r\n\t\t\t\t\t */\r\n\t\t\t\t\tString dialogTitle = \"Duplicate profile name\";\r\n\t\t\t\t\tString dialogMsg = \"The profile name \\\"\" + p.getName()\r\n\t\t\t\t\t\t\t+ \"\\\" already exists globally.\\n\"\r\n\t\t\t\t\t\t\t+ \"Please enter a globally unique\"\r\n\t\t\t\t\t\t\t+ \" profile name.\";\r\n\t\t\t\t\tString dialogRet = JOptionPane.showInputDialog(null,\r\n\t\t\t\t\t\t\tdialogMsg, dialogTitle, JOptionPane.ERROR_MESSAGE);\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * Only store the new name if not empty\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (dialogRet != null) {\r\n\t\t\t\t\t\tif (!dialogRet.isEmpty()) {\r\n\t\t\t\t\t\t\tp.setName(dialogRet);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Check also if there exists local uniqueness if the comparison against\r\n\t\t * the global names found no error.\r\n\t\t */\r\n\t\tif (duplicateNameOccours == false) {\r\n\t\t\tduplicateNameOccours = checkProfileNameUniquessLocal();\r\n\t\t}\r\n\r\n\t\treturn duplicateNameOccours;\r\n\t}",
"@Override\n public boolean isUserNameExists(String userName) {\n User user = getUserInfo(userName);\n return user != null && user.getUserName() != null && !user.getUserName().equals(\"\");\n }",
"boolean hasUsername();",
"boolean hasUsername();",
"boolean hasUsername();",
"boolean hasUsername();",
"boolean hasUsername();",
"boolean hasUsername();",
"private boolean checkNameExistAdd(String userName) {\n\n\t\tUser user = this.userDAO.getUserByName(userName);\n\t\tif (null != user) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"void checkUserName() {\n usernameChecked = false;\n signInUpController.checkUserName(userNameText.getText().toString(), new OnTaskListeners.Bool() {\n @Override\n public void onSuccess(Boolean result) {\n usernameChecked = true;\n if (result)\n uniqueUsername = false;\n else\n uniqueUsername = true;\n\n\n }\n });\n }",
"public String checkUsername() {\n String username = \"\"; // Create username\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n username = checkEmpty(\"Account\"); // Call method to check input of username\n boolean isExist = false; // Check exist username\n for (Account acc : accounts) {\n // If username is exist, print out error\n if (username.equals(acc.getUsername())) {\n System.out.println(\"This account has already existed\");\n System.out.print(\"Try another account: \");\n isExist = true;\n }\n }\n // If username not exist then return username\n if (!isExist) {\n return username;\n }\n }\n return username; // Return username\n }",
"public String validateUser(String un) {\n\t\tUser checkForUser = userDao.findByUsername(un);\n\t\tif (checkForUser != null) {\t\t\t\t\t//user exists\n\t\t\treturn \"That username already exists\";\n\t\t}\n\t\telse {\n\t\t\t//validate username\n\t\t\tif(!User.isValidUsername(un)) {\n\t\t\t\treturn \"Username must be between 5 and 11 characters and contain 1 alpha\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public static String userNameValid(String name){\n return \"select u_name from users having u_name = '\" + name + \"'\";\n }",
"@Override\n\tpublic void validateUserName(String name) throws UserException {\n\t\t\n\t}",
"boolean duplicatedUsername(String username);",
"public void validateUserName(String name) {\n\t\ttry {\n\t\t\tAssert.assertTrue(userName.getText().equalsIgnoreCase(\"Hi \"+name),\"Username is correctly displayed\");\n\t\t\tLog.addMessage(\"Username correctly displayed\");\n\t\t}catch(Exception e) {\n\t\t\tLog.addMessage(\"Validation of User Login is failed\");\n\t\t\tLog.addMessage(e.getMessage().toString());\n\t\t\tAssert.assertTrue(false, \"Failed to validate User Login\");\n\t\t}\n\t}",
"public boolean testUser(){\n VallidateUserName validator = new VallidateUserName();\n return validator.isValidUser(UserName);\n }",
"public static boolean userNameDuplicate(String arg_username) {\n\n\t\tboolean userNameFound = false;\n\n\t\tfor (User u0 : userInfoArray) {\n\t\t\tString currentUserName = ((User) u0).getUserName();\n\t\t\tif (arg_username.toUpperCase().equals(currentUserName.toUpperCase())) {\n\t\t\t\tuserNameFound = true;\n\t\t\t\tbreak;\n\n\t\t\t} else {\n\t\t\t\tuserNameFound = false;\n\t\t\t}\n\n\t\t}\n\t\treturn userNameFound;\n\t}",
"public Boolean isUsernameExist(String username);",
"boolean isUsernameExist(String username);",
"public boolean isUsernameTaken(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username from \"+ TABLE_NAME;\n Cursor cursor = db.rawQuery(query, null);\n\n String uname;\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if(uname.equals(username)) {\n return true;\n }\n } while (cursor.moveToNext());\n }\n\n return false;\n }",
"private boolean isOneUserName(String username){\r\n\t\tfor(int i = 0; i < users.size(); i++){\r\n\t\t\tif(users.get(i).username.equalsIgnoreCase(username)){\r\n\t\t\t\tSystem.out.println(\"Sorry the Username is already taken\");\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private boolean checkUsername(String newUsername, Label label)\n {\n label.setText(\"\");\n\n if(newUsername.length() == 0){\n label.setText(\"Please choose a username \");\n return false;\n }\n for(Account account : getListOfAccounts()){\n if(newUsername.equals(account.getUsername())){\n label.setText(\"This field is already taken by another account. Please choose another username\");\n return false;\n }\n }\n return true;\n }",
"boolean isUniqueUsername(String username) throws SQLException;",
"public void checkUsernameExist() {\n\n try {\n BLUser bluser = new BLUser();\n User user = new User();\n\n ResultSet rs = bluser.selectUserIdFromUsername(txt_username.getText());\n\n user.setUsername(txt_username.getText());\n bluser.setUser(user);\n\n if (bluser.checkUsernameExist()) {\n \n populateDataOnTable();\n }// end if\n else {\n JOptionPane.showMessageDialog(rootPane, \"Invalid username!\");\n }// end else \n\n }// end try\n catch (Exception ex) {\n JOptionPane.showMessageDialog(null, ex.getMessage(), \"Exception\", JOptionPane.INFORMATION_MESSAGE);\n }//end catch\n }",
"public boolean isUnique(String userName) {\n return userRepository.findByLogin(userName) == null ? true : false;\n }",
"@Override\n\tpublic boolean checkUser(final String value) {\n\t\treturn this.listUsers.checkUser(value);\n\t}",
"private void userNameErrorMessage(boolean exists, String userName){\n if(exists){\n System.out.println(\"\\nUserName: \" + userName + \" Already Exists In Database!\\n\");\n }\n }",
"private boolean checkExistingUsername(String username) {\n boolean existingUsername = false;\n User user = userFacade.getUserByUsername(username);\n if (user != null) {\n existingUsername = true;\n }\n return existingUsername;\n }",
"@Override\n\tpublic int validateUsername(User u) {\n\t\treturn 0;\n\t}",
"public boolean checkUsername(String name) {\r\n\t\ttry {\r\n\t\t\tStatement statement = connection.createStatement();\r\n\t\t\tResultSet rs = statement.executeQuery(\"SELECT count(*) FROM users where username = '\" + name + \"'\");\r\n\t\t\treturn rs.first();\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public boolean validateUserName(String name)\n\t{\n\t\tif (username.getText().length() < MIN_USERNAME_LENGTH)\n\t\t{\n\t\t\tsetWarning(\"username too short\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!name.matches(\"^[a-zA-Z0-9]*$\"))\n\t\t{\n\t\t\tsetWarning(\"invalid username\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public abstract boolean checkUser(String username);",
"private static boolean checkUsernameAvailable(String username) {\n if (username.length() <= 6) {\n return false; // Username too short.\n } else {\n if (!patients.isEmpty()) {\n for (Patient patient : patients\n ) {\n if (patient.getUserName().equals(username)) {\n return false; // Username already added for patient.\n }\n }\n for (Medic medic : medics\n ) {\n if (medic.getUserName().equals(username)) {\n return false; // Username already added for patient.\n }\n }\n }\n\n }\n return true;\n }",
"private boolean duplicationCheck(String userName) {\n\t\tboolean ret = true;\n\t\tif(obs.isEmpty()) {\n\t\t\tret = true;\n\t\t}\n\t\telse {\n\t\t\tfor(int i=0; i<obs.size(); i++) {\n\t\t\t\tif(obs.get(i).getUserName().compareTo(userName) == 0) {\n\t\t\t\t\tret = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tret = true;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}",
"private boolean checkUsername() {\n if(getUsername.getText().compareTo(\"\") != 0) { return true; }\n else {\n errorMessage.setText(\"Please enter a username.\");\n return false;\n }\n }",
"Boolean checkUserExists(String userName) throws AppException;",
"private void validationUsername( String name ) throws Exception {\n\t\t\t if ( name != null && name.trim().length() < 3 ) {\n\t\t\t throw new Exception( \"Le nom d'utilisateur doit contenir au moins 3 caractères.\" );\n\t\t\t }\n\t\t\t}",
"public void validateUserName(FacesContext context, UIComponent validate, Object value){\n\t\tcheckHibernateAnnotations(context, validate, value);\t\t\t\t\n\t\tString username=(String)value;\n\t\tif (!isUsernameAvailable(username)) {\n\t\t\tFacesMessage msg = new FacesMessage(\"ice username already taken\");\n\t\t\tcontext.addMessage(validate.getClientId(context), msg);\n\t\t\tusernameValid=false;\n\t\t}else usernameValid=true;\n\t}",
"public boolean userDuplicateCheck(String username){\n ArrayList<User> users = new ArrayList<>(db.getAllUsers());\n\n for(User user : users){\n if(user.getUsername().equals(username)){\n return false;\n }\n }\n return true;\n }",
"@Override\n public boolean checkUsername (User user) {\n String username = user.getUsername();\n User userEx = findByUserName(username);\n return userEx != null;\n }",
"private boolean validateUsername() {\n // Get doctor's username\n EditText doctorUsername = (EditText) rootView.findViewById(R.id.doctorField);\n String doctorUsernameString = doctorUsername.getText().toString();\n // Query on server using that username\n try {\n String query = String.format(\"select `username` from `user` inner join `doctor` on user.id=doctor.userid where username='%s'\", doctorUsernameString); // query to check username existence\n Document document = Jsoup.connect(Constants.SERVER + query).get();\n String queryJson = document.body().html();\n if (queryJson.equals(\"0\")) { // Username not existed\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Get patient's username\n EditText patientUsername = (EditText) rootView.findViewById(R.id.patientField);\n String patientUsernameString = patientUsername.getText().toString();\n // Query on server using that username\n try {\n String query = String.format(\"select `username` from `user` inner join `patient` on user.id=patient.userid where username='%s'\", patientUsernameString); // query to check username existence\n Document document = Jsoup.connect(Constants.SERVER + query).get();\n String queryJson = document.body().html();\n if (queryJson.equals(\"0\")) { // Username not existed\n return false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return true;\n }",
"public boolean isUser(String userName) throws Exception;",
"@Test\n public void testUserIdExists() {\n\n String userInput = \"guest.login\";\n Owner testUser = ownerHelper.validateUser(userInput, \"Pa$$w0rd\");\n assertEquals(testUser.getPassword(), owner3.getPassword());\n assertEquals(testUser.getFirstName(), owner3.getFirstName());\n assertEquals(testUser.getLastName(), owner3.getLastName());\n\n }",
"private boolean checkName(String name) {\n if (!name.equals(\"\")) {\n //Check si le nom est déjà utilisé\n return myDbA.checkName(name);\n }\n return false;\n }",
"private boolean isExistUserName(String userName, String userId) {\n User user = userService.findByUserNameAndStatus(userName, Constant.Status.ACTIVE.getValue());\n if (user != null && !user.getUserId().equals(userId)) {\n return true;\n }\n return false;\n }",
"public boolean isUsernameExist(String un) {\n\n boolean exist = false;\n\n // accessing registeredUser table (collection)\n MongoCollection<Document> collection = db.getCollection(\"registeredUser\");\n\n // ----- get document of given username from registeredData -----\n System.out.println(\"\\nVerifying if username already exists or not\\n--------------------\\n\");\n String colUsername = \"username\"; // set key and value to look for in document\n FindIterable<Document> docOne = collection.find(Filters.eq(colUsername, un)); // find document by filters\n MongoCursor<Document> cursor1 = docOne.iterator(); // set up cursor to iterate rows of documents\n try {\n // cursor1 will only have 1 data if we found a match\n if (cursor1.hasNext()) {\n System.out.println(\"Username already exists\");\n exist = true;\n }\n else {\n System.out.println(\"Username is available to register\");\n }\n } finally {\n cursor1.close();\n }\n\n return exist;\n }",
"public boolean askForUsername()\r\n\t{\r\n\t\tboolean nameEntered = true;\r\n\r\n\t\tTextInputDialog dialog = new TextInputDialog();\r\n\t\tdialog.setTitle(\"Nom d'utilisateur\");\r\n\t\tdialog.setHeaderText(null);\r\n\t\tdialog.setContentText(\"Entrer un nom d'utilisateur:\");\r\n\t\tOptional<String> result = dialog.showAndWait();\r\n\t\tif (result.isPresent())\r\n\t\t{\r\n\t\t\ttextFieldNomUtilisateur.setText(result.get());\r\n\t\t} else\r\n\t\t{\r\n\t\t\tnameEntered = false;\r\n\t\t}\r\n\r\n\t\treturn nameEntered;\r\n\t}",
"public void checkUserName(String userName, String playerType) throws Exception{\r\n\t\t\r\n\t\tboolean check = false;\r\n\t\tSystem.out.println(\"Checking Username\");\r\n\t\tFile file = new File(filePath);\r\n\t\tif(file.exists()) {\r\n\t\t\tScanner in = new Scanner(file);\r\n\t\t\t//if a user with the same name is found, then choose different name\r\n\t\t\twhile(in.hasNextLine()) {\r\n\t\t\t\tif(userName.equals(in.nextLine())){\r\n\t\t\t\t\t\r\n\t\t\t\t\tcheck = true;\r\n\t\t\t\t\tSystem.out.println(\"Username found\");\r\n\t\t\t\t\tsetuName(userName);\r\n\t\t\t\t\tif(Main.playerNum == 2)\r\n\t\t\t\t\t\tMain.resultLabel2.setText(userName);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tMain.resultLabel1.setText(userName);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tin.close();\r\n\t\t}\r\n\t\tsetNameSame(check, userName, playerType) ;\r\n\t}",
"public static boolean checkRegisteredUsername(String username){\n \tboolean found = false;\n \ttry {\n\t\t\tfound = DBHandler.isUsernameTaken(username, c); \n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n \treturn found;\n }",
"@Override\n\tpublic Boolean chkUserNameForApply(String usernameStr) {\n\t\tList<ApplyUsers> usersList = new ArrayList<ApplyUsers>();\n\t\tString sql=\"select applyid from apply_users where applyname='\" + usernameStr + \"'\";\n\t\tusersList = JdbcUtils.query(ApplyUsers.class, sql);\n\t\tif(usersList.size()>0){\n\t\t return false;\n\t\t}else{\n\t\t return true;\n\t\t}\n\t}",
"public void setUsername(String name)\r\n {\r\n int index = -1;\r\n //Check if the new username is not already taken before setting the new username\r\n if(usernamesTaken.indexOf(name) == -1)\r\n {\r\n index = usernamesTaken.indexOf(this.username);\r\n usernamesTaken.set(index, name);\r\n this.username = name;\r\n }\r\n else\r\n {\r\n //Outouts a warning message\r\n System.out.println(\"WARNING: This username is already taken\");\r\n }//end if \r\n }",
"public boolean nameValidation(String username){\n return !(username.isEmpty() || !username.matches(\"[a-zA-Z0-9_-]+\"));\n }",
"private static boolean checkDuplicateDocName(User user, String name) {\n\n\t\t// Check if document name is already in user's documents\n\t\tboolean isInvalid = false;\n\n\t\tfor(@SuppressWarnings(\"unchecked\")\n\t\tIterator<Document> iter = user.getDocumentList().iterator(); iter.hasNext(); ) {\n\t\t\tDocument doc = iter.next();\n\t\t\tif(doc.getDocName().equals(name)) {\n\t\t\t\tisInvalid = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn isInvalid;\n\t}",
"@Override\n\tpublic void validate() {\n\t\tif(name==null||name.trim().equals(\"\")){\n\t\t\taddActionError(\"用户必须填写!\");\n\t\t}\n\t\t\n\t\tList l=new ArrayList();\n\t\tl=userService.QueryByTabId(\"Xxuser\", \"id\", id);\n\t\t//判断是否修改\n\t\tif(l.size()!=0){\n\t\t\t\n\t\t\tfor(int i=0;i<l.size();i++){\n\t\t\t\tXxuser xxuser=new Xxuser();\n\t\t\t\txxuser=(Xxuser)l.get(i);\n\t\t\t\tif(xxuser.getName().equals(name.trim())){\n\t\t\t\t\tSystem.out.println(\"mei gai\");\n\t\t\t\t}else{\n\t\t\t\t\tList n=new ArrayList();\n\t\t\t\t\tn=userService.QueryByTab(\"Xxuser\", \"name\", name);\n\t\t\t\t\tif(n.size()!=0){\n\t\t\t\t\t\taddActionError(\"该用户已经存在!\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\n\t\t\t\n\t\t}\n\t}",
"boolean isUser(String username);",
"public boolean checkUser(String name) {\n String[] columns = {\n PDF_NAME\n };\n SQLiteDatabase db = this.getReadableDatabase();\n\n // selection criteria\n String selection = PDF_NAME + \" = ?\";\n\n // selection argument\n String[] selectionArgs = {name};\n\n // query user table with condition\n /**\n * Here query function is used to fetch records from user table this function works like we use sql query.\n * SQL query equivalent to this query function is\n * SELECT user_id FROM user WHERE user_email = '[email protected]';\n */\n Cursor cursor = db.query(TABLE_NAME, //Table to query\n columns, //columns to return\n selection, //columns for the WHERE clause\n selectionArgs, //The values for the WHERE clause\n null, //group the rows\n null, //filter by row groups\n null); //The sort order\n int cursorCount = cursor.getCount();\n cursor.close();\n db.close();\n\n if (cursorCount > 0) {\n return true;\n }\n\n return false;\n }",
"public void testvalidateUserName0001()\n\t{\n\t\tLoginCheck loginCheckTest = new LoginCheck();\n\t\t\n\t\tassertFalse(loginCheckTest.validateUserName(\"usrnm\"));\n\t}",
"private boolean IsUserExist(){\n SignupUser user =roomDB.dao().GetUserData(et_user.getText().toString());\n if(user!=null){\n if(!user.getEmail().isEmpty()){\n Toast.makeText(this, \"User is already registered!\", Toast.LENGTH_SHORT).show();\n return true;\n }\n\n }\n return false;\n }",
"private boolean checkChangeUsernameValidity(String newUsername)\n {\n return (!newUsername.equals(\"\") && !newUsername.equals(controllerComponents.getAccount().getUsername()));\n }",
"private boolean isValidUsername(EditText edtDisplayName) {\n boolean isValid = edtDisplayName.getText().length() != 0;\n\n if (!isValid) {\n edtDisplayName.setError(getString(R.string.required_field));\n }\n\n return isValid;\n }",
"public Boolean isUnique(String search) {\n\t\tfor (int i = 0; i < CarerAccounts.size(); i++) {\n if (CarerAccounts.get(i).getUsername().equals(search)){\n return false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"@Test\n public void userExist() {\n String username = argument.substring(0, 15);\n boolean found = false;\n\n for(int i = 0; i<users.size(); i++){\n if(users.get(i).substring(0, 15).trim().toLowerCase().contains(username.trim().toLowerCase())){\n found = true;\n }\n }\n assertTrue(\"User Not Found\", found);\n }",
"private void testUserName(){\r\n\t\t//get user with the 'test' userName\r\n\t\tString command = \"SELECT userName FROM users \"\r\n\t\t\t\t+ \"WHERE userName = \\\"\" + commandList.get(1) + \"\\\";\";\r\n\t\tSystem.out.println(command);//print command\r\n\t\ttry {//send command\r\n\t\t\trs = stmt.executeQuery(command);\r\n\t\t\t\r\n\t\t\tif(rs.next()){//if it returns user, userName exists\r\n\t\t\t\tout.println(\"exists\");\r\n\t\t\t} else {//no results returned, empty\r\n\t\t\t\tout.println(\"free\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\tout.println(e.getMessage());//send back error message\r\n\t\t}\r\n\t\t\r\n\r\n\t}",
"@Override\n\tpublic boolean user_register_samenametest(Map<String, Object> reqs) {\n\t\tString sql=\"select userName from tp_users where userName=:userName\";\n\t\tif(joaSimpleDao.count(sql, reqs)==1 )\n\t\t{\t\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\t\n\t}",
"public boolean hasUserName() {\n return ((bitField0_ & 0x00000002) != 0);\n }",
"public boolean hasUserName() {\n return ((bitField0_ & 0x00000002) != 0);\n }",
"public boolean checkName(String name)\n {\n return true;\n }",
"boolean isUserExists(RegisterData data) throws DuplicateUserException;",
"public boolean existsUser(String username);",
"private boolean isLoginUnique(int currentUserId){\n\t\tUser user = Main.getMMUser().getUserForLogin(userLoginField.getText());\n\t\tif (user == null) return true;\n\t\telse {\n\t\t\tif (user.getId() == currentUserId) return true;\n\t\t}\t\n\t\tlackUserLoginLabel.setText(\"taki login istnieje w bazie\");\n\t\tlackUserLoginLabel.setVisible(true);\n\t\treturn false;\n\t}",
"public boolean validateUsernameExist(String username) {\n return userRepository.findUsername(username);\n }",
"public boolean checkGoodName(Object bean, ValidatorAction va, Field field,\r\n\t\t\tActionMessages messages, HttpServletRequest request) {\r\n\r\n\t\tMemberForm memForm = (MemberForm)bean;\r\n\t\tString username = memForm.getMemberUserName();\r\n\r\n\r\n\t\ttry {\r\n\t\t\tStringUtil.checkGoodName(username);\r\n\t\t} catch (BadInputException e) {\r\n\t\t\tmessages.add(field.getKey(), Resources.getActionMessage(request,\r\n\t\t\t\t\tva, field));\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\r\n\t\tString unActivatePattern = sysProp.getValue(\"DEFAULT_USERNAME_PATTERN\");\r\n\r\n\t\tboolean validName = true;\r\n\t\tStringTokenizer st = new StringTokenizer(unActivatePattern, \",\");\r\n\t\twhile (st.hasMoreTokens()) {\r\n\t\t\tif (username.startsWith(st.nextToken())) {\r\n\t\t\t\tvalidName = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!validName) {\r\n\t\t\tmessages.add(field.getKey(), Resources.getActionMessage(request,\r\n\t\t\t\t\tva, field));\r\n\t\t}\r\n\r\n\t\treturn messages.isEmpty();\r\n\t}",
"public User whoIsTheUser(String name){\n boolean space5 = false;\n User userPrivate = null;\n for(int i = 0; i<MAX_USER && !space5; i++){\n userPrivate = user[i];\n if(userPrivate.getUserName().equals(name)){\n space5 = true;\n }\n }\n return userPrivate;\n }",
"public boolean isExistingUsername(String username) {\n boolean isExistingUser = false; \n \n List<User> retrievedUsersList = new LinkedList<User>(); \n retrievedUsersList = repo.returnAllUsers(); \n \n User aUser = null; \n for(var user : retrievedUsersList) {\n aUser = (User)user; \n \n if(aUser.username.equals(username)) {\n isExistingUser = true; \n }\n }\n \n return isExistingUser; \n }",
"private boolean isUserNameValid(String username) {\n if (username == null) {\n return false;\n } else {\n return !username.trim().isEmpty();\n }\n }",
"static boolean checkUserName(String userName) {\n\t\ttry {\n\t\t\tfor (char c : userName.toCharArray()) {\n\t\t\t\tif ((c <= '9' && c >= '0') || (c >= 'A' && c <= 'Z')\n\t\t\t\t\t\t|| (c >= 'a' && c <= 'z')) {\n\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (NullPointerException e) {\n\t\t\t// TODO: handle exception\n\n\t\t}\n\n\t\treturn true;\n\t}",
"@WebMethod public boolean checkUser(String userName);",
"private static boolean verificaUser(String username) {\n String user = null;\r\n try {\r\n PreparedStatement stmt = c.prepareStatement(\"SELECT * FROM utilizador where nome=?;\");\r\n stmt.setString(1, username);\r\n ResultSet rs = stmt.executeQuery();\r\n rs.next();\r\n user = rs.getString(\"nome\");\r\n if (user.equals(username)) {\r\n return true;\r\n }\r\n } catch (SQLException e) {\r\n System.out.println(e);\r\n }\r\n return false;\r\n }",
"private void emailExistCheck() {\n usernameFromEmail(email.getText().toString());\n }",
"public boolean checkUserId() {\n if (userIdEditText.getText().toString().isEmpty()) {\n userIdContainer.setError(getString(R.string.error_user_id));\n } else {\n userIdContainer.setError(null);\n }\n return !userIdEditText.getText().toString().isEmpty();\n }",
"@Override\n\tpublic boolean checkUser(String username) {\n\t\tboolean result = false;\n\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tQuery query = (Query) session.createQuery(\"from Member where username=?\");\n\n\t\tMember member = (Member) query.setString(0, username).uniqueResult();\n\t\tif (member != null) {\n\t\t\tresult = true;\n\t\t\tlogger.info(\"Member Exists\");\n\t\t} \n\n\t\treturn result;\n\n\t}",
"private boolean isNameValid(String name) {\n\n }",
"private boolean isUserExists() {\n\t\treturn KliqDataStore.isUserExists(this.mobileNumber, null);\r\n\t}",
"public boolean findUserBYName(String name);",
"boolean isUserExists(Username username);",
"@DefaultMessage(\"Since this user has no permissions, duplication is invalid\")\n @Key(\"systemUser.userDuplicateInvalid\")\n String systemUser_userDuplicateInvalid();",
"@Test\n\tvoid shouldFindUserWithIncorrectUsername() throws Exception {\n\t\tUser user = this.userService.findUserByUsername(\"antonio98\");\n\t\tAssertions.assertThat(user.getUsername()).isNotEqualTo(\"fernando98\");\n\t}",
"public void testvalidateUserName0003()\n\t{\n\t\tLoginCheck loginCheckTest = new LoginCheck();\n\t\t\n\t\tassertFalse(loginCheckTest.validateUserName(\"username test greater than\"));\n\t}"
] | [
"0.7350093",
"0.7330989",
"0.7158013",
"0.71154654",
"0.71152073",
"0.7107634",
"0.70728517",
"0.69809955",
"0.6936047",
"0.6934865",
"0.69341844",
"0.6913167",
"0.6872492",
"0.6872256",
"0.6872256",
"0.6872256",
"0.6872256",
"0.6872256",
"0.6872256",
"0.6861732",
"0.6860442",
"0.6858865",
"0.68445474",
"0.6840499",
"0.6839582",
"0.68089885",
"0.6806946",
"0.6799843",
"0.6790353",
"0.67803085",
"0.67417157",
"0.6697752",
"0.6689256",
"0.6674799",
"0.66402465",
"0.6617559",
"0.6607014",
"0.6606096",
"0.6598813",
"0.65886843",
"0.6573037",
"0.65723115",
"0.6569105",
"0.6568643",
"0.6567823",
"0.6564221",
"0.65594465",
"0.6555571",
"0.6535791",
"0.6529135",
"0.6527863",
"0.6527465",
"0.6475944",
"0.6461403",
"0.643744",
"0.64355457",
"0.6422319",
"0.63913405",
"0.63746965",
"0.6360188",
"0.6345029",
"0.63421977",
"0.63418466",
"0.6312187",
"0.6301445",
"0.6296783",
"0.62904596",
"0.62726206",
"0.626901",
"0.62485164",
"0.62484807",
"0.62408966",
"0.6238154",
"0.62349486",
"0.6230443",
"0.6228276",
"0.62209797",
"0.6217488",
"0.62147206",
"0.6210869",
"0.62097394",
"0.620371",
"0.61945415",
"0.61937904",
"0.6189921",
"0.6185306",
"0.61731803",
"0.6170825",
"0.61692715",
"0.6162301",
"0.61616844",
"0.6158779",
"0.61534333",
"0.61507475",
"0.61483014",
"0.6146261",
"0.6140611",
"0.61329067",
"0.613268",
"0.6125632"
] | 0.7264424 | 2 |
input parameter is not used in this case | public String createFirstAccessionNumber(String nullPrefix) {
StringBuilder builder = new StringBuilder(DateUtil.getTwoDigitYear());
builder.append(getSite());
builder.append(INCREMENT_STARTING_VALUE);
return builder.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void input() {\n\t\t\n\t}",
"@Override\n\tprotected void processInput() {\n\t}",
"public abstract void input();",
"private void validateInputParameters(){\n\n }",
"@Override\n\tvoid input() {\n\t}",
"protected abstract void getInput();",
"public abstract Object getInput ();",
"com.indosat.eai.catalist.standardInputOutput.DummyInputType getInput();",
"public void setInput(String input) { this.input = input; }",
"@Override\n\tpublic void setInput(Input arg0) {\n\t\t\n\t}",
"String getInput();",
"@Override\n\tpublic void setInput(Input arg0) {\n\n\t}",
"public void processInput() {\n\n\t}",
"INPUT createINPUT();",
"public void setInput(String input){\n this.input = input;\n }",
"void requestInput();",
"@Override\r\n\tpublic void acceptInput(String input) {\n\t\t\r\n\t}",
"public void setInput(String input);",
"public void setInput(Input input) {\n this.input = input;\n }",
"com.indosat.eai.catalist.standardInputOutput.DummyInputType addNewInput();",
"@Override\n\tprotected void preProcessInputData(JsonNode input) {\n\t\t\n\t}",
"@Override\n\tpublic String input() throws Exception {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String input() throws Exception {\n\t\treturn null;\n\t}",
"public void setInput(Input param) {\r\n localInputTracker = param != null;\r\n\r\n this.localInput = param;\r\n }",
"public void takeUserInput() {\n\t\t\r\n\t}",
"void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);",
"private Integer doSomething(Integer input) {\n System.out.println(\"The thread name is \"+Thread.currentThread().getName()+\" for handed data is \"+input);\n return input;\n }",
"protected void handleInput(String input) {}",
"private Input()\n {\n }",
"Input getObjetivo();",
"private boolean isValidInput() {\n\t\treturn true;\n\t}",
"@Override \n\t\tprotected int getNumParam() {\n\t\t\treturn 1;\n\t\t}",
"protected abstract void execute(INPUT input);",
"@Override\n public String getInputArg(String argName) {\n Log.w(TAG, \"Test input args is not supported.\");\n return null;\n }",
"public void beforeInput() {\n }",
"public void beforeInput() {\n }",
"protected abstract void registerInput();",
"Input createInput();",
"com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput addNewDummyInput();",
"public abstract void process(int input);",
"public interface ParameterInput extends Input {\n\t\n\t/**\n\t * Returns the metadata of this parameter.\n\t * @return ParameterMetadata\tmetadata\n\t */\n\tpublic ParameterMetadata getMetadata();\n\t\n\t/**\n\t * Returns the parameter value of an option.\n\t * \n\t * @return Object option parameter value\n\t */\n\tpublic Object getValue();\n\t\n\t/**\n\t * Returns the File parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return File file value\n\t */\n\tpublic File getFileValue();\n\t\n\t/**\n\t * Returns the directory parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return File a directory file\n\t */\t\n\tpublic File getDirectoryValue();\n\n\t/**\n\t * Returns the String parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return String string value\n\t */\n\tpublic String getStringValue();\n\t\n\t/**\n\t * Returns the Number parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return Number value\n\t */\n\tpublic Number getNumberValue();\n\t\n}",
"com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput getDummyInput();",
"protected Object getInitialInput() {\n return this;\n }",
"public void getInput(String input) {\n ((problemGeneratorArrayListener) activity).problemGeneratorArrayActivity(input);\n }",
"@Override\n\tpublic boolean isParam() {\n\t\treturn false;\n\t}",
"public T caseInput(Input object) {\n\t\treturn null;\n\t}",
"public void doIt(Input in);",
"@Override\n public boolean checkInput(String xmlid,XMLParameter env, Map input, Map output, Map config) throws Exception {\n return true;\n }",
"private void strin() {\n\n\t}",
"@Override\n\tpublic void inputStarted() {\n\t\t\n\t}",
"@Override\n\tpublic void update(Input input) {\n\t\t\n\t}",
"public double getParameterValue (Assignment input) ;",
"public void setInput(String input) {\n\t\t\tthis.input = input;\n\t\t}",
"private static String checkInputParamType(InputParam inputParam) {\r\n\t\tString type = inputParam.getType();\r\n\t\tString value = null;\r\n\t\tswitch (type) {\r\n\t\tcase BPConstant.STRING:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getStringValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.BOOLEAN:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getBooleanValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.DATE_TIME:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getDateValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.NUMBER:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getIntValue();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tvalue = BPConstant.EMPTY_STRING;\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"@Override\n\tpublic void inputStarted() {\n\n\t}",
"private void checkUserInput() {\n }",
"public interface Input \n{\n\t/*\n\t * Use to initialise input\n\t */\n\tboolean initialise (String args);\n\t/*\n\t * Return a line or return null\n\t */\n\tString getLine ();\n\t\n}",
"@Override\n\tpublic void handleInput() {\n\t\t\n\t}",
"public org.apache.spark.ml.param.Param<java.lang.String> handleInvalid () { throw new RuntimeException(); }",
"@Override\n\tprotected void initParams() {\n\t\t\n\t}",
"@Override\r\n \tpublic void process() {\n \t\t\r\n \t}",
"public void setInput(SVIResource in) throws Exception;",
"@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}",
"protected void addInputParameterWithoutChecks(Parameter parameter) {\n\t\tparameters.add(parameter);\n\t\tupdateStructureHash();\n\t}",
"protected abstract boolean checkInput();",
"protected void validatePreamp(int[] param) {\n }",
"@Override\n protected void onHubRequest(Tuple input) throws Exception {\n }",
"@Override\n\tpublic void GetOut() {\n\t\t\n\t}",
"protected void validate_return(java.lang.String[] param){\r\n \r\n }",
"@Override\n\tpublic void input(float delta) {\n\t\t\n\t}",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public void smell() {\n\t\t\n\t}",
"public interface InputParam extends Parameter {\r\n\r\n /* ***************************************************\r\n * Property http://www.semanticweb.org/rami#isEquivalent\r\n */\r\n \r\n /**\r\n * Gets all property values for the isEquivalent property.<p>\r\n * \r\n * @returns a collection of values for the isEquivalent property.\r\n */\r\n Collection<? extends Noun> getIsEquivalent();\r\n\r\n /**\r\n * Checks if the class has a isEquivalent property value.<p>\r\n * \r\n * @return true if there is a isEquivalent property value.\r\n */\r\n boolean hasIsEquivalent();\r\n\r\n /**\r\n * Adds a isEquivalent property value.<p>\r\n * \r\n * @param newIsEquivalent the isEquivalent property value to be added\r\n */\r\n void addIsEquivalent(Noun newIsEquivalent);\r\n\r\n /**\r\n * Removes a isEquivalent property value.<p>\r\n * \r\n * @param oldIsEquivalent the isEquivalent property value to be removed.\r\n */\r\n void removeIsEquivalent(Noun oldIsEquivalent);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.semanticweb.org/rami#isInputTo\r\n */\r\n \r\n /**\r\n * Gets all property values for the isInputTo property.<p>\r\n * \r\n * @returns a collection of values for the isInputTo property.\r\n */\r\n Collection<? extends MethodCall> getIsInputTo();\r\n\r\n /**\r\n * Checks if the class has a isInputTo property value.<p>\r\n * \r\n * @return true if there is a isInputTo property value.\r\n */\r\n boolean hasIsInputTo();\r\n\r\n /**\r\n * Adds a isInputTo property value.<p>\r\n * \r\n * @param newIsInputTo the isInputTo property value to be added\r\n */\r\n void addIsInputTo(MethodCall newIsInputTo);\r\n\r\n /**\r\n * Removes a isInputTo property value.<p>\r\n * \r\n * @param oldIsInputTo the isInputTo property value to be removed.\r\n */\r\n void removeIsInputTo(MethodCall oldIsInputTo);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.semanticweb.org/rami#Label\r\n */\r\n \r\n /**\r\n * Gets all property values for the Label property.<p>\r\n * \r\n * @returns a collection of values for the Label property.\r\n */\r\n Collection<? extends Object> getLabel();\r\n\r\n /**\r\n * Checks if the class has a Label property value.<p>\r\n * \r\n * @return true if there is a Label property value.\r\n */\r\n boolean hasLabel();\r\n\r\n /**\r\n * Adds a Label property value.<p>\r\n * \r\n * @param newLabel the Label property value to be added\r\n */\r\n void addLabel(Object newLabel);\r\n\r\n /**\r\n * Removes a Label property value.<p>\r\n * \r\n * @param oldLabel the Label property value to be removed.\r\n */\r\n void removeLabel(Object oldLabel);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Common interfaces\r\n */\r\n\r\n OWLNamedIndividual getOwlIndividual();\r\n\r\n OWLOntology getOwlOntology();\r\n\r\n void delete();\r\n\r\n}",
"public void setInput1(int input1) {\n this.input1 = input1;\n }",
"public WrongInputDataInScanner() {\n\tsuper();\n\t\n}",
"private String processOperationInput(String operationInput) {\n try {\n return \"bbox = \" + new JSONObject(operationInput).getString(\"bbox\");\n } catch (Exception ignore) {\n }\n return new String (\"No input parameters\");\n }",
"default void process(Input input, Output response) { }",
"public boolean getParam0(){\n return localParam0;\n }",
"@Override\n\tpublic void inputScore() {\n\n\t}",
"com.indosat.eai.catalist.standardInputOutput.RequestType getRequest();",
"@Override\n\tprotected void validateParameterValues() {\n\t\t\n\t}",
"public void setInput(boolean input) {\n this.input = input;\n }",
"public String input() throws Exception {\r\n\t\treturn INPUT;\r\n\t}",
"@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FArgument src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}",
"public interface UsersInput {\n\n /**\n * Return user's input on a given line.\n * @param outForUser given line.\n * @return user's input.\n * @throws IOException IOException.\n */\n String getUsersInput(String outForUser) throws IOException;\n}",
"public abstract void update(Input input);",
"public Object getCallInput() {\n\t\treturn null;\n\t}",
"public abstract void handleInput();",
"abstract int estimationParameter1();",
"public abstract void inputChange( int value );",
"@Override\r\n\tpublic int getSecondArg() {\n\t\treturn 0;\r\n\t}",
"protected void setupParameters() {\n \n \n\n }",
"public abstract boolean verifyInput();",
"InOut createInOut();",
"void setRequest(com.indosat.eai.catalist.standardInputOutput.RequestType request);",
"public interface IInputService {\n public int insertHiddenDanger(HiddenDanger hiddenDanger);\n public int insertInput(Input input);\n public int insertCheckTableDetail(CheckTableDetail checkTableDetail);\n public Map<String,Object> getDetailHiddenDanger(Integer hiddenDangerId);\n public Map<String,Object> getDetailInput(String inputId);\n public PageInfo<Map<String,Object>> getListInput(Integer pageNum,Integer pageSize);\n public List<Map<String,Object>> getAllListInput();\n public int toRectify(HiddenDanger hiddenDanger);\n public int rectify(HiddenDanger hiddenDanger);\n public PageInfo<Map<String,Object>> getHiddenDangerList(String status,int pageNum,int pageSize);\n public PageInfo<Map<String, Object>> getHiddenDangerListTimeOut(int pageNum,int pageSize);\n public List<Map<String,Object>> getNumberHiddenDanger();\n public List<Map<String,Object>> getNumberHiddenDangerTimeOut();\n\n //由inputId和二级指标id获得所有二级指标内容\n public Map<String,Object> getAllCheckDetail(@Param(\"inputId\") String inputId, @Param(\"secondId\") Integer secondId);\n\n //撤回隐患\n public int withdrawHiddenDanger(Integer hiddenDangerId);\n}",
"protected abstract int isValidInput();",
"@Override final protected Class<?>[] getInputTypes() { return this.InputTypes; }"
] | [
"0.69762313",
"0.68223697",
"0.6736774",
"0.6620128",
"0.65601623",
"0.6413289",
"0.6372067",
"0.6366532",
"0.63060886",
"0.614815",
"0.6121829",
"0.6103925",
"0.61011046",
"0.6091351",
"0.6053356",
"0.6008121",
"0.6006882",
"0.5948455",
"0.594779",
"0.5932132",
"0.5910312",
"0.58974606",
"0.58974606",
"0.5858003",
"0.58351076",
"0.58292425",
"0.5827346",
"0.58182675",
"0.57931626",
"0.5784749",
"0.57756525",
"0.57647985",
"0.57625747",
"0.5761209",
"0.57415473",
"0.57415473",
"0.57273483",
"0.5716303",
"0.5663082",
"0.56627345",
"0.56486833",
"0.5636219",
"0.56091154",
"0.56047523",
"0.5592973",
"0.5592784",
"0.5571636",
"0.5566168",
"0.5563276",
"0.5560104",
"0.5556942",
"0.55466115",
"0.5538688",
"0.5532084",
"0.55258447",
"0.55218315",
"0.5516686",
"0.551572",
"0.551061",
"0.5493923",
"0.5486353",
"0.5485378",
"0.54739815",
"0.54668695",
"0.5463381",
"0.5459862",
"0.5453937",
"0.54531956",
"0.5452229",
"0.54487735",
"0.5448108",
"0.5448108",
"0.5448108",
"0.5448108",
"0.543205",
"0.54233193",
"0.5420875",
"0.54123396",
"0.5399309",
"0.5390031",
"0.5367147",
"0.53568417",
"0.53380704",
"0.5336534",
"0.5329162",
"0.53283685",
"0.5328358",
"0.53281146",
"0.53240925",
"0.5315347",
"0.5310065",
"0.53045136",
"0.52963924",
"0.5294489",
"0.5291508",
"0.5290164",
"0.5281882",
"0.52758867",
"0.52728146",
"0.52708447",
"0.5268043"
] | 0.0 | -1 |
input parameter is not used in this case | public String getNextAvailableAccessionNumber(String nullPrefix) {
String nextAccessionNumber = null;
SampleDAO sampleDAO = new SampleDAOImpl();
String curLargestAccessionNumber = sampleDAO
.getLargestAccessionNumberWithPrefix(createFirstAccessionNumber(
null).substring(YEAR_START, SITE_END));
try {
if (curLargestAccessionNumber == null) {
if (REQUESTED_NUMBERS.isEmpty()) {
nextAccessionNumber = createFirstAccessionNumber(null);
} else {
nextAccessionNumber = REQUESTED_NUMBERS.iterator().next();
}
} else {
nextAccessionNumber = incrementAccessionNumber(curLargestAccessionNumber);
}
while (REQUESTED_NUMBERS.contains(nextAccessionNumber)) {
nextAccessionNumber = incrementAccessionNumber(nextAccessionNumber);
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
LogEvent.logError("YearSiteNumAccessionValidator",
"getNextAvailableAccessionNumber()",
StringUtil.getMessageForKey("error.accession.no.next"));
nextAccessionNumber = null;
}
REQUESTED_NUMBERS.add(nextAccessionNumber);
return nextAccessionNumber;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void input() {\n\t\t\n\t}",
"@Override\n\tprotected void processInput() {\n\t}",
"public abstract void input();",
"private void validateInputParameters(){\n\n }",
"@Override\n\tvoid input() {\n\t}",
"protected abstract void getInput();",
"public abstract Object getInput ();",
"com.indosat.eai.catalist.standardInputOutput.DummyInputType getInput();",
"public void setInput(String input) { this.input = input; }",
"@Override\n\tpublic void setInput(Input arg0) {\n\t\t\n\t}",
"String getInput();",
"@Override\n\tpublic void setInput(Input arg0) {\n\n\t}",
"public void processInput() {\n\n\t}",
"INPUT createINPUT();",
"public void setInput(String input){\n this.input = input;\n }",
"void requestInput();",
"@Override\r\n\tpublic void acceptInput(String input) {\n\t\t\r\n\t}",
"public void setInput(String input);",
"public void setInput(Input input) {\n this.input = input;\n }",
"com.indosat.eai.catalist.standardInputOutput.DummyInputType addNewInput();",
"@Override\n\tprotected void preProcessInputData(JsonNode input) {\n\t\t\n\t}",
"@Override\n\tpublic String input() throws Exception {\n\t\treturn null;\n\t}",
"@Override\n\tpublic String input() throws Exception {\n\t\treturn null;\n\t}",
"public void setInput(Input param) {\r\n localInputTracker = param != null;\r\n\r\n this.localInput = param;\r\n }",
"public void takeUserInput() {\n\t\t\r\n\t}",
"void setInput(com.indosat.eai.catalist.standardInputOutput.DummyInputType input);",
"private Integer doSomething(Integer input) {\n System.out.println(\"The thread name is \"+Thread.currentThread().getName()+\" for handed data is \"+input);\n return input;\n }",
"protected void handleInput(String input) {}",
"private Input()\n {\n }",
"Input getObjetivo();",
"private boolean isValidInput() {\n\t\treturn true;\n\t}",
"@Override \n\t\tprotected int getNumParam() {\n\t\t\treturn 1;\n\t\t}",
"protected abstract void execute(INPUT input);",
"@Override\n public String getInputArg(String argName) {\n Log.w(TAG, \"Test input args is not supported.\");\n return null;\n }",
"public void beforeInput() {\n }",
"public void beforeInput() {\n }",
"protected abstract void registerInput();",
"Input createInput();",
"com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput addNewDummyInput();",
"public abstract void process(int input);",
"public interface ParameterInput extends Input {\n\t\n\t/**\n\t * Returns the metadata of this parameter.\n\t * @return ParameterMetadata\tmetadata\n\t */\n\tpublic ParameterMetadata getMetadata();\n\t\n\t/**\n\t * Returns the parameter value of an option.\n\t * \n\t * @return Object option parameter value\n\t */\n\tpublic Object getValue();\n\t\n\t/**\n\t * Returns the File parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return File file value\n\t */\n\tpublic File getFileValue();\n\t\n\t/**\n\t * Returns the directory parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return File a directory file\n\t */\t\n\tpublic File getDirectoryValue();\n\n\t/**\n\t * Returns the String parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return String string value\n\t */\n\tpublic String getStringValue();\n\t\n\t/**\n\t * Returns the Number parameter value of an option.\n\t * If option's parameter type does not match with the\n\t * return type the value returned is null.\n\t * \n\t * @return Number value\n\t */\n\tpublic Number getNumberValue();\n\t\n}",
"com.indosat.eai.catalist.standardInputOutput.DummyInputDocument.DummyInput getDummyInput();",
"protected Object getInitialInput() {\n return this;\n }",
"public void getInput(String input) {\n ((problemGeneratorArrayListener) activity).problemGeneratorArrayActivity(input);\n }",
"@Override\n\tpublic boolean isParam() {\n\t\treturn false;\n\t}",
"public T caseInput(Input object) {\n\t\treturn null;\n\t}",
"public void doIt(Input in);",
"@Override\n public boolean checkInput(String xmlid,XMLParameter env, Map input, Map output, Map config) throws Exception {\n return true;\n }",
"private void strin() {\n\n\t}",
"@Override\n\tpublic void inputStarted() {\n\t\t\n\t}",
"@Override\n\tpublic void update(Input input) {\n\t\t\n\t}",
"public double getParameterValue (Assignment input) ;",
"public void setInput(String input) {\n\t\t\tthis.input = input;\n\t\t}",
"private static String checkInputParamType(InputParam inputParam) {\r\n\t\tString type = inputParam.getType();\r\n\t\tString value = null;\r\n\t\tswitch (type) {\r\n\t\tcase BPConstant.STRING:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getStringValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.BOOLEAN:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getBooleanValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.DATE_TIME:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getDateValue();\r\n\t\t\tbreak;\r\n\t\tcase BPConstant.NUMBER:\r\n\t\t\tvalue = inputParam.getInputParamvalue().getIntValue();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tvalue = BPConstant.EMPTY_STRING;\r\n\t\t}\r\n\t\treturn value;\r\n\t}",
"@Override\n\tpublic void inputStarted() {\n\n\t}",
"private void checkUserInput() {\n }",
"public interface Input \n{\n\t/*\n\t * Use to initialise input\n\t */\n\tboolean initialise (String args);\n\t/*\n\t * Return a line or return null\n\t */\n\tString getLine ();\n\t\n}",
"@Override\n\tpublic void handleInput() {\n\t\t\n\t}",
"public org.apache.spark.ml.param.Param<java.lang.String> handleInvalid () { throw new RuntimeException(); }",
"@Override\n\tprotected void initParams() {\n\t\t\n\t}",
"@Override\r\n \tpublic void process() {\n \t\t\r\n \t}",
"public void setInput(SVIResource in) throws Exception;",
"@Override\n\tpublic boolean checkInput() {\n\t\treturn true;\n\t}",
"protected void addInputParameterWithoutChecks(Parameter parameter) {\n\t\tparameters.add(parameter);\n\t\tupdateStructureHash();\n\t}",
"protected abstract boolean checkInput();",
"protected void validatePreamp(int[] param) {\n }",
"@Override\n protected void onHubRequest(Tuple input) throws Exception {\n }",
"@Override\n\tpublic void GetOut() {\n\t\t\n\t}",
"protected void validate_return(java.lang.String[] param){\r\n \r\n }",
"@Override\n\tpublic void input(float delta) {\n\t\t\n\t}",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public java.lang.String getParam0(){\n return localParam0;\n }",
"public void smell() {\n\t\t\n\t}",
"public interface InputParam extends Parameter {\r\n\r\n /* ***************************************************\r\n * Property http://www.semanticweb.org/rami#isEquivalent\r\n */\r\n \r\n /**\r\n * Gets all property values for the isEquivalent property.<p>\r\n * \r\n * @returns a collection of values for the isEquivalent property.\r\n */\r\n Collection<? extends Noun> getIsEquivalent();\r\n\r\n /**\r\n * Checks if the class has a isEquivalent property value.<p>\r\n * \r\n * @return true if there is a isEquivalent property value.\r\n */\r\n boolean hasIsEquivalent();\r\n\r\n /**\r\n * Adds a isEquivalent property value.<p>\r\n * \r\n * @param newIsEquivalent the isEquivalent property value to be added\r\n */\r\n void addIsEquivalent(Noun newIsEquivalent);\r\n\r\n /**\r\n * Removes a isEquivalent property value.<p>\r\n * \r\n * @param oldIsEquivalent the isEquivalent property value to be removed.\r\n */\r\n void removeIsEquivalent(Noun oldIsEquivalent);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.semanticweb.org/rami#isInputTo\r\n */\r\n \r\n /**\r\n * Gets all property values for the isInputTo property.<p>\r\n * \r\n * @returns a collection of values for the isInputTo property.\r\n */\r\n Collection<? extends MethodCall> getIsInputTo();\r\n\r\n /**\r\n * Checks if the class has a isInputTo property value.<p>\r\n * \r\n * @return true if there is a isInputTo property value.\r\n */\r\n boolean hasIsInputTo();\r\n\r\n /**\r\n * Adds a isInputTo property value.<p>\r\n * \r\n * @param newIsInputTo the isInputTo property value to be added\r\n */\r\n void addIsInputTo(MethodCall newIsInputTo);\r\n\r\n /**\r\n * Removes a isInputTo property value.<p>\r\n * \r\n * @param oldIsInputTo the isInputTo property value to be removed.\r\n */\r\n void removeIsInputTo(MethodCall oldIsInputTo);\r\n\r\n\r\n /* ***************************************************\r\n * Property http://www.semanticweb.org/rami#Label\r\n */\r\n \r\n /**\r\n * Gets all property values for the Label property.<p>\r\n * \r\n * @returns a collection of values for the Label property.\r\n */\r\n Collection<? extends Object> getLabel();\r\n\r\n /**\r\n * Checks if the class has a Label property value.<p>\r\n * \r\n * @return true if there is a Label property value.\r\n */\r\n boolean hasLabel();\r\n\r\n /**\r\n * Adds a Label property value.<p>\r\n * \r\n * @param newLabel the Label property value to be added\r\n */\r\n void addLabel(Object newLabel);\r\n\r\n /**\r\n * Removes a Label property value.<p>\r\n * \r\n * @param oldLabel the Label property value to be removed.\r\n */\r\n void removeLabel(Object oldLabel);\r\n\r\n\r\n\r\n /* ***************************************************\r\n * Common interfaces\r\n */\r\n\r\n OWLNamedIndividual getOwlIndividual();\r\n\r\n OWLOntology getOwlOntology();\r\n\r\n void delete();\r\n\r\n}",
"public void setInput1(int input1) {\n this.input1 = input1;\n }",
"public WrongInputDataInScanner() {\n\tsuper();\n\t\n}",
"private String processOperationInput(String operationInput) {\n try {\n return \"bbox = \" + new JSONObject(operationInput).getString(\"bbox\");\n } catch (Exception ignore) {\n }\n return new String (\"No input parameters\");\n }",
"default void process(Input input, Output response) { }",
"public boolean getParam0(){\n return localParam0;\n }",
"@Override\n\tpublic void inputScore() {\n\n\t}",
"com.indosat.eai.catalist.standardInputOutput.RequestType getRequest();",
"@Override\n\tprotected void validateParameterValues() {\n\t\t\n\t}",
"public void setInput(boolean input) {\n this.input = input;\n }",
"public String input() throws Exception {\r\n\t\treturn INPUT;\r\n\t}",
"@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FArgument src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}",
"public interface UsersInput {\n\n /**\n * Return user's input on a given line.\n * @param outForUser given line.\n * @return user's input.\n * @throws IOException IOException.\n */\n String getUsersInput(String outForUser) throws IOException;\n}",
"public abstract void update(Input input);",
"public Object getCallInput() {\n\t\treturn null;\n\t}",
"public abstract void handleInput();",
"abstract int estimationParameter1();",
"public abstract void inputChange( int value );",
"@Override\r\n\tpublic int getSecondArg() {\n\t\treturn 0;\r\n\t}",
"protected void setupParameters() {\n \n \n\n }",
"public abstract boolean verifyInput();",
"InOut createInOut();",
"void setRequest(com.indosat.eai.catalist.standardInputOutput.RequestType request);",
"public interface IInputService {\n public int insertHiddenDanger(HiddenDanger hiddenDanger);\n public int insertInput(Input input);\n public int insertCheckTableDetail(CheckTableDetail checkTableDetail);\n public Map<String,Object> getDetailHiddenDanger(Integer hiddenDangerId);\n public Map<String,Object> getDetailInput(String inputId);\n public PageInfo<Map<String,Object>> getListInput(Integer pageNum,Integer pageSize);\n public List<Map<String,Object>> getAllListInput();\n public int toRectify(HiddenDanger hiddenDanger);\n public int rectify(HiddenDanger hiddenDanger);\n public PageInfo<Map<String,Object>> getHiddenDangerList(String status,int pageNum,int pageSize);\n public PageInfo<Map<String, Object>> getHiddenDangerListTimeOut(int pageNum,int pageSize);\n public List<Map<String,Object>> getNumberHiddenDanger();\n public List<Map<String,Object>> getNumberHiddenDangerTimeOut();\n\n //由inputId和二级指标id获得所有二级指标内容\n public Map<String,Object> getAllCheckDetail(@Param(\"inputId\") String inputId, @Param(\"secondId\") Integer secondId);\n\n //撤回隐患\n public int withdrawHiddenDanger(Integer hiddenDangerId);\n}",
"protected abstract int isValidInput();",
"@Override final protected Class<?>[] getInputTypes() { return this.InputTypes; }"
] | [
"0.69762313",
"0.68223697",
"0.6736774",
"0.6620128",
"0.65601623",
"0.6413289",
"0.6372067",
"0.6366532",
"0.63060886",
"0.614815",
"0.6121829",
"0.6103925",
"0.61011046",
"0.6091351",
"0.6053356",
"0.6008121",
"0.6006882",
"0.5948455",
"0.594779",
"0.5932132",
"0.5910312",
"0.58974606",
"0.58974606",
"0.5858003",
"0.58351076",
"0.58292425",
"0.5827346",
"0.58182675",
"0.57931626",
"0.5784749",
"0.57756525",
"0.57647985",
"0.57625747",
"0.5761209",
"0.57415473",
"0.57415473",
"0.57273483",
"0.5716303",
"0.5663082",
"0.56627345",
"0.56486833",
"0.5636219",
"0.56091154",
"0.56047523",
"0.5592973",
"0.5592784",
"0.5571636",
"0.5566168",
"0.5563276",
"0.5560104",
"0.5556942",
"0.55466115",
"0.5538688",
"0.5532084",
"0.55258447",
"0.55218315",
"0.5516686",
"0.551572",
"0.551061",
"0.5493923",
"0.5486353",
"0.5485378",
"0.54739815",
"0.54668695",
"0.5463381",
"0.5459862",
"0.5453937",
"0.54531956",
"0.5452229",
"0.54487735",
"0.5448108",
"0.5448108",
"0.5448108",
"0.5448108",
"0.543205",
"0.54233193",
"0.5420875",
"0.54123396",
"0.5399309",
"0.5390031",
"0.5367147",
"0.53568417",
"0.53380704",
"0.5336534",
"0.5329162",
"0.53283685",
"0.5328358",
"0.53281146",
"0.53240925",
"0.5315347",
"0.5310065",
"0.53045136",
"0.52963924",
"0.5294489",
"0.5291508",
"0.5290164",
"0.5281882",
"0.52758867",
"0.52728146",
"0.52708447",
"0.5268043"
] | 0.0 | -1 |
if the year differs then start the sequence again. If not then increment but check for overflow into year | public String incrementAccessionNumber(String currentHighAccessionNumber)
throws IllegalArgumentException {
int year = new GregorianCalendar().get(Calendar.YEAR) - 2000;
try {
if (year != Integer.parseInt(currentHighAccessionNumber.substring(
YEAR_START, YEAR_END))) {
return createFirstAccessionNumber(null);
}
} catch (NumberFormatException nfe) {
return createFirstAccessionNumber(null);
}
int increment = Integer.parseInt(currentHighAccessionNumber
.substring(INCREMENT_START));
String incrementAsString = INCREMENT_STARTING_VALUE;
if (increment < UPPER_INC_RANGE) {
increment++;
incrementAsString = String.format("%06d", increment);
} else {
throw new IllegalArgumentException(
"AccessionNumber has no next value");
}
StringBuilder builder = new StringBuilder(
currentHighAccessionNumber.substring(YEAR_START, SITE_END));
builder.append(incrementAsString);
return builder.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setNextYear()\n\t{\n\t\tm_calendar.set(Calendar.YEAR,getYear()+1);\n\t\tsetDay(getYear(),getMonthInteger(),1);\n\n\t}",
"public String startYear(int year) throws IOException {\r\n File file = new File(\"evidence.ods\");\r\n SpreadSheet spreadSheet = SpreadSheet.createFromFile(file);\r\n \r\n if (checkIfYearExist(spreadSheet, year)) {\r\n System.err.println(\"Evidence for year: \" + year + \" already started\");\r\n return \"STARTED\";\r\n }\r\n if(checkIfYearContinue(spreadSheet.getSheet(spreadSheet.getSheetCount()-1))){\r\n return \"PREVIOUS\";\r\n }\r\n \r\n Sheet newSheet = spreadSheet.addSheet(year + \"\");\r\n addHeading(newSheet);\r\n saveFile(newSheet);\r\n createXmlYear(year);\r\n return \"OK\";\r\n }",
"public void addYear(){\n\t\tyearAdd++;\n\t}",
"public void increaseDay(){\n leapyear(year); //Call leapyear on year to check for leap year\r\n day++; //Increment day\r\n if(day > days[month-1]){ //If day reaches higher than the month's day\r\n day = 1; //Set day to zero\r\n month++; //Increment month\r\n }\r\n if(month > 12){ //If month reaches greater than 12\r\n year++; //Increment year\r\n month = 1; //Set month to 1\r\n }\r\n}",
"public void addYear(int year) {\n if (month < 0) {\n subtractYear(year);\n return;\n }\n\n this.year += year;\n }",
"private static boolean checkIfYearContinue(Sheet sheet) {\r\n String last = sheet.getCellAt(\"A\" + sheet.getRowCount()).getTextValue(); \r\n return !last.equals(\"end\");\r\n }",
"public boolean isALeapYear(int year){\n\n if (((year%4 == 0) && (year%100!=0)) || (year%400==0)){\n return true;\n }\n return false;\n }",
"public void setYear(int year){\r\n\t\ttry{\r\n\t\t\tif(year>=1900)\r\n\t\t\tthis.year = year;\r\n\t\t\telse\r\n\t\t\t\tthrow new cardYearException();\r\n\t\t}catch(cardYearException ex){\r\n\t\t\tSystem.out.println(\"Baseball Cards weren't invented \"\r\n\t\t\t\t\t+ \"before 1900!\");\r\n\t\t\tSystem.out.print(\"Please enter a valid year: \");\r\n\t\t\t\tScanner input = new Scanner(System.in);\r\n\t\t\t\tint retry = input.nextInt();\r\n\t\t\t\tsetYear(retry);\r\n\t\t}\r\n\t}",
"public void setPrevYear()\n\t{\n\t\tm_calendar.set(Calendar.YEAR,getYear()-1);\n\n\t}",
"private boolean leapyear(int yr){\n if(yr%4 == 0 && yr%100 != 0){ //If year is divisible by 4 but not by 100\r\n days[1] = 29; //Set February's days to 29\r\n return true; //Retrn true.\r\n }\r\n return false; //Otherwise, return false.\r\n }",
"private static Boolean checkYear(){\r\n try{\r\n int year = Integer.parseInt(yearField.getText().trim());\r\n int now = LocalDate.now().getYear();\r\n \r\n if(LocalDate.now().getMonth().compareTo(Month.SEPTEMBER) < 0){\r\n now--;\r\n }\r\n //SIS stores the schedule for last 3 years only \r\n if(year <= now && year >= now - 3 ){\r\n return true;\r\n }\r\n }\r\n catch(Exception e){\r\n Logger.getLogger(\"Year checker\").log(Level.WARNING, \"Exception while resolving the year \", e);\r\n }\r\n return false;\r\n }",
"public void setYear(int _year) { year = _year; }",
"public void increment() {\n\t\tif (m_bYear) {\n\t\t\tm_value++;\n\t\t\tif (m_value > 9999)\n\t\t\t\tm_value = 0;\n\t\t} else {\n\t\t\tm_value++;\n\t\t\tif (m_value > 11)\n\t\t\t\tm_value = 0;\n\n\t\t}\n\t\trepaint();\n\t}",
"public void setYear(int value) {\r\n this.year = value;\r\n }",
"@Override\n\tpublic void oneYearAgo(int year) {\n\n\t}",
"public void setStartYear(java.math.BigInteger startYear) {\r\n this.startYear = startYear;\r\n }",
"static String solve(int year){\n int beforeYear=1919, specialYear=1918, specialDay=28, sumDay=0, programmerDay=256;\n boolean leapYear=false;\n String result = null;\n if (year < beforeYear) {\n leapYear = year%4 == 0 ? true:false;\n } else {\n leapYear = (year%400 == 0 || (year%4 == 0 && year%100 != 0)) ? true : false;\n }\n for(int i=1; i < 13; i++) {\n int temp = i;\n\n if ((temp&=0x1) == 1 || i==8) {\n sumDay = sumDay + 31;\n } else {\n if (i == 2) {\n if (year == specialYear) {\n sumDay = sumDay + 15;\n } else {\n sumDay = sumDay + (leapYear ? specialDay + 1 : specialDay);\n }\n } else {\n sumDay = sumDay + 30;\n }\n }\n if ((programmerDay - sumDay) <= 30) {\n\n result = (programmerDay - sumDay) +\".\" + \"0\" + (i+1) + \".\"+ year;\n\n// try {\n// Date date = targetFmt.parse(temp1);\n//\n// return targetFmt2.parse(String.valueOf(date)).toString();\n// } catch (ParseException e) {\n// e.printStackTrace();\n// }\n return result;\n }\n }\n return result;\n }",
"public int getEndingYear()\n {\n return -1;\n }",
"public boolean setYear(int newYear, boolean check) {\n\t\tthis.year = newYear;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\tif (check) {\n\t\t\tdouble oldMonth = this.month;\n\t\t\tdouble oldDay = this.day;\n\t\t\tIDate dt = swe_revjul(this.jd, this.calType); // -> erzeugt neues\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Datum\n\t\t\tthis.year = dt.year;\n\t\t\tthis.month = dt.month;\n\t\t\tthis.day = dt.day;\n\t\t\tthis.hour = dt.hour;\n\t\t\treturn (this.year == newYear && this.month == oldMonth && this.day == oldDay);\n\t\t}\n\t\treturn true;\n\t}",
"public void setYear(int value) {\n\tthis.year = value;\n }",
"static String solve(int year) {\n \n\t\tString output = null;\n\t\tif (year > 1918) {\n\t\t\tif (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) {\n\t\t\t\toutput = leapYear + year;\n\t\t\t} else {\n\t\t\t\toutput = nonLeapYear + year;\n\t\t\t}\n\t\t}else if (year < 1918) {\n\t\t\tif (year % 4 == 0) {\n\t\t\t\toutput = leapYear + year;\n\t\t\t} else {\n\t\t\t\toutput = nonLeapYear + year;\n\t\t\t}\n\t\t}else {\n\t\t\toutput = changingYear;\n\t\t}\n\t\t\n\t\treturn output;\n }",
"public static WithAdjuster firstDayOfNextYear() {\n\n return Impl.FIRST_DAY_OF_NEXT_YEAR;\n }",
"public void nextDay() {\r\n\t\tif (day >= daysPerMonth[month] && !(month == 2 && day == 28) && !(month == 12 && day == 31)) {\r\n\t\t\tthis.month++;\r\n\t\t\tthis.day = 1;\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\telse if (month == 2 && day == 28 && !(year % 400 == 0 || (year % 4 == 0 && year % 100 != 0))) {\r\n\t\t\tthis.month++;\r\n\t\t\tthis.day = 1;\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\r\n\t\telse if (month == 12 && day == 31) {\r\n\t\t\tthis.year++;\r\n\t\t\tthis.month = 1;\r\n\t\t\tthis.day = 1;\r\n\t\t\tSystem.out.println(\"\\nhappy new year!!!\\n\");\r\n\t\t}\r\n\r\n\t\telse\r\n\t\t\tthis.day++;\r\n\t}",
"public void checkLeapYear(int year) {\r\n\t int count=1;\r\n\t int temp=year;\r\n\t\twhile(temp>10){\r\n\t\t\tint r= temp%10;\r\n\t\t\tcount++;\r\n\t\t\ttemp=temp/10;\r\n\t\t}\r\n\t\tif(count>=3){\r\n\t\t\tif(year%4==0){\r\n\t\t\t\tSystem.out.println(\"given year is leap year:\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"given year is not leap year:\");\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"please enter atleast 4 digit no to find leap year\");\r\n\t\t}\r\n}",
"public boolean setYear(int newYear) {\n\t\tthis.year = newYear;\n\t\tdeltatIsValid = false;\n\t\tthis.jd = swe_julday(this.year, this.month, this.day, this.hour, this.calType); // ->\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// erzeugt\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// JD\n\t\treturn true;\n\t}",
"protected static final int jan01OfYear(int yyyy)\n {\n int leapAdjustment;\n if ( yyyy < 0 )\n {\n // years -1 -5 -9 were leap years.\n // adjustment -1->1 -2->1 -3->1 -4->1 -5->2 -6->2\n leapAdjustment = (3 - yyyy) / 4;\n return(yyyy * 365) - leapAdjustment + BC_epochAdjustment;\n }\n\n // years 4 8 12 were leap years\n // adjustment 1->0 2->0, 3->0, 4->0, 5->1, 6->1, 7->1, 8->1, 9->2\n leapAdjustment = (yyyy - 1) / 4;\n\n int missingDayAdjust = (yyyy > GC_firstYYYY) ? missingDays : 0;\n\n // mod 100 and mod 400 rules started in 1600 for Gregorian,\n // but 1800/2000 in the British scheme\n if ( yyyy > Leap100RuleYYYY )\n {\n leapAdjustment -= (yyyy-Leap100RuleYYYY+99) / 100;\n }\n if ( yyyy > Leap400RuleYYYY )\n {\n leapAdjustment += (yyyy-Leap400RuleYYYY+399) / 400;\n }\n\n return yyyy * 365\n + leapAdjustment\n - missingDayAdjust\n + AD_epochAdjustment;\n }",
"private int NumberLeapyearsSince1900 (int YearNumber) {\n int i = 1900;\n int countLeapyears = 0;\n for (i = 1900; i < YearNumber; i = i+4); {\n if (daysInYear(i) == 366) {\n countLeapyears ++;\n }\n } return countLeapyears;\n\n }",
"public void setYear(int year)\r\n\t{\r\n\t\tthis.year = year;\r\n\t}",
"public DueDateBuilder setYear(int year) {\n this.year = year;\n return this;\n }",
"@Test\n public void isLeapYear() {\n assertFalse(Deadline.isLeapYear(Integer.parseInt(VALID_YEAR_2018)));\n\n // Valid leap year -> returns true\n assertTrue(Deadline.isLeapYear(Integer.parseInt(LEAP_YEAR_2020)));\n\n // Valid year divisible by 4 but is common year -> returns false\n assertFalse(Deadline.isLeapYear(Integer.parseInt(NON_LEAP_YEAR_2100)));\n\n // Valid year divisible by 100 but is leap year -> returns true\n assertTrue(Deadline.isLeapYear(Integer.parseInt(LEAP_YEAR_2400)));\n }",
"public int getStartingYear()\n {\n return 2013;\n }",
"public void setYear(int year) {\r\n this.year = year;\r\n }",
"public void setYear(int year) \n\t{\n\t\tthis.year = year;\n\t}",
"private boolean leap(int year) {\n\t\tif (!(year % 4 == 0)) {\n\t\t\treturn false;\n\t\t} else if (!(year % 100 == 0)) {\n\t\t\treturn true;\n\t\t} else if (!(year % 400 == 0)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public Calendar calculateEasterForYear(int year) {\n int a = year % 4;\n int b = year % 7;\n int c = year % 19;\n int d = (19 * c + 15) % 30;\n int e = (2 * a + 4 * b - d + 34) % 7;\n int month = (int) Math.floor((d + e + 114) / 31);\n int day = ((d + e + 144) % 31) + 1;\n day++;\n\n Calendar instance = Calendar.getInstance();\n instance.set(Calendar.YEAR, year);\n instance.set(Calendar.MONTH, month);\n instance.set(Calendar.DAY_OF_MONTH, day);\n\n instance.add(Calendar.DAY_OF_MONTH, 13);\n\n return instance;\n }",
"public ConcreteYear(int year) {\r\n if (year > 0) {\r\n this.year = year;\r\n }\r\n }",
"public void setYear(int year) {\n this.year = year;\n }",
"public abstract String reportLeapYear(int year);",
"private static int getDaysInYear(final int year) {\n return LocalDate.ofYearDay(year, 1).lengthOfYear();\n }",
"public void leapYear() {\n System.out.print(\"\\nEnter a year: \");\n long year = in.nextLong();\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n System.out.println(\"\\n\" + year + \" is a leap year.\\n\");\n } else {\n System.out.println(\"\\n\" + year + \" is not a leap year.\\n\");\n }\n }",
"public void setYear(int year)\n {\n this.year = year;\n }",
"public void setYear(Integer year) {\r\n this.year = year;\r\n }",
"public void setYear(Integer year) {\r\n this.year = year;\r\n }",
"Year createYear();",
"@Test\n public void leapYearIsDivisibleBy4(){\n int year = 2020;\n assertTrue(LeapYear.isLeapYear(year));\n }",
"public void setYear(Integer year) {\n this.year = year;\n }",
"public void setYear(Integer year) {\n this.year = year;\n }",
"public void setYear(Integer year) {\n this.year = year;\n }",
"public void setYear(final int year) {\n\t\tthis.year = year;\n\t}",
"private boolean isDivisibleBy400(int year) {\n\t\treturn checkDivisibility(year, 400);\n\t}",
"public void setYear(int year) {\n\t\tthis.year = year;\n\t}",
"public void setYear(int year) {\n\t\tthis.year = year;\n\t}",
"public void setYear(int year) throws InvalidDateException {\r\n\t\tif (year <= 2100 & year >= 2000) {\r\n\t\t\tthis.year = year;\r\n\t\t} else {\r\n\t\t\tthrow new InvalidDateException(\"Please enter a realistic year for the date (between 2000 and 2100) !\");\r\n\t\t}\r\n\t}",
"public void increaseYearsWorked() {\n ++yearsWorked;\n }",
"public void setYear (int yr) {\n year = yr;\n }",
"private static boolean isLeapYear(int year)\n\t{\n \t if ((year % 4 == 0) && (year % 100 != 0)) return true;\n\t\t if (year % 400 == 0) return true;\n\t\t return true;\n }",
"public void setYear(short value) {\n this.year = value;\n }",
"public String getNextYear(String date){\r\n\t\tString registerDueDate=\"\";\r\n\t\ttry{\r\n\t\t\tList<TransferNORInPSTBean> minimumRegisterDueDateList=(List<TransferNORInPSTBean>)sqlMapClient.queryForList(\"TransferNORInPSTBean.getNextRegisterDueDate\", date);\r\n\t\t\tfor(TransferNORInPSTBean minimumRegisterDueDateValue: minimumRegisterDueDateList){\r\n\t\t\t\tregisterDueDate=minimumRegisterDueDateValue.getRegisterDueDate();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\t//System.out.println(\"Exception in add next year\"+e.getMessage());\r\n\t\t\tlogger.info(\"Exception in get next year \"+e.getMessage());\r\n\t\t}\r\n\t\treturn registerDueDate;\r\n\t}",
"public void goToYear(int year) {\n if (mPager != null) {\n mPager.setCurrentItem(year - EPOCH_TIME_YEAR_START);\n }\n }",
"public SubscriptionYear(int year,double subscriptions) {\n\t setYear(year);\n\t setSubscription(subscriptions);\n\t this.next = null;\n\t}",
"public EventsCalendarYear(Integer year) {\n initYear(year);\n }",
"public void yearEndNotification() {\n\t\tif ((this.isActive()) && (!this.hasInfiniteAge())) {\n\t\t\tage++;\n\n\t\t\tif (age >= maximum_age)\n\t\t\t\tactive_status = false;\n\t\t}\n\t}",
"public void setYear(int year) {\n\tthis.year = year;\n}",
"private static final int getYear(long fixedDate) {\n\tlong d0;\n\tint d1, d2, d3;\n\tint n400, n100, n4, n1;\n\tint year;\n\n\tif (fixedDate >= 0) {\n\t d0 = fixedDate - 1;\n\t n400 = (int)(d0 / 146097);\n\t d1 = (int)(d0 % 146097);\n\t n100 = d1 / 36524;\n\t d2 = d1 % 36524;\n\t n4 = d2 / 1461;\n\t d3 = d2 % 1461;\n\t n1 = d3 / 365;\n\t} else {\n\t d0 = fixedDate - 1;\n\t n400 = (int)floorDivide(d0, 146097L);\n\t d1 = (int)mod(d0, 146097L);\n\t n100 = floorDivide(d1, 36524);\n\t d2 = mod(d1, 36524);\n\t n4 = floorDivide(d2, 1461);\n\t d3 = mod(d2, 1461);\n\t n1 = floorDivide(d3, 365);\n\t}\n\tyear = 400 * n400 + 100 * n100 + 4 * n4 + n1;\n\tif (!(n100 == 4 || n1 == 4)) {\n\t ++year;\n\t}\n\treturn year;\n }",
"public void setYear(short value) {\n this.year = value;\n }",
"public static String getNextSeq(String seq) {\n long intNextSeq = 0;\n// if (intSeq < 204) {\n// intNextSeq = Long.parseLong(seq)+1;\n// }\n// if (intSeq == 204) {\n// seq = seq.substring(0, seq.length() - 3);\n// SimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMdd\");\n// Date date = null;\n// try {\n// date = sdf.parse(seq);\n// } catch (ParseException e) {\n// e.printStackTrace();\n// }\n// Date date2 = DateUtils.addDays(date, 1);\n// String nextDate = sdf.format(date2) + \"000\";\n// intNextSeq = Long.parseLong(nextDate);\n// intNextSeq = intNextSeq + 1;\n// }\n return intNextSeq+\"\";\n }",
"public SubscriptionYear getNext() {\n\t\treturn this.next;\n\t\t\n\t}",
"protected void sequence_YEARS(ISerializationContext context, YearValue semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}",
"public static int normalizeYear(int year) {\n if (year < 100 && year >= 0) {\n Calendar now = Calendar.getInstance();\n String currentYear = String.valueOf(now.get(Calendar.YEAR));\n String prefix = currentYear.substring(0, currentYear.length() - 2);\n year = Integer.parseInt(String.format(Locale.US, \"%s%02d\", prefix, year));\n }\n return year;\n }",
"@Override\n\tpublic void setYear(int year) throws RARException {\n\t\tthis.year = year;\n\t}",
"public static int cleanReleaseYear(Literal year) {\n String yearString;\n int yearInt = 0;\n if(year == null || \"\".equals(year.toString())) {\n yearString = \"0\";\n } else {\n yearString = year.toString();\n }\n Pattern p = Pattern.compile(\"\\\\d\\\\d\\\\d\\\\d\");\n Matcher m = p.matcher(yearString);\n if(m.find()) {\n yearString = m.group();\n yearInt = Integer.parseInt(yearString);\n }\n return yearInt;\n }",
"private static Date getYearDate(int year) {\n Calendar calendar = Calendar.getInstance();\n calendar.clear();\n calendar.set(Calendar.YEAR, year);\n return calendar.getTime();\n }",
"public void setYear(short value) {\n this.year = value;\n }",
"public void setYear(short value) {\n this.year = value;\n }",
"public void setYear(short value) {\n this.year = value;\n }",
"public void addYear(int amount) {\r\n int oldValue = getYear();\r\n calendarTable.getCalendarModel().addYear(amount);\r\n yearChanged(oldValue);\r\n }",
"public void addOriginalReleaseYear(java.lang.Integer value) {\r\n\t\tBase.add(this.model, this.getResource(), ORIGINALRELEASEYEAR, value);\r\n\t}",
"public static void main(String args[])\n {\n\n Scanner sc = new Scanner(System.in);\n boolean isDistinct = false;\n\n System.out.print(\"What year do you want to start: \");\n\n int year = sc.nextInt();\n //firstYear somewhat reduntant, holds userInput of year, does not get modified\n int firstYear = year;\n //need to find year that is distinct after given userYear\n year++;\n\n //checks to see if year distinct, if not adds 1 to year and continues\n while ((isDistinct == false) && (year < 100001))\n {\n\n isDistinct = isDistinctYearCheck(Integer.toString(year));\n //System.out.println(\"the year: \" + year + \" is \" + isDistinct);\n \n //if Distinct year not found adds 1 to year\n if (!isDistinct)\n {\n year += 1;\n }\n\n\n }\n\n if (isDistinct == true)\n {\n System.out.println(year);\n }else\n {\n System.out.println(\"There were no distinct years between \" + firstYear + \" and 100001\" );\n }\n \n sc.close();\n\n }",
"public void enterYearField(String year) {\n Reporter.addStepLog(\" Enter year \" + year + \" to year field \" + _yearField.toString());\n sendTextToElement(_yearField, year);\n log.info(\" Enter year \" + year + \" to year field \" + _yearField.toString());\n }",
"public boolean LeapYearValidation(int year) {\r\n\t\tif (year >= 1582 && year <= 9999)\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\r\n\t}",
"public void setYear(int Year) {\n\t this.year= Year;\n\t}",
"public void setStartYear(int startYear) {\n\t\tthis.startYear = startYear;\n\t}",
"public boolean Leap_Gregorian(double year)\n {\n return ((year % 4) == 0) && (!(((year % 100) == 0) && ((year % 400) != 0)));\n }",
"public boolean isLeapYear(int year){\r\n if(year%4 != 0){\r\n return false;\r\n } else if(year%100 == 0){\r\n if(year%400 != 0) return false; \r\n }\r\n return true;\r\n }",
"public void setYear(int year) {\n\t\tthis.date.setYear(year);\n\t}",
"public void setYear(int y){\n\t\tyear = y ; \n\t}",
"private boolean checkDivisibility(int year, int num) {\n\t\treturn (year%num==0);\n\t}",
"@Test\n\tpublic void testNextDate(){\n\t\tif(year==444 && day==29){\n\t\t\t\tday=1;\n\t\t\t\tDate actualDate = new Date(year,(month+1),day);\n\t\t\t\tAssert.assertEquals(expectedDate,actualDate);\n\n } else if(day==30 && year==2005){ //for test case 10\n\t\t\t\tday=1;\n\t\t\t\tDate actualDate = new Date(year,(month+1),day);\n\t\t\t\tAssert.assertEquals(expectedDate,actualDate);\n\n\n\t\t} else if(day==31 ){ //for test cases 13,14,15\n\t\t\tif(month==12){\n\t\t\tday=1;\n\t\t\tmonth=1;\n\t\t\tyear+=1;\n\t\t\tDate actualDate = new Date(year,month,day);\n\t\t\tAssert.assertEquals(expectedDate,actualDate);\n } else {\n\t\t\t\tday=1;\n\t\t\t\tDate actualDate = new Date(year,(month+1),day);\n\t\t\t\tAssert.assertEquals(expectedDate,actualDate);\n\t\t\t}\n\n\t\t}\n\t\telse{\t\n\t\t\tDate actualDate = new Date(year,month,(day+1));\n\t\t\tAssert.assertEquals(expectedDate,actualDate);\n\n\t\t}\n\t\n\t}",
"public EventsCalendarYear() {\n initYear();\n }",
"private static boolean isLeapYear(int year) {\n return year % 400 == 0 || (year % 100 != 0 && year % 4 == 0);\n }",
"private boolean isDivisibleBy4(int year) {\n\t\treturn checkDivisibility(year,4);\n\t}",
"private void createXmlYear(int year){\r\n Document doc = initialize();\r\n Element parent = doc.getDocumentElement();\r\n Element docYear = doc.createElement(\"year\");\r\n docYear.setAttribute(\"yid\", Integer.toString(year));\r\n parent.appendChild(docYear);\r\n transformToXml(doc);\r\n }",
"public void increment()\n // Increments this IncDate to represent the next day.\n {\n\t boolean ly = false;\n\t if(((year % 4 == 0) && year % 100 != 0) || year % 400 == 0) {\n\t\t //leap year\n\t\t ly = true;\n\t }\n\t if ((month == 2 && day == 28 && !ly) || (month == 2 && day == 29 && ly)) {\n\t\t month = 3;\n\t\t day = 1;\n\t } else if (month == 2 && day == 28 && !ly) {\n\t\t day ++;\n\t } else if ((month == 4 || month == 6 || month == 9 || month == 11) && day == 30){\n\t\t month ++;\n\t\t day = 1;\n\t } else if ((month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10) && day == 31){\n\t\t System.out.println(\"month is \" + month);\n\t\t month ++;\n\t\t day = 1;\n\t } else if ((month == 12) && day == 31) {\n\t\t year ++;\n\t\t month = 1;\n\t\t day = 1;\n\t } else {\n\t\t day ++;\n\t }\n }",
"private int actualYear() throws IOException{\r\n try {\r\n return Integer.parseInt(getActualSheet().getName());\r\n } catch (NumberFormatException e) {\r\n System.err.println(\"You have to start year first\");\r\n return 0;\r\n }\r\n }",
"public void setIndicatorForYear(int requestedYear, Indicator data)\n {\n int incrementYear;\n if (indicators[0] == null)\n {\n indicators[0] = data;\n return;\n }\n incrementYear = indicators[0].getYear();\n for (int i = 0; i < indicators.length; i++)\n {\n if (incrementYear == requestedYear)\n {\n indicators[i] = data;\n return;\n }\n incrementYear++;\n }\n throw new IllegalArgumentException();\n }",
"private boolean isDivisibleBy100(int year) {\n\t\treturn checkDivisibility(year, 100);\n\t}",
"boolean isLeapYear(int year){\n\tif (year % 400 == 0)\n\t\treturn true;\n\telse if (year % 100 == 0)\n\t\treturn false;\n\telse if (year % 4 == 0)\n\t\treturn true;\n\telse\n\t\treturn false;\n }",
"private static boolean isLeapYear(int year)\n\t{\n\t\treturn ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\n\t}",
"public void advance() {\n\n if (length == Length.DAILY) {\n startDate.add(Calendar.DATE, 1);\n } else if (length == Length.WEEKLY) {\n startDate.add(Calendar.WEEK_OF_YEAR, 1);\n } else if (length == Length.BIWEEKLY) {\n startDate.add(Calendar.DATE, 14);\n } else if (length == Length.MONTHLY) {\n startDate.add(Calendar.MONTH, 1);\n } else if (length == Length.YEARLY) {\n startDate.add(Calendar.YEAR, 1);\n }\n\n calculateEndDate();\n\n }",
"private int restrictYear(Message msg, String parameter, int section) {\n int[] years = setYearRestriction(msg, parameter, section);\n\n if (years[0] == ERROR_CODE[0]) {\n return -1;\n }\n\n yearRestriction = true;\n lowerYear = years[0];\n upperYear = years[1];\n return 0;\n }",
"public void Leapyear(int YearToCheck) {\n\n boolean leapValue = false;\n\n if (((YearToCheck % 4 == 0) && (YearToCheck % 100 != 0)) || (YearToCheck % 400 == 0)){\n leapValue=true;}\n\n if (leapValue)\n System.out.println(YearToCheck + \" is a leap year.\");\n else\n System.out.println(YearToCheck + \" is not a leap year.\");\n }"
] | [
"0.68044734",
"0.64849454",
"0.64313865",
"0.63582224",
"0.63029015",
"0.6255139",
"0.6157794",
"0.6149514",
"0.6097141",
"0.595083",
"0.59367806",
"0.587788",
"0.5850977",
"0.58278584",
"0.58267474",
"0.5795586",
"0.5772456",
"0.5764016",
"0.5754571",
"0.5735687",
"0.5729934",
"0.5721008",
"0.5715646",
"0.57093513",
"0.5695204",
"0.56943107",
"0.56726265",
"0.56706136",
"0.5668915",
"0.5656549",
"0.5654837",
"0.5636789",
"0.56196487",
"0.5618329",
"0.56161004",
"0.561283",
"0.5608744",
"0.55999684",
"0.5599598",
"0.5598674",
"0.55950975",
"0.559323",
"0.559323",
"0.55860275",
"0.55799794",
"0.55778164",
"0.55778164",
"0.55778164",
"0.55739397",
"0.5569329",
"0.55589014",
"0.55589014",
"0.5555804",
"0.5554866",
"0.55498135",
"0.55404866",
"0.5530599",
"0.55278593",
"0.55192935",
"0.5515532",
"0.55115193",
"0.54982334",
"0.54849887",
"0.54779494",
"0.54768234",
"0.5469757",
"0.54694974",
"0.5469383",
"0.54392797",
"0.54364383",
"0.5434112",
"0.5433869",
"0.5430364",
"0.5430364",
"0.5430364",
"0.54283464",
"0.5425993",
"0.5422528",
"0.54154587",
"0.54117614",
"0.5397325",
"0.5392102",
"0.53898966",
"0.5377521",
"0.53753793",
"0.5369298",
"0.5363458",
"0.5352934",
"0.5347196",
"0.53465325",
"0.5336305",
"0.5334487",
"0.5329831",
"0.53266454",
"0.53228366",
"0.53164476",
"0.5315497",
"0.53149045",
"0.5309525",
"0.53087157",
"0.5308666"
] | 0.0 | -1 |
recordType parameter is not used in this case | public boolean accessionNumberIsUsed(String accessionNumber,
String recordType) {
SampleDAO SampleDAO = new SampleDAOImpl();
if (!FormFields.getInstance().useField(
Field.LAB_NUMBER_USED_ONLY_IF_SPECIMENS)) {
return SampleDAO.getSampleByAccessionNumber(accessionNumber) != null;
} else {
SampleItemDAO sampleItemDAO = new SampleItemDAOImpl();
Sample sample = null;
Set<Integer> includedSampleStatusList;
includedSampleStatusList = new HashSet<Integer>();
includedSampleStatusList.add(Integer.parseInt(StatusService
.getInstance().getStatusID(SampleStatus.Entered)));
// Dung add for sample if remove all sample item(edit sample)
includedSampleStatusList.add(Integer.parseInt(StatusService
.getInstance().getStatusID(SampleStatus.Canceled)));
sample = SampleDAO.getSampleByAccessionNumber(accessionNumber);
if (sample == null
|| GenericValidator.isBlankOrNull(sample.getId())) {
return false;
} else {
List<SampleItem> sampleItemList = sampleItemDAO
.getSampleItemsBySampleIdAndStatus(sample.getId(),
includedSampleStatusList);
return !sampleItemList.isEmpty();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected Class<RecordType> getBoundType() {\n return RecordType.class;\n }",
"public void setRecordType(String RecordType) {\n this.RecordType = RecordType;\n }",
"@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }",
"@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }",
"@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }",
"@Override\n public Class<Record> getRecordType() {\n return Record.class;\n }",
"GetRecordsType createGetRecordsType();",
"@Override\n public Class<MytableRecord> getRecordType() {\n return MytableRecord.class;\n }",
"@Test\n public void recordTypeTest() {\n // TODO: test recordType\n }",
"RecordPropertyType createRecordPropertyType();",
"@Override\n public Class<ModelRecord> getRecordType() {\n return ModelRecord.class;\n }",
"RecordType createRecordType();",
"GetRecordByIdType createGetRecordByIdType();",
"private RecordImpl(Table tableParent, long lRecord, RecordType rt) throws IOException\n\t{\n\t\t_tableParent\t= tableParent;\n\t\t_lRecord\t\t= lRecord;\n\t\tif (rt.getAny().size() > 0)\n\t\t{\n\t\t\tElement el = (Element) rt.getAny().get(0);\n\t\t\tif (el.getOwnerDocument() != getDocument())\n\t\t\t{\n\t\t\t\t_doc = el.getOwnerDocument();\n\t\t\t}\n\t\t}\n\t\tsetRecordType(rt);\n\t}",
"@Override\n public Class<LinearmodelRecord> getRecordType() {\n return LinearmodelRecord.class;\n }",
"@Override\n public Class<ZTest1Record> getRecordType() {\n return ZTest1Record.class;\n }",
"@Override\n public Class<PaymentP2007_03Record> getRecordType() {\n return PaymentP2007_03Record.class;\n }",
"@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}",
"@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}",
"@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}",
"@Override\n public Class<PatientRecord> getRecordType() {\n return PatientRecord.class;\n }",
"public GO_RecordType() {\n }",
"@Override\n\tpublic java.lang.Class<org.jooq.examples.h2.matchers.tables.records.V_2603Record> getRecordType() {\n\t\treturn org.jooq.examples.h2.matchers.tables.records.V_2603Record.class;\n\t}",
"@Override\n public Class<DynamicSchemaRecord> getRecordType() {\n return DynamicSchemaRecord.class;\n }",
"public void setRecordTypeId(Integer recordTypeId) {\n this.recordTypeId = recordTypeId;\n }",
"@Override\n public Class<PgAmopRecord> getRecordType() {\n return PgAmopRecord.class;\n }",
"public RecordRecord() {\n\t\tsuper(org.jooq.examples.cubrid.demodb.tables.Record.RECORD);\n\t}",
"@Override\n public Class<GetexamreceiptdeptlistRecord> getRecordType() {\n return GetexamreceiptdeptlistRecord.class;\n }",
"public Integer getRecordTypeId() {\n return recordTypeId;\n }",
"@Override\n public Class<ReportVersionArtefactRecord> getRecordType() {\n return ReportVersionArtefactRecord.class;\n }",
"public void addRecord(final AbstractRecord record) {\n\t\tif (record == null) {\n\t\t\tthrow new IllegalArgumentException(\"Passed record is null!\");\n\t\t} else if (!recordType.equals(record.getClass())) {\n\t\t\tthrow new IllegalArgumentException(\"Passed Record type \" + record.getClass().getName()\n\t\t\t\t\t+ \" is not compatibel with the wrapper record type \" + recordType.getName());\n\t\t}\n\n\t\tif (records.isEmpty()) {\n\n\t\t\tList<String> parNames = record.getNonMetricParameterNames();\n\t\t\tList<Object> parValues = record.getNonMetricValues();\n\t\t\tfor (int i = 0; i < parNames.size(); i++) {\n\t\t\t\taddInputParameter(parNames.get(i), parValues.get(i));\n\t\t\t}\n\n\t\t}\n\n\t\trecords.add(record);\n\t}",
"DescribeRecordType createDescribeRecordType();",
"@Override\n public Class<CarmodelRecord> getRecordType() {\n return CarmodelRecord.class;\n }",
"@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}",
"@Override\n\tpublic Class<Record> getRecordType() {\n\t\treturn Record.class;\n\t}",
"protected abstract boolean handleRecord(T mainRecord, T lookupRecord);",
"@Override\n public Class<TbljobSkillRecord> getRecordType() {\n return TbljobSkillRecord.class;\n }",
"@Override\n public Class<AnalysisRecord> getRecordType() {\n return AnalysisRecord.class;\n }",
"public Class<?> getRecordClass() \n\t{\n\t return recordClass ;\n\t}",
"@Override\n public Class<NewDigitalMediaObjectRecord> getRecordType() {\n return NewDigitalMediaObjectRecord.class;\n }",
"@Override\n public Class<QsRecord> getRecordType() {\n return QsRecord.class;\n }",
"RecordType newRecordType(String recordTypeId, QName name) throws TypeException;",
"public /*override*/ void LoadRecordData(BinaryReader bamlBinaryReader) \r\n {\r\n TypeId = bamlBinaryReader.ReadInt16(); \r\n RuntimeName = bamlBinaryReader.ReadString(); \r\n }",
"DescribeRecordResult describeRecord(DescribeRecordRequest describeRecordRequest);",
"public T caseRecordType(RecordType object) {\n\t\treturn null;\n\t}",
"@Override\n public Class<TblrefJoboptioncodeRecord> getRecordType() {\n return TblrefJoboptioncodeRecord.class;\n }",
"RecordTypeRule createRecordTypeRule();",
"@Override\n public Class<ReportVersionDataRecord> getRecordType() {\n return ReportVersionDataRecord.class;\n }",
"private String determineRecordType(String inputLine, int lineIndex) throws ModuleException {\n\t\tfor (String keyName: this.recordTypes.keySet()){\n\t\t\tRecordTypeParametersPlain2XML recordType = this.recordTypes.get(keyName);\n\t\t\tString keyValue = recordType.parseKeyFieldValue(inputLine);\n\t\t\tif (keyValue != null) {\n\t\t\t\treturn keyName;\n\t\t\t}\n\t\t}\n\t\tif(this.genericRecordType != null) {\n\t\t\treturn this.genericRecordType;\n\t\t} else {\n\t\t\tthrow new ModuleException(\"Unable to determine record type for line \" + (lineIndex+1) );\n\t\t}\n\t}",
"private @NotNull RecordDatum finishReadingRecord(\n @NotNull JsonToken token,\n @Nullable String fieldName,\n @NotNull RecordType type\n ) throws IOException, JsonFormatException {\n\n ensure(token, JsonToken.START_OBJECT);\n RecordDatum.Builder datum = type.createBuilder();\n if (fieldName == null) { // empty record?\n ensureCurr(JsonToken.END_OBJECT, \"field name or '}'\");\n return datum;\n } else {\n while (true) {\n Field field = type.fieldsMap().get(fieldName);\n if (field == null) throw error(\n \"Unknown field '\" + fieldName + \"' in record type '\" + type.name().toString() + \"'\"\n );\n Data fieldData = readData(field.dataType());\n datum._raw().setData(field, fieldData);\n\n token = nextNonEof();\n if (token == JsonToken.END_OBJECT) break;\n if (token == JsonToken.FIELD_NAME) fieldName = currentName();\n else throw expected(\"field name or '}'\");\n }\n }\n return datum;\n }",
"@Override\n public Class<XmlReportKloezelRecord> getRecordType() {\n return XmlReportKloezelRecord.class;\n }",
"@Override\n public Class<JournalEntryLineRecord> getRecordType() {\n return JournalEntryLineRecord.class;\n }",
"@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}",
"@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}",
"@Override\n\tpublic java.lang.Class<org.jooq.Record> getRecordType() {\n\t\treturn org.jooq.Record.class;\n\t}",
"@Override\n public Class<LangsRecord> getRecordType() {\n return LangsRecord.class;\n }",
"public static boolean recordType(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"recordType\")) return false;\n if (!nextTokenIs(b, LPAREN)) return false;\n boolean r;\n Marker m = enter_section_(b);\n r = consumeToken(b, LPAREN);\n r = r && recordType_1(b, l + 1);\n r = r && recordTypeInner(b, l + 1);\n r = r && consumeToken(b, RPAREN);\n r = r && recordType_4(b, l + 1);\n exit_section_(b, m, RECORD_TYPE, r);\n return r;\n }",
"@Override\n public Class<ProcedureRequestRecord> getRecordType() {\n return ProcedureRequestRecord.class;\n }",
"@ApiModelProperty(value = \"Type of the followed record. One of the following: EMAIL, NOTE, TASK, CONTACT, ORGANISATION, PROJECT, OPPORTUNITY, LEAD.\")\n @JsonProperty(\"RECORD_TYPE\")\n public String getRECORDTYPE() {\n return RECORD_TYPE;\n }",
"public GenericData.Record serialize() {\n return null;\n }",
"@Override\n public Class<AssessmentStudenttrainingworkflowRecord> getRecordType() {\n return AssessmentStudenttrainingworkflowRecord.class;\n }",
"@Override\n public Class<PgMatviewsRecord> getRecordType() {\n return PgMatviewsRecord.class;\n }",
"@Override\n public Class<TProductRentTypeRecord> getRecordType() {\n return TProductRentTypeRecord.class;\n }",
"protected void perRecordInit(Record record)\n {\n }",
"BriefRecordType createBriefRecordType();",
"@Override\n public Class<TableVersionRecord> getRecordType() {\n return TableVersionRecord.class;\n }",
"public void setRecord(Record record) {\n this.record = record;\n }",
"@Override\n public Class<AccountRecord> getRecordType() {\n return AccountRecord.class;\n }",
"Collection<RecordType> getRecordTypes() throws TypeException, InterruptedException;",
"@Override\n public Class<TOpLogsRecord> getRecordType() {\n return TOpLogsRecord.class;\n }",
"@Override\n public Class<QuestionForBuddysRecord> getRecordType() {\n return QuestionForBuddysRecord.class;\n }",
"@Override\n public Class<PgPublicationTablesRecord> getRecordType() {\n return PgPublicationTablesRecord.class;\n }",
"public abstract Object parseRecord(String input);",
"public RestoreItem setRecordingType(String str) {\n this.mRecordingType = str;\n return this;\n }",
"public void record(){\n\t}",
"@Override\n public Class<AbsenceRecord> getRecordType() {\n return AbsenceRecord.class;\n }",
"@Override\n public Class<TblscreenTestOptionRecord> getRecordType() {\n return TblscreenTestOptionRecord.class;\n }",
"@Override\n public Class<RedpacketConsumingRecordsRecord> getRecordType() {\n return RedpacketConsumingRecordsRecord.class;\n }",
"public static <T extends Record> T attemptParseRecord(byte[] data, int offsetStart) {\n // no data?\n if (data == null) {\n return null;\n }\n // invalid offset?\n if (data.length < offsetStart) {\n return null;\n }\n //Log.d(TAG,String.format(\"checking for handler for record type 0x%02X at index %d\",data[offsetStart],offsetStart));\n RecordTypeEnum en = RecordTypeEnum.fromByte(data[offsetStart]);\n T record = en.getRecordClass();\n if (record != null) {\n // sigh... trying to avoid array copying...\n // have to do this to set the record's opCode\n byte[] tmpData = new byte[data.length];\n System.arraycopy(data, offsetStart, tmpData, 0, data.length - offsetStart);\n record.collectRawData(tmpData, PumpModel.MM522);\n }\n return record;\n }",
"@Override\n public Class<SourceEightRecord> getRecordType() {\n return SourceEightRecord.class;\n }",
"public String getRecordType() {\n return this.RecordType;\n }",
"@Override\n public Class<HrCmsMediaRecord> getRecordType() {\n return HrCmsMediaRecord.class;\n }",
"@Override\n public Class<DictColumnScriptInfoRecord> getRecordType() {\n return DictColumnScriptInfoRecord.class;\n }",
"@Override\n\tpublic java.lang.Class<persistencia.tables.records.AsientoRecord> getRecordType() {\n\t\treturn persistencia.tables.records.AsientoRecord.class;\n\t}",
"@Override\n public Class<CabTripDataRecord> getRecordType() {\n return CabTripDataRecord.class;\n }",
"@Override\n public Class<TUserRecord> getRecordType() {\n return TUserRecord.class;\n }",
"@Override\n public Class<StudentCourseRecord> getRecordType() {\n return StudentCourseRecord.class;\n }",
"abstract protected T getRecordFromLine(String line) throws DataImportException ;",
"@Override\n public Class<MemberRecord> getRecordType() {\n return MemberRecord.class;\n }",
"public Long createRecord(Record object);",
"void handleParsedRecord(SampleRecord record);",
"SummaryRecordType createSummaryRecordType();",
"@Override\n public Class<EAssetRecord> getRecordType() {\n return EAssetRecord.class;\n }",
"RecordType newRecordType(QName name) throws TypeException;",
"@Override\n\tpublic java.lang.Class<net.user1.union.zz.common.model.tables.records.ZzcronRecord> getRecordType() {\n\t\treturn __RECORD_TYPE;\n\t}",
"public static boolean recordTypeField(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"recordTypeField\")) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, RECORD_TYPE_FIELD, \"<record type field>\");\n r = recordTypeField_0(b, l + 1);\n r = r && type(b, l + 1);\n r = r && recordTypeField_2(b, l + 1);\n exit_section_(b, l, m, r, false, null);\n return r;\n }",
"@Override\n\tpublic java.lang.Class<com.petpace.db.jooq.tables.records.PetAttributeValueHistoryRecord> getRecordType() {\n\t\treturn com.petpace.db.jooq.tables.records.PetAttributeValueHistoryRecord.class;\n\t}",
"@Override\n public Class<GchCarLifeBbsRecord> getRecordType() {\n return GchCarLifeBbsRecord.class;\n }",
"@Override\n public Class<TreasureVersionRecord> getRecordType() {\n return TreasureVersionRecord.class;\n }",
"@Override\n\tpublic java.lang.Class<models.tables.records.UserRecord> getRecordType() {\n\t\treturn models.tables.records.UserRecord.class;\n\t}",
"@Override\n public Class<ResourcesRecord> getRecordType() {\n return ResourcesRecord.class;\n }"
] | [
"0.70980424",
"0.7002447",
"0.69214314",
"0.69214314",
"0.69214314",
"0.69214314",
"0.6824319",
"0.67480767",
"0.67141587",
"0.6682869",
"0.66804796",
"0.6676266",
"0.66571933",
"0.6582582",
"0.6535174",
"0.6521814",
"0.64335215",
"0.6416895",
"0.6416895",
"0.6416895",
"0.6413759",
"0.6403984",
"0.63986236",
"0.63749254",
"0.63450587",
"0.633225",
"0.63283145",
"0.6292668",
"0.62878585",
"0.6262977",
"0.6257757",
"0.6256113",
"0.62359077",
"0.62265295",
"0.62265295",
"0.6199902",
"0.6199324",
"0.61989254",
"0.6189854",
"0.61645794",
"0.6160557",
"0.6157013",
"0.61563295",
"0.6151192",
"0.614706",
"0.6133437",
"0.61256206",
"0.61142695",
"0.61100477",
"0.61078525",
"0.6103119",
"0.60893965",
"0.6084303",
"0.6084303",
"0.6084303",
"0.6075222",
"0.607398",
"0.6059507",
"0.60508615",
"0.6045825",
"0.6040622",
"0.603454",
"0.6032482",
"0.59921694",
"0.5990341",
"0.5988649",
"0.598827",
"0.597584",
"0.59742135",
"0.5970449",
"0.5960635",
"0.59440804",
"0.5935398",
"0.5933755",
"0.59333146",
"0.5930716",
"0.5916588",
"0.59141463",
"0.59079754",
"0.59063655",
"0.58907837",
"0.58874905",
"0.5876453",
"0.58685",
"0.58609945",
"0.58599985",
"0.5846522",
"0.5845118",
"0.5843936",
"0.58370185",
"0.5834147",
"0.5833138",
"0.5832418",
"0.5825297",
"0.58185256",
"0.5818126",
"0.58082926",
"0.5804902",
"0.5803715",
"0.57994735",
"0.5798958"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int compare(Object arg0, Object arg1) {
return arg0.toString().compareTo(arg1.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
/ renamed from: a | public static C26323n m86584a() {
return f69309a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }",
"public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }",
"interface C10331b {\n /* renamed from: a */\n void mo26876a(int i);\n }",
"public interface C0779a {\n /* renamed from: a */\n void mo2311a();\n}",
"public interface C6788a {\n /* renamed from: a */\n void mo20141a();\n }",
"public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }",
"public interface C35013b {\n /* renamed from: a */\n void mo88773a(int i);\n}",
"public interface C11112n {\n /* renamed from: a */\n void mo38026a();\n }",
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }",
"interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }",
"public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }",
"public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }",
"private String convertir(String a) {\n StringBuilder atributo = new StringBuilder(a);\n atributo.insert(0, Character.toUpperCase(atributo.charAt(0)));\n return atributo.deleteCharAt(1).toString();\n }",
"protected m a(String name) {\n/* 42 */ return this.a.get(name);\n/* */ }",
"public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }",
"private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }",
"public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }",
"public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}",
"public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}",
"public interface C32459e<T> {\n /* renamed from: a */\n void mo83698a(T t);\n }",
"public interface C32458d<T> {\n /* renamed from: a */\n void mo83695a(T t);\n }",
"public interface C5482b {\n /* renamed from: a */\n void mo27575a();\n\n /* renamed from: a */\n void mo27576a(int i);\n }",
"public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }",
"public void a() {\n ((a) this.a).a();\n }",
"public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }",
"public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}",
"public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}",
"public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }",
"@Override\r\n\tpublic void a() {\n\t\t\r\n\t}",
"public interface C43270a {\n /* renamed from: a */\n void mo64942a(String str, long j, long j2);\n}",
"public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}",
"public interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}",
"public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}",
"interface C4483e {\n /* renamed from: a */\n boolean mo34114a();\n}",
"public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}",
"public interface C10965j<T> {\n /* renamed from: a */\n T mo26439a();\n}",
"public interface C28772a {\n /* renamed from: a */\n View mo73990a(View view);\n }",
"@Override\n\tpublic void a() {\n\t\t\n\t}",
"public interface C8326b {\n /* renamed from: a */\n C8325a mo21498a(String str);\n\n /* renamed from: a */\n void mo21499a(C8325a aVar);\n}",
"void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}",
"public interface C2367a {\n /* renamed from: a */\n C2368d mo1698a();\n }",
"interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }",
"public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}",
"public interface C4697a extends C5595at {\n /* renamed from: a */\n void mo12634a();\n\n /* renamed from: a */\n void mo12635a(String str);\n\n /* renamed from: a */\n void mo12636a(boolean z);\n\n /* renamed from: b */\n void mo12637b();\n\n /* renamed from: c */\n void mo12638c();\n }",
"public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}",
"public interface C4869f {\n /* renamed from: a */\n C4865b mo6249a();\n}",
"public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }",
"public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}",
"public interface C0601aq {\n /* renamed from: a */\n void mo9148a(int i, ArrayList<C0889x> arrayList);\n}",
"public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}",
"public interface AbstractC6461g {\n /* renamed from: a */\n String mo42332a();\n}",
"public interface AbstractC1645a {\n /* renamed from: a */\n String mo17375a();\n }",
"public interface C6178c {\n /* renamed from: a */\n Map<String, String> mo14888a();\n}",
"public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}",
"public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}",
"public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }",
"public interface C7720a {\n /* renamed from: a */\n long mo20406a();\n}",
"public String a()\r\n/* 25: */ {\r\n/* 26:171 */ return \"dig.\" + this.a;\r\n/* 27: */ }",
"public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}",
"public interface C24221b extends C28343z<C28318an> {\n /* renamed from: a */\n void mo62991a(int i);\n\n String aw_();\n\n /* renamed from: e */\n Aweme mo62993e();\n}",
"public interface C4051c {\n /* renamed from: a */\n boolean mo23707a();\n}",
"public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}",
"public void acionou(int a){\n\t\t\tb=a;\n\t\t}",
"public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}",
"public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }",
"public interface C5861g {\n /* renamed from: a */\n void mo18320a(C7251a aVar);\n\n @Deprecated\n /* renamed from: a */\n void mo18321a(C7251a aVar, String str);\n\n /* renamed from: a */\n void mo18322a(C7252b bVar);\n\n /* renamed from: a */\n void mo18323a(C7253c cVar);\n\n /* renamed from: a */\n void mo18324a(C7260j jVar);\n}",
"public interface C0937a {\n /* renamed from: a */\n void mo3807a(C0985po[] poVarArr);\n }",
"public interface C8466a {\n /* renamed from: a */\n void mo25956a(int i);\n\n /* renamed from: a */\n void mo25957a(long j, long j2);\n }",
"public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }",
"public interface C43470b {\n /* renamed from: a */\n void mo61496a(C43469a aVar, C43471c cVar);\n }",
"public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }",
"public interface C1436d {\n /* renamed from: a */\n C1435c mo1754a(C1433a c1433a, C1434b c1434b);\n}",
"public interface C4150sl {\n /* renamed from: a */\n void mo15005a(C4143se seVar);\n}",
"public void a(nm paramnm)\r\n/* 28: */ {\r\n/* 29:45 */ paramnm.a(this);\r\n/* 30: */ }",
"public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }",
"public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }",
"public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}",
"protected a<T> a(Tag.e<T> var0) {\n/* 80 */ Tag.a var1 = b(var0);\n/* 81 */ return new a<>(var1, this.c, \"vanilla\");\n/* */ }",
"public interface C35565a {\n /* renamed from: a */\n C45321i mo90380a();\n }",
"public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }",
"public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }",
"public interface C0456a {\n /* renamed from: a */\n void mo2090a(C0455b bVar);\n\n /* renamed from: a */\n boolean mo2091a(C0455b bVar, Menu menu);\n\n /* renamed from: a */\n boolean mo2092a(C0455b bVar, MenuItem menuItem);\n\n /* renamed from: b */\n boolean mo2093b(C0455b bVar, Menu menu);\n }",
"public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}",
"public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }",
"public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }",
"public interface afp {\n /* renamed from: a */\n C0512sx mo169a(C0497si siVar, afj afj, afr afr, Context context);\n}",
"public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}",
"public interface a {\n\n /* renamed from: c.b.a.c.b.b.a$a reason: collision with other inner class name */\n /* compiled from: DiskCache */\n public interface C0054a {\n a build();\n }\n\n /* compiled from: DiskCache */\n public interface b {\n boolean a(File file);\n }\n\n File a(c cVar);\n\n void a(c cVar, b bVar);\n}",
"public interface C0940d {\n /* renamed from: a */\n void mo3305a(boolean z);\n }",
"public interface AbstractC17368c {\n /* renamed from: a */\n void mo84656a(float f);\n }",
"interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }",
"public interface C10330c {\n /* renamed from: a */\n C7562b<C10403b, C10328a> mo25041a();\n}",
"public interface C3819a {\n /* renamed from: a */\n void mo23214a(Message message);\n }",
"private Proof atoAImpl(Expression a) {\n Proof where = axm2(a, arrow(a, a), a); //a->(a->a) -> (a->(a->a)->a) -> (a -> a)\n Proof one = axm1(a, a); //a->a->a\n Proof two = axm1(a, arrow(a, a)); //a->(a->a)->A\n return mpTwice(where, one, two);\n }",
"interface C1939a {\n /* renamed from: a */\n Bitmap mo1406a(Bitmap bitmap, float f);\n}",
"public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }",
"public b[] a() {\n/* 95 */ return this.a;\n/* */ }",
"interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }"
] | [
"0.62497115",
"0.6242887",
"0.61394435",
"0.61176854",
"0.6114027",
"0.60893",
"0.6046901",
"0.6024682",
"0.60201293",
"0.5975212",
"0.59482527",
"0.59121317",
"0.5883635",
"0.587841",
"0.58703005",
"0.5868436",
"0.5864884",
"0.5857492",
"0.58306104",
"0.5827752",
"0.58272064",
"0.5794689",
"0.57890314",
"0.57838726",
"0.5775679",
"0.57694733",
"0.5769128",
"0.57526815",
"0.56907034",
"0.5677874",
"0.5670547",
"0.56666386",
"0.56592244",
"0.5658682",
"0.56574154",
"0.5654324",
"0.5644676",
"0.56399715",
"0.5638734",
"0.5630582",
"0.56183887",
"0.5615435",
"0.56069666",
"0.5605207",
"0.56005067",
"0.559501",
"0.55910283",
"0.5590222",
"0.55736613",
"0.5556682",
"0.5554544",
"0.5550076",
"0.55493855",
"0.55446684",
"0.5538079",
"0.5529058",
"0.5528109",
"0.552641",
"0.5525864",
"0.552186",
"0.5519972",
"0.5509587",
"0.5507195",
"0.54881203",
"0.5485328",
"0.54826045",
"0.5482066",
"0.5481586",
"0.5479751",
"0.54776895",
"0.54671466",
"0.5463307",
"0.54505056",
"0.54436916",
"0.5440517",
"0.5439747",
"0.5431944",
"0.5422869",
"0.54217863",
"0.5417556",
"0.5403905",
"0.5400223",
"0.53998446",
"0.5394735",
"0.5388649",
"0.5388258",
"0.5374842",
"0.5368887",
"0.53591394",
"0.5357029",
"0.5355688",
"0.535506",
"0.5355034",
"0.53494394",
"0.5341044",
"0.5326166",
"0.53236824",
"0.53199095",
"0.53177035",
"0.53112453",
"0.5298229"
] | 0.0 | -1 |
/ renamed from: b | private static C33023i m86585b() {
return m86586c();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo2508a(bxb bxb);",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n public void b() {\n }",
"public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }",
"@Override\n\tpublic void b2() {\n\t\t\n\t}",
"void metodo1(int a, int[] b) {\r\n\t\ta += 5;//Par\\u00e1metro con el mismo nombre que el campo de la clase.\r\n\t\tb[0] += 7;//se produce un env\\u00edo por referencia, apunta a una copia de un objeto, que se asigna aqu\\u00ed.\r\n\t}",
"interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}",
"@Override\n\tpublic void b() {\n\n\t}",
"interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }",
"public bb b() {\n return a(this.a);\n }",
"@Override\n\tpublic void b1() {\n\t\t\n\t}",
"public void b() {\r\n }",
"@Override\n\tpublic void bbb() {\n\t\t\n\t}",
"public interface C34379a {\n /* renamed from: a */\n void mo46242a(bmc bmc);\n }",
"public abstract void b(StringBuilder sb);",
"public void b() {\n }",
"public void b() {\n }",
"protected b(int mb) {\n/* 87 */ this.b = mb;\n/* */ }",
"public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }",
"public interface b {\n void H_();\n\n void I_();\n\n void J_();\n\n void a(C0063d dVar);\n\n void a(byte[] bArr);\n\n void b(boolean z);\n }",
"public b[] a() {\n/* 95 */ return this.a;\n/* */ }",
"public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }",
"public interface C1153a {\n /* renamed from: a */\n void mo4520a(byte[] bArr);\n }",
"public interface C43499b {\n /* renamed from: a */\n void mo8445a(int i, String str, int i2, byte[] bArr);\n}",
"public void b() {\n ((a) this.a).b();\n }",
"public np a()\r\n/* 33: */ {\r\n/* 34:49 */ return this.b;\r\n/* 35: */ }",
"b(a aVar) {\n super(0);\n this.this$0 = aVar;\n }",
"public t b() {\n return a(this.a);\n }",
"public interface C32456b<T> {\n /* renamed from: a */\n void mo83696a(T t);\n }",
"public static String a(int c) {\n/* 89 */ return b.a(c);\n/* */ }",
"private void m678b(byte b) {\n byte[] bArr = this.f523r;\n bArr[0] = b;\n this.f552g.mo502b(bArr);\n }",
"public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }",
"public abstract T zzm(B b);",
"public b a()\r\n/* 12: */ {\r\n/* 13:13 */ return this.a;\r\n/* 14: */ }",
"public void b(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 27: */ {\r\n/* 28: 47 */ bcm localbcm = paramaqu.s(paramdt);\r\n/* 29: 48 */ if ((localbcm instanceof bdv)) {\r\n/* 30: 49 */ ((bdv)localbcm).h();\r\n/* 31: */ } else {\r\n/* 32: 51 */ super.b(paramaqu, paramdt, parambec);\r\n/* 33: */ }\r\n/* 34: */ }",
"public abstract void zzc(B b, int i, int i2);",
"public interface b {\n}",
"public interface b {\n}",
"private void m10263b(byte b) throws cf {\r\n this.f6483r[0] = b;\r\n this.g.m10347b(this.f6483r);\r\n }",
"BSubstitution createBSubstitution();",
"public void b(ahd paramahd) {}",
"void b();",
"public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}",
"B database(S database);",
"public interface C0615ja extends b<HomeFragment> {\n\n /* renamed from: c.c.a.h.b.ja$a */\n /* compiled from: FragmentModule_HomeFragment$app_bazaarRelease */\n public static abstract class a extends b.a<HomeFragment> {\n }\n}",
"public abstract C0631bt mo9227aB();",
"public an b() {\n return a(this.a);\n }",
"protected abstract void a(bru parambru);",
"static void go(Base b) {\n\t\tb.add(8);\n\t}",
"void mo46242a(bmc bmc);",
"public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }",
"public interface bca extends bbn {\n bca a();\n\n bca a(String str);\n\n bca b(String str);\n\n bca c(String str);\n}",
"public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }",
"public abstract BoundType b();",
"public void b(amj paramamj)\r\n/* 538: */ {\r\n/* 539:579 */ this.f = paramamj;\r\n/* 540: */ }",
"b(a aVar, com.bytedance.jedi.model.h.a aVar2) {\n super(aVar2);\n this.f21531a = aVar;\n this.f21532b = new com.bytedance.jedi.model.h.f(aVar);\n }",
"private void b(int paramInt)\r\n/* 193: */ {\r\n/* 194:203 */ this.h.a(a(paramInt));\r\n/* 195: */ }",
"public void b(ahb paramahb)\r\n/* 583: */ {\r\n/* 584:625 */ for (int i = 0; i < this.a.length; i++) {\r\n/* 585:626 */ this.a[i] = amj.b(paramahb.a[i]);\r\n/* 586: */ }\r\n/* 587:628 */ for (i = 0; i < this.b.length; i++) {\r\n/* 588:629 */ this.b[i] = amj.b(paramahb.b[i]);\r\n/* 589: */ }\r\n/* 590:631 */ this.c = paramahb.c;\r\n/* 591: */ }",
"interface b {\n\n /* compiled from: CreditAccountContract */\n public interface a extends com.bankeen.d.b.b.a {\n void a();\n\n void b();\n }\n\n /* compiled from: CreditAccountContract */\n public interface b extends c {\n void a(Float f);\n\n void a(Integer num);\n\n void b(Float f);\n\n void c(Float f);\n\n String d();\n\n void d(Float f);\n\n void d(String str);\n\n void e(Float f);\n\n void e(String str);\n\n void f(String str);\n\n void g(String str);\n\n Long j();\n\n LineChart k();\n }\n}",
"@Override\n\tpublic void visit(PartB partB) {\n\n\t}",
"public abstract void zzb(B b, int i, long j);",
"public abstract void zza(B b, int i, zzeh zzeh);",
"int metodo2(int a, int b) {\r\n\r\n\t\tthis.a += 5; // se modifica el campo del objeto, el uso de la palabra reservada this se utiliza para referenciar al campo.\r\n\t\tb += 7;\r\n\t\treturn a; // modifica en la asignaci\\u00f3n\r\n\t}",
"private void internalCopy(Board b) {\n for (int i = 0; i < SIDE * SIDE; i += 1) {\n set(i, b.get(i));\n }\n\n _directions = b._directions;\n _whoseMove = b._whoseMove;\n _history = b._history;\n }",
"public int b()\r\n/* 69: */ {\r\n/* 70:74 */ return this.b;\r\n/* 71: */ }",
"public void b(StringBuilder sb) {\n sb.append(this.a);\n sb.append(')');\n }",
"public void b() {\n e$a e$a;\n try {\n e$a = this.b;\n }\n catch (IOException iOException) {\n return;\n }\n Object object = this.c;\n e$a.b(object);\n }",
"public abstract void a(StringBuilder sb);",
"public interface C45101e {\n /* renamed from: b */\n void mo3796b(int i);\n}",
"public abstract void zzf(Object obj, B b);",
"public interface bdp {\n\n /* renamed from: a */\n public static final bdp f3422a = new bdo();\n\n /* renamed from: a */\n bdm mo1784a(akh akh);\n}",
"@Override\n\tpublic void parse(Buffer b) {\n\t\t\n\t}",
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"public abstract void a(b paramb, int paramInt1, int paramInt2);",
"public void mo1945a(byte b) throws cf {\r\n m10263b(b);\r\n }",
"void mo83703a(C32456b<T> bVar);",
"public void a(String str) {\n ((b.b) this.b).d(str);\n }",
"public void selectB() { }",
"BOperation createBOperation();",
"void metodo1(int a, int b) {\r\n\t\ta += 5;//par\\u00e1metro con el mismo nombre que el campo.\r\n\t\tb += 7;\r\n\t}",
"private static void m2196a(StringBuffer stringBuffer, byte b) {\n stringBuffer.append(\"0123456789ABCDEF\".charAt((b >> 4) & 15)).append(\"0123456789ABCDEF\".charAt(b & 15));\n }",
"public interface C1799a {\n /* renamed from: b */\n void mo3314b(String str);\n }",
"public void b(fv paramfv)\r\n/* 408: */ {\r\n/* 409:423 */ this.a = new amj[36];\r\n/* 410:424 */ this.b = new amj[4];\r\n/* 411:425 */ for (int i = 0; i < paramfv.c(); i++)\r\n/* 412: */ {\r\n/* 413:426 */ fn localfn = paramfv.b(i);\r\n/* 414:427 */ int j = localfn.d(\"Slot\") & 0xFF;\r\n/* 415:428 */ amj localamj = amj.a(localfn);\r\n/* 416:429 */ if (localamj != null)\r\n/* 417: */ {\r\n/* 418:430 */ if ((j >= 0) && (j < this.a.length)) {\r\n/* 419:431 */ this.a[j] = localamj;\r\n/* 420: */ }\r\n/* 421:433 */ if ((j >= 100) && (j < this.b.length + 100)) {\r\n/* 422:434 */ this.b[(j - 100)] = localamj;\r\n/* 423: */ }\r\n/* 424: */ }\r\n/* 425: */ }\r\n/* 426: */ }",
"public void b(String str) {\n ((b.b) this.b).e(str);\n }",
"public String b()\r\n/* 35: */ {\r\n/* 36:179 */ return a();\r\n/* 37: */ }",
"public abstract void zza(B b, int i, T t);",
"public Item b(World paramaqu, BlockPosition paramdt)\r\n/* 189: */ {\r\n/* 190:220 */ return null;\r\n/* 191: */ }",
"public abstract void zza(B b, int i, long j);",
"public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}",
"private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }",
"public abstract void mo9798a(byte b);",
"public void mo9798a(byte b) {\n if (this.f9108f == this.f9107e) {\n mo9827i();\n }\n byte[] bArr = this.f9106d;\n int i = this.f9108f;\n this.f9108f = i + 1;\n bArr[i] = b;\n this.f9109g++;\n }",
"public interface C1234b {\r\n /* renamed from: a */\r\n void m8367a();\r\n\r\n /* renamed from: b */\r\n void m8368b();\r\n}",
"private void m676a(TField bkVar, byte b) {\n if (b == -1) {\n b = m687e(bkVar.f538b);\n }\n short s = bkVar.f539c;\n short s2 = this.f519n;\n if (s <= s2 || s - s2 > 15) {\n m678b(b);\n mo446a(bkVar.f539c);\n } else {\n m686d(b | ((s - s2) << 4));\n }\n this.f519n = bkVar.f539c;\n }",
"private static void m831a(C0741g<?> gVar, C0747b bVar) {\n gVar.mo9477a(C0743i.f718b, (C0739e<? super Object>) bVar);\n gVar.mo9476a(C0743i.f718b, (C0738d) bVar);\n gVar.mo9474a(C0743i.f718b, (C0736b) bVar);\n }",
"public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}",
"private void j()\n/* */ {\n/* 223 */ c localc = this.b;\n/* 224 */ this.b = this.c;\n/* 225 */ this.c = localc;\n/* 226 */ this.c.b();\n/* */ }",
"public lj ar(byte b) {\n throw new Runtime(\"d2j fail translate: java.lang.RuntimeException: can not merge I and Z\\r\\n\\tat com.googlecode.dex2jar.ir.TypeClass.merge(TypeClass.java:100)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeRef.updateTypeClass(TypeTransformer.java:174)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.provideAs(TypeTransformer.java:780)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.e1expr(TypeTransformer.java:496)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:713)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.enexpr(TypeTransformer.java:698)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:719)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.exExpr(TypeTransformer.java:703)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.s1stmt(TypeTransformer.java:810)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.sxStmt(TypeTransformer.java:840)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer$TypeAnalyze.analyze(TypeTransformer.java:206)\\r\\n\\tat com.googlecode.dex2jar.ir.ts.TypeTransformer.transform(TypeTransformer.java:44)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.optimize(Dex2jar.java:162)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertCode(Dex2Asm.java:414)\\r\\n\\tat com.googlecode.d2j.dex.ExDex2Asm.convertCode(ExDex2Asm.java:42)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar$2.convertCode(Dex2jar.java:128)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertMethod(Dex2Asm.java:509)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertClass(Dex2Asm.java:406)\\r\\n\\tat com.googlecode.d2j.dex.Dex2Asm.convertDex(Dex2Asm.java:422)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.doTranslate(Dex2jar.java:172)\\r\\n\\tat com.googlecode.d2j.dex.Dex2jar.to(Dex2jar.java:272)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:108)\\r\\n\\tat com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)\\r\\n\\tat com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)\\r\\n\");\n }",
"public interface AbstractC10485b {\n /* renamed from: a */\n void mo64153a(boolean z);\n }",
"public interface C40108b {\n /* renamed from: a */\n void mo99838a(boolean z);\n }",
"interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }"
] | [
"0.64558864",
"0.6283203",
"0.6252635",
"0.6250949",
"0.6244743",
"0.6216273",
"0.6194491",
"0.6193556",
"0.61641675",
"0.6140157",
"0.60993093",
"0.60974354",
"0.6077849",
"0.6001867",
"0.5997364",
"0.59737104",
"0.59737104",
"0.5905105",
"0.5904295",
"0.58908087",
"0.5886636",
"0.58828026",
"0.5855491",
"0.584618",
"0.5842517",
"0.5824137",
"0.5824071",
"0.58097327",
"0.5802052",
"0.58012927",
"0.579443",
"0.5792392",
"0.57902914",
"0.5785124",
"0.57718205",
"0.57589084",
"0.5735892",
"0.5735892",
"0.5734873",
"0.5727929",
"0.5720821",
"0.5712531",
"0.5706813",
"0.56896514",
"0.56543154",
"0.5651059",
"0.5649904",
"0.56496733",
"0.5647035",
"0.5640965",
"0.5640109",
"0.563993",
"0.5631903",
"0.5597427",
"0.55843794",
"0.5583287",
"0.557783",
"0.55734867",
"0.55733293",
"0.5572254",
"0.55683887",
"0.55624336",
"0.55540246",
"0.5553985",
"0.55480546",
"0.554261",
"0.5535739",
"0.5529958",
"0.5519634",
"0.5517503",
"0.55160624",
"0.5511545",
"0.5505353",
"0.5500533",
"0.5491741",
"0.5486198",
"0.5481978",
"0.547701",
"0.54725856",
"0.5471632",
"0.5463497",
"0.5460805",
"0.5454913",
"0.5454885",
"0.54519916",
"0.5441594",
"0.5436747",
"0.5432453",
"0.5425923",
"0.5424724",
"0.54189867",
"0.54162544",
"0.54051477",
"0.53998184",
"0.53945845",
"0.53887725",
"0.5388146",
"0.5387678",
"0.53858143",
"0.53850687",
"0.5384439"
] | 0.0 | -1 |
/ renamed from: c | private static C33023i m86586c() {
return m86587d();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void mo5289a(C5102c c5102c);",
"public static void c0() {\n\t}",
"void mo57278c();",
"private static void cajas() {\n\t\t\n\t}",
"void mo5290b(C5102c c5102c);",
"void mo80457c();",
"void mo12638c();",
"void mo28717a(zzc zzc);",
"void mo21072c();",
"@Override\n\tpublic void ccc() {\n\t\t\n\t}",
"public void c() {\n }",
"void mo17012c();",
"C2451d mo3408a(C2457e c2457e);",
"void mo88524c();",
"void mo86a(C0163d c0163d);",
"void mo17021c();",
"public abstract void mo53562a(C18796a c18796a);",
"void mo4874b(C4718l c4718l);",
"void mo4873a(C4718l c4718l);",
"C12017a mo41088c();",
"public abstract void mo70702a(C30989b c30989b);",
"void mo72114c();",
"public void mo12628c() {\n }",
"C2841w mo7234g();",
"public interface C0335c {\n }",
"public void mo1403c() {\n }",
"public static void c3() {\n\t}",
"public static void c1() {\n\t}",
"void mo8712a(C9714a c9714a);",
"void mo67924c();",
"public void mo97906c() {\n }",
"public abstract void mo27385c();",
"String mo20731c();",
"public int c()\r\n/* 74: */ {\r\n/* 75:78 */ return this.c;\r\n/* 76: */ }",
"public interface C0939c {\n }",
"void mo1582a(String str, C1329do c1329do);",
"void mo304a(C0366h c0366h);",
"void mo1493c();",
"private String getString(byte c) {\n\t\treturn c==1? \"$ \": \" \";\n\t}",
"java.lang.String getC3();",
"C45321i mo90380a();",
"public interface C11910c {\n}",
"void mo57277b();",
"String mo38972c();",
"static int type_of_cnc(String passed){\n\t\treturn 1;\n\t}",
"public static void CC2_1() {\n\t}",
"static int type_of_cc(String passed){\n\t\treturn 1;\n\t}",
"public interface C7654b {\n /* renamed from: a */\n C7904c mo24084a();\n\n /* renamed from: b */\n C7716a mo24085b();\n }",
"public void mo56167c() {\n }",
"public interface C0136c {\n }",
"private void kk12() {\n\n\t}",
"abstract String mo1748c();",
"public abstract void mo70710a(String str, C24343db c24343db);",
"public interface C0303q extends C0291e {\n /* renamed from: a */\n void mo1747a(int i);\n\n /* renamed from: a */\n void mo1749a(C0288c cVar);\n\n /* renamed from: a */\n void mo1751a(byte[] bArr);\n\n /* renamed from: b */\n void mo1753b(int i);\n\n /* renamed from: c */\n void mo1754c(int i);\n\n /* renamed from: d */\n void mo1755d(int i);\n\n /* renamed from: e */\n int mo1756e(int i);\n\n /* renamed from: g */\n int mo1760g();\n\n /* renamed from: g */\n void mo1761g(int i);\n\n /* renamed from: h */\n void mo1763h(int i);\n}",
"C3577c mo19678C();",
"public abstract int c();",
"public abstract int c();",
"public final void mo11687c() {\n }",
"byte mo30283c();",
"private java.lang.String c(java.lang.String r7) {\n /*\n r6 = this;\n r2 = \"\";\n r0 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n if (r0 == 0) goto L_0x0050;\n L_0x0006:\n r0 = new java.lang.StringBuilder;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = java.lang.String.valueOf(r7);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0.<init>(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = \".\";\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r6.e;\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.append(r1);\t Catch:{ FileNotFoundException -> 0x0052 }\n r0 = r0.toString();\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x001f:\n r1 = r6.d;\t Catch:{ FileNotFoundException -> 0x0052 }\n r1 = r1.openFileInput(r0);\t Catch:{ FileNotFoundException -> 0x0052 }\n L_0x0025:\n r3 = new java.io.BufferedReader;\n r4 = new java.io.InputStreamReader;\n r0 = r1;\n r0 = (java.io.InputStream) r0;\n r5 = \"UTF-8\";\n r5 = java.nio.charset.Charset.forName(r5);\n r4.<init>(r0, r5);\n r3.<init>(r4);\n r0 = new java.lang.StringBuffer;\n r0.<init>();\n L_0x003d:\n r4 = r3.readLine();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n if (r4 != 0) goto L_0x0061;\n L_0x0043:\n r0 = r0.toString();\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007d }\n r1.close();\t Catch:{ IOException -> 0x007d }\n r3.close();\t Catch:{ IOException -> 0x007d }\n L_0x004f:\n return r0;\n L_0x0050:\n r0 = r7;\n goto L_0x001f;\n L_0x0052:\n r0 = move-exception;\n r0 = r6.d;\t Catch:{ IOException -> 0x005e }\n r0 = r0.getAssets();\t Catch:{ IOException -> 0x005e }\n r1 = r0.open(r7);\t Catch:{ IOException -> 0x005e }\n goto L_0x0025;\n L_0x005e:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0061:\n r0.append(r4);\t Catch:{ IOException -> 0x0065, all -> 0x0073 }\n goto L_0x003d;\n L_0x0065:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x0070 }\n r1.close();\t Catch:{ IOException -> 0x0070 }\n r3.close();\t Catch:{ IOException -> 0x0070 }\n r0 = r2;\n goto L_0x004f;\n L_0x0070:\n r0 = move-exception;\n r0 = r2;\n goto L_0x004f;\n L_0x0073:\n r0 = move-exception;\n r1 = (java.io.InputStream) r1;\t Catch:{ IOException -> 0x007f }\n r1.close();\t Catch:{ IOException -> 0x007f }\n r3.close();\t Catch:{ IOException -> 0x007f }\n L_0x007c:\n throw r0;\n L_0x007d:\n r1 = move-exception;\n goto L_0x004f;\n L_0x007f:\n r1 = move-exception;\n goto L_0x007c;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.a.b.b.c(java.lang.String):java.lang.String\");\n }",
"@Override\n\tpublic void compile(CodeBlock c, CompilerEnvironment environment) {\n\n\t}",
"public interface C3196it extends C3208jc {\n /* renamed from: a */\n void mo30275a(long j);\n\n /* renamed from: b */\n C3197iu mo30281b(long j);\n\n /* renamed from: b */\n boolean mo30282b();\n\n /* renamed from: c */\n byte mo30283c();\n\n /* renamed from: c */\n String mo30285c(long j);\n\n /* renamed from: d */\n void mo30290d(long j);\n\n /* renamed from: e */\n int mo30291e();\n\n /* renamed from: f */\n long mo30295f();\n}",
"public static void mmcc() {\n\t}",
"java.lang.String getCit();",
"public abstract C mo29734a();",
"C15430g mo56154a();",
"void mo41086b();",
"@Override\n public void func_104112_b() {\n \n }",
"public interface C9223b {\n }",
"public abstract String mo11611b();",
"void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);",
"String getCmt();",
"interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }",
"interface C2578d {\n}",
"public interface C1803l extends C1813t {\n /* renamed from: b */\n C1803l mo7382b(C2778au auVar);\n\n /* renamed from: f */\n List<C1700ar> mo7233f();\n\n /* renamed from: g */\n C2841w mo7234g();\n\n /* renamed from: q */\n C1800i mo7384q();\n}",
"double fFromC(double c) {\n return (c * 9 / 5) + 32;\n }",
"void mo72113b();",
"void mo1749a(C0288c cVar);",
"public interface C0764b {\n}",
"void mo41083a();",
"String[] mo1153c();",
"C1458cs mo7613iS();",
"public interface C0333a {\n }",
"public abstract int mo41077c();",
"public interface C8843g {\n}",
"public abstract void mo70709a(String str, C41018cm c41018cm);",
"void mo28307a(zzgd zzgd);",
"public static void mcdc() {\n\t}",
"public interface C2459d {\n /* renamed from: a */\n C2451d mo3408a(C2457e c2457e);\n}",
"C1435c mo1754a(C1433a c1433a, C1434b c1434b);",
"public interface C0389gj extends C0388gi {\n}",
"C5727e mo33224a();",
"C12000e mo41087c(String str);",
"public abstract String mo118046b();",
"public interface C11113o {\n /* renamed from: a */\n void mo37759a(String str);\n }",
"public interface C0938b {\n }",
"void mo80455b();",
"public interface C0385a {\n }",
"public interface C5527c {\n /* renamed from: a */\n int mo4095a(int i);\n\n /* renamed from: b */\n C5537g mo4096b(int i);\n}",
"public interface C32231g {\n /* renamed from: a */\n void mo8280a(int i, int i2, C1207m c1207m);\n}",
"public interface C11994b {\n /* renamed from: a */\n C11996a mo41079a(String str);\n\n /* renamed from: a */\n C11996a mo41080a(String str, C11997b bVar, String... strArr);\n\n /* renamed from: a */\n C11998c mo41081a(String str, C11999d dVar, String... strArr);\n\n /* renamed from: a */\n C12000e mo41082a(String str, C12001f fVar, String... strArr);\n\n /* renamed from: a */\n void mo41083a();\n\n /* renamed from: a */\n void mo41084a(C12018b bVar, ConnectionState... connectionStateArr);\n\n /* renamed from: b */\n C11996a mo41085b(String str);\n\n /* renamed from: b */\n void mo41086b();\n\n /* renamed from: c */\n C12000e mo41087c(String str);\n\n /* renamed from: c */\n C12017a mo41088c();\n\n /* renamed from: d */\n void mo41089d(String str);\n\n /* renamed from: e */\n C11998c mo41090e(String str);\n\n /* renamed from: f */\n C12000e mo41091f(String str);\n\n /* renamed from: g */\n C11998c mo41092g(String str);\n}"
] | [
"0.64592767",
"0.644052",
"0.6431582",
"0.6418656",
"0.64118475",
"0.6397491",
"0.6250796",
"0.62470585",
"0.6244832",
"0.6232792",
"0.618864",
"0.61662376",
"0.6152657",
"0.61496663",
"0.6138441",
"0.6137171",
"0.6131197",
"0.6103783",
"0.60983956",
"0.6077118",
"0.6061723",
"0.60513836",
"0.6049069",
"0.6030368",
"0.60263443",
"0.60089093",
"0.59970635",
"0.59756917",
"0.5956231",
"0.5949343",
"0.5937446",
"0.5911776",
"0.59034705",
"0.5901311",
"0.5883238",
"0.5871533",
"0.5865361",
"0.5851141",
"0.581793",
"0.5815705",
"0.58012",
"0.578891",
"0.57870495",
"0.5775621",
"0.57608724",
"0.5734331",
"0.5731584",
"0.5728505",
"0.57239383",
"0.57130504",
"0.57094604",
"0.570793",
"0.5697671",
"0.56975955",
"0.56911296",
"0.5684489",
"0.5684489",
"0.56768984",
"0.56749034",
"0.5659463",
"0.56589085",
"0.56573",
"0.56537443",
"0.5651912",
"0.5648272",
"0.5641736",
"0.5639226",
"0.5638583",
"0.56299245",
"0.56297386",
"0.56186295",
"0.5615729",
"0.56117755",
"0.5596015",
"0.55905765",
"0.55816257",
"0.55813104",
"0.55723965",
"0.5572061",
"0.55696625",
"0.5566985",
"0.55633485",
"0.555888",
"0.5555646",
"0.55525774",
"0.5549722",
"0.5548184",
"0.55460495",
"0.5539394",
"0.5535825",
"0.55300397",
"0.5527975",
"0.55183905",
"0.5517322",
"0.5517183",
"0.55152744",
"0.5514932",
"0.55128884",
"0.5509501",
"0.55044043",
"0.54984957"
] | 0.0 | -1 |
/ renamed from: d | private static C33023i m86587d() {
return (C33023i) C47375f.m147940a(C26295c.m86478o(), "Cannot return null from a non-@Nullable @Provides method");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void d() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"public int d()\r\n/* 79: */ {\r\n/* 80:82 */ return this.d;\r\n/* 81: */ }",
"public String d_()\r\n/* 445: */ {\r\n/* 446:459 */ return \"container.inventory\";\r\n/* 447: */ }",
"public abstract int d();",
"private void m2248a(double d, String str) {\n this.f2954c = d;\n this.f2955d = (long) d;\n this.f2953b = str;\n this.f2952a = ValueType.doubleValue;\n }",
"public int d()\n {\n return 1;\n }",
"public interface C19512d {\n /* renamed from: dd */\n void mo34676dd(int i, int i2);\n }",
"void mo21073d();",
"@Override\n public boolean d() {\n return false;\n }",
"int getD();",
"public void dor(){\n }",
"public int getD() {\n\t\treturn d;\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"public String getD() {\n return d;\n }",
"@Override\n\tpublic void dibuja() {\n\t\t\n\t}",
"public final void mo91715d() {\n }",
"public D() {}",
"void mo17013d();",
"public int getD() {\n return d_;\n }",
"void mo83705a(C32458d<T> dVar);",
"public void d() {\n\t\tSystem.out.println(\"d method\");\n\t}",
"double d();",
"public float d()\r\n/* 15: */ {\r\n/* 16:163 */ return this.b;\r\n/* 17: */ }",
"protected DNA(Population pop, DNA d) {\n\t\t// TODO: implement this\n\t}",
"public ahb(ahd paramahd)\r\n/* 12: */ {\r\n/* 13: 36 */ this.d = paramahd;\r\n/* 14: */ }",
"public abstract C17954dh<E> mo45842a();",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\n\tpublic void visitTdetree(Tdetree p) {\n\n\t}",
"public abstract void mo56925d();",
"void mo54435d();",
"public void mo21779D() {\n }",
"public void d() {\n this.f20599d.a(this.f20598c);\n this.f20598c.a(this);\n this.f20601f = new a(new d());\n d.a(this.f20596a, this.f20597b, this.f20601f);\n this.f20596a.setLayoutManager(new NPALinearLayoutManager(getContext()));\n ((s) this.f20596a.getItemAnimator()).setSupportsChangeAnimations(false);\n this.f20596a.setAdapter(this.f20601f);\n this.f20598c.a(this.f20602g);\n }",
"@Override\r\n public String getStringRepresentation()\r\n {\r\n return \"D\";\r\n }",
"void mo28307a(zzgd zzgd);",
"List<String> d();",
"d(l lVar, m mVar, b bVar) {\n super(mVar);\n this.f11484d = lVar;\n this.f11483c = bVar;\n }",
"public int getD() {\n return d_;\n }",
"public void addDField(String d){\n\t\tdfield.add(d);\n\t}",
"public void mo3749d() {\n }",
"public a dD() {\n return new a(this.HG);\n }",
"public String amd_to_dma(java.sql.Date d)\n {\n String resp = \"\";\n if (d!=null)\n {\n String sdat = d.toString();\n String sano = sdat.substring(0,4);\n String smes = sdat.substring(5,7);\n String sdia = sdat.substring(8,10);\n resp = sdia+\"/\"+smes+\"/\"+sano;\n }\n return resp;\n }",
"public void mo130970a(double d) {\n SinkDefaults.m149818a(this, d);\n }",
"public abstract int getDx();",
"public void mo97908d() {\n }",
"public com.c.a.d.d d() {\n return this.k;\n }",
"private static String toPsString(double d) {\n return \"(\" + d + \")\";\n }",
"public boolean d() {\n return false;\n }",
"void mo17023d();",
"String dibujar();",
"@Override\n\tpublic void setDurchmesser(int d) {\n\n\t}",
"public void mo2470d() {\n }",
"public abstract VH mo102583a(ViewGroup viewGroup, D d);",
"public abstract String mo41079d();",
"public void setD ( boolean d ) {\n\n\tthis.d = d;\n }",
"public Dx getDx() {\n/* 32 */ return this.dx;\n/* */ }",
"DoubleNode(int d) {\n\t data = d; }",
"DD createDD();",
"@java.lang.Override\n public float getD() {\n return d_;\n }",
"public void setD(String d) {\n this.d = d == null ? null : d.trim();\n }",
"public int d()\r\n {\r\n return 20;\r\n }",
"float getD();",
"public static int m22546b(double d) {\n return 8;\n }",
"void mo12650d();",
"String mo20732d();",
"static void feladat4() {\n\t}",
"void mo130799a(double d);",
"public void mo2198g(C0317d dVar) {\n }",
"@Override\n public void d(String TAG, String msg) {\n }",
"private double convert(double d){\n\t\tDecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance();\n\t\tsymbols.setDecimalSeparator('.');\n\t\tDecimalFormat df = new DecimalFormat(\"#.##\",symbols); \n\t\treturn Double.valueOf(df.format(d));\n\t}",
"public void d(String str) {\n ((b.b) this.b).g(str);\n }",
"public abstract void mo42329d();",
"public abstract long mo9229aD();",
"public abstract String getDnForPerson(String inum);",
"public interface ddd {\n public String dan();\n\n}",
"@Override\n public void func_104112_b() {\n \n }",
"public Nodo (String d){\n\t\tthis.dato = d;\n\t\tthis.siguiente = null; //para que apunte el nodo creado a nulo\n\t}",
"public void mo5117a(C0371d c0371d, double d) {\n new C0369b(this, c0371d, d).start();\n }",
"public interface C27442s {\n /* renamed from: d */\n List<EffectPointModel> mo70331d();\n}",
"public final void m22595a(double d) {\n mo4383c(Double.doubleToRawLongBits(d));\n }",
"public void d() {\n this.f23522d.a(this.f23521c);\n this.f23521c.a(this);\n this.i = new a();\n this.i.a(new ae(this.f23519a));\n this.f23519a.setAdapter(this.i);\n this.f23519a.setOnItemClickListener(this);\n this.f23521c.e();\n this.h.a(hashCode(), this.f23520b);\n }",
"public Vector2d(double d) {\n\t\tthis.x = d;\n\t\tthis.y = d;\n\t}",
"DomainHelper dh();",
"private Pares(PLoc p, PLoc s, int d){\n\t\t\tprimero=p;\n\t\t\tsegundo=s;\n\t\t\tdistancia=d;\n\t\t}",
"static double DEG_to_RAD(double d) {\n return d * Math.PI / 180.0;\n }",
"@java.lang.Override\n public float getD() {\n return d_;\n }",
"private final VH m112826b(ViewGroup viewGroup, D d) {\n return mo102583a(viewGroup, d);\n }",
"public Double getDx();",
"public void m25658a(double d) {\n if (d <= 0.0d) {\n d = 1.0d;\n }\n this.f19276f = (float) (50.0d / d);\n this.f19277g = new C4658a(this, this.f19273c);\n }",
"boolean hasD();",
"public abstract void mo27386d();",
"MergedMDD() {\n }",
"@ReflectiveMethod(name = \"d\", types = {})\n public void d(){\n NMSWrapper.getInstance().exec(nmsObject);\n }",
"@Override\n public Chunk d(int i0, int i1) {\n return null;\n }",
"public void d(World paramaqu, BlockPosition paramdt, Block parambec)\r\n/* 47: */ {\r\n/* 48: 68 */ BlockPosition localdt = paramdt.offset(((EnumDirection)parambec.getData(a)).opposite());\r\n/* 49: 69 */ Block localbec = paramaqu.getBlock(localdt);\r\n/* 50: 70 */ if (((localbec.getType() instanceof bdq)) && (((Boolean)localbec.getData(bdq.b)).booleanValue())) {\r\n/* 51: 71 */ paramaqu.g(localdt);\r\n/* 52: */ }\r\n/* 53: */ }",
"double defendre();",
"public static int setDimension( int d ) {\n int temp = DPoint.d;\n DPoint.d = d;\n return temp;\n }",
"public Datum(Datum d) {\n this.dan = d.dan;\n this.mesec = d.mesec;\n this.godina = d.godina;\n }",
"public Nodo (String d, Nodo n){\n\t\tdato = d;\n\t\tsiguiente=n;\n\t}"
] | [
"0.63810617",
"0.616207",
"0.6071929",
"0.59959275",
"0.5877492",
"0.58719957",
"0.5825175",
"0.57585526",
"0.5701679",
"0.5661244",
"0.5651699",
"0.56362265",
"0.562437",
"0.5615328",
"0.56114155",
"0.56114155",
"0.5605659",
"0.56001145",
"0.5589302",
"0.5571578",
"0.5559222",
"0.5541367",
"0.5534182",
"0.55326",
"0.550431",
"0.55041796",
"0.5500838",
"0.54946786",
"0.5475938",
"0.5466879",
"0.5449981",
"0.5449007",
"0.54464436",
"0.5439673",
"0.543565",
"0.5430978",
"0.5428843",
"0.5423923",
"0.542273",
"0.541701",
"0.5416963",
"0.54093426",
"0.53927654",
"0.53906536",
"0.53793144",
"0.53732955",
"0.53695524",
"0.5366731",
"0.53530186",
"0.535299",
"0.53408253",
"0.5333639",
"0.5326304",
"0.53250664",
"0.53214055",
"0.53208005",
"0.5316437",
"0.53121597",
"0.52979535",
"0.52763224",
"0.5270543",
"0.526045",
"0.5247397",
"0.5244388",
"0.5243049",
"0.5241726",
"0.5241194",
"0.523402",
"0.5232349",
"0.5231111",
"0.5230985",
"0.5219358",
"0.52145815",
"0.5214168",
"0.5209237",
"0.52059376",
"0.51952434",
"0.5193699",
"0.51873696",
"0.5179743",
"0.5178796",
"0.51700175",
"0.5164517",
"0.51595956",
"0.5158281",
"0.51572365",
"0.5156627",
"0.5155795",
"0.51548296",
"0.51545656",
"0.5154071",
"0.51532024",
"0.5151545",
"0.5143571",
"0.5142079",
"0.5140048",
"0.51377696",
"0.5133826",
"0.5128858",
"0.5125679",
"0.5121545"
] | 0.0 | -1 |
This method should do it best to preparse and validate the query. It should not store the query or execute anything towards EHR data. | public abstract String debugQuery(Form staticQueryParametersAsForm)
throws Exception; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void validateQuery(Query query) throws InvalidQueryException;",
"public CQLQueryResults processQuery(CQLQuery cqlQuery) throws MalformedQueryException, \n\t QueryProcessingException {\n\t\tthrow new RuntimeException(\"not impl yet. port from ncia-core-grid-transfer\");\n\t}",
"public CQLQueryResults processQuery(CQLQuery cqlQuery) throws MalformedQueryException, \r\n\t QueryProcessingException {\r\n\t\tthrow new RuntimeException(\"not impl yet. port from ncia-core-grid-transfer\");\r\n\t}",
"protected abstract String getValidationQuery();",
"public void validate() throws org.apache.thrift.TException {\n if (query != null) {\n query.validate();\n }\n }",
"boolean stageAfterQueryParsing(Object input) throws ValidationFailedException;",
"public void parseQuery(String queryString) {\r\n\t\t// call the methods\r\n\t\tgetSplitStrings(queryString);\r\n\t\tgetFile(queryString);\r\n\t\tgetBaseQuery(queryString);\r\n\t\tgetConditionsPartQuery(queryString);\r\n\t\tgetConditions(queryString);\r\n\t\tgetLogicalOperators(queryString);\r\n\t\tgetFields(queryString);\r\n\t\tgetOrderByFields(queryString);\r\n\t\tgetGroupByFields(queryString);\r\n\t\tgetAggregateFunctions(queryString);\r\n\t}",
"public void validate() throws org.apache.thrift.TException {\n if (simpleSearchQuery != null) {\r\n simpleSearchQuery.validate();\r\n }\r\n }",
"@SuppressWarnings(\"null\")\n\tpublic QueryParameter parseQuery(String queryString) {\n\t\t\n/*\n\t\t * extract the name of the file from the query. File name can be found after the\n\t\t * \"from\" clause.\n\t\t */\n\n\t\t/*\n\t\t * extract the order by fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"order by\" clause in the query, if at all\n\t\t * the order by clause exists. For eg: select city,winner,team1,team2 from\n\t\t * data/ipl.csv order by city from the query mentioned above, we need to extract\n\t\t * \"city\". Please note that we can have more than one order by fields.\n\t\t */\n\n\t\t/*\n\t\t * extract the group by fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"group by\" clause in the query, if at all\n\t\t * the group by clause exists. For eg: select city,max(win_by_runs) from\n\t\t * data/ipl.csv group by city from the query mentioned above, we need to extract\n\t\t * \"city\". Please note that we can have more than one group by fields.\n\t\t */\n\n\t\t /*\n\t\t * extract the selected fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"select\" clause followed by a space from\n\t\t * the query string. For eg: select city,win_by_runs from data/ipl.csv from the\n\t\t * query mentioned above, we need to extract \"city\" and \"win_by_runs\". Please\n\t\t * note that we might have a field containing name \"from_date\" or \"from_hrs\".\n\t\t * Hence, consider this while parsing.\n\t\t */\n\n\t\t/*\n\t\t * extract the conditions from the query string(if exists). for each condition,\n\t\t * we need to capture the following: 1. Name of field 2. condition 3. value\n\t\t * \n\t\t * For eg: select city,winner,team1,team2,player_of_match from data/ipl.csv\n\t\t * where season >= 2008 or toss_decision != bat\n\t\t * \n\t\t * here, for the first condition, \"season>=2008\" we need to capture: 1. Name of\n\t\t * field: season 2. condition: >= 3. value: 2008\n\t\t * \n\t\t * the query might contain multiple conditions separated by OR/AND operators.\n\t\t * Please consider this while parsing the conditions.\n\t\t * \n\t\t */\n\n\t\t /*\n\t\t * extract the logical operators(AND/OR) from the query, if at all it is\n\t\t * present. For eg: select city,winner,team1,team2,player_of_match from\n\t\t * data/ipl.csv where season >= 2008 or toss_decision != bat and city =\n\t\t * bangalore\n\t\t * \n\t\t * the query mentioned above in the example should return a List of Strings\n\t\t * containing [or,and]\n\t\t */\n\n\t\t/*\n\t\t * extract the aggregate functions from the query. The presence of the aggregate\n\t\t * functions can determined if we have either \"min\" or \"max\" or \"sum\" or \"count\"\n\t\t * or \"avg\" followed by opening braces\"(\" after \"select\" clause in the query\n\t\t * string. in case it is present, then we will have to extract the same. For\n\t\t * each aggregate functions, we need to know the following: 1. type of aggregate\n\t\t * function(min/max/count/sum/avg) 2. field on which the aggregate function is\n\t\t * being applied\n\t\t * \n\t\t * Please note that more than one aggregate function can be present in a query\n\t\t * \n\t\t * \n\t\t */\n\n\t\tString file = null;\n\t\tList<Restriction> restrictions = new ArrayList<Restriction>();\n\t\tList<String> logicalOperators = new ArrayList<String>();\n\t\tList<String> fields = new ArrayList<String>();;\n\t\tList<AggregateFunction> aggregateFunction = new ArrayList<AggregateFunction>();\n\t\tList<String> groupByFields = new ArrayList<String>();;\n\t\tList<String> orderByFields = new ArrayList<String>();;\n\t\tString baseQuery=null;\n\t\n\t\tfile = getFile(queryString);\n\n\t\t\n\t\tString[] conditions = getConditions(queryString);\n\t\tif(conditions!=null) {\n\t\tRestriction[] restriction = new Restriction[conditions.length];\n\t\t\n\t\tfor (int i = 0; i < conditions.length; i++) {\n\t\t\trestriction[i] = new Restriction();\n\t\t\t\n\t\t\tString operator=null;\n\t\t\tString value=null;\n\t\t\tString property=null;\n\t\t\t if(conditions[i].contains(\"<=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"<=\");\n\t\t\t\toperator=\"<=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\">=\")) {\n\t\t\t\tString[] split = conditions[i].split(\">=\");\n\t\t\t\toperator=\">=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\">\")) {\n\t\t\t\tString[] split = conditions[i].split(\">\");\n\t\t\t\toperator=\">\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"!=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"!=\");\n\t\t\t\toperator=\"!=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"=\");\n\t\t\t\toperator=\"=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t if(value.contains(\"'\")) {\n\t\t\t\t\t value= value.replaceAll(\"'\",\"\").trim();\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"<\")) {\n\t\t\t\tString[] split = conditions[i].split(\"<\");\n\t\t\t\toperator=\"<\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\t \n\t\t\t\n\t\t\trestriction[i].setCondition(operator);\n\t\t\trestriction[i].setPropertyName(property);\n\t\t\trestriction[i].setPropertyValue(value);\n\t\t\trestrictions.add(restriction[i]);\n\n\t\t}\n\t\t}\n\t\n\t\tString[] operators = getLogicalOperators(queryString);\n\t\tif(operators!=null) {\n\t\tfor (String op : operators) {\n\t\t\tlogicalOperators.add(op);\n\t\t}\n\t\t}\n\t\t\n\t\tString[] filds = getFields(queryString);\n\t\tif(filds!=null) {\n\t\tfor (String field : filds) {\n\t\t\tfields.add(field);\n\t\t}\n\t\t}\n\t\t\n\t\tString[] aggregationVal = getAggregateFunctions(queryString);\n\t\tif(aggregationVal!=null) {\n\t\tAggregateFunction[] aggregation = new AggregateFunction[aggregationVal.length];\n\t\tfor (int i = 0; i < aggregationVal.length; i++) {\n\t\t\taggregation[i] = new AggregateFunction();\n\t\t\tString[] split = (aggregationVal[i].replace(\"(\", \" \")).split(\" \");\n\t\t\tSystem.out.println(split[0]);\n\t\t\tSystem.out.println(split[1].replace(\")\", \"\").trim());\n\t\t\t\n\t\t\taggregation[i].setFunction(split[0]);\n\t\t\taggregation[i].setField(split[1].replace(\")\", \"\").trim());\n\t\t\taggregateFunction.add(aggregation[i]);\n\n\t\t}\n\t\t}\n\t\t\n\t\t\t\n\t\t\n\t\tString[] groupBy = getGroupByFields(queryString);\n\t\tif(groupBy!=null) {\n\t\tfor (String group : groupBy) {\n\t\t\tgroupByFields.add(group);\n\t\t}\n\t\t}\n\t\n\t\tString[] orderBy = getOrderByFields(queryString);\n\t\tif(orderBy!=null) {\n\t\tfor (String order : orderBy) {\n\t\t\torderByFields.add(order);\n\t\t}\n\t\t}\n\t\tqueryParameter.setFile(file);\n\t\tif(restrictions.size()!=0) {\n\t\t\tqueryParameter.setRestrictions(restrictions);\n\t\t}\n\t\telse {\n\t\t\tqueryParameter.setRestrictions(null);\n\t\t}\n\t\tif(logicalOperators.size()!=0) {\n\t\tqueryParameter.setLogicalOperators(logicalOperators);\n\t\t}\n\t\telse {\n\t\t\tqueryParameter.setLogicalOperators(null);\n\t\t}\n\t\tbaseQuery=getBaseQuery(queryString);\n\t\t\n\t\tqueryParameter.setFields(fields);\n\t\tqueryParameter.setAggregateFunctions(aggregateFunction);\n\t\tqueryParameter.setGroupByFields(groupByFields);\n\t\tqueryParameter.setOrderByFields(orderByFields);\n\t\tqueryParameter.setBaseQuery(baseQuery.trim());\n\t\treturn queryParameter;\n\n\t}",
"private ParsedQuery parseQuery(Layer layer, Query query) {\n PlainSelect plainSelect;\n try {\n Select select = (Select) CCJSqlParserUtil.parse(query.getSql());\n plainSelect = (PlainSelect) select.getSelectBody();\n } catch (JSQLParserException e) {\n String message =\n String.format(\n \"The layer '%s' contains a malformed query.\\n\" + \"\\tQuery:\\n\\t\\t%s\",\n layer.getId(), query.getSql());\n throw new IllegalArgumentException(message, e);\n }\n\n // Check the number of columns\n if (plainSelect.getSelectItems().size() != 3) {\n String message =\n String.format(\n \"The layer '%s' contains a malformed query.\\n\"\n + \"\\tExpected format:\\n\\t\\tSELECT c1::bigint, c2::hstore, c3::geometry FROM t WHERE c\\n\"\n + \"\\tActual query:\\n\\t\\t%s\",\n layer.getId(), query.getSql());\n throw new IllegalArgumentException(message);\n }\n\n // Remove all the aliases\n for (SelectItem selectItem : plainSelect.getSelectItems()) {\n selectItem.accept(\n new SelectItemVisitorAdapter() {\n @Override\n public void visit(SelectExpressionItem selectExpressionItem) {\n selectExpressionItem.setAlias(null);\n }\n });\n }\n return new ParsedQuery(layer, query, plainSelect);\n }",
"public void parseUserQuery(String userQuery) {\n\t\tuserQuery = userQuery.toUpperCase();\n\t\tString[] selectStage;\n\t\tselectStage = userQuery.split(\"SELECT\\\\s*|\\\\s*FROM\\\\s*\");\n\t\tcolumnNames = new ArrayList<String>(Arrays.asList(selectStage[1].split(\",\\\\s*\")));\n\t\tString[] fromStage = selectStage[2].split(\"\\\\s*WHERE\\\\s*\");\n\t\tfromStage[0] = fromStage[0].replaceAll(\";\", \"\");\n\t\ttableNames = new ArrayList<String>(Arrays.asList(fromStage[0].split(\",\\\\s\")));\n\t\tif (fromStage.length > 1) {\n\t\t\tfromStage[1] = fromStage[1].replaceAll(\";\", \"\");\n\t\t\tList<String> conditions = new ArrayList<String>(Arrays.asList(fromStage[1].split(\"\\\\sAND\\\\s\")));\n\t\t\tseparateConditions(conditions);\n\t\t}\n\t}",
"public void setQuery (String q)\n\t throws QueryParseException\n {\n\n\tthis.q = new Query ();\n\tthis.q.parse (q);\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n\tthis.checkFrom ();\n\n }",
"protected boolean query() {\r\n\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator())\r\n\t\t\t\t+ processQueryPublisher(queryBk.getPublisher()));\r\n\t\tSystem.out.println(queryStr);\r\n\t\t// if edition is 'lastest' (coded '0'), no query is performed; and\r\n\t\t// return false.\r\n\t\tif (queryBk.parseEdition() == 0) {\r\n\t\t\treturn false;\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * The following section adds edition info to the query string if edition no. is\r\n\t\t * greater than one. By cataloging practice, for the first edition, probably\r\n\t\t * there is NO input on the associated MARC field. Considering this, edition\r\n\t\t * query string to Primo is NOT added if querying for the first edition or no\r\n\t\t * edition is specified.\r\n\t\t */\r\n\t\tif (queryBk.parseEdition() > 1) {\r\n\t\t\tqueryStr += processQueryEdition(queryBk.parseEdition());\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * Querying the Primo X-service; and invoking the matching processes (all done\r\n\t\t * by remoteQuery()).\r\n\t\t */\r\n\t\tif (strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * For various reasons, there are possibilities that the first query fails while\r\n\t\t * a match should be found. The follow work as remedy queries to ensure the\r\n\t\t * accuracy.\r\n\t\t */\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryPublisher(queryBk.getPublisher()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryYear(queryBk.getPublishYear()));\r\n\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryTitleShort(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional query for Chinese titles\r\n\r\n\t\tif (!match && (CJKStringHandling.isCJKString(queryBk.getTitle())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getCreator())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getPublisher()))) {\r\n\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition2(queryBk.parseEdition()));\r\n\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition3(queryBk.parseEdition()));\r\n\t\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\t\tmatch = true;\r\n\t\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmatch = false;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional check for ISO Document number in <search> <genernal> PNX\r\n\t\t// tag\r\n\t\tif (!match && !CJKStringHandling.isCJKString(queryBk.getTitle())) {\r\n\t\t\tqueryStr = new String(processQueryTitleISODoc(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t\terrMsg += \"Query: No record found on Primo.\" + Config.QUERY_SETTING;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\t\treturn false;\r\n\t}",
"public static void parseQueryString(String queryString) {\n\n System.out.println(\"STUB: Calling parseQueryString(String s) to process queries\");\n System.out.println(\"Parsing the string:\\\"\" + queryString + \"\\\"\");\n queryString = queryString.toLowerCase();\n String colName = queryString.substring(0,queryString.indexOf(\"from\")+5).trim();\n String colNames[] = removeWhiteSpacesInArray(colName.split(\" \"));\n ArrayList<String> queryStringList = new ArrayList<String>(Arrays.asList(colNames));\n queryStringList.remove(\"select\");\n queryStringList.remove(\"from\");\n String condition = \"\";\n String keyValueCond[] = new String[]{};\n String tableName = \"\";\n if(queryString.contains(\"where\")) {\n tableName = queryString.substring(queryString.indexOf(\"from\") + 5, queryString.indexOf(\"where\")).trim();\n condition = queryString.substring(queryString.indexOf(\"where\")+6, queryString.length()).trim();\n keyValueCond = removeWhiteSpacesInArray(condition.split(\" \"));\n }else\n tableName = queryString.substring(queryString.indexOf(\"from\")+5).trim();\n try {\n Table table = new Table(tableName.concat(\".tbl\"));\n int noOfRecords = table.page.getNoOfRecords();\n long pos = table.page.getStartofContent();\n TreeMap<String, String> colOrder = columnOrdinalHelper.getColumnsInOrdinalPositionOrder(tableName);\n int recordLength = Integer.parseInt(recordLengthHelper.getProperties(tableName.concat(\".\").concat(Constant.recordLength)));\n if(keyValueCond.length>0){\n\n }else{\n Iterator it = colOrder.entrySet().iterator();\n while (it.hasNext()){\n Map.Entry<String, String> entryPair = (Map.Entry<String, String>) it.next();\n// ReadResult<Object> readResult = table.page.readIntasByte(pos);\n// System.out.println(readResult.getT());\n ReadResult<Object> readResult = RecordFormat.readRecordFormat(columnTypeHelper.getProperties(entryPair.getValue()),table,pos);\n System.out.println(\"RESULT COLUMN NAME : \"+entryPair.getValue()+\" Value : \"+readResult.getT());\n\n }\n\n }\n\n\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"protected String compileQuery(final String query, String result) throws IllegalArgumentException {\n\t\t\n\t\tif (query != null && ! query.isEmpty()) {\n\t\t\tfinal SelektQLErrorListener selektQLErrorListener = new SelektQLErrorListener();\n\t\t\tSelektQLLexer lexer = new SelektQLLexer(CharStreams.fromString(query));\n\t\t\tSelektQLParser parser = new SelektQLParser(new CommonTokenStream(lexer));\n\t\t\tparser.removeErrorListeners();\n\t\t\tparser.addErrorListener(selektQLErrorListener);\n\t\t\tresult = selektQL2Solr.visit(parser.anfrage());\n\t\t\tif (selektQLErrorListener.error) {\n\t\t\t\tthrow new IllegalArgumentException(\"Fehler beim Kompilieren der Anfrage \" + query);\n\t\t\t}\n\t\t} \n\t\treturn result;\n\t}",
"String processQuery(String query);",
"private void checkInlineQueries() throws Exceptions.OsoException, Exceptions.InlineQueryFailedError {\n Ffi.Query nextQuery = ffiPolar.nextInlineQuery();\n while (nextQuery != null) {\n if (!new Query(nextQuery, host).hasMoreElements()) {\n String source = nextQuery.source();\n throw new Exceptions.InlineQueryFailedError(source);\n }\n nextQuery = ffiPolar.nextInlineQuery();\n }\n }",
"public void setQuery (Query q)\n\t throws IllegalStateException,\n\t QueryParseException\n {\n\n\tif (!q.parsed ())\n\t{\n\n\t throw new IllegalStateException (\"Query has not yet been parsed.\");\n\n\t}\n\n\tthis.q = q;\n\n\tthis.checkFrom ();\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n }",
"@Override\n\tprotected void runData(Query query) throws SQLException {\n\t\tStringBuilder q = new StringBuilder();\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tquery.inc(2);\n\t\twhile (!isData(query.part()) || !isComment(query.part()) || !isCode(query.part())) {\n\t\t\tq.append(query.part());\n\t\t\tq.append(\" \");\n\t\t\tquery.inc();\n\t\t}\n\t\tArrayList<Integer> originList = getLinesFromData(q.toString());\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}",
"Query query();",
"protected SelectQuery getQuery(final String query) {\n\t\treturn queryFactory.parseQuery(query);\n\t}",
"public abstract String createQuery();",
"@Test\n\tpublic void badQueryTest() {\n\t\texception.expect(IllegalArgumentException.class);\n\t\t\n\t\t// numbers not allowed\n\t\tqueryTest.query(\"lfhgkljaflkgjlkjlkj9f8difj3j98ouijsflkedfj90\");\n\t\t// unbalanced brackets\n\t\tqueryTest.query(\"( hello & goodbye | goodbye ( or hello )\");\n\t\t// & ) not legal\n\t\tqueryTest.query(\"A hello & goodbye | goodbye ( or hello &)\");\n\t\t// unbalanced quote\n\t\tqueryTest.query(\"kdf ksdfj (\\\") kjdf\");\n\t\t// empty quotes\n\t\tqueryTest.query(\"kdf ksdfj (\\\"\\\") kjdf\");\n\t\t// invalid text in quotes\n\t\tqueryTest.query(\"kdf ksdfj \\\"()\\\" kjdf\");\n\t\t// double negation invalid (decision)\n\t\tqueryTest.query(\"!!and\");\n\t\t\n\t\t// gibberish\n\t\tqueryTest.query(\"kjlkfgj! ! ! !!! ! !\");\n\t\tqueryTest.query(\"klkjgi & df & | herllo\");\n\t\tqueryTest.query(\"kjdfkj &\");\n\t\t\n\t\t// single negation\n\t\tqueryTest.query(\"( ! )\");\n\t\tqueryTest.query(\"!\");\n\t\t\n\t\t// quotes and parenthesis interspersed\n\t\tqueryTest.query(\"our lives | coulda ( \\\" been so ) \\\" but momma had to \\\" it all up wow\\\"\");\n\t}",
"private ExecStmtParser(String query) {\n\t\tsuper(query);\n\t}",
"public QueryCore(String query)\n {\n this.query = query;\n }",
"public void Query() {\n }",
"private void compile() throws QueryException, MappingException {\n \t\tLOG.trace( \"Compiling query\" );\n \t\ttry {\n \t\t\tParserHelper.parse( new PreprocessingParser( tokenReplacements ),\n \t\t\t\t\tqueryString,\n \t\t\t\t\tParserHelper.HQL_SEPARATORS,\n \t\t\t\t\tthis );\n \t\t\trenderSQL();\n \t\t}\n \t\tcatch ( QueryException qe ) {\n \t\t\tqe.setQueryString( queryString );\n \t\t\tthrow qe;\n \t\t}\n \t\tcatch ( MappingException me ) {\n \t\t\tthrow me;\n \t\t}\n \t\tcatch ( Exception e ) {\n \t\t\tLOG.debug( \"Unexpected query compilation problem\", e );\n \t\t\te.printStackTrace();\n \t\t\tQueryException qe = new QueryException( \"Incorrect query syntax\", e );\n \t\t\tqe.setQueryString( queryString );\n \t\t\tthrow qe;\n \t\t}\n \n \t\tpostInstantiate();\n \n \t\tcompiled = true;\n \n \t}",
"public void pre() {\n\t\t//handlePreReset(); //replaced with handlePostReset \n\t\tsendKeepAlive();\n\t\tcurrentQuery = new Query();\n\t\tfastForward = false;\n\n\t\t// System.out.println(\"New query starts now.\");\n\t}",
"@Override\n\t\tpublic void executeQuery(String query) {\n\t\t\t\n\t\t}",
"@Override\n\tpublic Query objectQuery(String query) throws Exception {\n\t\treturn null;\n\t}",
"public boolean parse()\n\t{\n\t\tif (m_sqlOriginal == null || m_sqlOriginal.length() == 0)\n\t\t\tthrow new IllegalArgumentException(\"No SQL\");\n\t\t//\n\t//\tif (CLogMgt.isLevelFinest())\n\t//\t\tlog.fine(m_sqlOriginal);\n\t\tgetSelectStatements();\n\t\t//\tanalyse each select\t\n\t\tfor (int i = 0; i < m_sql.length; i++)\n\t\t{\t\n\t\t\tTableInfo[] info = getTableInfo(m_sql[i].trim());\n\t\t\tm_tableInfo.add(info);\n\t\t}\n\t\t//\n\t\tif (CLogMgt.isLevelFinest())\n\t\t\tlog.fine(toString());\n\t\treturn m_tableInfo.size() > 0;\n\t}",
"Query createQuery(final String query);",
"@Override\n\tpublic Query createQuery(String qlString) {\n\t\treturn null;\n\t}",
"TSearchQuery prepareSearchQuery(SearchQueryDefinitionAPI searchQueryDefinition);",
"private void constructSearchingQueryIfScanIsValid(){\n\t\t//todo: test roll back \n\t\t//String scanContent = scanningResult.getContents();\n\t\t//String scanFormat = scanningResult.getFormatName();\n\t\t\n\t\t//todo: test need delete\n\t\tString scanContent = \"9781430247883\";\n\t\tString scanFormat = \"EAN_13\";\n\t\tif(GoogleApiConverter.isScanFormatMatching(scanContent, scanFormat)){\n\t\t\tString bookSearchString = GoogleApiConverter.formateBookApiSearchQuery(scanContent);\n\t\t\tnew GetBookInfo().execute(bookSearchString);\n\t\t}\n\t\telse{\n\t\t\tToastExceptions.onShowException(this, \"Not a valid scan!\");\n\t\t}\n\t}",
"public static Query parse(String userQuery, String defaultOperator) {\n\n\t\ttry\n\t\t{\n\t\t\tif(userQuery != null && !\"\".equals(userQuery))\n\t\t\t{\n\t\t\t\treturn new Query(new QueryEvaluators(userQuery.trim(), defaultOperator));\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new QueryParserException();\n\t\t}\n\t\tcatch(QueryParserException e) //QueryParserException -- Need to define.?\n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\treturn null;\n\t}",
"protected abstract void onQueryStart();",
"public List<QueryHit> processQuery(String query) {\n // Do something!\n System.err.println(\"Processing query '\" + query + \"'\");\n return new ArrayList<QueryHit>();\n }",
"@SuppressWarnings({\"DuplicateExpressions\", \"DuplicatedCode\"})\n public static DataTable executeQuery(String query) throws DataFormatException, FileNotFoundException{\n if(query.isBlank()){\n throw new IllegalArgumentException(\"The query cannot be blank.\");\n }\n\n query = getItemInsideOuterParentheses(query.trim());\n\n String firstLetter = query.substring(0, 1);\n if(firstLetter.equals(MINUS) || firstLetter.equals(UNION) || firstLetter.equals(JOIN) || firstLetter.equals(CROSS_PRODUCT)){\n //noinspection GrazieInspection\n throw new IllegalArgumentException(\"The first item cannot be a two-table operator. It can't be \" + firstLetter + \", which is what you put.\");\n }\n\n //noinspection SwitchStatementWithoutDefaultBranch\n switch(query.substring(0, 4)){\n case SELECT:\n return executeQuery(getItemInsideOuterParentheses(query.substring(query.indexOf(\"}\") + 1))).selectWhere(getItemInsideOuterCurlyBraces(query.substring(query.indexOf(\"{\"), query.indexOf(\"}\") + 1)));\n case PROJECT:\n return executeQuery(getItemInsideOuterParentheses(query.substring(query.indexOf(\"}\") + 1))).project(getItemInsideOuterCurlyBraces(query.substring(query.indexOf(\"{\"), query.indexOf(\"}\") + 1)).split(\",\"));\n }\n\n int firstOperator = Integer.MAX_VALUE;\n String firstOperatorName = null;\n\n if(query.contains(MINUS)){\n firstOperator = query.indexOf(MINUS);\n firstOperatorName = MINUS;\n }\n if(query.contains(UNION) && (query.indexOf(UNION) < firstOperator)){\n firstOperator = query.indexOf(UNION);\n firstOperatorName = UNION;\n }\n if(query.contains(JOIN) && (query.indexOf(JOIN) < firstOperator)){\n firstOperator = query.indexOf(JOIN);\n firstOperatorName = JOIN;\n }\n if(query.contains(CROSS_PRODUCT) && (query.indexOf(CROSS_PRODUCT) < firstOperator)){\n firstOperator = query.indexOf(CROSS_PRODUCT);\n firstOperatorName = CROSS_PRODUCT;\n }\n if(query.contains(INTERSECT) && (query.indexOf(INTERSECT) < firstOperator)){\n firstOperator = query.indexOf(INTERSECT);\n firstOperatorName = INTERSECT;\n }\n\n if(firstOperatorName != null){\n String beforeOperator = query.substring(0, firstOperator);\n String afterOperator = query.substring(firstOperator + 1);\n\n // Since “INTE“ is not a single character, it won't work in the switch above.\n return switch(firstOperatorName){\n case MINUS -> executeQuery(beforeOperator).minus(executeQuery(afterOperator));\n case UNION -> executeQuery(beforeOperator).unionWith(executeQuery(afterOperator));\n case JOIN -> executeQuery(beforeOperator).joinWith(executeQuery(afterOperator));\n case INTERSECT -> executeQuery(beforeOperator).intersectWith(executeQuery(afterOperator));\n case CROSS_PRODUCT -> executeQuery(beforeOperator).crossWith(executeQuery(afterOperator));\n default -> throw new UnsupportedOperationException(\"IDK man, the compiler forced me to put this in here.\");\n };\n }\n\n // If none of the above are satisfied, then we are at a raw table name, so we need to fetch that.\n String tableName = getItemInsideOuterParentheses(query);\n if(tableName.contains(\")\") || tableName.contains(DataTable.EQUALS) || tableName.contains(DataTable.LESS_THAN) || tableName.contains(DataTable.GREATER_THAN) || tableName.contains(MINUS) || tableName.contains(UNION) || tableName.contains(\n INTERSECT) || tableName.contains(JOIN) || tableName.contains(SELECT) || tableName.contains(PROJECT) || tableName.contains(CROSS_PRODUCT)){\n throw new DataFormatException(\n \"The string parsing algorithm was done incorrectly. Please try a simpler query so that the developer does not lose points on this very hard project. Thanks much. The algorithm thinks the table name is \" + \"\\\"\" + tableName +\n \"\\\".\");\n }\n\n File tableFile = new File(tableName + \".txt\");\n if(!tableFile.exists()){\n throw new FileNotFoundException(\"Bruh, please state a table that actually exists, as \" + tableFile + \".txt doesn't. The file must be of the extension \\\".txt\\\" (all lowercase).\");\n }\n\n return new DataTable(tableFile);\n }",
"private void executeQuery() {\n }",
"public void queryDataPreProcess(String queryText) throws Exception {\n StopwordRemover stopwordRemover = new StopwordRemover();\n WordNormalizer wordNormalizer = new WordNormalizer();\n\n // initiate the BufferedWriter to output result\n FilePathGenerator fpg = new FilePathGenerator(\"result.txt\");\n String path = fpg.getPath();\n\n // queryId\n String queryId = \"\";\n if (queryId == null || queryId.length() == 0){\n// queryId = UUID.randomUUID().toString().replace(\"-\", \"\");\n queryId = String.valueOf(FileConst.query_doc_id);\n }\n\n // append query_id:query_text to exiting doc_id:doc_content text file\n try (FileWriter fileWriter = new FileWriter(path, true); // Path.ResultAssignment1\n BufferedWriter bw = new BufferedWriter(fileWriter)){\n // write doc_id into the result file\n bw.write(queryId + '\\n');\n\n // load doc content\n char[] content = queryText.toCharArray();\n\n // initiate a word object to hold a word\n char[] word;\n\n // initiate the WordTokenizer\n WordTokenizer tokenizer = new WordTokenizer(content);\n\n // process the query word by word iteratively\n while ((word = tokenizer.nextWord()) != null){\n word = wordNormalizer.lowercase(word);\n // write only non-stopword into result file\n if (!stopwordRemover.isStopword(Arrays.toString(word))){\n bw.append(wordNormalizer.toStem(word)).append(\" \");\n query_tokens.add(wordNormalizer.toStem(word));\n }\n }\n bw.append(\"\\n\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void parse(\n ParserProto.ParserRequest request,\n StreamObserver<ParserProto.ParserResponse> responseObserver) {\n\n String q = request.getQuery();\n int epos = -1; // Don't use query.length(), use -1.\n String err = \"\";\n\n try {\n ParseDriver pd = new ParseDriver();\n ASTNode node = pd.parse(q);\n\n } catch (ParseException e) {\n try {\n Field errorsField = ParseException.class.getDeclaredField(\"errors\");\n errorsField.setAccessible(true);\n ArrayList<ParseError> errors = (ArrayList<ParseError>) errorsField.get(e);\n Field reField = ParseError.class.getDeclaredField(\"re\");\n reField.setAccessible(true);\n RecognitionException re = (RecognitionException) reField.get(errors.get(0));\n epos = ParserServer.posToIndex(q, re.line, re.charPositionInLine);\n } catch (Exception all) {\n err = \"Cannot parse the error message from HiveQL parser\";\n }\n\n if (err == \"\") {\n try {\n ParseDriver pd = new ParseDriver();\n ASTNode node = pd.parse(q);\n } catch (ParseException ee) {\n err = ee.getMessage();\n }\n }\n }\n\n responseObserver.onNext(\n ParserProto.ParserResponse.newBuilder().setIndex(epos).setError(err).build());\n responseObserver.onCompleted();\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate CompoundQuery handleQuery() throws Exception{\n\t\tif (this.resultant != null && this.resultant.getResultsContainer() != null){\n\t\t\t//compoundQuery = (CompoundQuery) resultant.getAssociatedQuery();\n\t\t\tViewable view = newCompoundQuery.getAssociatedView();\n\t\t\tResultsContainer resultsContainer = this.resultant.getResultsContainer();\n\t\t\tsampleCrit = null;\n\t Collection sampleIDs = new ArrayList(); \n\t\t\t//Get the samples from the resultset object\n\t\t\tif(resultsContainer!= null){\n\t\t\t\tCollection samples = null;\n\t\t\t\tif(resultsContainer != null &&resultsContainer instanceof DimensionalViewContainer){\t\t\t\t\n\t\t\t\t\tDimensionalViewContainer dimensionalViewContainer = (DimensionalViewContainer)resultsContainer;\n\t\t\t\t\t\tCopyNumberSingleViewResultsContainer copyNumberSingleViewContainer = dimensionalViewContainer.getCopyNumberSingleViewContainer();\n\t\t\t\t\t\tGeneExprSingleViewResultsContainer geneExprSingleViewContainer = dimensionalViewContainer.getGeneExprSingleViewContainer();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(copyNumberSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = copyNumberSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(geneExprSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = geneExprSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \t\tsampleCrit = new SampleCriteria();\n\t\t \t\t\tsampleCrit.setSampleIDs(sampleIDs);\n\n AddConstrainsToQueriesHelper constrainedSamplesHandler= new AddConstrainsToQueriesHelper();\n constrainedSamplesHandler.constrainQueryWithSamples(newCompoundQuery,sampleCrit);\n\t\t\t\tnewCompoundQuery = getShowAllValuesQuery(newCompoundQuery);\n\t\t\t\tnewCompoundQuery.setAssociatedView(view);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn newCompoundQuery;\n\t\t}",
"@Override\n public boolean onQueryTextSubmit(String query) {\n queryMain = query;\n consultarDb();\n return true;\n }",
"@Test\n\tpublic void isValidQueryTest() {\n\t\tString query1 = \"< nice & cool \";\n\t\tString query2 = \"( hello & !!cool )\";\n\t\tString query3 = \"( hello | !cool )\";\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\tqueryTest.isValidQuery(query1);\n\t\tqueryTest.isValidQuery(query2);\n\n\t\texception = ExpectedException.none();\n\t\tqueryTest.isValidQuery(query3);\n\n\t\t// test num of brackets\n\t\tquery1 = \"( nice & cool )\";\n\t\tquery2 = \"( ( nice & cool )\";\n\t\tquery3 = \"( hello & my | ( name | is ) | bar & ( hi )\";\n\t\t\n\t\tqueryTest.isValidQuery(query1);\n\t\texception.expect(IllegalArgumentException.class);\n\t\tqueryTest.isValidQuery(query2);\n\t\tqueryTest.isValidQuery(query3);\n\t\t\n\t\t// test phrases (+ used to indicate phrase)\n\t\tquery1 = \"hello+hi+my\";\n\t\tquery2 = \"hello+contains+my\";\n\t\tquery3 = \"( my+name & hello | ( oh my ))\";\n\t\t\n\t\texception = ExpectedException.none();\n\t\tqueryTest.isValidQuery(query1);\n\t\tqueryTest.isValidQuery(query2);\n\t\tqueryTest.isValidQuery(queryTest.fixSpacing(query3));\n\t}",
"public AbstractJoSQLFilter (Query q)\n\t throws IllegalStateException,\n\t QueryParseException\n {\n\n\tthis.setQuery (q);\n\n }",
"public Query getFinalQuery(String field) throws ParseException;",
"private String sanitizeQuery(String query) {\n if (query.length() >= MAX_ALLOWED_SQL_CHARACTERS) {\n throw new TooLongQueryError(query.length());\n }\n return query;\n }",
"public JPQLQuery(ExecutionContext ec, String query)\r\n {\r\n super(ec, query);\r\n }",
"void execute() throws TMQLLexerException;",
"public QueryExecution createQueryExecution(String qryStr);",
"public void newQuery(String query){\n\t\tparser = new Parser(query);\n\t\tQueryClass parsedQuery = parser.createQueryClass();\n\t\tqueryList.add(parsedQuery);\n\t\t\n\t\tparsedQuery.matchFpcRegister((TreeRegistry)ps.getRegistry());\n\t\tparsedQuery.matchAggregatorRegister();\n\t\t\n\t\t\n\t}",
"public QueryExecution createQueryExecution(Query qry);",
"private QueryResult performMappedQuery() throws VizException {\n\n if (database == null) {\n throw new VizException(\"Database not specified for query\");\n }\n if (query == null) {\n throw new VizException(\"Cannot execute null query\");\n }\n\n QlServerRequest request = new QlServerRequest(query);\n request.setDatabase(database);\n request.setType(QueryType.QUERY);\n request.setParamMap(paramMap);\n\n // set the mode so the handler knows what to do\n if (queryLanguage == null) {\n throw new VizException(\"Query language not specified\");\n } else if (queryLanguage.equals(QueryLanguage.HQL)) {\n request.setLang(QlServerRequest.QueryLanguage.HQL);\n } else {\n request.setLang(QlServerRequest.QueryLanguage.SQL);\n }\n\n // create request object\n QueryResult retVal = null;\n // get result\n AbstractResponseMessage response = (AbstractResponseMessage) ThriftClient\n .sendRequest(request);\n\n if (response instanceof ResponseMessageGeneric) {\n retVal = (QueryResult) ((ResponseMessageGeneric) response)\n .getContents();\n\n } else if (response instanceof ResponseMessageError) {\n ResponseMessageError rme = (ResponseMessageError) response;\n VizServerSideException innerException = new VizServerSideException(\n rme.toString());\n throw new VizServerSideException(rme.getErrorMsg(), innerException);\n }\n\n return retVal;\n }",
"public QueryParserException() {\n super();\n }",
"private static Boolean specialQueries(String query) throws ClassNotFoundException, InstantiationException, IllegalAccessException {\n clickList = false;\n //newCorpus = true;\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n return true;\n }\n\n String[] subqueries = query.split(\"\\\\s+\"); //split around white space\n\n if (subqueries[0].equals(\"stem\")) //first term in subqueries tells computer what to do \n {\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n TokenProcessor processor = new NewTokenProcessor();\n if (subqueries.length > 1) //user meant to stem the token not to search stem\n {\n List<String> stems = processor.processToken(subqueries[1]);\n\n //clears list and repopulates it \n String stem = \"Stem of query '\" + subqueries[1] + \"' is '\" + stems.get(0) + \"'\";\n\n GUI.ResultsLabel.setText(stem);\n\n return true;\n }\n\n } else if (subqueries[0].equals(\"vocab\")) {\n List<String> vocabList = Disk_posIndex.getVocabulary();\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n\n int vocabCount = 0;\n for (String v : vocabList) {\n if (vocabCount < 1000) {\n vocabCount++;\n GUI.JListModel.addElement(v);\n }\n }\n GUI.ResultsLabel.setText(\"Total size of vocabulary: \" + vocabCount);\n return true;\n }\n\n return false;\n }",
"private Tuple<String,String> extractQueryAndQueryExecution(String query){\n\t\tString[] elements = query.split(\"--\");\n\t\treturn new Tuple<String,String>(elements[0].trim(), elements[1].trim());\n\t}",
"public Query parseQuery(String query) {\n\t\tint start = 0;\n\n\t\t// General routine: scan the query to identify a literal, and put that literal into a list.\n\t\t//\tRepeat until a + or the end of the query is encountered; build an AND query with each\n\t\t//\tof the literals found. Repeat the scan-and-build-AND-query phase for each segment of the\n\t\t// query separated by + signs. In the end, build a single OR query that composes all of the built\n\t\t// AND subqueries.\n\n\t\tList<Query> allSubqueries = new ArrayList<>();\n\t\tdo {\n\t\t\t// Identify the next subquery: a portion of the query up to the next + sign.\n\t\t\tStringBounds nextSubquery = findNextSubquery(query, start);\n\t\t\t// Extract the identified subquery into its own string.\n\t\t\tString subquery = query.substring(nextSubquery.start, nextSubquery.start + nextSubquery.length);\n\n\t\t\tint subStart = 0;\n\n\t\t\t// Store all the individual components of this subquery.\n\t\t\tList<Query> subqueryLiterals = new ArrayList<>(0);\n\n\t\t\tdo {\n\t\t\t\t// Extract the next literal from the subquery.\n\t\t\t\tLiteral lit = findNextLiteral(subquery, subStart);\n\n\t\t\t\t// Add the literal component to the conjunctive list.\n\t\t\t\tsubqueryLiterals.add(lit.literalComponent);\n\n\t\t\t\t// Set the next index to start searching for a literal.\n\t\t\t\tsubStart = lit.bounds.start + lit.bounds.length;\n\n\t\t\t} while (subStart < subquery.length()-1);\n\n\t\t\t// After processing all literals, we are left with a conjunctive list\n\t\t\t// of query components, and must fold that list into the final disjunctive list\n\t\t\t// of components.\n\n\t\t\t// If there was only one literal in the subquery, we don't need to AND it with anything --\n\t\t\t// its component can go straight into the list.\n\t\t\tif (subqueryLiterals.size() == 1) {\n\t\t\t\tallSubqueries.add(subqueryLiterals.get(0));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// With more than one literal, we must wrap them in an AndQuery component.\n\t\t\t\tallSubqueries.add(new AndQuery(subqueryLiterals));\n\t\t\t}\n\t\t\tstart = nextSubquery.start + nextSubquery.length;\n\t\t} while (start < query.length());\n\n\t\t// After processing all subqueries, we either have a single component or multiple components\n\t\t// that must be combined with an OrQuery.\n\t\tif (allSubqueries.size() == 1) {\n\t\t\treturn allSubqueries.get(0);\n\t\t}\n\t\telse if (allSubqueries.size() > 1) {\n\t\t\treturn new OrQuery(allSubqueries);\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n public boolean onQueryTextSubmit(String query) {\n machineAdapter.getFilter().filter(query);\n return false;\n }",
"private boolean isAdvancedQuery(String enteredQuery){\n try{\n Character firstChar = enteredQuery.charAt(0);\n Character secondChar = enteredQuery.charAt(1);\n\n return isSignOperator(firstChar.toString()) && secondChar.equals(' ');\n }catch (StringIndexOutOfBoundsException ex){\n return false;\n }\n }",
"private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }",
"private QueryResponse query(Query query) throws ElasticSearchException{\r\n\t\tQueryResponse response = executor.executeQuery(query);\r\n\t\tresponse.setObjectMapper(mapper);\r\n\t\treturn response;\t\t\r\n\t}",
"CampusSearchQuery generateQuery();",
"private ASTQuery() {\r\n dataset = Dataset.create();\r\n }",
"protected void preprocessQueryModel( SQLQueryModel query, List<Selection> selections,\n Map<LogicalTable, String> tableAliases, DatabaseMeta databaseMeta ) {\n }",
"private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }",
"public abstract Query<T> setQuery(String oql);",
"public void parse_sql(String sql, Boolean as_is) throws ConnectorConfigException{\n\t\tif (as_is){\n\t\t\tfieldset = sql;\n\t\t\treturn;\n\t\t}\n\t\tPattern limit_regex = Pattern.compile(\"[ \\n]+limit[\\n ,0-9]\", Pattern.CASE_INSENSITIVE);\n\t\tPattern where_regex = Pattern.compile(\"[ \\n]+where\", Pattern.CASE_INSENSITIVE);\n\t\tPattern from_regex = Pattern.compile(\"[ \\n]+from\", Pattern.CASE_INSENSITIVE);\n\t\tPattern select_regex = Pattern.compile(\"select\", Pattern.CASE_INSENSITIVE);\n\t\tPattern order_regex = Pattern.compile(\"[ \\n]+order[ ]+by\", Pattern.CASE_INSENSITIVE);\n\t\tPattern empty_regex = Pattern.compile(\"[ ]+\", Pattern.CASE_INSENSITIVE);\n\t\tPattern groupby_regex = Pattern.compile(\"[ \\n]+group[ \\n]+by[ \\n]+\", Pattern.CASE_INSENSITIVE);\n\n\t\tsql = limit_regex.split(sql)[0]; //drop limit part;\n\n\t\tif (groupby_regex.split(sql).length > 1){ //workaround for GROUP BY in sql\n\t\t\tset_source(\"(\"+sql+\") dhx_group_table\");\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\t//locate select part\n\t\tString[] data = from_regex.split(sql,2);\n\t\tset_fieldset(select_regex.split(data[0],2)[1]);\n\t\t\n\t\tString [] table_data = where_regex.split(data[1],2);\n\t\tif (table_data.length>1){ //where construction exists\n\t\t\tset_source(table_data[0]);\n\t\t\tString [] where_data = order_regex.split(table_data[1]);\n\t\t\tset_filter(where_data[0]);\n\t\t\tif (where_data.length==1) return; //all parsed\n\t\t\tsql = where_data[1].trim();\n\t\t} else { //check order \n\t\t\tString [] order_data = order_regex.split(table_data[0],2);\n\t\t\tset_source(order_data[0]);\n\t\t\tif (order_data.length==1) return; //all parsed\n\t\t\tsql = order_data[1].trim();\n\t\t}\n\t\t\n\t\tif (!sql.equals(\"\")){\n\t\t\tString [] order_details = empty_regex.split(sql);\n\t\t\tset_sort(order_details[0],order_details[1]);\n\t\t}\n\t}",
"public abstract List createQuery(String query);",
"private String checkQuery(String query){\n\t\tif(query != null){\n\t\t\tString[] param = query.split(\"=\");\n\t\t\tif(param[0].equals(\"tenantID\")){\n\t\t\t\treturn param[1];\n\t\t\t}\n\t\t}\n\t\treturn \"\";\n\t}",
"protected String getQuery(String query) {\r\n\t\treturn query;\r\n\t}",
"@Override\n\tpublic void queryData() {\n\t\t\n\t}",
"@ActionTrigger(action=\"QUERY\")\n\t\tpublic void spriden_Query()\n\t\t{\n\t\t\t\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tenterQuery();\n//\t\t\t\tif ( SupportClasses.SQLFORMS.FormSuccess().not() )\n//\t\t\t\t{\n//\t\t\t\t\t\n//\t\t\t\t\tthrow new ApplicationException();\n//\t\t\t\t}\n\t\t\t}",
"@Test\n\tpublic void queryTest() {\n\t\tString query1 = \"(\\\"hello my name is\\\" & my | (!no & yes))\";\n\t\tString query2 = \"(hello & (\\\"yes sir\\\") | !no)\";\n\t\tString query3 = \"\\\"bob dylan\\\" ( big boy | toy ) & \\\"named troy\\\"\";\n\t\tString query4 = \"test \\\"quan what does\\\"\";\n\t\t\n\t\tString query1Result = \"hello+my+name+is my & !no yes & |\";\n\t\tString query2Result = \"hello yes+sir & !no |\";\n\t\tString query3Result = \"bob+dylan big boy & toy | & named+troy &\";\n\t\tString query4Result = \"test quan+what+does &\";\n\t\t\n\t\tassertEquals(query1Result, String.join(\" \", queryTest.getPostFix(query1)));\n\t\tassertEquals(query2Result, String.join(\" \", queryTest.getPostFix(query2)));\n\t\tassertEquals(query3Result, String.join(\" \", queryTest.getPostFix(query3)));\n\t\tassertEquals(query4Result, String.join(\" \", queryTest.getPostFix(query4)));\n\t}",
"public void createQuery(String s) throws HibException;",
"public static boolean isValidinput(String query){\r\n\t\tPattern regex = Pattern.compile(\"[$&+,:;=@#|]\");\r\n\t\tMatcher matcher = regex.matcher(query);\r\n\t\tif (matcher.find()){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t}",
"private void parseQuery(String str) {\n String[] parts = str.split(\"orderby\");\n String[] elements = parts[0].split(\"\\\\s+\");\n\n // Use two-stack algorithm to parse prefix notation\n Stack<Comparable<String>> terms = new Stack<Comparable<String>>();\n Stack<Comparable<String>> helper = new Stack<Comparable<String>>();\n\n for (String el : elements) { terms.push(el); }\n while (!terms.isEmpty()) {\n Comparable<String> term = terms.pop();\n String operands = \"+|-\";\n if (operands.contains(term.toString())) {\n Comparable<String> leftSide = helper.pop();\n Comparable<String> rightSide = helper.pop();\n helper.push(new Subquery(leftSide, term.toString(), rightSide));\n } else {\n helper.push(term);\n }\n }\n\n Comparable<String> resultQuery = helper.pop();\n parsedQuery = resultQuery instanceof String ? new Subquery(resultQuery) : (Subquery) resultQuery;\n computeUniqueNotation(parsedQuery);\n\n if (parts.length < 2) {\n return;\n }\n\n // Parse sorting properties\n if (parts[1].contains(\"relevance\")) {\n property = \"RELEVANCE\";\n } else if (parts[1].contains(\"popularity\")) {\n property = \"POPULARITY\";\n }\n\n if (parts[1].contains(\"asc\")) {\n direction = 1;\n } else if (parts[1].contains(\"desc\")) {\n direction = -1;\n }\n }",
"private void handleEntitiesQuery(RoutingContext routingContext) {\n LOGGER.debug(\"Info:handleEntitiesQuery method started.;\");\n /* Handles HTTP request from client */\n JsonObject authInfo = (JsonObject) routingContext.data().get(\"authInfo\");\n LOGGER.debug(\"authInfo : \" + authInfo);\n HttpServerRequest request = routingContext.request();\n /* Handles HTTP response from server to client */\n HttpServerResponse response = routingContext.response();\n // get query paramaters\n MultiMap params = getQueryParams(routingContext, response).get();\n MultiMap headerParams = request.headers();\n // validate request parameters\n Future<Boolean> validationResult = validator.validate(params);\n validationResult.onComplete(validationHandler -> {\n if (validationHandler.succeeded()) {\n // parse query params\n NGSILDQueryParams ngsildquery = new NGSILDQueryParams(params);\n if (isTemporalParamsPresent(ngsildquery)) {\n ValidationException ex =\n new ValidationException(\"Temporal parameters are not allowed in entities query.\");\n ex.setParameterName(\"[timerel,time or endtime]\");\n routingContext.fail(ex);\n }\n // create json\n QueryMapper queryMapper = new QueryMapper();\n JsonObject json = queryMapper.toJson(ngsildquery, false);\n Future<List<String>> filtersFuture =\n catalogueService.getApplicableFilters(json.getJsonArray(\"id\").getString(0));\n /* HTTP request instance/host details */\n String instanceID = request.getHeader(HEADER_HOST);\n json.put(JSON_INSTANCEID, instanceID);\n LOGGER.debug(\"Info: IUDX query json;\" + json);\n /* HTTP request body as Json */\n JsonObject requestBody = new JsonObject();\n requestBody.put(\"ids\", json.getJsonArray(\"id\"));\n filtersFuture.onComplete(filtersHandler -> {\n if (filtersHandler.succeeded()) {\n json.put(\"applicableFilters\", filtersHandler.result());\n if (json.containsKey(IUDXQUERY_OPTIONS)\n && JSON_COUNT.equalsIgnoreCase(json.getString(IUDXQUERY_OPTIONS))) {\n executeCountQuery(json, response);\n } else {\n executeSearchQuery(json, response);\n }\n } else {\n LOGGER.error(\"catalogue item/group doesn't have filters.\");\n }\n });\n } else if (validationHandler.failed()) {\n LOGGER.error(\"Fail: Validation failed\");\n handleResponse(response, ResponseType.BadRequestData,\n validationHandler.cause().getMessage());\n }\n });\n }",
"public AbstractJoSQLFilter (String q)\n\t throws QueryParseException\n {\n\n\tthis.setQuery (q);\n\n }",
"@Override\r\n\tprotected boolean remoteQuery(String qstr) {\r\n\t\tif (queryBk.getPublishYear() == null || queryBk.getPublishYear().equals(\"\")) {\r\n\t\t\tif (queryBk.getPublisher() == null || queryBk.getPublisher().equals(\"\")) {\r\n\t\t\t\tif (queryBk.parseEdition() == -1 && queryBk.parseVolume() == -1) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tDocumentBuilderFactory f;\r\n\t\tDocumentBuilder b;\r\n\t\tDocument doc;\r\n\t\ttry {\r\n\t\t\tf = DocumentBuilderFactory.newInstance();\r\n\t\t\tb = f.newDocumentBuilder();\r\n\t\t\tURL url = new URL(Config.PRIMO_X_BASE + qstr);\r\n\r\n\t\t\tURLConnection con = url.openConnection();\r\n\t\t\tcon.setConnectTimeout(3000);\r\n\t\t\tdoc = b.parse(con.getInputStream());\r\n\t\t\tqueryStr = Config.PRIMO_X_BASE + qstr;\r\n\t\t\tdebug += queryStr + \"\\n\";\r\n\r\n\t\t\tnodesRecord = doc.getElementsByTagName(\"record\");\r\n\r\n\t\t\t/*\r\n\t\t\t * After fetched a XML doc, store necessary tags from the XMLs for further\r\n\t\t\t * matching.\r\n\t\t\t */\r\n\r\n\t\t\tfor (int i = 0; i < nodesRecord.getLength(); i++) {\r\n\t\t\t\tnodesControl = doc.getElementsByTagName(\"control\").item(i).getChildNodes();\r\n\t\t\t\tnodesDisplay = doc.getElementsByTagName(\"display\").item(i).getChildNodes();\r\n\t\t\t\tnodesLink = doc.getElementsByTagName(\"links\").item(i).getChildNodes();\r\n\t\t\t\tnodesSearch = doc.getElementsByTagName(\"search\").item(i).getChildNodes();\r\n\t\t\t\tnodesDelivery = doc.getElementsByTagName(\"delivery\").item(i).getChildNodes();\r\n\t\t\t\tnodesFacet = doc.getElementsByTagName(\"facets\").item(i).getChildNodes();\r\n\r\n\t\t\t\t// Return true if the query item is of ISO doc no. and of\r\n\t\t\t\t// published by ISO\r\n\t\t\t\tif (matchIsoPublisher() && matchIsoDocNo()) {\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!strHandle.hasSomething(queryBk.getCreator())) {\r\n\t\t\t\t\tif (matchTitle() && matchPublisher() && matchYear()) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (matchTitle() && matchAuthor()) {\r\n\r\n\t\t\t\t\tif ((matchEdition() && matchPublisher() && matchYear())) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else if (!strHandle.hasSomething(queryBk.getPublisher()) && matchYear()\r\n\t\t\t\t\t\t\t&& strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else if (matchEdition() && queryBk.parseEdition() > 1) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * As Primo X-service only shows the first FRBRed record, check the rest records\r\n\t\t\t\t\t\t * involving the same frbrgroupid.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tString frbrid = \"\";\r\n\t\t\t\t\t\tfrbrid = getNodeValue(\"frbrgroupid\", nodesFacet);\r\n\t\t\t\t\t\tString frbr_qstr = qstr + \"&query=facet_frbrgroupid,exact,\" + frbrid;\r\n\t\t\t\t\t\t// System.out.println(\"FRBR:\" + Config.PRIMO_X_BASE +\r\n\t\t\t\t\t\t// frbr_qstr);\r\n\t\t\t\t\t\tDocument doc2 = b.parse(Config.PRIMO_X_BASE + frbr_qstr);\r\n\t\t\t\t\t\tnodesFrbrRecord = doc2.getElementsByTagName(\"record\");\r\n\r\n\t\t\t\t\t\tfor (int j = 0; j < nodesFrbrRecord.getLength(); j++) {\r\n\r\n\t\t\t\t\t\t\tnodesControl = doc2.getElementsByTagName(\"control\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesDisplay = doc2.getElementsByTagName(\"display\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesLink = doc2.getElementsByTagName(\"links\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesSearch = doc2.getElementsByTagName(\"search\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesDelivery = doc2.getElementsByTagName(\"delivery\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesFacet = doc2.getElementsByTagName(\"facets\").item(j).getChildNodes();\r\n\r\n\t\t\t\t\t\t\tif (!strHandle.hasSomething(queryBk.getPublishYear()) && queryBk.parseEdition() == -1\r\n\t\t\t\t\t\t\t\t\t&& !strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t} // end if\r\n\r\n\t\t\t\t\t\t\tif (matchEdition() && matchTitle() && matchAuthor() && matchPublisher() && matchYear()) {\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t} else if (matchEdition() && matchTitle() && matchAuthor() && matchYear()\r\n\t\t\t\t\t\t\t\t\t&& !strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t} // end if\r\n\t\t\t\t\t\t} // end for\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end for\r\n\t\t} // end try\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tStringWriter errors = new StringWriter();\r\n\t\t\te.printStackTrace(new PrintWriter(errors));\r\n\t\t\tString errStr = \"PrimoQueryByNonISBN:remoteQuery()\" + errors.toString();\r\n\t\t\tSystem.out.println(errStr);\r\n\t\t\terrMsg = errStr;\r\n\t\t} // end catch\r\n\t\treturn false;\r\n\t}",
"public static void checkFormat(String queryString) throws WrongQueryFormatException {\n\t\tString filters[] = queryString.split(\" \");\n\t\tif (filters.length != 7)\n\t\t\tthrow new WrongQueryFormatException(\n\t\t\t\t\t\"the query should be in this format-- QUERY <IP_ADDRESS> <CPU_ID> <START_DATE> <START_HOUR:START_MIN> <END_DATE> <END_HOUR:END_MIN>\");\n\t\tif (!filters[0].equals(\"QUERY\") && !filters[0].equals(\"EXIT\"))\n\t\t\tthrow new WrongQueryFormatException(\"the query should either start with a 'QUERY' or type 'EXIT' to end\");\n\t\tif (!isAnIp(filters[1]))\n\t\t\tthrow new WrongQueryFormatException(\"the second argument must be an ip address\");\n\t\tif (!isCpuId(filters[2]))\n\t\t\tthrow new WrongQueryFormatException(\"the third argument must be a cpu id(0 or 1)\");\n\t\tisDateTime(filters);\n\t}",
"private DbQuery() {}",
"@Override\n public boolean onQueryTextSubmit(String query) {\n prepareBooks(engine.search(query.toLowerCase(),filter));\n return false;\n }",
"boolean isIsQuery();",
"public abstract void inLineQuery(InlineQuery q);",
"@Override\n\tvoid executeQuery(String query) {\n\t\tSystem.out.println(\"Mssql ==> \" + query);\n\t}",
"private QueryRequest prepareAndValidateInputs() throws AutomicException {\n // Validate Work item type\n String workItemType = getOptionValue(\"workitemtype\");\n AgileCentralValidator.checkNotEmpty(workItemType, \"Work Item type\");\n\n // Validate export file path check for just file name.\n String temp = getOptionValue(\"exportfilepath\");\n AgileCentralValidator.checkNotEmpty(temp, \"Export file path\");\n File file = new File(temp);\n AgileCentralValidator.checkFileWritable(file);\n try {\n filePath = file.getCanonicalPath();\n } catch (IOException e) {\n throw new AutomicException(\" Error in getting unique absolute path \" + e.getMessage());\n }\n\n QueryRequest queryRequest = new QueryRequest(workItemType);\n String workSpaceName = getOptionValue(\"workspace\");\n if (CommonUtil.checkNotEmpty(workSpaceName)) {\n String workSpaceRef = RallyUtil.getWorspaceRef(rallyRestTarget, workSpaceName);\n queryRequest.setWorkspace(workSpaceRef);\n }\n\n String filters = getOptionValue(\"filters\");\n if (CommonUtil.checkNotEmpty(filters)) {\n queryRequest.addParam(\"query\", filters);\n }\n\n String fieldInput = getOptionValue(\"fields\");\n if (CommonUtil.checkNotEmpty(fieldInput)) {\n prepareUserFields(fieldInput);\n Fetch fetchList = new Fetch();\n fetchList.addAll(uniqueFields);\n queryRequest.setFetch(fetchList);\n }\n\n // Validate count\n String rowLimit = getOptionValue(\"limit\");\n limit = CommonUtil.parseStringValue(rowLimit, -1);\n if (limit < 0) {\n throw new AutomicException(String.format(ExceptionConstants.INVALID_INPUT_PARAMETER, \"Maximum Items\",\n rowLimit));\n }\n if (limit == 0) {\n limit = Integer.MAX_VALUE;\n }\n return queryRequest;\n }",
"public PseudoQuery() {\r\n\t}",
"String query();",
"static AnalysisResult analyseQuery(String query) {\n for (String attack : commonAttacks) {\n attack = attack.toLowerCase();\n if (trim(query.toLowerCase()).contains(trim(attack))) {\n return new AnalysisResult(true, null, attack, true);\n }\n }\n return new AnalysisResult(false, null, null, true);\n }",
"private QueryExecution returnQueryExecObject(String coreQuery) {\n\t\tStringBuffer queryStr = new StringBuffer();\n\t\t// Establish Prefixes\n\t\tfor(String prefix:neededPrefixesForQueries)\n\t\t{\n\t\t\tqueryStr.append(\"prefix \" + prefix);\n\t\t}\n\n\t\tqueryStr.append(coreQuery);\n\n\t\tQuery query = QueryFactory.create(queryStr.toString());\n\t\tQueryExecution qexec = QueryExecutionFactory.create(query, this.model);\n\n\t\treturn qexec;\n\t}",
"private static String addQueryEntry(String query) throws IOException {\n\t\t\t\t\n\t\tString submittedQuery=null;\n\t\tString queryParts[]=query.split(\"&\"); // get parameters from query\t\t\n\t\tboolean isNextPage=false;\n\t\tString key=null;\n\t\tInteger value=null;\n\t\tboolean docsProcessed=false; // identifies if 'docs' occurs more than once in the query\t\t\n\t\tboolean termsProcessed=false; // identifies if 'terms' occurs more than once in the query\n\t\t\n\t\t// identify if it is a next page\n\t\tfor (int i=0;i<queryParts.length;i++) { // verifies if it is a next page\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\tif (queryPartsFields.length>1) {\n\t\t\t\tqueryPartsFields[1]=queryPartsFields[1].trim();\n\t\t\t}\n\t\t\t\n\t\t\tif (queryPartsFields[0].equals(DOCS_KEY) && queryPartsFields.length>1 && !queryPartsFields[1].equals(\"\")) {\t\t\t\n\t\t\t\tint ipage;\n\t\t\t\ttry {\n\t\t\t\t\tipage=Integer.parseInt(queryPartsFields[1]);\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e) {\n\t\t\t\t\tipage=0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ipage!=0) { // regist only pages>0 \t\t\t\t\t\t\t\n\t\t\t\t\tisNextPage=true;\t\t\t\n\t\t\t\t\tif (ipage%RESULTS_PER_PAGE!=0) {\n\t\t\t\t\t\tSystem.err.println(\"Page results not multiple of \"+RESULTS_PER_PAGE+\": \"+ipage);\n\t\t\t\t\t\tipage+=ipage%RESULTS_PER_PAGE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!docsProcessed) {\n\t\t\t\t\t\tint index=ipage/RESULTS_PER_PAGE>pagesViewedDistAux.length-1 ? pagesViewedDistAux.length-1 : ipage/RESULTS_PER_PAGE;\t\t\t\n\t\t\t\t\t\tif (index==0) { // sanity check\n\t\t\t\t\t\t throw new IOException(\"Error of index=0 on a next page. ipage:\"+ipage);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpagesViewedDistAux[index]++;\n\t\t\t\t\t}\n\t\t\t\t\tdocsProcessed=true;\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (queryPartsFields[0].equals(QUERY_KEY)) {\n\t\t\t\ttermsProcessed=true;\n\t\t\t}\n\t\t}\n\t\t// check wrong entries\n\t\tif (docsProcessed && !termsProcessed) {\n\t\t\tSystem.err.println(\"Error of query with docs without terms: \"+query);\n\t\t\treturn null;\n\t\t}\t\t\t\t\n\t\tif (isNextPage) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// count only first page\n\t\tdocsProcessed=false;\n\t\tfor (int i=0;i<queryParts.length;i++) {\t\t\t\t\t\t\t\t\t\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\t\n\t\t\tif (!queryPartsFields[0].equals(QUERY_KEY) || queryPartsFields.length!=2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// normalize query\t\t\t\n\t\t\ttry {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(java.net.URLDecoder.decode(queryPartsFields[1],\"ISO8859-1\").toLowerCase()));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(IllegalArgumentException e) {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(queryPartsFields[1].toLowerCase()));\n\t\t\t}\n\t\t\t// remove spaces\n\t\t\tString terms[]=queryPartsFields[1].split(\"\\\\s\");\n\t\t\tqueryPartsFields[1]=\"\";\n\t\t\tfor (int j=0,k=0;j<terms.length;j++) {\t\t\t\t\t\n\t\t\t\tif (terms[j].equals(\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\tif (k>0) {\n\t\t\t\t\tqueryPartsFields[1]+=\" \";\t\n\t\t\t\t}\n\t\t\t\tqueryPartsFields[1]+=terms[j];\t\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// filter queries\t\t\t\t\t\n\t\t\tif (queryFiltersMap.containsKey(queryPartsFields[1]) || queryPartsFields[1].startsWith(\"cache%3\") || queryPartsFields[1].equals(\"\")) {\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t// set first page viewed\n\t\t\tif (!docsProcessed) {\n\t\t\t\tpagesViewedDistAux[0]++;\n\t\t\t\tdocsProcessed=true;\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//key=queryPartsFields[0]+\" \"+queryPartsFields[1];\n\t\t\tkey=NEW_QUERY_KEY+\" \"+queryPartsFields[1];\t\t\t\n\t\t\tif ((value=queryPartsMap.get(key))==null) {\n\t\t\t\tqueryPartsMap.put(key,1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tqueryPartsMap.put(key,value+1);\n\t\t\t}\n\t\t\t\n\t\t\t// set submitted query\n\t\t\tif (submittedQuery!=null) { // sanity check\n\t\t\t\tthrow new IOException(\"Submitted query already set.\");\n\t\t\t}\n\t\t\tsubmittedQuery=queryPartsFields[1];\n\t\t\t\t\n\t\t\t// count queries per session\t\n\t\t\tnQueriesSession++;\n\t\t}\n\t\treturn submittedQuery;\n\t}",
"public Query() {\r\n }",
"public abstract void resetQuery();",
"@Override\n\tprotected void runLine(Query query) {\n\t\tquery.inc();\n\t\tint i = Integer.parseInt(query.next());\n\t\tArrayList<Integer> originList = new ArrayList<Integer>();\n\t\toriginList.add(i - 1);\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}",
"public void setQuery(java.lang.String query) {\r\n this.query = query;\r\n }",
"public void finalPass() throws Exception {\n if (_CommandText != null)\n _CommandText.finalPass();\n \n if (_QueryParameters != null)\n _QueryParameters.finalPass();\n \n // verify the data source\n DataSourceDefn ds = null;\n if (OwnerReport.getDataSourcesDefn() != null && OwnerReport.getDataSourcesDefn().getItems() != null)\n {\n ds = OwnerReport.getDataSourcesDefn().get___idx(_DataSourceName);\n }\n \n if (ds == null)\n {\n OwnerReport.rl.logError(8,\"Query references unknown data source '\" + _DataSourceName + \"'\");\n return ;\n }\n \n _DataSourceDefn = ds;\n IDbConnection cnSQL = ds.sqlConnect(null);\n if (cnSQL == null || _CommandText == null)\n return ;\n \n // Treat this as a SQL statement\n String sql = _CommandText.evaluateString(null,null);\n IDbCommand cmSQL = null;\n IDataReader dr = null;\n try\n {\n cmSQL = cnSQL.CreateCommand();\n cmSQL.CommandText = addParametersAsLiterals(null,cnSQL,sql,false);\n if (this._QueryCommandType == QueryCommandTypeEnum.StoredProcedure)\n cmSQL.CommandType = CommandType.StoredProcedure;\n \n addParameters(null,cnSQL,cmSQL,false);\n dr = cmSQL.ExecuteReader(CommandBehavior.SchemaOnly);\n if (dr.FieldCount < 10)\n _Columns = new ListDictionary();\n else\n // Hashtable is overkill for small lists\n _Columns = new Hashtable(dr.FieldCount); \n for (int i = 0;i < dr.FieldCount;i++)\n {\n QueryColumn qc = new QueryColumn(i, dr.GetName(i), Type.GetTypeCode(dr.GetFieldType(i)));\n try\n {\n _Columns.Add(qc.colName, qc);\n }\n catch (Exception __dummyCatchVar0)\n {\n // name has already been added to list:\n // According to the RDL spec SQL names are matched by Name not by relative\n // position: this seems wrong to me and causes this problem; but\n // user can fix by using \"as\" keyword to name columns in Select\n // e.g. Select col as \"col1\", col as \"col2\" from tableA\n OwnerReport.rl.LogError(8, String.Format(\"Column '{0}' is not uniquely defined within the SQL Select columns.\", qc.colName));\n }\n \n }\n }\n catch (Exception e)\n {\n OwnerReport.rl.logError(4,\"SQL Exception during report compilation: \" + e.Message + \"\\r\\nSQL: \" + sql);\n }\n finally\n {\n if (cmSQL != null)\n {\n cmSQL.Dispose();\n if (dr != null)\n dr.Close();\n \n }\n \n }\n return ;\n }",
"private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }",
"public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);",
"@Override\n \t\tpublic boolean onQueryTextSubmit(String query) {\n \t\t\t\t\n \t\t\treturn false;\n \t\t}",
"@Override\n\tprotected void runCode(Query query) {\n\t\tquery.inc();\n\t\tArrayList<Integer> originList = getListOnCode(query.next());\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}"
] | [
"0.7001092",
"0.6589921",
"0.6547079",
"0.64985126",
"0.64566106",
"0.6395626",
"0.6310218",
"0.6283796",
"0.62672377",
"0.611813",
"0.611301",
"0.6094339",
"0.60847026",
"0.60194755",
"0.5987905",
"0.59510356",
"0.58646876",
"0.582425",
"0.5812317",
"0.5804494",
"0.57745826",
"0.5766161",
"0.5746508",
"0.57413715",
"0.573196",
"0.5695309",
"0.56943977",
"0.5687621",
"0.5675179",
"0.5652488",
"0.56197727",
"0.56128883",
"0.5586613",
"0.5584502",
"0.5573964",
"0.5572803",
"0.55489796",
"0.55465674",
"0.55436087",
"0.5534118",
"0.5531558",
"0.55272436",
"0.55255574",
"0.5519547",
"0.55168635",
"0.5507558",
"0.5504713",
"0.5502037",
"0.5498603",
"0.54971015",
"0.5469473",
"0.54652184",
"0.5458514",
"0.54582167",
"0.54477125",
"0.54425824",
"0.54401046",
"0.54370856",
"0.541283",
"0.5406188",
"0.5404646",
"0.5394677",
"0.53817016",
"0.5377241",
"0.536703",
"0.5366151",
"0.53654176",
"0.5361584",
"0.535384",
"0.53537667",
"0.5347978",
"0.5344747",
"0.53367025",
"0.5328387",
"0.5327007",
"0.532641",
"0.53184885",
"0.5315769",
"0.53150105",
"0.5310163",
"0.53061634",
"0.5300933",
"0.52962434",
"0.5294824",
"0.52939296",
"0.5269441",
"0.52646196",
"0.5255293",
"0.52549845",
"0.5253248",
"0.52498174",
"0.5246099",
"0.52361655",
"0.52361524",
"0.5233129",
"0.52274007",
"0.5225475",
"0.5218127",
"0.5215961",
"0.5211496",
"0.5209922"
] | 0.0 | -1 |
This method should do it best to preparse and validate the query It should store the query or execute anything towards EHR data. | public abstract QueryContainer translateQuery(QueryContainer query)
throws Exception; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void validateQuery(Query query) throws InvalidQueryException;",
"public CQLQueryResults processQuery(CQLQuery cqlQuery) throws MalformedQueryException, \n\t QueryProcessingException {\n\t\tthrow new RuntimeException(\"not impl yet. port from ncia-core-grid-transfer\");\n\t}",
"public CQLQueryResults processQuery(CQLQuery cqlQuery) throws MalformedQueryException, \r\n\t QueryProcessingException {\r\n\t\tthrow new RuntimeException(\"not impl yet. port from ncia-core-grid-transfer\");\r\n\t}",
"protected abstract String getValidationQuery();",
"public void parseQuery(String queryString) {\r\n\t\t// call the methods\r\n\t\tgetSplitStrings(queryString);\r\n\t\tgetFile(queryString);\r\n\t\tgetBaseQuery(queryString);\r\n\t\tgetConditionsPartQuery(queryString);\r\n\t\tgetConditions(queryString);\r\n\t\tgetLogicalOperators(queryString);\r\n\t\tgetFields(queryString);\r\n\t\tgetOrderByFields(queryString);\r\n\t\tgetGroupByFields(queryString);\r\n\t\tgetAggregateFunctions(queryString);\r\n\t}",
"boolean stageAfterQueryParsing(Object input) throws ValidationFailedException;",
"public void validate() throws org.apache.thrift.TException {\n if (query != null) {\n query.validate();\n }\n }",
"@SuppressWarnings(\"null\")\n\tpublic QueryParameter parseQuery(String queryString) {\n\t\t\n/*\n\t\t * extract the name of the file from the query. File name can be found after the\n\t\t * \"from\" clause.\n\t\t */\n\n\t\t/*\n\t\t * extract the order by fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"order by\" clause in the query, if at all\n\t\t * the order by clause exists. For eg: select city,winner,team1,team2 from\n\t\t * data/ipl.csv order by city from the query mentioned above, we need to extract\n\t\t * \"city\". Please note that we can have more than one order by fields.\n\t\t */\n\n\t\t/*\n\t\t * extract the group by fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"group by\" clause in the query, if at all\n\t\t * the group by clause exists. For eg: select city,max(win_by_runs) from\n\t\t * data/ipl.csv group by city from the query mentioned above, we need to extract\n\t\t * \"city\". Please note that we can have more than one group by fields.\n\t\t */\n\n\t\t /*\n\t\t * extract the selected fields from the query string. Please note that we will\n\t\t * need to extract the field(s) after \"select\" clause followed by a space from\n\t\t * the query string. For eg: select city,win_by_runs from data/ipl.csv from the\n\t\t * query mentioned above, we need to extract \"city\" and \"win_by_runs\". Please\n\t\t * note that we might have a field containing name \"from_date\" or \"from_hrs\".\n\t\t * Hence, consider this while parsing.\n\t\t */\n\n\t\t/*\n\t\t * extract the conditions from the query string(if exists). for each condition,\n\t\t * we need to capture the following: 1. Name of field 2. condition 3. value\n\t\t * \n\t\t * For eg: select city,winner,team1,team2,player_of_match from data/ipl.csv\n\t\t * where season >= 2008 or toss_decision != bat\n\t\t * \n\t\t * here, for the first condition, \"season>=2008\" we need to capture: 1. Name of\n\t\t * field: season 2. condition: >= 3. value: 2008\n\t\t * \n\t\t * the query might contain multiple conditions separated by OR/AND operators.\n\t\t * Please consider this while parsing the conditions.\n\t\t * \n\t\t */\n\n\t\t /*\n\t\t * extract the logical operators(AND/OR) from the query, if at all it is\n\t\t * present. For eg: select city,winner,team1,team2,player_of_match from\n\t\t * data/ipl.csv where season >= 2008 or toss_decision != bat and city =\n\t\t * bangalore\n\t\t * \n\t\t * the query mentioned above in the example should return a List of Strings\n\t\t * containing [or,and]\n\t\t */\n\n\t\t/*\n\t\t * extract the aggregate functions from the query. The presence of the aggregate\n\t\t * functions can determined if we have either \"min\" or \"max\" or \"sum\" or \"count\"\n\t\t * or \"avg\" followed by opening braces\"(\" after \"select\" clause in the query\n\t\t * string. in case it is present, then we will have to extract the same. For\n\t\t * each aggregate functions, we need to know the following: 1. type of aggregate\n\t\t * function(min/max/count/sum/avg) 2. field on which the aggregate function is\n\t\t * being applied\n\t\t * \n\t\t * Please note that more than one aggregate function can be present in a query\n\t\t * \n\t\t * \n\t\t */\n\n\t\tString file = null;\n\t\tList<Restriction> restrictions = new ArrayList<Restriction>();\n\t\tList<String> logicalOperators = new ArrayList<String>();\n\t\tList<String> fields = new ArrayList<String>();;\n\t\tList<AggregateFunction> aggregateFunction = new ArrayList<AggregateFunction>();\n\t\tList<String> groupByFields = new ArrayList<String>();;\n\t\tList<String> orderByFields = new ArrayList<String>();;\n\t\tString baseQuery=null;\n\t\n\t\tfile = getFile(queryString);\n\n\t\t\n\t\tString[] conditions = getConditions(queryString);\n\t\tif(conditions!=null) {\n\t\tRestriction[] restriction = new Restriction[conditions.length];\n\t\t\n\t\tfor (int i = 0; i < conditions.length; i++) {\n\t\t\trestriction[i] = new Restriction();\n\t\t\t\n\t\t\tString operator=null;\n\t\t\tString value=null;\n\t\t\tString property=null;\n\t\t\t if(conditions[i].contains(\"<=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"<=\");\n\t\t\t\toperator=\"<=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\">=\")) {\n\t\t\t\tString[] split = conditions[i].split(\">=\");\n\t\t\t\toperator=\">=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\">\")) {\n\t\t\t\tString[] split = conditions[i].split(\">\");\n\t\t\t\toperator=\">\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"!=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"!=\");\n\t\t\t\toperator=\"!=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"=\")) {\n\t\t\t\tString[] split = conditions[i].split(\"=\");\n\t\t\t\toperator=\"=\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t\t if(value.contains(\"'\")) {\n\t\t\t\t\t value= value.replaceAll(\"'\",\"\").trim();\n\t\t\t\t }\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(conditions[i].contains(\"<\")) {\n\t\t\t\tString[] split = conditions[i].split(\"<\");\n\t\t\t\toperator=\"<\";\n\t\t\t\t value=split[1].trim();\n\t\t\t\t property=split[0].trim();\n\t\t\t}\n\t\t\t \n\t\t\t\n\t\t\trestriction[i].setCondition(operator);\n\t\t\trestriction[i].setPropertyName(property);\n\t\t\trestriction[i].setPropertyValue(value);\n\t\t\trestrictions.add(restriction[i]);\n\n\t\t}\n\t\t}\n\t\n\t\tString[] operators = getLogicalOperators(queryString);\n\t\tif(operators!=null) {\n\t\tfor (String op : operators) {\n\t\t\tlogicalOperators.add(op);\n\t\t}\n\t\t}\n\t\t\n\t\tString[] filds = getFields(queryString);\n\t\tif(filds!=null) {\n\t\tfor (String field : filds) {\n\t\t\tfields.add(field);\n\t\t}\n\t\t}\n\t\t\n\t\tString[] aggregationVal = getAggregateFunctions(queryString);\n\t\tif(aggregationVal!=null) {\n\t\tAggregateFunction[] aggregation = new AggregateFunction[aggregationVal.length];\n\t\tfor (int i = 0; i < aggregationVal.length; i++) {\n\t\t\taggregation[i] = new AggregateFunction();\n\t\t\tString[] split = (aggregationVal[i].replace(\"(\", \" \")).split(\" \");\n\t\t\tSystem.out.println(split[0]);\n\t\t\tSystem.out.println(split[1].replace(\")\", \"\").trim());\n\t\t\t\n\t\t\taggregation[i].setFunction(split[0]);\n\t\t\taggregation[i].setField(split[1].replace(\")\", \"\").trim());\n\t\t\taggregateFunction.add(aggregation[i]);\n\n\t\t}\n\t\t}\n\t\t\n\t\t\t\n\t\t\n\t\tString[] groupBy = getGroupByFields(queryString);\n\t\tif(groupBy!=null) {\n\t\tfor (String group : groupBy) {\n\t\t\tgroupByFields.add(group);\n\t\t}\n\t\t}\n\t\n\t\tString[] orderBy = getOrderByFields(queryString);\n\t\tif(orderBy!=null) {\n\t\tfor (String order : orderBy) {\n\t\t\torderByFields.add(order);\n\t\t}\n\t\t}\n\t\tqueryParameter.setFile(file);\n\t\tif(restrictions.size()!=0) {\n\t\t\tqueryParameter.setRestrictions(restrictions);\n\t\t}\n\t\telse {\n\t\t\tqueryParameter.setRestrictions(null);\n\t\t}\n\t\tif(logicalOperators.size()!=0) {\n\t\tqueryParameter.setLogicalOperators(logicalOperators);\n\t\t}\n\t\telse {\n\t\t\tqueryParameter.setLogicalOperators(null);\n\t\t}\n\t\tbaseQuery=getBaseQuery(queryString);\n\t\t\n\t\tqueryParameter.setFields(fields);\n\t\tqueryParameter.setAggregateFunctions(aggregateFunction);\n\t\tqueryParameter.setGroupByFields(groupByFields);\n\t\tqueryParameter.setOrderByFields(orderByFields);\n\t\tqueryParameter.setBaseQuery(baseQuery.trim());\n\t\treturn queryParameter;\n\n\t}",
"public static void parseQueryString(String queryString) {\n\n System.out.println(\"STUB: Calling parseQueryString(String s) to process queries\");\n System.out.println(\"Parsing the string:\\\"\" + queryString + \"\\\"\");\n queryString = queryString.toLowerCase();\n String colName = queryString.substring(0,queryString.indexOf(\"from\")+5).trim();\n String colNames[] = removeWhiteSpacesInArray(colName.split(\" \"));\n ArrayList<String> queryStringList = new ArrayList<String>(Arrays.asList(colNames));\n queryStringList.remove(\"select\");\n queryStringList.remove(\"from\");\n String condition = \"\";\n String keyValueCond[] = new String[]{};\n String tableName = \"\";\n if(queryString.contains(\"where\")) {\n tableName = queryString.substring(queryString.indexOf(\"from\") + 5, queryString.indexOf(\"where\")).trim();\n condition = queryString.substring(queryString.indexOf(\"where\")+6, queryString.length()).trim();\n keyValueCond = removeWhiteSpacesInArray(condition.split(\" \"));\n }else\n tableName = queryString.substring(queryString.indexOf(\"from\")+5).trim();\n try {\n Table table = new Table(tableName.concat(\".tbl\"));\n int noOfRecords = table.page.getNoOfRecords();\n long pos = table.page.getStartofContent();\n TreeMap<String, String> colOrder = columnOrdinalHelper.getColumnsInOrdinalPositionOrder(tableName);\n int recordLength = Integer.parseInt(recordLengthHelper.getProperties(tableName.concat(\".\").concat(Constant.recordLength)));\n if(keyValueCond.length>0){\n\n }else{\n Iterator it = colOrder.entrySet().iterator();\n while (it.hasNext()){\n Map.Entry<String, String> entryPair = (Map.Entry<String, String>) it.next();\n// ReadResult<Object> readResult = table.page.readIntasByte(pos);\n// System.out.println(readResult.getT());\n ReadResult<Object> readResult = RecordFormat.readRecordFormat(columnTypeHelper.getProperties(entryPair.getValue()),table,pos);\n System.out.println(\"RESULT COLUMN NAME : \"+entryPair.getValue()+\" Value : \"+readResult.getT());\n\n }\n\n }\n\n\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void setQuery (String q)\n\t throws QueryParseException\n {\n\n\tthis.q = new Query ();\n\tthis.q.parse (q);\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n\tthis.checkFrom ();\n\n }",
"public void validate() throws org.apache.thrift.TException {\n if (simpleSearchQuery != null) {\r\n simpleSearchQuery.validate();\r\n }\r\n }",
"protected boolean query() {\r\n\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator())\r\n\t\t\t\t+ processQueryPublisher(queryBk.getPublisher()));\r\n\t\tSystem.out.println(queryStr);\r\n\t\t// if edition is 'lastest' (coded '0'), no query is performed; and\r\n\t\t// return false.\r\n\t\tif (queryBk.parseEdition() == 0) {\r\n\t\t\treturn false;\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * The following section adds edition info to the query string if edition no. is\r\n\t\t * greater than one. By cataloging practice, for the first edition, probably\r\n\t\t * there is NO input on the associated MARC field. Considering this, edition\r\n\t\t * query string to Primo is NOT added if querying for the first edition or no\r\n\t\t * edition is specified.\r\n\t\t */\r\n\t\tif (queryBk.parseEdition() > 1) {\r\n\t\t\tqueryStr += processQueryEdition(queryBk.parseEdition());\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * Querying the Primo X-service; and invoking the matching processes (all done\r\n\t\t * by remoteQuery()).\r\n\t\t */\r\n\t\tif (strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t/*\r\n\t\t * For various reasons, there are possibilities that the first query fails while\r\n\t\t * a match should be found. The follow work as remedy queries to ensure the\r\n\t\t * accuracy.\r\n\t\t */\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryPublisher(queryBk.getPublisher()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()) + processQueryAuthor(queryBk.getCreator()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match && strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryYear(queryBk.getPublishYear()));\r\n\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tif (!match) {\r\n\t\t\tqueryStr = new String(\r\n\t\t\t\t\tprocessQueryAuthor(queryBk.getCreator()) + processQueryTitleShort(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional query for Chinese titles\r\n\r\n\t\tif (!match && (CJKStringHandling.isCJKString(queryBk.getTitle())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getCreator())\r\n\t\t\t\t|| CJKStringHandling.isCJKString(queryBk.getPublisher()))) {\r\n\r\n\t\t\tqueryStr = new String(processQueryTitle(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t} // end if\r\n\r\n\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition2(queryBk.parseEdition()));\r\n\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\tmatch = true;\r\n\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmatch = false;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!match && queryBk.parseEdition() != -1) {\r\n\t\t\t\t\tqueryStr = new String(\r\n\t\t\t\t\t\t\tprocessQueryTitle(queryBk.getTitle()) + processQueryEdition3(queryBk.parseEdition()));\r\n\t\t\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\t\t\tmatch = true;\r\n\t\t\t\t\t\tsetBookInfo();\r\n\t\t\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tmatch = false;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\t// Additional check for ISO Document number in <search> <genernal> PNX\r\n\t\t// tag\r\n\t\tif (!match && !CJKStringHandling.isCJKString(queryBk.getTitle())) {\r\n\t\t\tqueryStr = new String(processQueryTitleISODoc(queryBk.getTitle()));\r\n\t\t\tif (remoteQuery(queryStr)) {\r\n\t\t\t\tmatch = true;\r\n\t\t\t\tsetBookInfo();\r\n\t\t\t\tcheckAVA(queryBk.parseVolume());\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\tmatch = false;\r\n\t\t\t\terrMsg += \"Query: No record found on Primo.\" + Config.QUERY_SETTING;\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\t\treturn false;\r\n\t}",
"Query query();",
"public void Query() {\n }",
"@Override\n\t\tpublic void executeQuery(String query) {\n\t\t\t\n\t\t}",
"public void parseUserQuery(String userQuery) {\n\t\tuserQuery = userQuery.toUpperCase();\n\t\tString[] selectStage;\n\t\tselectStage = userQuery.split(\"SELECT\\\\s*|\\\\s*FROM\\\\s*\");\n\t\tcolumnNames = new ArrayList<String>(Arrays.asList(selectStage[1].split(\",\\\\s*\")));\n\t\tString[] fromStage = selectStage[2].split(\"\\\\s*WHERE\\\\s*\");\n\t\tfromStage[0] = fromStage[0].replaceAll(\";\", \"\");\n\t\ttableNames = new ArrayList<String>(Arrays.asList(fromStage[0].split(\",\\\\s\")));\n\t\tif (fromStage.length > 1) {\n\t\t\tfromStage[1] = fromStage[1].replaceAll(\";\", \"\");\n\t\t\tList<String> conditions = new ArrayList<String>(Arrays.asList(fromStage[1].split(\"\\\\sAND\\\\s\")));\n\t\t\tseparateConditions(conditions);\n\t\t}\n\t}",
"public abstract String createQuery();",
"private void executeQuery() {\n }",
"@Override\n public boolean onQueryTextSubmit(String query) {\n queryMain = query;\n consultarDb();\n return true;\n }",
"@Override\n\tprotected void runData(Query query) throws SQLException {\n\t\tStringBuilder q = new StringBuilder();\n\t\tArrayList<Integer> destinationList = new ArrayList<Integer>();\n\t\tquery.inc(2);\n\t\twhile (!isData(query.part()) || !isComment(query.part()) || !isCode(query.part())) {\n\t\t\tq.append(query.part());\n\t\t\tq.append(\" \");\n\t\t\tquery.inc();\n\t\t}\n\t\tArrayList<Integer> originList = getLinesFromData(q.toString());\n\t\tparseSecondCondition(query, originList, destinationList);\n\t}",
"private ParsedQuery parseQuery(Layer layer, Query query) {\n PlainSelect plainSelect;\n try {\n Select select = (Select) CCJSqlParserUtil.parse(query.getSql());\n plainSelect = (PlainSelect) select.getSelectBody();\n } catch (JSQLParserException e) {\n String message =\n String.format(\n \"The layer '%s' contains a malformed query.\\n\" + \"\\tQuery:\\n\\t\\t%s\",\n layer.getId(), query.getSql());\n throw new IllegalArgumentException(message, e);\n }\n\n // Check the number of columns\n if (plainSelect.getSelectItems().size() != 3) {\n String message =\n String.format(\n \"The layer '%s' contains a malformed query.\\n\"\n + \"\\tExpected format:\\n\\t\\tSELECT c1::bigint, c2::hstore, c3::geometry FROM t WHERE c\\n\"\n + \"\\tActual query:\\n\\t\\t%s\",\n layer.getId(), query.getSql());\n throw new IllegalArgumentException(message);\n }\n\n // Remove all the aliases\n for (SelectItem selectItem : plainSelect.getSelectItems()) {\n selectItem.accept(\n new SelectItemVisitorAdapter() {\n @Override\n public void visit(SelectExpressionItem selectExpressionItem) {\n selectExpressionItem.setAlias(null);\n }\n });\n }\n return new ParsedQuery(layer, query, plainSelect);\n }",
"public void setQuery (Query q)\n\t throws IllegalStateException,\n\t QueryParseException\n {\n\n\tif (!q.parsed ())\n\t{\n\n\t throw new IllegalStateException (\"Query has not yet been parsed.\");\n\n\t}\n\n\tthis.q = q;\n\n\tthis.checkFrom ();\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate CompoundQuery handleQuery() throws Exception{\n\t\tif (this.resultant != null && this.resultant.getResultsContainer() != null){\n\t\t\t//compoundQuery = (CompoundQuery) resultant.getAssociatedQuery();\n\t\t\tViewable view = newCompoundQuery.getAssociatedView();\n\t\t\tResultsContainer resultsContainer = this.resultant.getResultsContainer();\n\t\t\tsampleCrit = null;\n\t Collection sampleIDs = new ArrayList(); \n\t\t\t//Get the samples from the resultset object\n\t\t\tif(resultsContainer!= null){\n\t\t\t\tCollection samples = null;\n\t\t\t\tif(resultsContainer != null &&resultsContainer instanceof DimensionalViewContainer){\t\t\t\t\n\t\t\t\t\tDimensionalViewContainer dimensionalViewContainer = (DimensionalViewContainer)resultsContainer;\n\t\t\t\t\t\tCopyNumberSingleViewResultsContainer copyNumberSingleViewContainer = dimensionalViewContainer.getCopyNumberSingleViewContainer();\n\t\t\t\t\t\tGeneExprSingleViewResultsContainer geneExprSingleViewContainer = dimensionalViewContainer.getGeneExprSingleViewContainer();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(copyNumberSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = copyNumberSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(geneExprSingleViewContainer!= null){\n\t\t\t\t\t\t\tSet<BioSpecimenIdentifierDE> biospecimenIDs = geneExprSingleViewContainer.getAllBiospecimenLabels();\n\t\t\t\t \t\tfor (BioSpecimenIdentifierDE bioSpecimen: biospecimenIDs) {\n\t\t\t\t \t\t\tif(bioSpecimen.getSpecimenName()!= null){\n\t\t\t\t \t\t\t\t\tsampleIDs.add(new SampleIDDE(bioSpecimen.getSpecimenName()));\n\t\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t \t\tsampleCrit = new SampleCriteria();\n\t\t \t\t\tsampleCrit.setSampleIDs(sampleIDs);\n\n AddConstrainsToQueriesHelper constrainedSamplesHandler= new AddConstrainsToQueriesHelper();\n constrainedSamplesHandler.constrainQueryWithSamples(newCompoundQuery,sampleCrit);\n\t\t\t\tnewCompoundQuery = getShowAllValuesQuery(newCompoundQuery);\n\t\t\t\tnewCompoundQuery.setAssociatedView(view);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn newCompoundQuery;\n\t\t}",
"protected String compileQuery(final String query, String result) throws IllegalArgumentException {\n\t\t\n\t\tif (query != null && ! query.isEmpty()) {\n\t\t\tfinal SelektQLErrorListener selektQLErrorListener = new SelektQLErrorListener();\n\t\t\tSelektQLLexer lexer = new SelektQLLexer(CharStreams.fromString(query));\n\t\t\tSelektQLParser parser = new SelektQLParser(new CommonTokenStream(lexer));\n\t\t\tparser.removeErrorListeners();\n\t\t\tparser.addErrorListener(selektQLErrorListener);\n\t\t\tresult = selektQL2Solr.visit(parser.anfrage());\n\t\t\tif (selektQLErrorListener.error) {\n\t\t\t\tthrow new IllegalArgumentException(\"Fehler beim Kompilieren der Anfrage \" + query);\n\t\t\t}\n\t\t} \n\t\treturn result;\n\t}",
"public QueryCore(String query)\n {\n this.query = query;\n }",
"String processQuery(String query);",
"protected abstract void onQueryStart();",
"@Override\n\tpublic void queryData() {\n\t\t\n\t}",
"private QueryResponse query(Query query) throws ElasticSearchException{\r\n\t\tQueryResponse response = executor.executeQuery(query);\r\n\t\tresponse.setObjectMapper(mapper);\r\n\t\treturn response;\t\t\r\n\t}",
"public void queryDataPreProcess(String queryText) throws Exception {\n StopwordRemover stopwordRemover = new StopwordRemover();\n WordNormalizer wordNormalizer = new WordNormalizer();\n\n // initiate the BufferedWriter to output result\n FilePathGenerator fpg = new FilePathGenerator(\"result.txt\");\n String path = fpg.getPath();\n\n // queryId\n String queryId = \"\";\n if (queryId == null || queryId.length() == 0){\n// queryId = UUID.randomUUID().toString().replace(\"-\", \"\");\n queryId = String.valueOf(FileConst.query_doc_id);\n }\n\n // append query_id:query_text to exiting doc_id:doc_content text file\n try (FileWriter fileWriter = new FileWriter(path, true); // Path.ResultAssignment1\n BufferedWriter bw = new BufferedWriter(fileWriter)){\n // write doc_id into the result file\n bw.write(queryId + '\\n');\n\n // load doc content\n char[] content = queryText.toCharArray();\n\n // initiate a word object to hold a word\n char[] word;\n\n // initiate the WordTokenizer\n WordTokenizer tokenizer = new WordTokenizer(content);\n\n // process the query word by word iteratively\n while ((word = tokenizer.nextWord()) != null){\n word = wordNormalizer.lowercase(word);\n // write only non-stopword into result file\n if (!stopwordRemover.isStopword(Arrays.toString(word))){\n bw.append(wordNormalizer.toStem(word)).append(\" \");\n query_tokens.add(wordNormalizer.toStem(word));\n }\n }\n bw.append(\"\\n\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"protected SelectQuery getQuery(final String query) {\n\t\treturn queryFactory.parseQuery(query);\n\t}",
"@Override\n\tpublic Query createQuery(String qlString) {\n\t\treturn null;\n\t}",
"TSearchQuery prepareSearchQuery(SearchQueryDefinitionAPI searchQueryDefinition);",
"@SuppressWarnings({\"DuplicateExpressions\", \"DuplicatedCode\"})\n public static DataTable executeQuery(String query) throws DataFormatException, FileNotFoundException{\n if(query.isBlank()){\n throw new IllegalArgumentException(\"The query cannot be blank.\");\n }\n\n query = getItemInsideOuterParentheses(query.trim());\n\n String firstLetter = query.substring(0, 1);\n if(firstLetter.equals(MINUS) || firstLetter.equals(UNION) || firstLetter.equals(JOIN) || firstLetter.equals(CROSS_PRODUCT)){\n //noinspection GrazieInspection\n throw new IllegalArgumentException(\"The first item cannot be a two-table operator. It can't be \" + firstLetter + \", which is what you put.\");\n }\n\n //noinspection SwitchStatementWithoutDefaultBranch\n switch(query.substring(0, 4)){\n case SELECT:\n return executeQuery(getItemInsideOuterParentheses(query.substring(query.indexOf(\"}\") + 1))).selectWhere(getItemInsideOuterCurlyBraces(query.substring(query.indexOf(\"{\"), query.indexOf(\"}\") + 1)));\n case PROJECT:\n return executeQuery(getItemInsideOuterParentheses(query.substring(query.indexOf(\"}\") + 1))).project(getItemInsideOuterCurlyBraces(query.substring(query.indexOf(\"{\"), query.indexOf(\"}\") + 1)).split(\",\"));\n }\n\n int firstOperator = Integer.MAX_VALUE;\n String firstOperatorName = null;\n\n if(query.contains(MINUS)){\n firstOperator = query.indexOf(MINUS);\n firstOperatorName = MINUS;\n }\n if(query.contains(UNION) && (query.indexOf(UNION) < firstOperator)){\n firstOperator = query.indexOf(UNION);\n firstOperatorName = UNION;\n }\n if(query.contains(JOIN) && (query.indexOf(JOIN) < firstOperator)){\n firstOperator = query.indexOf(JOIN);\n firstOperatorName = JOIN;\n }\n if(query.contains(CROSS_PRODUCT) && (query.indexOf(CROSS_PRODUCT) < firstOperator)){\n firstOperator = query.indexOf(CROSS_PRODUCT);\n firstOperatorName = CROSS_PRODUCT;\n }\n if(query.contains(INTERSECT) && (query.indexOf(INTERSECT) < firstOperator)){\n firstOperator = query.indexOf(INTERSECT);\n firstOperatorName = INTERSECT;\n }\n\n if(firstOperatorName != null){\n String beforeOperator = query.substring(0, firstOperator);\n String afterOperator = query.substring(firstOperator + 1);\n\n // Since “INTE“ is not a single character, it won't work in the switch above.\n return switch(firstOperatorName){\n case MINUS -> executeQuery(beforeOperator).minus(executeQuery(afterOperator));\n case UNION -> executeQuery(beforeOperator).unionWith(executeQuery(afterOperator));\n case JOIN -> executeQuery(beforeOperator).joinWith(executeQuery(afterOperator));\n case INTERSECT -> executeQuery(beforeOperator).intersectWith(executeQuery(afterOperator));\n case CROSS_PRODUCT -> executeQuery(beforeOperator).crossWith(executeQuery(afterOperator));\n default -> throw new UnsupportedOperationException(\"IDK man, the compiler forced me to put this in here.\");\n };\n }\n\n // If none of the above are satisfied, then we are at a raw table name, so we need to fetch that.\n String tableName = getItemInsideOuterParentheses(query);\n if(tableName.contains(\")\") || tableName.contains(DataTable.EQUALS) || tableName.contains(DataTable.LESS_THAN) || tableName.contains(DataTable.GREATER_THAN) || tableName.contains(MINUS) || tableName.contains(UNION) || tableName.contains(\n INTERSECT) || tableName.contains(JOIN) || tableName.contains(SELECT) || tableName.contains(PROJECT) || tableName.contains(CROSS_PRODUCT)){\n throw new DataFormatException(\n \"The string parsing algorithm was done incorrectly. Please try a simpler query so that the developer does not lose points on this very hard project. Thanks much. The algorithm thinks the table name is \" + \"\\\"\" + tableName +\n \"\\\".\");\n }\n\n File tableFile = new File(tableName + \".txt\");\n if(!tableFile.exists()){\n throw new FileNotFoundException(\"Bruh, please state a table that actually exists, as \" + tableFile + \".txt doesn't. The file must be of the extension \\\".txt\\\" (all lowercase).\");\n }\n\n return new DataTable(tableFile);\n }",
"private QueryResult performMappedQuery() throws VizException {\n\n if (database == null) {\n throw new VizException(\"Database not specified for query\");\n }\n if (query == null) {\n throw new VizException(\"Cannot execute null query\");\n }\n\n QlServerRequest request = new QlServerRequest(query);\n request.setDatabase(database);\n request.setType(QueryType.QUERY);\n request.setParamMap(paramMap);\n\n // set the mode so the handler knows what to do\n if (queryLanguage == null) {\n throw new VizException(\"Query language not specified\");\n } else if (queryLanguage.equals(QueryLanguage.HQL)) {\n request.setLang(QlServerRequest.QueryLanguage.HQL);\n } else {\n request.setLang(QlServerRequest.QueryLanguage.SQL);\n }\n\n // create request object\n QueryResult retVal = null;\n // get result\n AbstractResponseMessage response = (AbstractResponseMessage) ThriftClient\n .sendRequest(request);\n\n if (response instanceof ResponseMessageGeneric) {\n retVal = (QueryResult) ((ResponseMessageGeneric) response)\n .getContents();\n\n } else if (response instanceof ResponseMessageError) {\n ResponseMessageError rme = (ResponseMessageError) response;\n VizServerSideException innerException = new VizServerSideException(\n rme.toString());\n throw new VizServerSideException(rme.getErrorMsg(), innerException);\n }\n\n return retVal;\n }",
"Query createQuery(final String query);",
"private ExecStmtParser(String query) {\n\t\tsuper(query);\n\t}",
"public QueryExecution createQueryExecution(Query qry);",
"public boolean parse()\n\t{\n\t\tif (m_sqlOriginal == null || m_sqlOriginal.length() == 0)\n\t\t\tthrow new IllegalArgumentException(\"No SQL\");\n\t\t//\n\t//\tif (CLogMgt.isLevelFinest())\n\t//\t\tlog.fine(m_sqlOriginal);\n\t\tgetSelectStatements();\n\t\t//\tanalyse each select\t\n\t\tfor (int i = 0; i < m_sql.length; i++)\n\t\t{\t\n\t\t\tTableInfo[] info = getTableInfo(m_sql[i].trim());\n\t\t\tm_tableInfo.add(info);\n\t\t}\n\t\t//\n\t\tif (CLogMgt.isLevelFinest())\n\t\t\tlog.fine(toString());\n\t\treturn m_tableInfo.size() > 0;\n\t}",
"public abstract Query<T> setQuery(String oql);",
"@ActionTrigger(action=\"QUERY\")\n\t\tpublic void spriden_Query()\n\t\t{\n\t\t\t\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tnextBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tclearBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tpreviousBlock();\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t\tenterQuery();\n//\t\t\t\tif ( SupportClasses.SQLFORMS.FormSuccess().not() )\n//\t\t\t\t{\n//\t\t\t\t\t\n//\t\t\t\t\tthrow new ApplicationException();\n//\t\t\t\t}\n\t\t\t}",
"public void newQuery(String query){\n\t\tparser = new Parser(query);\n\t\tQueryClass parsedQuery = parser.createQueryClass();\n\t\tqueryList.add(parsedQuery);\n\t\t\n\t\tparsedQuery.matchFpcRegister((TreeRegistry)ps.getRegistry());\n\t\tparsedQuery.matchAggregatorRegister();\n\t\t\n\t\t\n\t}",
"@Override\n public boolean onQueryTextSubmit(String query) {\n machineAdapter.getFilter().filter(query);\n return false;\n }",
"public QueryExecution createQueryExecution(String qryStr);",
"@Override\n\tvoid executeQuery(String query) {\n\t\tSystem.out.println(\"Mssql ==> \" + query);\n\t}",
"private void compile() throws QueryException, MappingException {\n \t\tLOG.trace( \"Compiling query\" );\n \t\ttry {\n \t\t\tParserHelper.parse( new PreprocessingParser( tokenReplacements ),\n \t\t\t\t\tqueryString,\n \t\t\t\t\tParserHelper.HQL_SEPARATORS,\n \t\t\t\t\tthis );\n \t\t\trenderSQL();\n \t\t}\n \t\tcatch ( QueryException qe ) {\n \t\t\tqe.setQueryString( queryString );\n \t\t\tthrow qe;\n \t\t}\n \t\tcatch ( MappingException me ) {\n \t\t\tthrow me;\n \t\t}\n \t\tcatch ( Exception e ) {\n \t\t\tLOG.debug( \"Unexpected query compilation problem\", e );\n \t\t\te.printStackTrace();\n \t\t\tQueryException qe = new QueryException( \"Incorrect query syntax\", e );\n \t\t\tqe.setQueryString( queryString );\n \t\t\tthrow qe;\n \t\t}\n \n \t\tpostInstantiate();\n \n \t\tcompiled = true;\n \n \t}",
"public List<QueryHit> processQuery(String query) {\n // Do something!\n System.err.println(\"Processing query '\" + query + \"'\");\n return new ArrayList<QueryHit>();\n }",
"public void pre() {\n\t\t//handlePreReset(); //replaced with handlePostReset \n\t\tsendKeepAlive();\n\t\tcurrentQuery = new Query();\n\t\tfastForward = false;\n\n\t\t// System.out.println(\"New query starts now.\");\n\t}",
"@Override\n\tpublic Query objectQuery(String query) throws Exception {\n\t\treturn null;\n\t}",
"private void constructSearchingQueryIfScanIsValid(){\n\t\t//todo: test roll back \n\t\t//String scanContent = scanningResult.getContents();\n\t\t//String scanFormat = scanningResult.getFormatName();\n\t\t\n\t\t//todo: test need delete\n\t\tString scanContent = \"9781430247883\";\n\t\tString scanFormat = \"EAN_13\";\n\t\tif(GoogleApiConverter.isScanFormatMatching(scanContent, scanFormat)){\n\t\t\tString bookSearchString = GoogleApiConverter.formateBookApiSearchQuery(scanContent);\n\t\t\tnew GetBookInfo().execute(bookSearchString);\n\t\t}\n\t\telse{\n\t\t\tToastExceptions.onShowException(this, \"Not a valid scan!\");\n\t\t}\n\t}",
"private void checkInlineQueries() throws Exceptions.OsoException, Exceptions.InlineQueryFailedError {\n Ffi.Query nextQuery = ffiPolar.nextInlineQuery();\n while (nextQuery != null) {\n if (!new Query(nextQuery, host).hasMoreElements()) {\n String source = nextQuery.source();\n throw new Exceptions.InlineQueryFailedError(source);\n }\n nextQuery = ffiPolar.nextInlineQuery();\n }\n }",
"@Override\n public boolean onQueryTextSubmit(String query) {\n prepareBooks(engine.search(query.toLowerCase(),filter));\n return false;\n }",
"void execute() throws TMQLLexerException;",
"public ORM executeQuery(String query) {\n ResultSet rs = null;\n this.query =query;\n System.out.println(\"run: \" + this.query);\n //this.curId = 0;\n Statement statement;\n try {\n statement = this.conn.createStatement();\n rs = statement.executeQuery(this.query);\n //this.saveLog(0,\"\",query);\n } catch (SQLException e) {\n System.out.println( ColorCodes.ANSI_RED +\"ERROR in SQL: \" + this.query);\n // e.printStackTrace();\n }\n lastResultSet=rs;\n this.fields_values = \"\";\n return this;\n\n }",
"private void handleEntitiesQuery(RoutingContext routingContext) {\n LOGGER.debug(\"Info:handleEntitiesQuery method started.;\");\n /* Handles HTTP request from client */\n JsonObject authInfo = (JsonObject) routingContext.data().get(\"authInfo\");\n LOGGER.debug(\"authInfo : \" + authInfo);\n HttpServerRequest request = routingContext.request();\n /* Handles HTTP response from server to client */\n HttpServerResponse response = routingContext.response();\n // get query paramaters\n MultiMap params = getQueryParams(routingContext, response).get();\n MultiMap headerParams = request.headers();\n // validate request parameters\n Future<Boolean> validationResult = validator.validate(params);\n validationResult.onComplete(validationHandler -> {\n if (validationHandler.succeeded()) {\n // parse query params\n NGSILDQueryParams ngsildquery = new NGSILDQueryParams(params);\n if (isTemporalParamsPresent(ngsildquery)) {\n ValidationException ex =\n new ValidationException(\"Temporal parameters are not allowed in entities query.\");\n ex.setParameterName(\"[timerel,time or endtime]\");\n routingContext.fail(ex);\n }\n // create json\n QueryMapper queryMapper = new QueryMapper();\n JsonObject json = queryMapper.toJson(ngsildquery, false);\n Future<List<String>> filtersFuture =\n catalogueService.getApplicableFilters(json.getJsonArray(\"id\").getString(0));\n /* HTTP request instance/host details */\n String instanceID = request.getHeader(HEADER_HOST);\n json.put(JSON_INSTANCEID, instanceID);\n LOGGER.debug(\"Info: IUDX query json;\" + json);\n /* HTTP request body as Json */\n JsonObject requestBody = new JsonObject();\n requestBody.put(\"ids\", json.getJsonArray(\"id\"));\n filtersFuture.onComplete(filtersHandler -> {\n if (filtersHandler.succeeded()) {\n json.put(\"applicableFilters\", filtersHandler.result());\n if (json.containsKey(IUDXQUERY_OPTIONS)\n && JSON_COUNT.equalsIgnoreCase(json.getString(IUDXQUERY_OPTIONS))) {\n executeCountQuery(json, response);\n } else {\n executeSearchQuery(json, response);\n }\n } else {\n LOGGER.error(\"catalogue item/group doesn't have filters.\");\n }\n });\n } else if (validationHandler.failed()) {\n LOGGER.error(\"Fail: Validation failed\");\n handleResponse(response, ResponseType.BadRequestData,\n validationHandler.cause().getMessage());\n }\n });\n }",
"public void createQuery(String s) throws HibException;",
"public AbstractJoSQLFilter (Query q)\n\t throws IllegalStateException,\n\t QueryParseException\n {\n\n\tthis.setQuery (q);\n\n }",
"private ASTQuery() {\r\n dataset = Dataset.create();\r\n }",
"private Tuple<String,String> extractQueryAndQueryExecution(String query){\n\t\tString[] elements = query.split(\"--\");\n\t\treturn new Tuple<String,String>(elements[0].trim(), elements[1].trim());\n\t}",
"public SidhdhiQueryExecutor(String query){\n this.query = query;\n }",
"public static Query parse(String userQuery, String defaultOperator) {\n\n\t\ttry\n\t\t{\n\t\t\tif(userQuery != null && !\"\".equals(userQuery))\n\t\t\t{\n\t\t\t\treturn new Query(new QueryEvaluators(userQuery.trim(), defaultOperator));\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new QueryParserException();\n\t\t}\n\t\tcatch(QueryParserException e) //QueryParserException -- Need to define.?\n\t\t{\n\t\t\te.printStackTrace(); \n\t\t}\n\t\treturn null;\n\t}",
"public abstract List createQuery(String query);",
"public JPQLQuery(ExecutionContext ec, String query)\r\n {\r\n super(ec, query);\r\n }",
"public Query() {\n\n// oriToRwt = new HashMap();\n// oriToRwt.put(); // TODO\n }",
"private DbQuery() {}",
"CampusSearchQuery generateQuery();",
"@Test\n\tpublic void badQueryTest() {\n\t\texception.expect(IllegalArgumentException.class);\n\t\t\n\t\t// numbers not allowed\n\t\tqueryTest.query(\"lfhgkljaflkgjlkjlkj9f8difj3j98ouijsflkedfj90\");\n\t\t// unbalanced brackets\n\t\tqueryTest.query(\"( hello & goodbye | goodbye ( or hello )\");\n\t\t// & ) not legal\n\t\tqueryTest.query(\"A hello & goodbye | goodbye ( or hello &)\");\n\t\t// unbalanced quote\n\t\tqueryTest.query(\"kdf ksdfj (\\\") kjdf\");\n\t\t// empty quotes\n\t\tqueryTest.query(\"kdf ksdfj (\\\"\\\") kjdf\");\n\t\t// invalid text in quotes\n\t\tqueryTest.query(\"kdf ksdfj \\\"()\\\" kjdf\");\n\t\t// double negation invalid (decision)\n\t\tqueryTest.query(\"!!and\");\n\t\t\n\t\t// gibberish\n\t\tqueryTest.query(\"kjlkfgj! ! ! !!! ! !\");\n\t\tqueryTest.query(\"klkjgi & df & | herllo\");\n\t\tqueryTest.query(\"kjdfkj &\");\n\t\t\n\t\t// single negation\n\t\tqueryTest.query(\"( ! )\");\n\t\tqueryTest.query(\"!\");\n\t\t\n\t\t// quotes and parenthesis interspersed\n\t\tqueryTest.query(\"our lives | coulda ( \\\" been so ) \\\" but momma had to \\\" it all up wow\\\"\");\n\t}",
"public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);",
"private void performNewQuery(){\n\n // update the label of the Activity\n setLabelForActivity();\n // reset the page number that is being used in queries\n pageNumberBeingQueried = 1;\n // clear the ArrayList of Movie objects\n cachedMovieData.clear();\n // notify our MovieAdapter about this\n movieAdapter.notifyDataSetChanged();\n // reset endless scroll listener when performing a new search\n recyclerViewScrollListener.resetState();\n\n /*\n * Loader call - case 3 of 3\n * We call loader methods as we have just performed reset of the data set\n * */\n // initiate a new query\n manageLoaders();\n\n }",
"public void setQuery(java.lang.String query) {\r\n this.query = query;\r\n }",
"protected final void executeQuery() {\n\ttry {\n\t executeQuery(queryBox.getText());\n\t} catch(SQLException e) {\n\t e.printStackTrace();\n\t clearTable();\n\t JOptionPane.showMessageDialog(\n\t\tnull, e.getMessage(),\n\t\t\"Database Error\",\n\t\tJOptionPane.ERROR_MESSAGE);\n\t}\n }",
"public abstract ResultList executeQuery(DatabaseQuery query);",
"public Query getFinalQuery(String field) throws ParseException;",
"public void query() throws Exception{\n\t\tm_service = new DistrictService();\n\t\t//String queryStr=\"~`~`~`~`~`~@~#\";\n\t\t//String queryStr=\"~`PK~`京北~`~`~`~@~#\";\n\t\t//查询用的类似Queery,查询条件是Query里面的,位置按照Query里面的来\n\t\t//String saveStr = \"~`哈迪~`达鲁~`哥本~`~`~`C~`9898~`9898~`0~`~`0~`~`从DHL地区表中导入~`N~`N~`N~`~`~`~`~`~`~`EMS~`~`~@~#\";\t\n\n\t\tString queryStr = \"~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`~`EMS~`~`~@~#\";\t\n\t\tDecoder objPD = new Decoder(queryStr);\n\t\tString objReturn = \tm_service.query(objPD);\n\t\tSystem.out.println(objReturn);\n\t}",
"public void parse_sql(String sql, Boolean as_is) throws ConnectorConfigException{\n\t\tif (as_is){\n\t\t\tfieldset = sql;\n\t\t\treturn;\n\t\t}\n\t\tPattern limit_regex = Pattern.compile(\"[ \\n]+limit[\\n ,0-9]\", Pattern.CASE_INSENSITIVE);\n\t\tPattern where_regex = Pattern.compile(\"[ \\n]+where\", Pattern.CASE_INSENSITIVE);\n\t\tPattern from_regex = Pattern.compile(\"[ \\n]+from\", Pattern.CASE_INSENSITIVE);\n\t\tPattern select_regex = Pattern.compile(\"select\", Pattern.CASE_INSENSITIVE);\n\t\tPattern order_regex = Pattern.compile(\"[ \\n]+order[ ]+by\", Pattern.CASE_INSENSITIVE);\n\t\tPattern empty_regex = Pattern.compile(\"[ ]+\", Pattern.CASE_INSENSITIVE);\n\t\tPattern groupby_regex = Pattern.compile(\"[ \\n]+group[ \\n]+by[ \\n]+\", Pattern.CASE_INSENSITIVE);\n\n\t\tsql = limit_regex.split(sql)[0]; //drop limit part;\n\n\t\tif (groupby_regex.split(sql).length > 1){ //workaround for GROUP BY in sql\n\t\t\tset_source(\"(\"+sql+\") dhx_group_table\");\n\t\t\treturn;\n\t\t}\n\t\t\t\n\t\t//locate select part\n\t\tString[] data = from_regex.split(sql,2);\n\t\tset_fieldset(select_regex.split(data[0],2)[1]);\n\t\t\n\t\tString [] table_data = where_regex.split(data[1],2);\n\t\tif (table_data.length>1){ //where construction exists\n\t\t\tset_source(table_data[0]);\n\t\t\tString [] where_data = order_regex.split(table_data[1]);\n\t\t\tset_filter(where_data[0]);\n\t\t\tif (where_data.length==1) return; //all parsed\n\t\t\tsql = where_data[1].trim();\n\t\t} else { //check order \n\t\t\tString [] order_data = order_regex.split(table_data[0],2);\n\t\t\tset_source(order_data[0]);\n\t\t\tif (order_data.length==1) return; //all parsed\n\t\t\tsql = order_data[1].trim();\n\t\t}\n\t\t\n\t\tif (!sql.equals(\"\")){\n\t\t\tString [] order_details = empty_regex.split(sql);\n\t\t\tset_sort(order_details[0],order_details[1]);\n\t\t}\n\t}",
"private static Boolean specialQueries(String query) throws ClassNotFoundException, InstantiationException, IllegalAccessException {\n clickList = false;\n //newCorpus = true;\n\n if (query.equals(\"q\")) {\n\n System.exit(0);\n return true;\n }\n\n String[] subqueries = query.split(\"\\\\s+\"); //split around white space\n\n if (subqueries[0].equals(\"stem\")) //first term in subqueries tells computer what to do \n {\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n TokenProcessor processor = new NewTokenProcessor();\n if (subqueries.length > 1) //user meant to stem the token not to search stem\n {\n List<String> stems = processor.processToken(subqueries[1]);\n\n //clears list and repopulates it \n String stem = \"Stem of query '\" + subqueries[1] + \"' is '\" + stems.get(0) + \"'\";\n\n GUI.ResultsLabel.setText(stem);\n\n return true;\n }\n\n } else if (subqueries[0].equals(\"vocab\")) {\n List<String> vocabList = Disk_posIndex.getVocabulary();\n GUI.JListModel.clear();\n GUI.ResultsLabel.setText(\"\");\n\n int vocabCount = 0;\n for (String v : vocabList) {\n if (vocabCount < 1000) {\n vocabCount++;\n GUI.JListModel.addElement(v);\n }\n }\n GUI.ResultsLabel.setText(\"Total size of vocabulary: \" + vocabCount);\n return true;\n }\n\n return false;\n }",
"@Override\n public void parse(\n ParserProto.ParserRequest request,\n StreamObserver<ParserProto.ParserResponse> responseObserver) {\n\n String q = request.getQuery();\n int epos = -1; // Don't use query.length(), use -1.\n String err = \"\";\n\n try {\n ParseDriver pd = new ParseDriver();\n ASTNode node = pd.parse(q);\n\n } catch (ParseException e) {\n try {\n Field errorsField = ParseException.class.getDeclaredField(\"errors\");\n errorsField.setAccessible(true);\n ArrayList<ParseError> errors = (ArrayList<ParseError>) errorsField.get(e);\n Field reField = ParseError.class.getDeclaredField(\"re\");\n reField.setAccessible(true);\n RecognitionException re = (RecognitionException) reField.get(errors.get(0));\n epos = ParserServer.posToIndex(q, re.line, re.charPositionInLine);\n } catch (Exception all) {\n err = \"Cannot parse the error message from HiveQL parser\";\n }\n\n if (err == \"\") {\n try {\n ParseDriver pd = new ParseDriver();\n ASTNode node = pd.parse(q);\n } catch (ParseException ee) {\n err = ee.getMessage();\n }\n }\n }\n\n responseObserver.onNext(\n ParserProto.ParserResponse.newBuilder().setIndex(epos).setError(err).build());\n responseObserver.onCompleted();\n }",
"public void finalPass() throws Exception {\n if (_CommandText != null)\n _CommandText.finalPass();\n \n if (_QueryParameters != null)\n _QueryParameters.finalPass();\n \n // verify the data source\n DataSourceDefn ds = null;\n if (OwnerReport.getDataSourcesDefn() != null && OwnerReport.getDataSourcesDefn().getItems() != null)\n {\n ds = OwnerReport.getDataSourcesDefn().get___idx(_DataSourceName);\n }\n \n if (ds == null)\n {\n OwnerReport.rl.logError(8,\"Query references unknown data source '\" + _DataSourceName + \"'\");\n return ;\n }\n \n _DataSourceDefn = ds;\n IDbConnection cnSQL = ds.sqlConnect(null);\n if (cnSQL == null || _CommandText == null)\n return ;\n \n // Treat this as a SQL statement\n String sql = _CommandText.evaluateString(null,null);\n IDbCommand cmSQL = null;\n IDataReader dr = null;\n try\n {\n cmSQL = cnSQL.CreateCommand();\n cmSQL.CommandText = addParametersAsLiterals(null,cnSQL,sql,false);\n if (this._QueryCommandType == QueryCommandTypeEnum.StoredProcedure)\n cmSQL.CommandType = CommandType.StoredProcedure;\n \n addParameters(null,cnSQL,cmSQL,false);\n dr = cmSQL.ExecuteReader(CommandBehavior.SchemaOnly);\n if (dr.FieldCount < 10)\n _Columns = new ListDictionary();\n else\n // Hashtable is overkill for small lists\n _Columns = new Hashtable(dr.FieldCount); \n for (int i = 0;i < dr.FieldCount;i++)\n {\n QueryColumn qc = new QueryColumn(i, dr.GetName(i), Type.GetTypeCode(dr.GetFieldType(i)));\n try\n {\n _Columns.Add(qc.colName, qc);\n }\n catch (Exception __dummyCatchVar0)\n {\n // name has already been added to list:\n // According to the RDL spec SQL names are matched by Name not by relative\n // position: this seems wrong to me and causes this problem; but\n // user can fix by using \"as\" keyword to name columns in Select\n // e.g. Select col as \"col1\", col as \"col2\" from tableA\n OwnerReport.rl.LogError(8, String.Format(\"Column '{0}' is not uniquely defined within the SQL Select columns.\", qc.colName));\n }\n \n }\n }\n catch (Exception e)\n {\n OwnerReport.rl.logError(4,\"SQL Exception during report compilation: \" + e.Message + \"\\r\\nSQL: \" + sql);\n }\n finally\n {\n if (cmSQL != null)\n {\n cmSQL.Dispose();\n if (dr != null)\n dr.Close();\n \n }\n \n }\n return ;\n }",
"@Override\n\t\tpublic void execute() {\n\t\t\tsuper.execute();\n\t\t\ttry {\n\t\t\t\tString select;\n\t\t\t\tif (tokenData.isRtb4FreeSuperUser()) \n\t\t\t\t\tselect = \"select * from rtb_standards\";\n\t\t\t\telse\n\t\t\t\t\tselect = \"select * from rtb_standards where customer_id='\"+tokenData.customer+\"'\";\n\t\t\t\tvar conn = CrosstalkConfig.getInstance().getConnection();\n\t\t\t\tvar stmt = conn.createStatement();\n\t\t\t\tvar prep = conn.prepareStatement(select);\n\t\t\t\tResultSet rs = prep.executeQuery();\n\t\t\t\t\n\t\t\t\trules = convertToJson(rs); \n\t\t\t\t\t\t\t\n\t\t\t\treturn;\n\t\t\t} catch (Exception err) {\n\t\t\t\terr.printStackTrace();\n\t\t\t\terror = true;\n\t\t\t\tmessage = err.toString();\n\t\t\t}\n\t\t\tmessage = \"Timed out\";\n\t\t}",
"private void addQueries(String query){\n ArrayList <String> idsFullSet = new ArrayList <String>(searchIDs);\n while(idsFullSet.size() > 0){\n ArrayList <String> idsSmallSet = new ArrayList <String>(); \n if(debugMode) {\n System.out.println(\"\\t Pmids not used in query available : \" + idsFullSet.size());\n }\n idsSmallSet.addAll(idsFullSet.subList(0,Math.min(getSearchIdsLimit(), idsFullSet.size())));\n idsFullSet.removeAll(idsSmallSet);\n String idsConstrain =\"\";\n idsConstrain = idsConstrain(idsSmallSet);\n addQuery(query,idsConstrain);\n }\n }",
"public void customerQuery(){\n }",
"private GeneralQueryFormat createQueryFromRow(int rowNum) {\n String fname = this.employee_first_name.get(rowNum);\n String lname = this.employee_last_name.get(rowNum);\n String mname = this.employee_middle_initial.get(rowNum);\n String ssn = this.employee_ssn.get(rowNum);\n String address = this.employee_address.get(rowNum);\n String address2 = this.employee_address2.get(rowNum);\n String city = this.employee_city.get(rowNum);\n String state = this.employee_state.get(rowNum);\n String zip = this.employee_zip.get(rowNum);\n String phone = this.employee_phone.get(rowNum);\n String phone2 = this.employee_phone2.get(rowNum);\n String pager = this.employee_pager.get(rowNum);\n String cell = this.employee_cell.get(rowNum);\n String email = this.employee_email.get(rowNum);\n String bdate = this.employee_birthdate.get(rowNum);\n String branchId = this.branch.getBranchId() + \"\";\n String hireDate = this.employee_hire_date.get(rowNum);\n \n ssn = ssn.replaceAll(\"-\", \"\");\n if(bdate.equals(\"\")) bdate = \"01/01/1000\";\n if(hireDate.equals(\"\")) hireDate = \"NOW()\";\n \n employee_save_query query = new employee_save_query();\n query.setCompany(company.getName());\n //query.update(fname, lname, mname, phone, phone2, cell, pager, address, address2, city, state, zip, ssn, email, hireDate, \"2100-10-10\",\n // \"(CASE WHEN (SELECT (MAX(employee_id) + 1) From employee) IS NULL THEN 1 ELSE (SELECT (MAX(employee_id) + 1) From employee) END)\",\n // \"0\", false, bdate, this.branch.getId());\n return query;\n }",
"public Query() {\r\n }",
"public abstract Statement queryToRetrieveData();",
"public AbstractJoSQLFilter (String q)\n\t throws QueryParseException\n {\n\n\tthis.setQuery (q);\n\n }",
"private QueryExecution returnQueryExecObject(String coreQuery) {\n\t\tStringBuffer queryStr = new StringBuffer();\n\t\t// Establish Prefixes\n\t\tfor(String prefix:neededPrefixesForQueries)\n\t\t{\n\t\t\tqueryStr.append(\"prefix \" + prefix);\n\t\t}\n\n\t\tqueryStr.append(coreQuery);\n\n\t\tQuery query = QueryFactory.create(queryStr.toString());\n\t\tQueryExecution qexec = QueryExecutionFactory.create(query, this.model);\n\n\t\treturn qexec;\n\t}",
"@Override\r\n\tprotected boolean remoteQuery(String qstr) {\r\n\t\tif (queryBk.getPublishYear() == null || queryBk.getPublishYear().equals(\"\")) {\r\n\t\t\tif (queryBk.getPublisher() == null || queryBk.getPublisher().equals(\"\")) {\r\n\t\t\t\tif (queryBk.parseEdition() == -1 && queryBk.parseVolume() == -1) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t} // end if\r\n\t\t\t} // end if\r\n\t\t} // end if\r\n\r\n\t\tDocumentBuilderFactory f;\r\n\t\tDocumentBuilder b;\r\n\t\tDocument doc;\r\n\t\ttry {\r\n\t\t\tf = DocumentBuilderFactory.newInstance();\r\n\t\t\tb = f.newDocumentBuilder();\r\n\t\t\tURL url = new URL(Config.PRIMO_X_BASE + qstr);\r\n\r\n\t\t\tURLConnection con = url.openConnection();\r\n\t\t\tcon.setConnectTimeout(3000);\r\n\t\t\tdoc = b.parse(con.getInputStream());\r\n\t\t\tqueryStr = Config.PRIMO_X_BASE + qstr;\r\n\t\t\tdebug += queryStr + \"\\n\";\r\n\r\n\t\t\tnodesRecord = doc.getElementsByTagName(\"record\");\r\n\r\n\t\t\t/*\r\n\t\t\t * After fetched a XML doc, store necessary tags from the XMLs for further\r\n\t\t\t * matching.\r\n\t\t\t */\r\n\r\n\t\t\tfor (int i = 0; i < nodesRecord.getLength(); i++) {\r\n\t\t\t\tnodesControl = doc.getElementsByTagName(\"control\").item(i).getChildNodes();\r\n\t\t\t\tnodesDisplay = doc.getElementsByTagName(\"display\").item(i).getChildNodes();\r\n\t\t\t\tnodesLink = doc.getElementsByTagName(\"links\").item(i).getChildNodes();\r\n\t\t\t\tnodesSearch = doc.getElementsByTagName(\"search\").item(i).getChildNodes();\r\n\t\t\t\tnodesDelivery = doc.getElementsByTagName(\"delivery\").item(i).getChildNodes();\r\n\t\t\t\tnodesFacet = doc.getElementsByTagName(\"facets\").item(i).getChildNodes();\r\n\r\n\t\t\t\t// Return true if the query item is of ISO doc no. and of\r\n\t\t\t\t// published by ISO\r\n\t\t\t\tif (matchIsoPublisher() && matchIsoDocNo()) {\r\n\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (!strHandle.hasSomething(queryBk.getCreator())) {\r\n\t\t\t\t\tif (matchTitle() && matchPublisher() && matchYear()) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\r\n\t\t\t\tif (matchTitle() && matchAuthor()) {\r\n\r\n\t\t\t\t\tif ((matchEdition() && matchPublisher() && matchYear())) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else if (!strHandle.hasSomething(queryBk.getPublisher()) && matchYear()\r\n\t\t\t\t\t\t\t&& strHandle.hasSomething(queryBk.getPublishYear())) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else if (matchEdition() && queryBk.parseEdition() > 1) {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t * As Primo X-service only shows the first FRBRed record, check the rest records\r\n\t\t\t\t\t\t * involving the same frbrgroupid.\r\n\t\t\t\t\t\t */\r\n\t\t\t\t\t\tString frbrid = \"\";\r\n\t\t\t\t\t\tfrbrid = getNodeValue(\"frbrgroupid\", nodesFacet);\r\n\t\t\t\t\t\tString frbr_qstr = qstr + \"&query=facet_frbrgroupid,exact,\" + frbrid;\r\n\t\t\t\t\t\t// System.out.println(\"FRBR:\" + Config.PRIMO_X_BASE +\r\n\t\t\t\t\t\t// frbr_qstr);\r\n\t\t\t\t\t\tDocument doc2 = b.parse(Config.PRIMO_X_BASE + frbr_qstr);\r\n\t\t\t\t\t\tnodesFrbrRecord = doc2.getElementsByTagName(\"record\");\r\n\r\n\t\t\t\t\t\tfor (int j = 0; j < nodesFrbrRecord.getLength(); j++) {\r\n\r\n\t\t\t\t\t\t\tnodesControl = doc2.getElementsByTagName(\"control\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesDisplay = doc2.getElementsByTagName(\"display\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesLink = doc2.getElementsByTagName(\"links\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesSearch = doc2.getElementsByTagName(\"search\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesDelivery = doc2.getElementsByTagName(\"delivery\").item(j).getChildNodes();\r\n\t\t\t\t\t\t\tnodesFacet = doc2.getElementsByTagName(\"facets\").item(j).getChildNodes();\r\n\r\n\t\t\t\t\t\t\tif (!strHandle.hasSomething(queryBk.getPublishYear()) && queryBk.parseEdition() == -1\r\n\t\t\t\t\t\t\t\t\t&& !strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t} // end if\r\n\r\n\t\t\t\t\t\t\tif (matchEdition() && matchTitle() && matchAuthor() && matchPublisher() && matchYear()) {\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t} else if (matchEdition() && matchTitle() && matchAuthor() && matchYear()\r\n\t\t\t\t\t\t\t\t\t&& !strHandle.hasSomething(queryBk.getPublisher())) {\r\n\t\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t\t} // end if\r\n\t\t\t\t\t\t} // end for\r\n\t\t\t\t\t} // end if\r\n\t\t\t\t} // end if\r\n\t\t\t} // end for\r\n\t\t} // end try\r\n\r\n\t\tcatch (Exception e) {\r\n\t\t\tStringWriter errors = new StringWriter();\r\n\t\t\te.printStackTrace(new PrintWriter(errors));\r\n\t\t\tString errStr = \"PrimoQueryByNonISBN:remoteQuery()\" + errors.toString();\r\n\t\t\tSystem.out.println(errStr);\r\n\t\t\terrMsg = errStr;\r\n\t\t} // end catch\r\n\t\treturn false;\r\n\t}",
"private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }",
"public void setQuery(String query) {\n this.query = query;\n }",
"protected String getQuery(String query) {\r\n\t\treturn query;\r\n\t}",
"@Override\n public boolean onQueryTextSubmit(String query) {\n Log.i(TAG, \"on query submit: \" + query);\n return true;\n }",
"protected void preprocessQueryModel( SQLQueryModel query, List<Selection> selections,\n Map<LogicalTable, String> tableAliases, DatabaseMeta databaseMeta ) {\n }",
"public void setQuery(String query) {\n this.query = query;\n }",
"private static String addQueryEntry(String query) throws IOException {\n\t\t\t\t\n\t\tString submittedQuery=null;\n\t\tString queryParts[]=query.split(\"&\"); // get parameters from query\t\t\n\t\tboolean isNextPage=false;\n\t\tString key=null;\n\t\tInteger value=null;\n\t\tboolean docsProcessed=false; // identifies if 'docs' occurs more than once in the query\t\t\n\t\tboolean termsProcessed=false; // identifies if 'terms' occurs more than once in the query\n\t\t\n\t\t// identify if it is a next page\n\t\tfor (int i=0;i<queryParts.length;i++) { // verifies if it is a next page\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\tif (queryPartsFields.length>1) {\n\t\t\t\tqueryPartsFields[1]=queryPartsFields[1].trim();\n\t\t\t}\n\t\t\t\n\t\t\tif (queryPartsFields[0].equals(DOCS_KEY) && queryPartsFields.length>1 && !queryPartsFields[1].equals(\"\")) {\t\t\t\n\t\t\t\tint ipage;\n\t\t\t\ttry {\n\t\t\t\t\tipage=Integer.parseInt(queryPartsFields[1]);\n\t\t\t\t}\n\t\t\t\tcatch (NumberFormatException e) {\n\t\t\t\t\tipage=0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (ipage!=0) { // regist only pages>0 \t\t\t\t\t\t\t\n\t\t\t\t\tisNextPage=true;\t\t\t\n\t\t\t\t\tif (ipage%RESULTS_PER_PAGE!=0) {\n\t\t\t\t\t\tSystem.err.println(\"Page results not multiple of \"+RESULTS_PER_PAGE+\": \"+ipage);\n\t\t\t\t\t\tipage+=ipage%RESULTS_PER_PAGE;\n\t\t\t\t\t}\n\t\t\t\t\tif (!docsProcessed) {\n\t\t\t\t\t\tint index=ipage/RESULTS_PER_PAGE>pagesViewedDistAux.length-1 ? pagesViewedDistAux.length-1 : ipage/RESULTS_PER_PAGE;\t\t\t\n\t\t\t\t\t\tif (index==0) { // sanity check\n\t\t\t\t\t\t throw new IOException(\"Error of index=0 on a next page. ipage:\"+ipage);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpagesViewedDistAux[index]++;\n\t\t\t\t\t}\n\t\t\t\t\tdocsProcessed=true;\t\t\t\t\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse if (queryPartsFields[0].equals(QUERY_KEY)) {\n\t\t\t\ttermsProcessed=true;\n\t\t\t}\n\t\t}\n\t\t// check wrong entries\n\t\tif (docsProcessed && !termsProcessed) {\n\t\t\tSystem.err.println(\"Error of query with docs without terms: \"+query);\n\t\t\treturn null;\n\t\t}\t\t\t\t\n\t\tif (isNextPage) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// count only first page\n\t\tdocsProcessed=false;\n\t\tfor (int i=0;i<queryParts.length;i++) {\t\t\t\t\t\t\t\t\t\n\t\t\tString queryPartsFields[]=queryParts[i].split(\"=\",2);\t\t\t\n\t\t\tqueryPartsFields[0]=queryPartsFields[0].trim();\n\t\t\t\n\t\t\tif (!queryPartsFields[0].equals(QUERY_KEY) || queryPartsFields.length!=2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// normalize query\t\t\t\n\t\t\ttry {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(java.net.URLDecoder.decode(queryPartsFields[1],\"ISO8859-1\").toLowerCase()));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch(IllegalArgumentException e) {\n\t\t\t\tqueryPartsFields[1]=decodeStrings(decodeNCR(queryPartsFields[1].toLowerCase()));\n\t\t\t}\n\t\t\t// remove spaces\n\t\t\tString terms[]=queryPartsFields[1].split(\"\\\\s\");\n\t\t\tqueryPartsFields[1]=\"\";\n\t\t\tfor (int j=0,k=0;j<terms.length;j++) {\t\t\t\t\t\n\t\t\t\tif (terms[j].equals(\"\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\tif (k>0) {\n\t\t\t\t\tqueryPartsFields[1]+=\" \";\t\n\t\t\t\t}\n\t\t\t\tqueryPartsFields[1]+=terms[j];\t\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t// filter queries\t\t\t\t\t\n\t\t\tif (queryFiltersMap.containsKey(queryPartsFields[1]) || queryPartsFields[1].startsWith(\"cache%3\") || queryPartsFields[1].equals(\"\")) {\t\t\t\t\n\t\t\t\tcontinue;\n\t\t\t}\t\t\t\t\t\t\t\t\n\t\t\t// set first page viewed\n\t\t\tif (!docsProcessed) {\n\t\t\t\tpagesViewedDistAux[0]++;\n\t\t\t\tdocsProcessed=true;\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//key=queryPartsFields[0]+\" \"+queryPartsFields[1];\n\t\t\tkey=NEW_QUERY_KEY+\" \"+queryPartsFields[1];\t\t\t\n\t\t\tif ((value=queryPartsMap.get(key))==null) {\n\t\t\t\tqueryPartsMap.put(key,1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tqueryPartsMap.put(key,value+1);\n\t\t\t}\n\t\t\t\n\t\t\t// set submitted query\n\t\t\tif (submittedQuery!=null) { // sanity check\n\t\t\t\tthrow new IOException(\"Submitted query already set.\");\n\t\t\t}\n\t\t\tsubmittedQuery=queryPartsFields[1];\n\t\t\t\t\n\t\t\t// count queries per session\t\n\t\t\tnQueriesSession++;\n\t\t}\n\t\treturn submittedQuery;\n\t}",
"public QueryParserException() {\n super();\n }",
"String query();",
"private ArrayList<WordDocument> executeAdvancedQuery(){\n ArrayList<WordDocument> documents = customDijkstrasTwoStack(this.query.split(\" \"));\n ArrayList<WordDocument> result = new ArrayList<WordDocument>();\n\n try{\n String[] orderByPart = query.substring(query.indexOf(\"ORDERBY\")).trim().toLowerCase().split(\" \");\n if(isOrderByCommand(orderByPart[0]))\n result = orderBy(documents, orderByPart[1], orderByPart[2]);\n }catch (StringIndexOutOfBoundsException ex){\n result = documents;\n }\n\n return result;\n }",
"private void montaQuery(Publicacao object, Query q) {\t\t\n\t}",
"boolean isIsQuery();",
"private QueryRequest prepareAndValidateInputs() throws AutomicException {\n // Validate Work item type\n String workItemType = getOptionValue(\"workitemtype\");\n AgileCentralValidator.checkNotEmpty(workItemType, \"Work Item type\");\n\n // Validate export file path check for just file name.\n String temp = getOptionValue(\"exportfilepath\");\n AgileCentralValidator.checkNotEmpty(temp, \"Export file path\");\n File file = new File(temp);\n AgileCentralValidator.checkFileWritable(file);\n try {\n filePath = file.getCanonicalPath();\n } catch (IOException e) {\n throw new AutomicException(\" Error in getting unique absolute path \" + e.getMessage());\n }\n\n QueryRequest queryRequest = new QueryRequest(workItemType);\n String workSpaceName = getOptionValue(\"workspace\");\n if (CommonUtil.checkNotEmpty(workSpaceName)) {\n String workSpaceRef = RallyUtil.getWorspaceRef(rallyRestTarget, workSpaceName);\n queryRequest.setWorkspace(workSpaceRef);\n }\n\n String filters = getOptionValue(\"filters\");\n if (CommonUtil.checkNotEmpty(filters)) {\n queryRequest.addParam(\"query\", filters);\n }\n\n String fieldInput = getOptionValue(\"fields\");\n if (CommonUtil.checkNotEmpty(fieldInput)) {\n prepareUserFields(fieldInput);\n Fetch fetchList = new Fetch();\n fetchList.addAll(uniqueFields);\n queryRequest.setFetch(fetchList);\n }\n\n // Validate count\n String rowLimit = getOptionValue(\"limit\");\n limit = CommonUtil.parseStringValue(rowLimit, -1);\n if (limit < 0) {\n throw new AutomicException(String.format(ExceptionConstants.INVALID_INPUT_PARAMETER, \"Maximum Items\",\n rowLimit));\n }\n if (limit == 0) {\n limit = Integer.MAX_VALUE;\n }\n return queryRequest;\n }",
"@Test\n\tpublic void isValidQueryTest() {\n\t\tString query1 = \"< nice & cool \";\n\t\tString query2 = \"( hello & !!cool )\";\n\t\tString query3 = \"( hello | !cool )\";\n\t\t\n\t\texception.expect(IllegalArgumentException.class);\n\t\tqueryTest.isValidQuery(query1);\n\t\tqueryTest.isValidQuery(query2);\n\n\t\texception = ExpectedException.none();\n\t\tqueryTest.isValidQuery(query3);\n\n\t\t// test num of brackets\n\t\tquery1 = \"( nice & cool )\";\n\t\tquery2 = \"( ( nice & cool )\";\n\t\tquery3 = \"( hello & my | ( name | is ) | bar & ( hi )\";\n\t\t\n\t\tqueryTest.isValidQuery(query1);\n\t\texception.expect(IllegalArgumentException.class);\n\t\tqueryTest.isValidQuery(query2);\n\t\tqueryTest.isValidQuery(query3);\n\t\t\n\t\t// test phrases (+ used to indicate phrase)\n\t\tquery1 = \"hello+hi+my\";\n\t\tquery2 = \"hello+contains+my\";\n\t\tquery3 = \"( my+name & hello | ( oh my ))\";\n\t\t\n\t\texception = ExpectedException.none();\n\t\tqueryTest.isValidQuery(query1);\n\t\tqueryTest.isValidQuery(query2);\n\t\tqueryTest.isValidQuery(queryTest.fixSpacing(query3));\n\t}"
] | [
"0.67943555",
"0.6540625",
"0.6501913",
"0.64061636",
"0.63247436",
"0.63235813",
"0.6275777",
"0.62709445",
"0.6100189",
"0.6097699",
"0.6093731",
"0.6049474",
"0.600212",
"0.59889",
"0.597342",
"0.592243",
"0.5918234",
"0.5871553",
"0.58272046",
"0.5825826",
"0.5814089",
"0.5805623",
"0.57918036",
"0.57768124",
"0.57664543",
"0.57543564",
"0.5659238",
"0.56406945",
"0.559992",
"0.55888355",
"0.55831295",
"0.55704534",
"0.5565714",
"0.55600417",
"0.5557174",
"0.5555798",
"0.55538154",
"0.555311",
"0.55414677",
"0.55384314",
"0.5533169",
"0.55254066",
"0.5525334",
"0.55209714",
"0.55168176",
"0.55120105",
"0.5508301",
"0.55080706",
"0.5505492",
"0.55041796",
"0.5503426",
"0.5492992",
"0.547135",
"0.54675436",
"0.54484576",
"0.5444357",
"0.5423824",
"0.5414645",
"0.54103893",
"0.5409485",
"0.5399763",
"0.5392792",
"0.5391912",
"0.53685224",
"0.5366707",
"0.53643876",
"0.5361457",
"0.53586036",
"0.5358498",
"0.5357507",
"0.53533435",
"0.53456515",
"0.53386617",
"0.5333469",
"0.53315103",
"0.53245187",
"0.5323803",
"0.53215057",
"0.5321292",
"0.53081274",
"0.5306362",
"0.52992916",
"0.52903134",
"0.5283296",
"0.5275303",
"0.5274078",
"0.5265806",
"0.5262681",
"0.5260432",
"0.5255889",
"0.5255404",
"0.52508605",
"0.52494806",
"0.5248568",
"0.5248424",
"0.5240795",
"0.5240587",
"0.5231767",
"0.5221253",
"0.5218524",
"0.5216938"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void run() {
synchronized(Main.lck) {
System.out.println(this.t.getName());
try {
Main.lck.wait();
System.out.println("Terminating thread "+this.t.getName());
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Set exception in case of failure. | TransactionContext setException(Exception exception); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setException(Exception e)\n {\n this.exception = e;\n }",
"public void setException(LoadException exception) {\n\t\tloadProgress.setException(exception);\n\t}",
"void setFailed(Throwable lastFailure);",
"@Override\r\n\tpublic void setException(Throwable throwable) {\r\n super.setException(throwable);\r\n if ( getFutureListenerProcessor() != null ) {\r\n getFutureListenerProcessor().futureSetException(this, throwable);\r\n }\r\n }",
"public sparqles.avro.discovery.DGETInfo.Builder setException(java.lang.CharSequence value) {\n validate(fields()[3], value);\n this.Exception = value;\n fieldSetFlags()[3] = true;\n return this; \n }",
"public void setException(java.lang.String exception) {\n this.exception = exception;\n }",
"public void setException(Exception e){\r\n //build message\r\n String dialog = e+\"\\n\\n\";\r\n StackTraceElement[] trace = e.getStackTrace();\r\n for(int i=0;i<trace.length;i++)\r\n dialog += \" \" + trace[i] + \"\\n\";\r\n //dialog\r\n setMessage(\"Internal error caught.\", dialog);\r\n }",
"public void setException(java.lang.CharSequence value) {\n this.Exception = value;\n }",
"void markFailed(Execution execution, Throwable cause);",
"protected void setWriteException(Exception e) {\n\tif (writeException == null) writeException = e;\n }",
"void setError(@Nullable Exception error) {\n this.error = error;\n }",
"private void failWithException(final CronetException exception) {\n postTaskToExecutor(new Runnable() {\n @Override\n public void run() {\n failWithExceptionOnExecutor(exception);\n }\n });\n }",
"@Override\n\t\tpublic void setThrowable(Throwable throwable) {\n\t\t\t\n\t\t}",
"public boolean setException(Throwable throwable) {\n if (!ATOMIC_HELPER.casValue(this, null, new Failure((Throwable) Preconditions.checkNotNull(throwable)))) {\n return false;\n }\n complete(this);\n return true;\n }",
"public void taskSetFailed(TaskSet taskSet, String reason, Throwable exception) {\n eventProcessLoop.post(new TaskSetFailed(taskSet, reason, exception));\n }",
"public void setFailed() throws RemoteException;",
"public boolean setException(Throwable th) {\n if (!zzhwd.zza((zzdxo<?>) this, (Object) null, (Object) new zzb((Throwable) zzdvv.checkNotNull(th)))) {\n return false;\n }\n zza((zzdxo<?>) this);\n return true;\n }",
"private void failWithExceptionOnExecutor(CronetException e) {\n mException = e;\n // Do not call into mCallback if request is complete.\n synchronized (mNativeStreamLock) {\n if (isDoneLocked()) {\n return;\n }\n mReadState = mWriteState = State.ERROR;\n destroyNativeStreamLocked(false);\n }\n try {\n mCallback.onFailed(this, mResponseInfo, e);\n } catch (Exception failException) {\n Log.e(CronetUrlRequestContext.LOG_TAG, \"Exception notifying of failed request\",\n failException);\n }\n mInflightDoneCallbackCount.decrement();\n }",
"protected void setLastException(ActionExecutionException exception) {\n Util.checkNull(exception, \"exception\");\n\n this.lastException = exception;\n }",
"void setError();",
"public void addException(Exception exception);",
"public TeWeinigGeldException(Exception e) {this.e = e;}",
"public ExceptionValue(Throwable e) {\n this.set(e);\n }",
"protected abstract void setErrorCode();",
"void failed (Exception e);",
"public void setExceptions(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(EXCEPTIONS_PROP.get(), value);\n }",
"void setStageExceptionMode(StageExceptionMode mode);",
"public ScriptThrownException(Exception e, Object value) {\n super(e);\n this.value = value;\n }",
"public void markAsFailed() {\n execution.setErrorReported();\n }",
"public void markAsFailed() {\n \n \t\texecutionStateChanged(ExecutionState.FAILED, \"Execution thread died unexpectedly\");\n \t}",
"public void setExceptions(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(EXCEPTIONS_PROP.get(), value);\n }",
"public void error(Throwable e);",
"public Builder setException(com.palantir.paxos.persistence.generated.PaxosPersistence.ExceptionProto value) {\n if (exceptionBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n exception_ = value;\n onChanged();\n } else {\n exceptionBuilder_.setMessage(value);\n }\n bitField0_ |= 0x00000002;\n return this;\n }",
"public void testCtor_ProjectConfigurationException() {\n System.setProperty(\"exception\", \"ProjectConfigurationException\");\n try {\n new AddActionStateAction(state, activityGraph, manager);\n fail(\"IllegalArgumentException expected.\");\n } catch (IllegalArgumentException iae) {\n //good\n } finally {\n System.clearProperty(\"exception\");\n }\n }",
"public void error(Exception e);",
"public ChannelProgressivePromise setFailure(Throwable cause)\r\n/* 57: */ {\r\n/* 58: 89 */ super.setFailure(cause);\r\n/* 59: 90 */ return this;\r\n/* 60: */ }",
"@Override\n public void onSetFailure(String s) {\n }",
"@Override\n public void onSetFailure(String s) {\n }",
"void markFailed(Throwable t) {\n\t}",
"public void throwCustomException() throws Exception {\n\n\t\tthrow new Exception(\"Custom Error\");\n\t}",
"public void set(Throwable e) {\n this.classType = e.getClass().getName();\n this.objectId = System.identityHashCode(e);\n StackTraceElement[] stack = e.getStackTrace();\n if ( stack != null && stack.length > 0 ) {\n this.path = stack[0].getFileName();\n this.lineNumber = stack[0].getLineNumber();\n }\n this.message = e.getMessage();\n }",
"public void markError(Throwable e, StatusCode statusCode) {\n\t\tsetState(State.ERROR);\n\t\terrorMessage = e.getMessage();\n\t\tif (e.getCause() != null) {\n\t\t\terrorMessage = errorMessage + \"; Cause: \"\n\t\t\t\t\t+ e.getCause().getMessage();\n\t\t}\n\t\tthis.statusCode = statusCode.code;\n\t}",
"@Test\r\n\tpublic void setRelatedFieldError() {\r\n\t\ttry {\r\n\t\t\ttestObj.setRelatedField(0, 1);\r\n\t\t \tfail(\"Expected an IndexOutOfBoundsException to be thrown for setRelatedField\");\r\n\t\t} \r\n\t\tcatch (IndexOutOfBoundsException anIndexOutOfBoundsException) {\r\n\t\t \treturn;\r\n\t\t}\r\n\t}",
"public void setExceptionToThrow(RuntimeException re) {\n\t\t\ttoThrow = re;\n\t\t}",
"public void setExceptionGenerator(ExceptionGenerator eg) {\n exceptionGenerator = Args.notNull(eg, \"exceptionGenerator\");\n\n }",
"public Builder setException(\n com.palantir.paxos.persistence.generated.PaxosPersistence.ExceptionProto.Builder builderForValue) {\n if (exceptionBuilder_ == null) {\n exception_ = builderForValue.build();\n onChanged();\n } else {\n exceptionBuilder_.setMessage(builderForValue.build());\n }\n bitField0_ |= 0x00000002;\n return this;\n }",
"public void setError(@Nullable ExceptionBean error) {\n this.error = error;\n }",
"public void setExceptionOn(boolean flag)\n {\n this.setProperty(GUILoggerSeverityProperty.EXCEPTION, flag);\n }",
"@Override\r\n\tpublic void doException() {\n\r\n\t}",
"protected void connectionException(Exception exception) {}",
"public void failure(TwitterException exception) {\n }",
"public static void throwGlobalException(Throwable exception) {\n MockPageContext.globalException = exception;\n }",
"public abstract void setError(String message);",
"public Promise<V> setFailure(Throwable cause)\r\n/* 331: */ {\r\n/* 332:415 */ if (setFailure0(cause))\r\n/* 333: */ {\r\n/* 334:416 */ notifyListeners();\r\n/* 335:417 */ return this;\r\n/* 336: */ }\r\n/* 337:419 */ throw new IllegalStateException(\"complete already: \" + this, cause);\r\n/* 338: */ }",
"public void testAddException() {\r\n list.add(\"A\");\r\n Exception e = null;\r\n try {\r\n list.add(2, \"B\");\r\n } \r\n catch (Exception exception) {\r\n e = exception;\r\n }\r\n assertTrue(e instanceof IndexOutOfBoundsException);\r\n e = null;\r\n try {\r\n list.add(-1, \"B\");\r\n } \r\n catch (Exception exception) {\r\n e = exception;\r\n }\r\n assertTrue( e instanceof IndexOutOfBoundsException);\r\n }",
"public Builder setExceptions(\n int index, java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureExceptionsIsMutable();\n exceptions_.set(index, value);\n onChanged();\n return this;\n }",
"public void setFailure(AfFailure failure)\n {\n _failure = failure;\n }",
"public static void setExitOnException(boolean flag) {\n exitOnException = flag; \n }",
"public void setError(File error) {\r\n this.error = error;\r\n incompatibleWithSpawn = true;\r\n }",
"public static void setExceptionOnTimeout(boolean bException)\n\t{\n\t\tAJAX.bException = bException;\n\t}",
"public ResultProxy addStandardException(Exception e){\n\t\taddRecordToDataset(\"exceptions\", new RecordProxy()\n\t\t\t.addParam(\"opstatus\", 10500)\n\t\t\t.addParam(\"httpStatusCode\", 500)\n\t\t\t.addParam(\"message\", e.getMessage())\n\t\t\t.addParam(\"class\", e.getClass().getCanonicalName())\n\t\t\t.addParam(\"stack\", ExceptionUtils.getStackTrace(e))\n\t\t);\n\t\t//\t)\n\t\t//);\n\n\t\treturn this;\n\t}",
"public Builder setError(\n int index, WorldUps.UErr value) {\n if (errorBuilder_ == null) {\n if (value == null) {\n throw new NullPointerException();\n }\n ensureErrorIsMutable();\n error_.set(index, value);\n onChanged();\n } else {\n errorBuilder_.setMessage(index, value);\n }\n return this;\n }",
"public AlwaysFailsCheck(String excepmsg) {\n errmsg = excepmsg;\n }",
"protected void setError(String message) {\n\t\tif (message == null)\n\t\t\tthrow new IllegalArgumentException(\"null error message\");\n\t\tif (hasError()) \n\t\t\tthrow new IllegalStateException(\"An error was already detected.\");\n\t\texpression = null;\n\t\terror = message;\n\t}",
"@Override\n\tpublic void setFailedError() {\n\t\tnew Customdialog_Base(this, \"정보가 올바르지 않습니다.\").show();\n\t}",
"private void setErrorCode(Throwable ex, ErrorResponse errorMessage) {\n errorMessage.setCode(\"1\");\n }",
"public CrashReport withException(Throwable t);",
"public void falschesSpiel(SpielException e);",
"public void threadFail(Throwable e) {\n failure = e;\n resume(mainThread);\n }",
"private static void setFailed() {\n HealthCheck.failed = true;\n }",
"public void testAfterPropertiesSetException() throws Exception {\n\t\ttry {\n\t\t\texchangeTarget.afterPropertiesSet();\n\t\t\tfail(\"afterPropertiesSet should fail when interface, service, and uri are null.\");\n\t\t} catch (MessagingException me) {\n\t\t\t// test succeeds\n\t\t}\n\t}",
"public void setWorkitemsFailed(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(WORKITEMSFAILED_PROP.get(), value);\n }",
"public EtudiantDejaInscritExceptionHolder(Etudes.EtudiantDejaInscritException initial)\r\n {\r\n value = initial;\r\n }",
"@Override\n public void testAssumptionFailure(Failure failure) {\n exception = new AssumptionViolatedException(failure.getException().getMessage());\n exception.setStackTrace(failure.getException().getStackTrace());\n ;\n }",
"public ImagingMigratorException(int exceptionCode) {\n this.errorCode = exceptionCode;\n }",
"public void error(SAXParseException exception) throws SAXException\n {\n\n // Increment counter, save the exception, and log what we got\n counters[TYPE_ERROR]++;\n\n String exInfo = getParseExceptionInfo(exception);\n\n setLastItem(exInfo);\n\n // Log or validate the exception\n logOrCheck(TYPE_ERROR, \"error\", exInfo);\n\n // Also re-throw the exception if asked to\n if ((throwWhen & THROW_ON_ERROR) == THROW_ON_ERROR)\n {\n throw new SAXException(exception);\n }\n }",
"@Test\n\tpublic final void testWriteException() {\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our test assertion exception\"), \"Unit Tests\",\n\t\t\t\t\"Test of logging exception attachment.\", null);\n\n\t\tLog.write(LogMessageSeverity.WARNING, LogWriteMode.QUEUED,\n\t\t\t\tnew RuntimeException(\"This is our top exception\",\n\t\t\t\t\t\tnew RuntimeException(\"This is our middle exception\",\n\t\t\t\t\t\t\t\tnew RuntimeException(\"This is our bottom exception\"))),\n\t\t\t\t\"Unit Tests\", \"Test of logging exception attachment with nested exceptions.\", null);\n\t}",
"public void onFailure(Exception t);",
"public ValidationFailure(Exception exception) {\n message = exception.getMessage();\n if (exception instanceof XPathException) {\n errorCode = ((XPathException)exception).getErrorCodeLocalPart();\n }\n }",
"public void setWorkitemsFailed(java.lang.Integer value) {\n __getInternalInterface().setFieldValue(WORKITEMSFAILED_PROP.get(), value);\n }",
"public void addException(Exception e ) {\n logger.info(Thread.currentThread().getStackTrace()[1].getMethodName());\n logger.debug(\"Adding new Exception -> \"+ e);\n exception = e;\n }",
"public void downloadFailed(Throwable t);",
"public SMSLibException(Throwable originalE)\n/* 17: */ {\n/* 18:45 */ this.originalE = originalE;\n/* 19: */ }",
"@Before\r\n\tpublic void setUp() throws Exception {\r\n\t\tdbme = new DBManagerException(dbme.getMessage());\r\n\t}",
"public Builder setErrcode(int value) {\n bitField0_ |= 0x00000001;\n errcode_ = value;\n onChanged();\n return this;\n }",
"public NSException() {\n\t\tsuper();\n\t\tthis.exception = new Exception();\n\t}",
"private void setFailed(int errorCode){\n\t\tCartPayIndent currentIndent = mCoffeeIndentsList.get(mCurrentIndentIndex);\n\t\tString indentID = currentIndent.getIndentID();\n\t\tint coffeeID = currentIndent.getCoffeeID();\n\t\tLogUtil.e(TAG, \"make coffee unsuccessully, code:\" + errorCode + \", indent:\" + indentID);\n\t\tupdateIndentStatusDB(FLAG_ERROR, indentID, coffeeID);\n\t\t// rollback order\n\t\trollBackOrder(errorCode);\n\t\t// report server\n\t\tList<Integer> status = new ArrayList<Integer>();\n\t\tMachineStatusReportInfo info = new MachineStatusReportInfo();\n\t\tinfo.setUid(U.getMyVendorNum());\n\t\tinfo.setTimestamp(TimeUtil.getNow_millisecond());\n\t\tstatus.add(errorCode);\n\t\tinfo.setStatus(status);\n\t\texecute(info.toRemote());\n\n\t\tmMachineStatus = CoffeeMachineStatus.READY;\n\t\t// quit time\n\t\tmUIHandler.sendEmptyMessage(MSG_UI_MAKE_COFFEE_FAIL);\n\t\tmQuitTimer.startCountDownTimer(QUIT_WAIT_TIME, 1000, 1000);\n\t}",
"public void addError(Throwable t);",
"protected void failed()\r\n {\r\n //overwrite\r\n }",
"@Override\n\t\t\t\t\t\t\tpublic void error(Exception e) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}",
"public void setError(final XyzError error) {\n this.error = error;\n }",
"@Override\n\tpublic void setWrongError() {\n\t\t\n\t}",
"public void failed(String msg) {\n failureMsg = msg;\n }",
"@Override\n public void failure(TwitterException exception) {\n }",
"public void testGetException() {\r\n Exception exception = null;\r\n try {\r\n list.get(-1);\r\n } \r\n catch (Exception e) {\r\n exception = e;\r\n }\r\n assertTrue(exception instanceof IndexOutOfBoundsException);\r\n exception = null;\r\n list.add(\"A\");\r\n try {\r\n list.get(1);\r\n } \r\n catch (IndexOutOfBoundsException e) {\r\n exception = e;\r\n }\r\n assertTrue(exception instanceof IndexOutOfBoundsException);\r\n }",
"public void setError(int value) {\n this.error = value;\n }",
"private void throwsError() throws OBException {\n }",
"public void testupdateAddress_PersistenceException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n new InformixAddressDAO(\"InformixAddressDAO_Error_4\").updateAddress(address, false);\r\n fail(\"PersistenceException expected\");\r\n } catch (PersistenceException e) {\r\n //good\r\n }\r\n }",
"public CommandFailedByConfigException(Throwable ex) {\n super(ex);\n }",
"public void setFailonerror(boolean fail) {\r\n failOnError = fail;\r\n incompatibleWithSpawn |= fail;\r\n }"
] | [
"0.7686328",
"0.6725359",
"0.67083675",
"0.6643836",
"0.6643529",
"0.65465474",
"0.64858514",
"0.6472077",
"0.63406265",
"0.6335677",
"0.62740374",
"0.6163988",
"0.6161383",
"0.6142059",
"0.61303246",
"0.6114288",
"0.60855865",
"0.60683143",
"0.60574085",
"0.6029263",
"0.6023804",
"0.6012991",
"0.59598666",
"0.59576327",
"0.5946061",
"0.59251004",
"0.5917831",
"0.588943",
"0.58772105",
"0.5867904",
"0.58562964",
"0.58331966",
"0.5832776",
"0.5829667",
"0.5777898",
"0.577658",
"0.57660383",
"0.57660383",
"0.5747237",
"0.5689243",
"0.56753033",
"0.56531537",
"0.56469226",
"0.56199706",
"0.56179637",
"0.5617332",
"0.561379",
"0.5605486",
"0.5603908",
"0.55811435",
"0.5580106",
"0.5578995",
"0.5561845",
"0.55540335",
"0.5551413",
"0.55126375",
"0.5505852",
"0.55057317",
"0.550187",
"0.5492377",
"0.5481423",
"0.54692334",
"0.5454679",
"0.54372793",
"0.54369366",
"0.54230595",
"0.541865",
"0.54162174",
"0.5406261",
"0.539911",
"0.5375008",
"0.5360664",
"0.5359751",
"0.5351339",
"0.53457373",
"0.5336788",
"0.53349155",
"0.5321899",
"0.5321076",
"0.53183717",
"0.5314491",
"0.53066045",
"0.528639",
"0.5279276",
"0.52767134",
"0.5275573",
"0.52703524",
"0.52639115",
"0.52521163",
"0.52514124",
"0.5248121",
"0.5247842",
"0.52455306",
"0.52417964",
"0.52352697",
"0.5232003",
"0.52313626",
"0.52161634",
"0.5214562",
"0.5211002"
] | 0.6959448 | 1 |
Returns the committed log entry | LogEntryProto getLogEntry(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"BufferedLogChannel getCurrentLogIfPresent(long entryLogId);",
"public static void log() {\n String branch = commitPointers.readHeadCommit()[0];\n String currName = commitPointers.readHeadCommit()[1];\n File cFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n Commit curr = Utils.readObject(cFile, Commit.class);\n\n while (currName != null) {\n System.out.println(\"===\");\n System.out.println(\"commit \" + curr.commitID);\n if (curr.parentID.size() == 2) {\n System.out.println(\"Merge: \" + curr.parentID.get(0).substring(0, 7) + \" \" + curr.parentID.get(1).substring(0, 7));\n }\n System.out.println(\"Date: \" + curr.timeStamp.format(myFormatObj) + \" -0800\");\n System.out.println(curr.message);\n System.out.println();\n\n currName = curr.parentID.get(0);\n\n if (currName != null) {\n File newcFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n curr = Utils.readObject(newcFile, Commit.class);\n }\n }\n }",
"@Nullable\n\tpublic LogIndex getCommitted() {\n\t\treturn committedIndex;\n\t}",
"public void log() {\n String headID = head.getCommitID();\n while (headID != null) {\n File curr = new File(\".gitlet/commits/\" + headID);\n Comm currcomm = Utils.readObject(curr, Comm.class);\n System.out.println(\"===\");\n System.out.println(\"commit \" + currcomm.getCommitID());\n if (currcomm.getMergepointer() != null) {\n System.out.println(\"Merge: \"\n + currcomm.getParent().getCommitID()\n .substring(0, 7) + \" \"\n + currcomm.getMergepointer().getCommitID()\n .substring(0, 7));\n }\n System.out.println(\"Date: \" + currcomm.getDate());\n System.out.println(currcomm.getMessage());\n System.out.println();\n if (currcomm.getParent() == null) {\n break;\n } else {\n headID = currcomm.getParent().getCommitID();\n }\n }\n }",
"long getCommitID() {\r\n return commit_id;\r\n }",
"Commit getCurrentCommit() {\n String branchh = null;\n Commit prev = null;\n File currentB = new File(\".gitlet/current\");\n for (File file: currentB.listFiles()) {\n branchh = file.getName();\n }\n return deserializeCommit(\".gitlet/heads/\" + branchh);\n }",
"Object getRelativeToChangelogFile();",
"public long getminCommittedLog() {\n return minCommittedLog;\n }",
"public long getCommitTime() { return _rev.getCommitTime()*1000L; }",
"Commit getLastCommitDetails(Object requestBody) throws VersionControlException;",
"String getCommitMessageForLine(IPath filePath, int line);",
"private synchronized long getLastSeenCommitIndex()\n {\n return lastSeenCommitIndex;\n }",
"CommitIndex getCommittedIndex() {\n return committed;\n }",
"public Git.Entry getObject() { return ent; }",
"public static String getLogEntry(int index){\n if(index < 0 || index >= log.size()){\n return \"\";\n }\n return log.get(index);\n }",
"public HistoryEntry getLastEntry() {\n\t\t\treturn null;\n\t\t}",
"public T caseCommitLogEntry(CommitLogEntry object) {\n\t\treturn null;\n\t}",
"private String getBranchForRevision(SVNLogEntry logEntry) {\n @SuppressWarnings(\"unchecked\")\n Set<String> paths = logEntry.getChangedPaths().keySet();\n // Finds the common path among all those paths\n String commonPath = null;\n for (String path : paths) {\n if (commonPath == null) {\n commonPath = path;\n } else {\n int diff = StringUtils.indexOfDifference(commonPath, path);\n commonPath = StringUtils.left(commonPath, diff);\n }\n }\n // Gets the branch for this path\n if (commonPath != null) {\n return extractBranch(commonPath);\n } else {\n // No path in the revision: no branch!\n return null;\n }\n }",
"public String getLastCommit() {\n return getCellContent(LAST_COMMIT);\n }",
"LogEntry getEntry(final long index);",
"long getCurrentRevision();",
"protected Log getLog()\n/* */ {\n/* 59 */ return log;\n/* */ }",
"public Commit getRoot(){\n\t\treturn myRoot;\n\t}",
"@NonNull\n public String getCommitId() {\n return this.commitId;\n }",
"public String getCurrentCommitHash() throws IOException {\n String baseCommit = git.launchCommand(\"rev-parse\", \"--verify\", \"HEAD\").trim();\n debuggingLogger.fine(String.format(\"Base commit hash%s\", baseCommit));\n return baseCommit;\n }",
"long getLastLogIndex();",
"long currentRevision();",
"Commit getCommit(String hash) {\n Commit newCommit = null;\n File gettin = new File(\".gitlet/commits/\" + hash);\n if (gettin.exists()) {\n return deserializeCommit(\".gitlet/commits/\" + hash);\n } else {\n return deserializeCommit(\".gitlet/commits/\" + hash + \".ser\");\n }\n }",
"public synchronized int getCommitNumber()\n\t{\n\t\treturn m_dbCommitNum;\n\t}",
"public String getClLog() {\r\n return clLog;\r\n }",
"public int getLogid() {\n\treturn logid;\n}",
"public Commit getCommitById(int id) {\r\n for (Commit c : this.commmit) {\r\n if (c.getId() == id) {\r\n return c;\r\n }\r\n }\r\n return null;\r\n }",
"@Override\r\n\tpublic Log getLog() {\n\t\treturn log;\r\n\t}",
"public Commit getLeaf(){\n\t\treturn myLeaf;\n\t}",
"private Commit findCommit(String branchName) {\n File givenBranch = new File(Main.ALL_BRANCHES, branchName);\n if (givenBranch.exists()) {\n String commitID = Utils.readObject(givenBranch, String.class);\n File theCommit = new File(Main.ALL_COMMITS, commitID);\n Commit cmt = Utils.readObject(theCommit, Commit.class);\n return cmt;\n } else {\n return null;\n }\n }",
"public synchronized String getHistory() {\r\n\t\tString log = new String();\r\n\t\ttry {\r\n\t\t\tFile logFile = new File(\"serverlogs.log\");\r\n\t\t\tBufferedReader logReader = new BufferedReader(new InputStreamReader(new FileInputStream(logFile)));\r\n\t\t\tString line;\r\n\t\t\twhile((line = logReader.readLine()) != null) {\r\n\t\t\t\tlog += (line + \"\\n\");\r\n\t\t\t}\r\n\t\t\tlogReader.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tgui.acknowledge(\"Error : logs are not available\");\r\n\t\t\tstop();\r\n\t\t}\r\n\t\tif(log.equals(\"\\n\")) {\r\n\t\t\tlog = new String();\r\n\t\t}\r\n\t\treturn log;\r\n\t}",
"public Commit commitFullInfo(ArrayList<Commit> commitList) {\n\t\tCommit previousCommitID = null;\n\t\tfor (int i = 0; i < commitList.size(); i++) {\n\t\t\tif (commitList.get(i).commitID.contains(this.commitID)) {\n\t\t\t\treturn commitList.get(i);\n\t\t\t}\n\t\t}\n\n\t\treturn previousCommitID;\n\n\t}",
"public Commit getHeadCommit() {\n Commit result = null;\n File headFile = new File(Main.DOTFILE, HEADNAME.getName());\n if (headFile.exists()) {\n String id = Utils.readObject(HEADNAME, String.class);\n File associatedFile = new File(Main.ALL_BRANCHES, id);\n if (associatedFile.exists()) {\n String headID = Utils.readObject(associatedFile, String.class);\n File cmt = new File(Main.ALL_COMMITS, headID);\n result = Utils.readObject(cmt, Commit.class);\n }\n }\n return result;\n }",
"public Commit findCommit(String hash) {\r\n Query<Commit> commitQuery = datastore.find(Commit.class);\r\n commitQuery.and(\r\n commitQuery.criteria(\"revision_hash\").equal(hash),\r\n commitQuery.criteria(\"vcs_system_id\").equal(getVcSystem().getId())\r\n );\r\n final List<Commit> commits = commitQuery.asList();\r\n\r\n if (commits.size() == 1) {\r\n return commits.get(0);\r\n } else {\r\n logger.debug(\"Could not find commit: \" + hash);\r\n return null;\r\n }\r\n }",
"public String getCommitter() {\n return committer;\n }",
"java.lang.String getLogMessage();",
"Appendable getLog();",
"public UndoPointer getCommitLSN() {\n return commitList.getCommitLSN();\n }",
"public String getLogId() {\r\n return logId;\r\n }",
"private final Log getLog() {\r\n return this.log;\r\n }",
"public String getHeadCommitID() {\n return Utils.readObject(HEADFILE, String.class);\n }",
"public EventLogMessageEntry getEventLogMessage(int index);",
"public String getLastChange() {\n return lastChange;\n }",
"public long getCommitTransId() {\n return commitList.getCommitTransId();\n }",
"@Override\n\tpublic long getChangesetEntryId() {\n\t\treturn _changesetEntry.getChangesetEntryId();\n\t}",
"public long getAuditLogId() {\n return auditLogId;\n }",
"public ChangeLogPrepare changeLogPrepare() {\n return changeLogPrepare;\n }",
"public EventLogEntry getEventLogEntry(int index);",
"@Override\n public GetCommitResult getCommit(GetCommitRequest request) {\n request = beforeClientExecution(request);\n return executeGetCommit(request);\n }",
"public long getmaxCommittedLog() {\n return maxCommittedLog;\n }",
"public String getLog();",
"public String getRunLog();",
"int getLogId();",
"public void globalLog() {\n\t\tIterator iter = myCommit.entrySet().iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tMap.Entry entry = (Map.Entry) iter.next();\n\t\t\tVersion currVersion = (Version) entry.getValue();\n\t\t\tcurrVersion.log();\n\t\t}\n\t}",
"private Commit getCommit(Repository repository, RevCommit currentCommit, RevCommit parent){\n ObjectId newTree = currentCommit.getTree();\n ObjectId oldTree = parent.getTree();\n TreeWalk tw = new TreeWalk(repository);\n tw.setRecursive(true);\n try {\n tw.addTree(oldTree);\n tw.addTree(newTree);\n List<DiffEntry> diffs = DiffEntry.scan(tw);\n Commit commit = new Commit(currentCommit);\n commit.changedFileList = this.getChangedFiles(repository, diffs);\n commit.setLines();\n return commit;\n } catch (Exception e) {\n System.out.println(e);\n logger.error(e);\n throw new AssertionError();\n }\n }",
"private GitCommit getParentImpl()\n {\n RevCommit r = _rev.getParentCount()>0? _rev.getParent(0) : null;\n if(r!=null) r = (RevCommit)getRevObject(r); // They return a rev commit, but it isn't loaded!\n return r!=null? new GitCommit(r) : null;\n }",
"public void printCommitLog(Commit commit) {\n System.out.println(\"===\");\n System.out.println(\"commit \" + commit.getShaCode());\n if (commit.parents().size() == NUMPARENTS) {\n String mom = commit.getParent();\n mom = mom.substring(0, 7);\n String dad = commit.getSecondParent();\n dad = dad.substring(0, 7);\n System.out.println(\"Merge: \" + mom + \" \" + dad);\n }\n System.out.println(\"Date: \" + commit.getTimeStamp());\n System.out.println(commit.getLogMsg() + \"\\n\");\n }",
"public Integer getLogid() {\n return logid;\n }",
"public List<CommitLogStatus> getCommitLogStatus(String tabletName) throws IOException {\n return null;\n }",
"public String fetchRecentChange(){\n\t\treturn recentChange;\n\t}",
"private Data getLastCommitData(int varIndex) {\n List<Data> dataList = _dataMap.get(varIndex);\n return dataList.get(dataList.size() - 1);\n }",
"public ChangeLogSet<? extends Entry> getChangeSet() {\n if(scm==null)\n scm = new CVSChangeLogParser();\n \n if(changeSet==null) // cached value\n changeSet = calcChangeSet();\n return changeSet;\n }",
"public ArrayList<Commit> getCommmit() {\r\n return commmit;\r\n }",
"public long getLastModified() { return _entry!=null? _entry.getLastModified() : 0; }",
"synchronized public LogEvent getLogEvent () {\n LogEvent evt = (LogEvent) get (LOGEVT.toString());\n if (evt == null) {\n evt = new LogEvent ();\n evt.setNoArmor(true);\n put (LOGEVT.toString(), evt);\n }\n return evt;\n }",
"TCommit createCommit();",
"public Log getLog() {\r\n return this.delegate.getLog();\r\n }",
"public String getLogFileContent() {\r\n\t\treturn _logFileContent;\r\n\t}",
"TCommit getLatestCommitForBranch(String branchName, TRepo repo);",
"private void indexInTransaction(SVNLogEntry logEntry) throws SVNException {\n // Log values\n long revision = logEntry.getRevision();\n String author = logEntry.getAuthor();\n // Date to date time\n Date date = logEntry.getDate();\n DateTime dateTime = new DateTime(date.getTime(), DateTimeZone.UTC);\n // Message\n String message = logEntry.getMessage();\n // Branch for the revision\n String branch = getBranchForRevision(logEntry);\n // Logging\n logger.info(String.format(\"Indexing revision %d\", revision));\n // Inserting or updating the revision\n revisionDao.addRevision(revision, author, dateTime, message, branch);\n // Merge relationships (using a nested SVN client)\n Transaction svn = transactionService.start(true);\n try {\n List<Long> mergedRevisions = subversionService.getMergedRevisions(SVNUtils.toURL(subversionConfigurationExtension.getUrl(), branch), revision);\n revisionDao.addMergedRevisions(revision, mergedRevisions);\n } finally {\n svn.close();\n }\n // Subversion events\n indexSVNEvents(logEntry);\n // Indexes the issues\n indexIssues(logEntry);\n }",
"public synchronized ILogData handleRetrieval(long address) {\n LogData entry = streamLog.read(address);\n log.trace(\"Retrieved[{} : {}]\", address, entry);\n return entry;\n }",
"private String getLog() {\n\n\t\tNexTask curTask = TaskHandler.getCurrentTask();\n\t\tif (curTask == null || curTask.getLog() == null) {\n\t\t\treturn \"log:0\";\n\t\t}\n\t\tString respond = \"task_log:1:\" + TaskHandler.getCurrentTask().getLog();\n\t\treturn respond;\n\t}",
"public void print(){\t\t\r\n\t\tSystem.out.println(\"===\\nCommit \" + id +\"\\n\"+ Time + \"\\n\" + message + \"\\n\");\r\n\t}",
"long getFirstLogIndex();",
"public String getCurrentEntry() {\n if (entries.size() > 0) {\n int index = Math.round(offsetValue) % entries.size();\n return entries.get(index);\n }\n\n return null;\n }",
"private Commit getCommitFromID(String shaCode) {\n File f = new File(Main.ALL_COMMITS, shaCode);\n if (f.exists()) {\n return Utils.readObject(f, Commit.class);\n } else {\n return null;\n }\n }",
"public JSONObject getLastProjectCommitRecord(int pgId) {\n String sql = \"SELECT * from Project_Commit_Record a where (a.commitNumber = \"\n + \"(SELECT max(commitNumber) FROM Project_Commit_Record WHERE pgId = ?));\";\n JSONObject ob = new JSONObject();\n JSONArray array = new JSONArray();\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n preStmt.setInt(1, pgId);\n try (ResultSet rs = preStmt.executeQuery()) {\n\n int statusId = rs.getInt(\"status\");\n StatusEnum statusEnum = csDb.getStatusNameById(statusId);\n int commitNumber = rs.getInt(\"commitNumber\");\n Date commitTime = rs.getTimestamp(\"time\");\n String commitStudent = rs.getString(\"commitStudent\");\n JSONObject eachHw = new JSONObject();\n eachHw.put(\"status\", statusEnum.getType());\n eachHw.put(\"commitNumber\", commitNumber);\n eachHw.put(\"commitTime\", commitTime);\n eachHw.put(\"commitStudent\", commitStudent);\n array.put(eachHw);\n }\n ob.put(\"commits\", array);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return ob;\n }",
"public abstract long getRevision(int lineNumber);",
"public Commit getCommit(Repository repository, RevCommit currentCommit) {\n if (currentCommit.getParentCount() <= 0) {\n return new Commit(currentCommit);\n }\n RevCommit parent = currentCommit.getParent(0);\n return getCommit(repository, currentCommit, parent);\n }",
"public TransactionType getLogCode () {\n return logCode;\n }",
"public JSONObject getProjectCommitRecord(int pgId) {\n String sql = \"SELECT * FROM Project_Commit_Record WHERE pgId=?\";\n JSONObject ob = new JSONObject();\n JSONArray array = new JSONArray();\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n preStmt.setInt(1, pgId);\n try (ResultSet rs = preStmt.executeQuery()) {\n while (rs.next()) {\n int statusId = rs.getInt(\"status\");\n StatusEnum statusEnum = csDb.getStatusNameById(statusId);\n int commitNumber = rs.getInt(\"commitNumber\");\n Date commitTime = rs.getTimestamp(\"time\");\n String commitStudent = rs.getString(\"commitStudent\");\n JSONObject eachHw = new JSONObject();\n eachHw.put(\"status\", statusEnum.getType());\n eachHw.put(\"commitNumber\", commitNumber);\n eachHw.put(\"commitTime\", commitTime);\n eachHw.put(\"commitStudent\", commitStudent);\n array.put(eachHw);\n }\n }\n ob.put(\"commits\", array);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return ob;\n }",
"public abstract String getRevision();",
"public void globallog() {\n for (Comm currcomm: allcomms.values()) {\n System.out.println(\"===\");\n System.out.println(\"commit \" + currcomm.getCommitID());\n if (currcomm.getMergepointer() != null) {\n System.out.println(\"Merge: \"\n + currcomm.getParent()\n .getCommitID().substring(0, 7) + \" \"\n + currcomm\n .getMergepointer().getCommitID().substring(0, 7));\n }\n System.out.println(\"Date: \" + currcomm.getDate());\n System.out.println(currcomm.getMessage());\n System.out.println();\n }\n }",
"public io.opencannabis.schema.commerce.CommercialOrder.StatusCheckin getActionLog(int index) {\n if (actionLogBuilder_ == null) {\n return actionLog_.get(index);\n } else {\n return actionLogBuilder_.getMessage(index);\n }\n }",
"public Log log() {\n return _log;\n }",
"public TicketLog getLogByPosition(int position) {\n\t\tint previousPosition = logList.size()-position;\n\t\treturn logList.get(previousPosition);\n\t}",
"private String fetchLogEntry(int i) {\n\t\tif (log.size() >= i) {\n\t\t\tLog logEntry = log.get(log.size()-i);\n\t\t\tif (logEntry.getStatus() == Status.ALARM) {\n\t\t\t\treturn logEntry.getTimeStamp()+\"* \"+logEntry.getMessage();\n\t\t\t} else {\n\t\t\t\treturn logEntry.getTimeStamp()+\" \"+logEntry.getMessage();\n\t\t\t}\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}",
"String getWorkfileRevisionString();",
"private final Log getLogBase() {\r\n return this.logBase;\r\n }",
"public Git.Entry getRoot() { \n Node c = this; \n while (c.par != null) c = c.par;\n return c.getObject();\n }",
"public Object getAuditUpdateActionTaskRecord() {\n return auditUpdateActionTaskRecord;\n }",
"Id getLastDefinedParent() {\n for (Commit c : Lists.reverse(commits)) {\n if (c.isSaved()) {\n return c.id;\n }\n }\n\n throw new IllegalStateException(\"Unable to determine last defined parent.\");\n }",
"LogRecord saveLog(LogRecord logRecord);",
"public CommitLogPosition add(Mutation mutation) throws CDCWriteException\n {\n assert mutation != null;\n\n mutation.validateSize(MessagingService.current_version, ENTRY_OVERHEAD_SIZE);\n\n try (DataOutputBuffer dob = DataOutputBuffer.scratchBuffer.get())\n {\n Mutation.serializer.serialize(mutation, dob, MessagingService.current_version);\n int size = dob.getLength();\n int totalSize = size + ENTRY_OVERHEAD_SIZE;\n Allocation alloc = segmentManager.allocate(mutation, totalSize);\n\n CRC32 checksum = new CRC32();\n final ByteBuffer buffer = alloc.getBuffer();\n try (BufferedDataOutputStreamPlus dos = new DataOutputBufferFixed(buffer))\n {\n // checksummed length\n dos.writeInt(size);\n updateChecksumInt(checksum, size);\n buffer.putInt((int) checksum.getValue());\n\n // checksummed mutation\n dos.write(dob.unsafeGetBufferAndFlip());\n updateChecksum(checksum, buffer, buffer.position() - size, size);\n buffer.putInt((int) checksum.getValue());\n }\n catch (IOException e)\n {\n throw new FSWriteError(e, alloc.getSegment().getPath());\n }\n finally\n {\n alloc.markWritten();\n }\n\n executor.finishWriteFor(alloc);\n return alloc.getCommitLogPosition();\n }\n catch (IOException e)\n {\n throw new FSWriteError(e, segmentManager.allocatingFrom().getPath());\n }\n }",
"private Log getLog() {\n if (controller != null) {\n log = controller.getLog();\n } \n return log ;\n }"
] | [
"0.68728137",
"0.67011106",
"0.64493394",
"0.6410849",
"0.61674905",
"0.6130221",
"0.59594417",
"0.59485936",
"0.5930254",
"0.5912151",
"0.59074444",
"0.59029824",
"0.5829642",
"0.5809389",
"0.5786383",
"0.5756924",
"0.57300663",
"0.57162386",
"0.5710766",
"0.5659177",
"0.56547636",
"0.5648683",
"0.55820256",
"0.5580674",
"0.5554053",
"0.55354774",
"0.5508929",
"0.54818606",
"0.5477652",
"0.54654074",
"0.5447102",
"0.5441725",
"0.54334193",
"0.5425886",
"0.541652",
"0.5400115",
"0.5399236",
"0.5395235",
"0.53868014",
"0.53812486",
"0.5367201",
"0.5363849",
"0.5347529",
"0.53425133",
"0.53398967",
"0.53329647",
"0.53311265",
"0.53207225",
"0.5312626",
"0.5309718",
"0.53086853",
"0.5301813",
"0.529829",
"0.5296569",
"0.52960217",
"0.52860403",
"0.52782464",
"0.52769315",
"0.52707726",
"0.52676433",
"0.5259792",
"0.52569944",
"0.52523774",
"0.52470005",
"0.5217777",
"0.5214823",
"0.5196928",
"0.5196651",
"0.51905507",
"0.51885223",
"0.51811403",
"0.5177753",
"0.5162714",
"0.51485443",
"0.5142845",
"0.5138198",
"0.5126223",
"0.5124013",
"0.5123856",
"0.51145",
"0.51097804",
"0.5094848",
"0.5093512",
"0.50927526",
"0.5087871",
"0.5082034",
"0.5081702",
"0.5071618",
"0.50687295",
"0.5055137",
"0.5039351",
"0.50383675",
"0.5037943",
"0.50336534",
"0.5029263",
"0.50171447",
"0.5013874",
"0.5010792",
"0.5008808",
"0.5007125"
] | 0.6275469 | 4 |
It indicates if the transaction should be committed to the RAFT log | boolean shouldCommit(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logTransactionEnd();",
"Boolean isTransacted();",
"Boolean isTransacted();",
"public boolean isCommited() {\n return votedCommit;\n }",
"public boolean isCommitted() {\n\t\treturn false;\n\t}",
"private void reportTransactionStatus(boolean success){\n if(success){\n sendMessage(\"<st>\");\n }else{\n sendMessage(\"<f>\");\n }\n }",
"@Override\n\tpublic boolean isCommitted() {\n\t\treturn false;\n\t}",
"public boolean transactionStarted();",
"public boolean isCommitOnFailure () {\n return commitOnFailure;\n }",
"boolean isAutoCommit();",
"void setTransactionSuccessful();",
"public boolean is_record_transaction(){\n\t\treturn transaction_type == TransactionType.OPERATION;\n\t}",
"public void commit() {\n\t\tcommitted = true;\n\t}",
"public Boolean isRollback() {\n return this.rollback;\n }",
"@Override\n public boolean isCommitted() {\n return false;\n }",
"protected boolean isTransactionRollback()\n {\n try\n {\n UMOTransaction tx = TransactionCoordination.getInstance().getTransaction();\n if (tx != null && tx.isRollbackOnly())\n {\n return true;\n }\n }\n catch (TransactionException e)\n {\n // TODO MULE-863: What should we really do?\n logger.warn(e.getMessage());\n }\n return false;\n }",
"public boolean isTransactionRunning();",
"boolean isMarkedRollback() throws Exception;",
"@Override\r\n\tprotected boolean isAutoCommit() {\r\n\t\tif ((consistentRegionContext != null) || (transactionSize > 1)\r\n\t\t\t\t|| (commitInterval > 0) || (commitOnPunct)) {\r\n\t\t\t// Set automatic commit to false when transaction size is more than\r\n\t\t\t// 1 or it is a consistent region or commit on punct is enabled.\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"boolean hasTransactionChangesPending() {\n// System.out.println(transaction_mod_list);\n return transaction_mod_list.size() > 0;\n }",
"public boolean syncRollbackPhase() {\n return syncRollbackPhase;\n }",
"public void transactionComplete(TransactionId tid, boolean commit)\n throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }",
"private boolean transactionCanBeEnded(Transaction tx) {\n return tx != null && !(tx.getStatus() != null && tx.getStatus().isOneOf(TransactionStatus.COMMITTED, TransactionStatus.ROLLED_BACK));\n }",
"public void errorWhenCommitting();",
"public void commitTransaction() {\n\r\n\t}",
"public void transactionComplete(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\\\n \t//should always commit, simply call transactionComplete(tid,true)\n \ttransactionComplete(tid, true);\n \t\n }",
"public boolean flushTransactions() {\n return true;\n }",
"@Override\n public void commitTx() {\n \n }",
"String getTransactionStatus();",
"public void forceCommitTx()\n{\n}",
"public boolean fullCommitNeeded ()\n {\n return true;\n }",
"public synchronized void writeCommit(Transaction t) {\n\t\tflush();\n\t\tpw.println(t.transactionId() + \" commit\");\t\n\t\tflush();\n\t}",
"protected abstract boolean commitTxn(Txn txn) throws PersistException;",
"public Boolean getRollback() {\n return this.rollback;\n }",
"boolean requiresRollbackAfterSqlError();",
"public boolean isCommitted(long transId) {\n return commitList.isCommitted(transId);\n }",
"public boolean isTransactional()\n {\n return _isTransactional;\n }",
"@Override\n\tpublic boolean isJoinedToTransaction() {\n\t\treturn false;\n\t}",
"public void commit() {\n tryCommit(true);\n }",
"public static boolean isMarkedAsRollback(Transaction tx)\n {\n if (tx == null) return false;\n int status;\n try\n {\n status = tx.getStatus();\n return status == Status.STATUS_MARKED_ROLLBACK;\n }\n catch (SystemException e)\n {\n return false;\n }\n }",
"protected boolean attemptCommit() {\n \t\t\tpretendCommit();\n \t\t\tif (isValid()) {\n \t\t\t\tfDocumentUndoManager.commit();\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\treturn false;\n \t\t}",
"public void printTransaction() {\n\t\tdao.printTransaction();\r\n\t\t\r\n\t}",
"private synchronized boolean shouldCommit(Message m) {\n\n\t\tboolean flag = false;\n\n\t\ttry {\n\t\t\t// get the commit flag set by the FailoverQSender\n\t\t\tflag = m.getBooleanProperty(FailoverQSender.COMMIT_PROPERTY_NAME);\n\n//\t\t\tif (flag) {\n//\t\t\t\t// check if message property contains expected message counter\n//\t\t\t\tvalidate(m);\n//\t\t\t}\n\n\t\t} catch (JMSException jmse) {\n\t\t\tlog(jmse);\n\t\t}\n\n\t\treturn flag;\n\t}",
"public boolean hasTransaction() {\n\t\treturn (this.transactionStatus != null);\n\t}",
"@Override\n\tpublic boolean requiresPostCommitHanding(EntityPersister arg0) {\n\t\treturn false;\n\t}",
"public void authorizeTransaction() {}",
"public void base_ok(Transaction t) {\n verify_transaction(t);\n make_transaction(t);\n }",
"public boolean isRecordsAwaitingToBeCommitted() {\n var partitionWorkRemainingCount = getNumberOfEntriesInPartitionQueues();\n return partitionWorkRemainingCount > 0;\n }",
"public void transactionStarted() {\n transactionStart = true;\n }",
"public boolean commit(Connection conn) throws SQLException {\n boolean status = true;\n try {\n // Start of system transaction\n conn.setAutoCommit(false);\n BookingMapper bm = new BookingMapper();\n status = status && bm.addNewBooking(newBooking, conn);\n status = status && bm.updateBooking(modifiedBooking, conn);\n status = status && bm.deleteBooking(deleteBooking, conn);\n if (!status) {\n\n throw new Exception(\"Business Transaction aborted\");\n }\n // System transaction ends with success\n conn.commit();\n } catch (Exception e) {\n System.out.println(\"fail in UnitOfWork - commit()\");\n System.err.println(e);\n // System transaction fails, rollsback\n conn.rollback();\n status = false;\n }\n return status;\n }",
"public boolean isAutoRollback () {\n return autoRollback;\n }",
"@Test\r\n\tpublic void testCommit()\r\n\t\tthrows Exception\r\n\t{\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(john, email, johnemail,dirgraph);\r\n\t\r\n\t\t\tassertTrue(\"Uncommitted update should be visible to own connection\",\r\n\t\t\t\t\ttestAdminCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\t\tassertFalse(\"Uncommitted update should only be visible to own connection\",\r\n\t\t\t\t\ttestReaderCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\t\tassertThat(testWriterCon.size(), is(equalTo(0L)));\r\n\t\r\n\t\t\ttestAdminCon.commit();\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tlogger.debug(e.getMessage());\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif(testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\tassertThat(testWriterCon.size(), is(equalTo(1L)));\r\n\t\tassertTrue(\"Repository should contain statement after commit\",\r\n\t\t\t\ttestAdminCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t\tassertTrue(\"Committed update will be visible to all connection\",\r\n\t\t\t\ttestReaderCon.hasStatement(john, email, johnemail, false, dirgraph));\r\n\t}",
"protected void post_commit_hook() { }",
"public boolean isCommitted() {\n return this.response.isCommitted();\n }",
"@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}",
"void commit() {\n }",
"public boolean transactionWillSucceed(Transaction transaction) {\n return transactionBuffer.transactionWillSucceed(transaction);\n }",
"protected void commit()\n\t{\n\t\t_Status = DBRowStatus.Unchanged;\n\t}",
"void commitTransaction();",
"@Override\r\n\t\tpublic boolean getAutoCommit() throws SQLException {\n\t\t\treturn false;\r\n\t\t}",
"public void other_statements_ok(Transaction t) {\n System.out.println(\"about to verify\");\n verify_transaction(t);\n System.out.println(\"verified\");\n make_transaction(t);\n System.out.println(\"success!\");\n }",
"void commit(Transaction transaction);",
"@Override\n\tpublic void commit() {\n\n\t}",
"public boolean rolledback() throws HibException;",
"public boolean syncCommitPhase() {\n return syncCommitPhase;\n }",
"public boolean commitCustomers(Connection conn) throws SQLException {\n boolean status = true;\n try {\n // Start of system transaction\n conn.setAutoCommit(false);\n BookingMapper bm = new BookingMapper();\n status = status && bm.addNewCustomer(newCustomers, conn);\n\n if (!status) {\n throw new Exception(\"Business Transaction aborted\");\n }\n // System transaction ends with success\n conn.commit();\n } catch (Exception e) {\n System.out.println(\"fail in UnitOfWork - commit()\");\n System.err.println(e);\n // System transaction fails, rollsback\n conn.rollback();\n status = false;\n }\n return status;\n }",
"boolean hasTxnrequest();",
"public void commit() {\n }",
"public java.lang.Boolean getIncludeLastTransaction() {\r\n return includeLastTransaction;\r\n }",
"boolean hasTxnresponse();",
"public boolean hasTransactionId() {\n return fieldSetFlags()[10];\n }",
"public static boolean isRollbackOnly() {\n\t\tTxStatus status = (TxStatus) txContexts.get();\n\t\tif (status == null) {\n\t\t\tSystem.out.println(\"No transaction to set rollbackonly on\");\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn status.getRollbackOnly();\n\t\t}\n\t}",
"@Override\n\tpublic boolean supportsTransactions() {\n\n\t\treturn false;\n\t}",
"private static boolean commitTransaction(int trans_id) {\n Transaction txn = null;\n if (transactions.containsKey(trans_id))\n txn = transactions.get(trans_id);\n else\n return false;\n\n if (txn != null)\n txn.commit();\n\n return true;\n }",
"boolean hasTransactionDateTime();",
"public boolean createTransaction() {\n\t\t\treturn false;\n\t\t}",
"public void commit() {\n doCommit();\n }",
"public boolean hasTransactionId() {\n return fieldSetFlags()[24];\n }",
"@Override\n public void commit() {\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterBCompId compId = new MasterBCompId();\r\n\t\t\t\tcompId.setIdA(1);\r\n\t\t\t\tcompId.setIdB(1);\r\n\t\t\t\tMasterBEnt masterBEnt = (MasterBEnt) ss.get(MasterBEnt.class, compId);\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterBEnt.getDatetimeA());\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterBEnt.getDatetimeA().getTime());\r\n\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<MasterBEnt> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEnt);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"public void beforeCompletion()\n {\n \n boolean success = false;\n try\n {\n flush();\n // internalPreCommit() can lead to new updates performed by usercode \n // in the Synchronization.beforeCompletion() callback\n internalPreCommit();\n flush();\n success = true;\n }\n finally\n {\n if (!success) \n {\n // TODO Localise these messages\n NucleusLogger.TRANSACTION.error(\"Exception flushing work in JTA transaction. Mark for rollback\");\n try\n {\n jtaTx.setRollbackOnly();\n }\n catch (Exception e)\n {\n NucleusLogger.TRANSACTION.fatal(\n \"Cannot mark transaction for rollback after exception in beforeCompletion. PersistenceManager might be in inconsistent state\", e);\n }\n }\n }\n }",
"boolean supportsRollbackAfterDDL();",
"public boolean checkpoint() {\n\t\ttry {\n\t\t\toutputStream.flush();\n\t\t} catch (IOException e) {\n\t\t\tif (RTS_COMMON.Option.VERBOSE)\n\t\t\t\te.printStackTrace();\n\t\t\treturn (false);\n\t\t}\n\t\treturn (true);\n\t}",
"protected boolean isTransactionAllowedToRollback() throws SystemException\n {\n return this.getTransactionStatus() != Status.STATUS_COMMITTED &&\n this.getTransactionStatus() != Status.STATUS_NO_TRANSACTION &&\n this.getTransactionStatus() != Status.STATUS_UNKNOWN;\n }",
"public boolean addTransaction(Transaction trans) {\n if (trans == null) {\n return false;\n }\n if (!previousHash.equals(\"0\")) {\n if (!trans.processTransaction()) {\n System.out.println(\"Transaction failed to process. Transaction discarded!\");\n return false;\n }\n }\n transactions.add(trans);\n System.out.println(\"Transaction successfully added to the block\");\n return true;\n }",
"public void setRollback(Boolean rollback) {\n this.rollback = rollback;\n }",
"public void commit(){\n \n }",
"public abstract void commitSprintBacklog();",
"public void rollbackTx()\n\n{\n\n}",
"public Boolean removeTransaction()\n {\n return true;\n }",
"void setLogAbandoned(boolean logAbandoned);",
"void commit( boolean onSave );",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tMasterBEnt masterBEnt = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tMasterBComp masterBComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAuZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> compDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wIiwicmF3S2V5VmFsdWVzIjpbIjEiLCIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciIsImphdmEubGFuZy5JbnRlZ2VyIl19\");\r\n\t\t\t\tMasterBCompComp masterBCompComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wLmRldGFpbEFFbnRDb2wiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tCollection<DetailAEnt> compCompDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp(), sameInstance(masterBComp)\", masterBEnt.getMasterBComp(), sameInstance(masterBComp));\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compDetailAEntCol))\", detailAEntCol, not(sameInstance(compDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compCompDetailAEntCol))\", detailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"compDetailAEntCol, not(sameInstance(compCompDetailAEntCol))\", compDetailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"public abstract void commitProductBacklog();",
"@Override\n public boolean commitSMO() {\n return true;\n }",
"@Override protected String isEnabled(final String param) {\n if (getDrbdResource().isCommited()\n && DRBD_RES_PARAM_NAME.equals(param)) {\n return \"\";\n }\n return null;\n }",
"@Override\n\tpublic void commit(boolean onSave) {\n\t\tsuper.commit(onSave);\n\t}",
"public boolean commit() {\r\n\tboolean result = false;\r\n\r\n\tif (conn != null && isConnected()) {\r\n\t try {\r\n\t\tboolean autoCommit = getAutoCommit();\r\n\r\n\t\tif (!autoCommit) {\r\n\t\t conn.commit();\r\n\t\t result = true;\r\n\t\t}\r\n\t } catch (Exception e) {\r\n\t\te.printStackTrace();\r\n\t }\r\n\t}\r\n\r\n\treturn result;\r\n }",
"public boolean rollback() {\r\n\tboolean result = false;\r\n\r\n\tif (conn != null && isConnected()) {\r\n\t try {\r\n\t\tboolean autoCommit = getAutoCommit();\r\n\r\n\t\tif (!autoCommit) {\r\n\t\t conn.rollback();\r\n\t\t result = true;\r\n\t\t}\r\n\t } catch (Exception e) {\r\n\t\te.printStackTrace();\r\n\t }\r\n\t}\r\n\r\n\treturn result;\r\n }",
"@Override\r\n\tpublic boolean commit() {\n\t\ttry {\r\n\t\t\tconn = DriverManager.getConnection(URL, USER, PASS);\r\n\t\t\tString sql = \"commit\";\r\n\t\t\tps = conn.prepareStatement(sql);\r\n\t\t\tps.executeUpdate();\r\n\t\t\trs.close();\r\n\t\t\tps.close();\r\n\t\t\treturn true;\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}"
] | [
"0.6468415",
"0.637833",
"0.637833",
"0.6341572",
"0.62918067",
"0.62707585",
"0.62632006",
"0.6184741",
"0.6180041",
"0.61071503",
"0.6106119",
"0.607762",
"0.60068125",
"0.5958903",
"0.59337986",
"0.5931971",
"0.5862417",
"0.5841543",
"0.58257097",
"0.5806779",
"0.57762384",
"0.57759905",
"0.57570523",
"0.5754062",
"0.5751124",
"0.5742758",
"0.5719554",
"0.5698573",
"0.56924933",
"0.5690821",
"0.5683147",
"0.5667253",
"0.5659356",
"0.56173545",
"0.56034887",
"0.5597476",
"0.559597",
"0.5588649",
"0.5576432",
"0.5555173",
"0.55535644",
"0.5545458",
"0.5545229",
"0.5543367",
"0.55421925",
"0.5541498",
"0.55235356",
"0.55211866",
"0.5515945",
"0.5512854",
"0.55099624",
"0.5508477",
"0.5495875",
"0.5494896",
"0.5485486",
"0.5471295",
"0.54683316",
"0.54522026",
"0.5448682",
"0.54390913",
"0.5437958",
"0.54372025",
"0.5436058",
"0.5425495",
"0.5416205",
"0.54145384",
"0.5405046",
"0.53999525",
"0.5395566",
"0.5380846",
"0.53687054",
"0.5350263",
"0.53468186",
"0.5339073",
"0.53178394",
"0.5316169",
"0.53146166",
"0.5309533",
"0.5308469",
"0.5305024",
"0.5304702",
"0.53007793",
"0.5298627",
"0.52884144",
"0.52766925",
"0.5273266",
"0.5260328",
"0.5259791",
"0.52542734",
"0.524553",
"0.52454805",
"0.524509",
"0.5239859",
"0.52362025",
"0.5228335",
"0.5225989",
"0.52240443",
"0.5219775",
"0.5219676",
"0.5215473"
] | 0.70401 | 0 |
proxy StateMachine methods. We do not want to expose the SM to the RaftLog This is called before the transaction passed from the StateMachine is appended to the raft log. This method will be called from log append and having the same strict serial order that the Transactions will have in the RAFT log. Since this is called serially in the critical path of log append, it is important to do only required operations here. | TransactionContext preAppendTransaction() throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void log() {\n\t\t\n//\t\tif (trx_loggin_on){\n\t\t\n\t\tif ( transLogModelThreadLocal.get().isTransLoggingOn() ) {\n\t\t\t\n\t\t\tTransLogModel translog = transLogModelThreadLocal.get();\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesConText().entrySet()) {\n\t\t\t\tMDC.put(entry.getKey().toString(), ((entry.getValue() == null)? \"\":entry.getValue()));\n\t\t\t}\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesOnce().entrySet()) {\n\t\t\t\tMDC.put(entry.getKey().toString(), ((entry.getValue() == null)? \"\":entry.getValue()));\n\t\t\t}\n\t\t\ttransactionLogger.info(\"\"); // don't really need a msg here\n\t\t\t\n\t\t\t// TODO MDC maybe conflic with existing MDC using in the project\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesConText().entrySet()) {\n\t\t\t\tMDC.remove(entry.getKey().toString());\n\t\t\t}\n\t\t\tfor (Entry<Attr, String> entry : translog.getAttributesOnce().entrySet()) {\n\t\t\t\tMDC.remove(entry.getKey().toString());\n\t\t\t}\n\t\t\t\n\t\t\ttranslog.getAttributesOnce().clear();\n\t\t}\n\t\t\n\t}",
"protected AbstractPropagator() {\n multiplexer = new StepHandlerMultiplexer();\n additionalStateProviders = new ArrayList<>();\n unmanagedStates = new HashMap<>();\n harvester = null;\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tMasterBEnt masterBEnt = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tMasterBComp masterBComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAuZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> compDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wIiwicmF3S2V5VmFsdWVzIjpbIjEiLCIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciIsImphdmEubGFuZy5JbnRlZ2VyIl19\");\r\n\t\t\t\tMasterBCompComp masterBCompComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wLmRldGFpbEFFbnRDb2wiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tCollection<DetailAEnt> compCompDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp(), sameInstance(masterBComp)\", masterBEnt.getMasterBComp(), sameInstance(masterBComp));\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compDetailAEntCol))\", detailAEntCol, not(sameInstance(compDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compCompDetailAEntCol))\", detailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"compDetailAEntCol, not(sameInstance(compCompDetailAEntCol))\", compDetailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\r\n\t\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\t\tsqlLogInspetor.enable();\r\n\r\n\t\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t\tmasterAEnt.setBlobLazyB(null);\r\n\t\t\t\t\targ0.flush();\r\n\t\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}",
"@Override\n public void setLogTracer(LogTracer log) {\n\n }",
"@Override\n public void forceMlog() {\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest.this\r\n\t\t\t\t\t.manager\r\n\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\tPlayerSnapshot<Collection<DetailAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailAEntCol);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest.this\r\n\t\t\t\t\t.manager\r\n\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\tArrayList<DetailAEnt> detailAEntCuttedCol = new ArrayList<>();\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(0));\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(1));\r\n\t\t\t\tPlayerSnapshot<Collection<DetailAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailAEntCuttedCol);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest.this\r\n\t\t\t\t\t.manager\r\n\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\tArrayList<DetailAEnt> detailAEntCuttedCol = new ArrayList<>();\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(1));\r\n\t\t\t\tdetailAEntCuttedCol.add(new ArrayList<>(detailAEntCol).get(2));\r\n\t\t\t\tPlayerSnapshot<Collection<DetailAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailAEntCuttedCol);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"protected void sequence_StateMachine(ISerializationContext context, StateMachine semanticObject) {\r\n\t\tgenericSequencer.createSequence(context, semanticObject);\r\n\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterBCompId compId = new MasterBCompId();\r\n\t\t\t\tcompId.setIdA(1);\r\n\t\t\t\tcompId.setIdB(1);\r\n\t\t\t\tMasterBEnt masterBEnt = (MasterBEnt) ss.get(MasterBEnt.class, compId);\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterBEnt.getDatetimeA());\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterBEnt.getDatetimeA().getTime());\r\n\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<MasterBEnt> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEnt);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\n public void startTx() {\n \n }",
"@Trace(excludeFromTransactionTrace = true, leaf = true)\n private void tracedActivityFromFlyweight() {\n TracedActivity tracedActivity = AgentBridge.getAgent().getTransaction().createAndStartTracedActivity();\n Assert.assertTrue(tracedActivity instanceof NoOpSegment);\n }",
"public TransactionStateUpdater() {\n super();\n }",
"@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setEmitTrgPRE(true);\r\n }",
"@Override\r\n\t\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\r\n\t\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\t\tsqlLogInspetor.enable();\r\n\r\n\t\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA());\r\n\t\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA().getTime());\r\n\r\n\t\t\t\t\tPlayerManagerTest.this.manager.overwriteConfigurationTemporarily(PlayerManagerTest.this.manager\r\n\t\t\t\t\t\t\t.getConfig().clone().configSerialiseBySignatureAllRelationship(true));\r\n\r\n\t\t\t\t\tPlayerSnapshot<MasterAEnt> playerSnapshot = PlayerManagerTest.this.manager\r\n\t\t\t\t\t\t\t.createPlayerSnapshot(masterAEnt);\r\n\r\n\t\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\t\tPlayerManagerTest.this.manager.getConfig().getObjectMapper().writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsqlLogInspetor.disable();\r\n\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}",
"@Override\n\tpublic void onTransactionStart() {}",
"@Override\n public void log()\n {\n }",
"protected void startTopLevelTrx() {\n startTransaction();\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterAEnt> masterAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"id\")).list();\r\n\t\t\t\tList<MasterAWrapper> masterAWrapperList = new ArrayList<>();\r\n\t\t\t\tfor (MasterAEnt masterAEnt : masterAEntList) {\r\n\t\t\t\t\tMasterAWrapper masterAWrapper = new MasterAWrapper();\r\n\t\t\t\t\tmasterAWrapper.setMasterA(masterAEnt);\r\n\t\t\t\t\tmasterAWrapper.setDetailAWrapperList(new ArrayList<>());\r\n\t\t\t\t\tmasterAWrapper.setDetailAEntCol(new ArrayList<>(masterAEnt.getDetailAEntCol()));\r\n\t\t\t\t\tfor (DetailAEnt detailAEnt : masterAEnt.getDetailAEntCol()) {\r\n\t\t\t\t\t\tDetailAWrapper detailAWrapper = new DetailAWrapper();\r\n\t\t\t\t\t\tdetailAWrapper.setDetailA(detailAEnt);\r\n\t\t\t\t\t\tmasterAWrapper.getDetailAWrapperList().add(detailAWrapper);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmasterAWrapperList.add(masterAWrapper);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<MasterAWrapper>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAWrapperList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\t//doing lazy-load\r\n\t\t\t\tmasterAEnt.getDetailAEntCol().size();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<MasterAEnt> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAEnt);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"public void transactionStarted() {\n transactionStart = true;\n }",
"public void doLog() {\n SelfInvokeTestService self = (SelfInvokeTestService)context.getBean(\"selfInvokeTestService\");\n self.selfLog();\n //selfLog();\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA());\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterAEnt.getDatetimeA().getTime());\r\n\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<MasterAEnt> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAEnt);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompId> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getCompId());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(DetailAEnt.class, detailAEnt.getCompId(), d -> d.getCompId());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompId>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompComp> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getDetailAComp().getDetailACompComp());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(\r\n\t\t\t\t\t\t\tDetailAEnt.class, \r\n\t\t\t\t\t\t\tdetailAEnt.getDetailAComp().getDetailACompComp(),\r\n\t\t\t\t\t\t\td -> d.getDetailAComp().getDetailACompComp());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompComp>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"public void recordState() {\n this.event = null;\n flowContextInfo.setWaitingNode(currentNode);\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterAEnt masterAEnt = (MasterAEnt) ss.get(MasterAEnt.class, 1);\r\n\t\t\t\tList<MasterAEnt> masterAEntList = new ArrayList<>();\r\n\t\t\t\tmasterAEntList.add(masterAEnt);\r\n\t\t\t\tmasterAEntList.add(masterAEnt);\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<MasterAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAEntList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Subscribe\n public void onActionEventStarted(RemoteExecutionActionEvent.Started event) {\n writeRemoteExecutionStateTraceEvents(event);\n }",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterBEnt> masterBEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterBEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idA\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idB\")).list();\r\n\t\t\t\tList<Map<String, Map<String, MasterBEnt>>> masterBEntBizarreList = new ArrayList<>();\r\n\t\t\t\t\r\n\t\t\t\tfor (MasterBEnt masterB : masterBEntList) {\r\n\t\t\t\t\tSignatureBean signBean = ((IPlayerManagerImplementor) PlayerManagerTest.this.manager).generateSignature(masterB);\r\n\t\t\t\t\tString signStr = PlayerManagerTest.this.manager.serializeSignature(signBean);\r\n\t\t\t\t\tMap<String, Map<String, MasterBEnt>> mapItem = new LinkedHashMap<>();\r\n\t\t\t\t\tPlayerSnapshot<MasterBEnt> masterBPS = PlayerManagerTest.this.manager.createPlayerSnapshot(masterB);\r\n\t\t\t\t\tMap<String, MasterBEnt> mapMapItem = new LinkedHashMap<>();\r\n\t\t\t\t\tmapMapItem.put(\"wrappedSnapshot\", masterB);\r\n\t\t\t\t\tmapItem.put(signStr, mapMapItem);\r\n\t\t\t\t\tmasterBEntBizarreList.add(mapItem);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<Map<String, Map<String, MasterBEnt>>>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEntBizarreList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"abstract protected void _log(TrackingActivity activity) throws Exception;",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompComp> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getDetailAComp().getDetailACompComp());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(detailAEnt, d -> d.getDetailAComp());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(detailAEnt.getDetailAComp(), dc -> dc.getDetailACompComp());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompComp>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompId> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getCompId());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(detailAEnt, d -> d.getCompId());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompId>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"public Object prepareForTrading()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to prepareForTrading : \" + \"Agent\");\r\n/* 230 */ return this;\r\n/* */ }",
"abstract void initiateLog();",
"@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterBEnt> masterBEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterBEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idA\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idB\")).list();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<MasterBEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEntList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}",
"public OrderLogRecord() {\n super(OrderLog.ORDER_LOG);\n }",
"private void recover() throws IllegalStateException, InvalidRecordLocationException, IOException, IOException {\n \n RecordLocation pos = null;\n int transactionCounter = 0;\n \n log.info(\"Journal Recovery Started from: \" + journal);\n ConnectionContext context = new ConnectionContext();\n \n // While we have records in the journal.\n while ((pos = journal.getNextRecordLocation(pos)) != null) {\n org.activeio.Packet data = journal.read(pos);\n DataStructure c = (DataStructure) wireFormat.unmarshal(data);\n \n if (c instanceof Message ) {\n Message message = (Message) c;\n JournalMessageStore store = (JournalMessageStore) createMessageStore(message.getDestination());\n if ( message.isInTransaction()) {\n transactionStore.addMessage(store, message, pos);\n }\n else {\n store.replayAddMessage(context, message);\n transactionCounter++;\n }\n } else {\n switch (c.getDataStructureType()) {\n case JournalQueueAck.DATA_STRUCTURE_TYPE:\n {\n JournalQueueAck command = (JournalQueueAck) c;\n JournalMessageStore store = (JournalMessageStore) createMessageStore(command.getDestination());\n if (command.getMessageAck().isInTransaction()) {\n transactionStore.removeMessage(store, command.getMessageAck(), pos);\n }\n else {\n store.replayRemoveMessage(context, command.getMessageAck());\n transactionCounter++;\n }\n }\n break;\n case JournalTopicAck.DATA_STRUCTURE_TYPE: \n {\n JournalTopicAck command = (JournalTopicAck) c;\n JournalTopicMessageStore store = (JournalTopicMessageStore) createMessageStore(command.getDestination());\n if (command.getTransactionId() != null) {\n transactionStore.acknowledge(store, command, pos);\n }\n else {\n store.replayAcknowledge(context, command.getClientId(), command.getSubscritionName(), command.getMessageId());\n transactionCounter++;\n }\n }\n break;\n case JournalTransaction.DATA_STRUCTURE_TYPE:\n {\n JournalTransaction command = (JournalTransaction) c;\n try {\n // Try to replay the packet.\n switch (command.getType()) {\n case JournalTransaction.XA_PREPARE:\n transactionStore.replayPrepare(command.getTransactionId());\n break;\n case JournalTransaction.XA_COMMIT:\n case JournalTransaction.LOCAL_COMMIT:\n Tx tx = transactionStore.replayCommit(command.getTransactionId(), command.getWasPrepared());\n if (tx == null)\n break; // We may be trying to replay a commit that\n // was already committed.\n \n // Replay the committed operations.\n tx.getOperations();\n for (Iterator iter = tx.getOperations().iterator(); iter.hasNext();) {\n TxOperation op = (TxOperation) iter.next();\n if (op.operationType == TxOperation.ADD_OPERATION_TYPE) {\n op.store.replayAddMessage(context, (Message) op.data);\n }\n if (op.operationType == TxOperation.REMOVE_OPERATION_TYPE) {\n op.store.replayRemoveMessage(context, (MessageAck) op.data);\n }\n if (op.operationType == TxOperation.ACK_OPERATION_TYPE) {\n JournalTopicAck ack = (JournalTopicAck) op.data;\n ((JournalTopicMessageStore) op.store).replayAcknowledge(context, ack.getClientId(), ack.getSubscritionName(), ack\n .getMessageId());\n }\n }\n transactionCounter++;\n break;\n case JournalTransaction.LOCAL_ROLLBACK:\n case JournalTransaction.XA_ROLLBACK:\n transactionStore.replayRollback(command.getTransactionId());\n break;\n }\n }\n catch (IOException e) {\n log.error(\"Recovery Failure: Could not replay: \" + c + \", reason: \" + e, e);\n }\n }\n break;\n case JournalTrace.DATA_STRUCTURE_TYPE:\n JournalTrace trace = (JournalTrace) c;\n log.debug(\"TRACE Entry: \" + trace.getMessage());\n break;\n default:\n log.error(\"Unknown type of record in transaction log which will be discarded: \" + c);\n }\n }\n }\n \n RecordLocation location = writeTraceMessage(\"RECOVERED\", true);\n journal.setMark(location, true);\n \n log.info(\"Journal Recovered: \" + transactionCounter + \" message(s) in transactions recovered.\");\n }",
"abstract protected void _log(TrackingEvent event) throws Exception;",
"@Override\r\n\t\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\t\r\n\t\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\t\r\n\t\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\t\tList<MasterAEnt> masterAEntList = hbSupport.createCriteria(ss, MasterAEnt.class)\r\n\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"id\")).list();\r\n\t\t\t\t\t\r\n\t\t\t\t\tPlayerManagerTest.this.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest.this.manager.getConfig().clone()\r\n\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\t\r\n\t\t\t\t\tPlayerSnapshot<List<MasterAEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAEntList);\r\n\t\t\t\t\t\r\n\t\t\t\t\tFileOutputStream fos;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}",
"@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setEmitTrgEND(true);\r\n }",
"protected abstract void trace_pre_updates();",
"abstract protected void _log(Snapshot snapshot) throws Exception;",
"@Override\n public void append( LogEvent event ) {\n long eventTimestamp;\n if (event instanceof AbstractLoggingEvent) {\n eventTimestamp = ((AbstractLoggingEvent) event).getTimestamp();\n } else {\n eventTimestamp = System.currentTimeMillis();\n }\n LogEventRequest packedEvent = new LogEventRequest(Thread.currentThread().getName(), // Remember which thread this event belongs to\n event, eventTimestamp); // Remember the event time\n\n if (event instanceof AbstractLoggingEvent) {\n AbstractLoggingEvent dbLoggingEvent = (AbstractLoggingEvent) event;\n switch (dbLoggingEvent.getEventType()) {\n\n case START_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the test case id, which we will later pass to ATS agent\n testCaseState.setTestcaseId(eventProcessor.getTestCaseId());\n\n // clear last testcase id\n testCaseState.clearLastExecutedTestcaseId();\n\n //this event has already been through the queue\n return;\n }\n case END_TEST_CASE: {\n\n // on Test Executor side we block until the test case start is committed in the DB\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n // remember the last executed test case id\n testCaseState.setLastExecutedTestcaseId(testCaseState.getTestcaseId());\n\n // clear test case id\n testCaseState.clearTestcaseId();\n // this event has already been through the queue\n return;\n }\n case GET_CURRENT_TEST_CASE_STATE: {\n // get current test case id which will be passed to ATS agent\n ((GetCurrentTestCaseEvent) event).setTestCaseState(testCaseState);\n\n //this event should not go through the queue\n return;\n }\n case START_RUN:\n\n /* We synchronize the run start:\n * Here we make sure we are able to connect to the log DB.\n * We also check the integrity of the DB schema.\n * If we fail here, it does not make sense to run tests at all\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n Level level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n // create the queue logging thread and the DbEventRequestProcessor\n if (queueLogger == null) {\n initializeDbLogging(null);\n }\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, false);\n //this event has already been through the queue\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n return;\n case END_RUN: {\n /* We synchronize the run end.\n * This way if there are remaining log events in the Test Executor's queue,\n * the JVM will not be shutdown prior to committing all events in the DB, as\n * the END_RUN event is the last one in the queue\n */\n atsConsoleLogger.info(\"Waiting for \"\n + event.getClass().getSimpleName()\n + \" event completion\");\n\n /** disable root logger's logging in order to prevent deadlock **/\n level = LogManager.getRootLogger().getLevel();\n Configurator.setRootLevel(Level.OFF);\n\n AtsConsoleLogger.setLevel(level);\n\n waitForEventToBeExecuted(packedEvent, dbLoggingEvent, true);\n\n /*Revert Logger's level*/\n Configurator.setRootLevel(level);\n AtsConsoleLogger.setLevel(level);\n\n //this event has already been through the queue\n return;\n }\n case DELETE_TEST_CASE: {\n // tell the thread on the other side of the queue, that this test case is to be deleted\n // on first chance\n eventProcessor.requestTestcaseDeletion( ((DeleteTestCaseEvent) dbLoggingEvent).getTestCaseId());\n // this event is not going through the queue\n return;\n }\n default:\n // do nothing about this event\n break;\n }\n }\n\n passEventToLoggerQueue(packedEvent);\n }",
"void log() {\n\t\tm_drivetrain.log();\n\t\tm_forklift.log();\n\t}",
"@Override\n protected void preSaveDTO( final D dto )\n {\n final String methodName = \"preSaveDTO\";\n logMethodBegin( methodName, dto );\n checkTickerSymbol( dto );\n super.preSaveDTO( dto );\n logMethodEnd( methodName );\n }",
"@Override\n public void openEvent(){\n rl.lock();\n try{\n log.printFirst();\n System.out.println(\"B : Opening the event...\");\n //change broker state\n// MyThreadBroker broker = (MyThreadBroker) Thread.currentThread();\n// broker.broker_states = MyThreadBroker.Broker_States.OPENING_THE_EVENT;\n //change log\n log.changeLog();\n log.setBrokerState(MyThreadBroker.Broker_States.OPENING_THE_EVENT); \n log.changeLog();\n }finally{\n rl.unlock();\n }\n }",
"void addTransactionJournal(MasterTableJournal change) {\n transaction_mod_list.add(change);\n system.stats().increment(journal_count_stat_key);\n }",
"protected void sequence_State(ISerializationContext context, State semanticObject) {\r\n\t\tif (errorAcceptor != null) {\r\n\t\t\tif (transientValues.isValueTransient(semanticObject, TP1_EMPackage.Literals.STATE__NAME) == ValueTransient.YES)\r\n\t\t\t\terrorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TP1_EMPackage.Literals.STATE__NAME));\r\n\t\t}\r\n\t\tSequenceFeeder feeder = createSequencerFeeder(context, semanticObject);\r\n\t\tfeeder.accept(grammarAccess.getStateAccess().getNameEStringParserRuleCall_2_0(), semanticObject.getName());\r\n\t\tfeeder.finish();\r\n\t}",
"private void logTx(String message) throws IOException {\n\t\tlog.write(\"TX \" + System.currentTimeMillis() +\n\t\t\t\": \" + message + \"\\n\");\n\t}",
"void send() {\n if (mInFlight == this) {\n // This was probably queued up and sent during a sync runnable of the last callback.\n // Don't queue it again.\n return;\n }\n if (mInFlight != null) {\n throw new IllegalStateException(\"Sync Transactions must be serialized. In Flight: \"\n + mInFlight.mId + \" - \" + mInFlight.mWCT);\n }\n mInFlight = this;\n if (DEBUG) Slog.d(TAG, \"Sending sync transaction: \" + mWCT);\n if (mLegacyTransition != null) {\n mId = new WindowOrganizer().startLegacyTransition(mLegacyTransition.getType(),\n mLegacyTransition.getAdapter(), this, mWCT);\n } else {\n mId = new WindowOrganizer().applySyncTransaction(mWCT, this);\n }\n if (DEBUG) Slog.d(TAG, \" Sent sync transaction. Got id=\" + mId);\n mMainExecutor.executeDelayed(mOnReplyTimeout, REPLY_TIMEOUT);\n }",
"public interface IReversalTransaction {\n\n ITransaction getOriginalMessage();\n // private final ITransaction original;\n\n\n}",
"@Override\n public long superstep() {\n return context.superstep();\n }",
"public void beginTransaction() {\n\r\n\t}",
"@Override\n\tpublic void force() {\n\t\t\n\t\ttry (Restore restore = ComponentBoundary.push(loggerName(), this)) {\t\t\n\t\t\tstateHandler.waitToWhen(new IsSoftResetable(), new Runnable() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlogger().info(\"Forcing complete.\");\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tchildStateReflector.stop();\n\t\t\t\t\t\n\t\t\t\t\tgetStateChanger().setState(ParentState.COMPLETE);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}",
"void setTransaction(final INodeReadTrx pRtx);",
"void beforeState();",
"private MetaSparqlRequest createRollbackPreInsered() {\n\t\treturn createRollbackMT1();\n\t}",
"@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setEmitOrgPRE(true);\r\n \r\n }",
"@Override\n\tpublic void trans() {\n\t\tSystem.out.println(\"BigCar trans\");\n\t}",
"private void _addMessage(LogMessage logMessage) {\n\t\tString realmName = logMessage.getRealm();\n\t\tLinkedHashSet<LogMessage> logMessages = this.logMessagesByRealmAndId.computeIfAbsent(realmName,\n\t\t\t\tOperationsLog::newHashSet);\n\t\tlogMessages.add(logMessage);\n\n\t\t// store under locator\n\t\tLinkedHashMap<Locator, LinkedHashSet<LogMessage>> logMessagesLocator = this.logMessagesByLocator.computeIfAbsent(\n\t\t\t\trealmName, this::newBoundedLocatorMap);\n\t\tLinkedHashSet<LogMessage> messages = logMessagesLocator.computeIfAbsent(logMessage.getLocator(),\n\t\t\t\tOperationsLog::newHashSet);\n\t\tmessages.add(logMessage);\n\n\t\t// prune if necessary\n\t\tList<LogMessage> messagesToRemove = _pruneMessages(realmName, logMessages);\n\n\t\t// persist changes for non-transient realms\n\t\tStrolchRealm realm = getContainer().getRealm(realmName);\n\t\tif (!realm.getMode().isTransient())\n\t\t\tpersist(realm, logMessage, messagesToRemove);\n\t}",
"@Override\r\n\tprotected void onResume() {\n\t\tstack.setCurrentPhase(TracePhase.MAIN);\r\n\t\tsuper.onResume();\r\n\t}",
"StmTransaction() {\n\n // Spin until we get a next rev number and put it in the queue of rev numbers in use w/o concurrent change.\n // (We avoid concurrent change because if another thread bumped the revisions in use, it might also have\n // cleaned up the revision before we said we were using it.)\n while ( true ) {\n long sourceRevNumber = lastCommittedRevisionNumber.get();\n sourceRevisionsInUse.add( sourceRevNumber );\n if ( sourceRevNumber == lastCommittedRevisionNumber.get() ) {\n this.sourceRevisionNumber = sourceRevNumber;\n break;\n }\n sourceRevisionsInUse.remove( sourceRevNumber );\n }\n\n // Use the next negative pending revision number to mark our writes.\n this.targetRevisionNumber = new AtomicLong( lastPendingRevisionNumber.decrementAndGet() );\n\n // Track the versioned items read and written by this transaction.\n this.versionedItemsRead = new HashSet<>();\n this.versionedItemsWritten = new HashSet<>();\n\n // Flag a write conflict as early as possible.\n this.newerRevisionSeen = false;\n\n // Establish a link for putting this transaction in a linked list of completed transactions.\n this.nextTransactionAwaitingCleanUp = new AtomicReference<>( null );\n\n }",
"@Override\r\n\tpublic void onStartTrading() throws Exception {\n\t\t\r\n\t}",
"public void transact() {\n\t\truPay.transact();\n\n\t}",
"@Override\n public void rowWrittenEvent(IRowMeta rowMeta, Object[] row)\n throws HopTransformException { Set the log level back to the original value.\n //\n transformCopy.getLogChannel().setLogLevel(baseLogLevel);\n }",
"private void dumpState() {\n try {\n if (cpeFactory.getCPEConfig() != null\n && cpeFactory.getCPEConfig().getDeployment().equalsIgnoreCase(SINGLE_THREADED_MODE)) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_show_cr_state__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(readerState) });\n\n for (int i = 0; processingUnits != null && i < processingUnits.length; i++) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_show_pu_state__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(i),\n String.valueOf(processingUnits[i].threadState) });\n }\n if (casConsumerPU != null) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_show_cc_state__INFO\",\n new Object[] { Thread.currentThread().getName(),\n String.valueOf(casConsumerPU.threadState) });\n }\n\n } else {\n if (producer != null) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_show_cr_state__INFO\",\n new Object[] { Thread.currentThread().getName(),\n String.valueOf(producer.threadState) });\n }\n for (int i = 0; processingUnits != null && i < processingUnits.length; i++) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_show_pu_state__INFO\",\n new Object[] { Thread.currentThread().getName(), String.valueOf(i),\n String.valueOf(processingUnits[i].threadState) });\n }\n if (casConsumerPU != null) {\n UIMAFramework.getLogger(this.getClass()).logrb(Level.INFO, this.getClass().getName(),\n \"process\", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, \"UIMA_CPM_show_cc_state__INFO\",\n new Object[] { Thread.currentThread().getName(),\n String.valueOf(casConsumerPU.threadState) });\n }\n }\n } catch (Exception e) { // ignore. This is called on stop()\n }\n\n }",
"public interface StreamLogWithRankedAddressSpace extends StreamLog {\n\n /**\n * Check whether the data can be appended to a given log address.\n * Note that it is not permitted multiple threads to access the same log address\n * concurrently through this method, this method does not lock or synchronize.\n * This method needs\n * @param address\n * @param newEntry\n * @throws DataOutrankedException if the log entry cannot be assigned to this log address as there is a data with higher rank\n * @throws ValueAdoptedException if the new message is a proposal during the two phase recovery write and there is an existing\n * data at this log address already.\n * @throw OverwriteException if the new data is with rank 0 (not from recovery write). This can happen only if there is a bug in the client implementation.\n */\n default void assertAppendPermittedUnsafe(long address, LogData newEntry) throws DataOutrankedException, ValueAdoptedException {\n LogData oldEntry = read(address);\n if (oldEntry.getType()==DataType.EMPTY) {\n return;\n }\n if (newEntry.getRank().getRank()==0) {\n // data consistency in danger\n throw new OverwriteException();\n }\n int compare = newEntry.getRank().compareTo(oldEntry.getRank());\n if (compare<0) {\n throw new DataOutrankedException();\n }\n if (compare>0) {\n if (newEntry.getType()==DataType.RANK_ONLY && oldEntry.getType() != DataType.RANK_ONLY) {\n // the new data is a proposal, the other data is not, so the old value should be adopted\n ReadResponse resp = new ReadResponse();\n resp.put(address, oldEntry);\n throw new ValueAdoptedException(resp);\n } else {\n return;\n }\n }\n }\n}",
"public boolean transactionStarted();",
"private void enterSequence_mainRegion_State2__region0_State4__region0_State7__region0_State9_default() {\n\t\tnextStateIndex = 0;\n\t\tstateVector[0] = State.mainRegion_State2__region0_State4__region0_State7__region0_State9;\n\n\t\thistoryVector[2] = stateVector[0];\n\t}",
"public abstract void graphEvent(TrustLogEvent event, boolean forward);",
"@Override\n\tpublic void beforeSave(Collection<R> rows) {\n\t\ttable//\n\t\t\t.getTransactionAttribute()\n\t\t\t.ifPresent(attribute -> attribute.updateTransactionFields(rows));\n\n\t\t// track which fields where changed\n\t\tDbConnections//\n\t\t\t.getOrPutTransactionData(EmfChangeTracker.class, EmfChangeTracker::new)\n\t\t\t.ifPresent(tracker -> tracker.trackChanges(rows));\n\n\t\texecuteSaveHooks(hook -> hook.beforeSave(rows));\n\t}",
"@Override\n public void persistFlowUnit(FlowUnitOperationArgWrapper args) {}",
"public TransactionEvent() {\n this.local = true;\n }",
"@Override\r\n\tpublic TransactionMetadata initializeTransaction(BigInteger txid,TransactionMetadata prevMetadata) {\n\t\tTransactionMetadata ret = initializeTransactionMetadat();\r\n\t\tif(nextBatchRows!=null && !nextBatchRows.isEmpty()){\r\n\t\t\tList<ObjectId> rowIds = Util.convertToIdList(nextBatchRows);\r\n//\t\t\tquantity = quantity > MAX_TRANSACTION_SIZE ? MAX_TRANSACTION_SIZE : quantity;\r\n\t\t\tret = new TransactionMetadata(collectionName,rowIds);\r\n\t\t\tObjectId[] objectIds = Util.convertObjectIdListToArr(rowIds);\r\n\t\t\tString objIdStr = Util.convertObjectIdArrToStr(objectIds);\r\n\t\t\tlogger.debug(\"store transactionMetadata,txid:\"+txid+\" [collection:\"+collectionName+\"]objIds : \"+objIdStr);\r\n\t\t}\r\n//\t\tnextRead += quantity;\r\n//\t\tmongoManager.updateFlagToInprogress(idList);\r\n\t\treturn ret;\r\n\t}",
"public Systemlog (java.lang.Integer rowid) {\n\t\tsuper(rowid);\n\t}",
"public void printTransaction() {\n\t\tdao.printTransaction();\r\n\t\t\r\n\t}",
"@Override\n\tpublic void trace(MessageSupplier msgSupplier) {\n\n\t}",
"void readOnlyTransaction();",
"@Override\n public void logSmartDashboard() {\n SmartDashboard.putString(\"CargoIntake RollerState\", direction.toString());\n \n // Smart dashboard cargo loaded and photoelectric value\n SmartDashboard.putBoolean(\"CargoIntake IsCargoDetected\", isCargoDetected());\n SmartDashboard.putBoolean(\"CargoIntake IgnorePhotoelectric\",ignorePhotoelectric);\n }",
"@Override\n\tpublic void trace(Message msg) {\n\n\t}",
"private void addIncomingTransform() {\n TransformTableNodeGroupLink incomingTransform = new TransformTableNodeGroupLink();\n incomingTransform.setTransformPoint(TransformPoint.LOAD);\n incomingTransform.setTransformId(\"stress_test_incoming_transform\");\n incomingTransform.setSourceTableName(STRESS_TEST_ROW_INCOMING);\n incomingTransform.setTargetTableName(STRESS_TEST_ROW_INCOMING);\n incomingTransform.setColumnPolicy(ColumnPolicy.IMPLIED);\n incomingTransform.setNodeGroupLink(engine.getConfigurationService().getNodeGroupLinkFor(CLIENT_NODE_GROUP, SERVER_NODE_GROUP, true));\n\n TransformColumn incomingInsertCol = new TransformColumn(\"INSERT_SYNC_TIME\", \"INSERT_SYNC_TIME\", false, \"variable\",\n \"system_timestamp\");\n incomingInsertCol.setTransformId(incomingTransform.getTransformId());\n incomingInsertCol.setTransformOrder(3);\n incomingInsertCol.setIncludeOn(IncludeOnType.ALL);\n incomingTransform.addTransformColumn(incomingInsertCol);\n\n engine.getTransformService().saveTransformTable(incomingTransform, true);\n }",
"protected void sequence_Transition(ISerializationContext context, Transition semanticObject) {\r\n\t\tgenericSequencer.createSequence(context, semanticObject);\r\n\t}",
"@Override\r\n\tpublic void addLog(Log log) throws RuntimeException {\n\t\tlogMapper.addLog(log);\r\n\t}",
"void initializeStateOrder( int nIdWorkflow );",
"@Override\n protected void incrementStates() {\n\n }",
"public void testAddLockToken() {\n \n String lock = \"some lock\";\n session.addLockToken(lock);\n \n sessionControl.replay();\n sfControl.replay();\n \n jt.addLockToken(lock);\n \n }",
"@Override\r\n\tpublic void printTransdetails() {\n\t\t\r\n\t}",
"@Override\n\tpublic void tranfermoney() {\n\t\tSystem.out.println(\"hsbc tranfermoney\");\n\t}",
"@Override\n public boolean onTransact(int n, Parcel parcel, Parcel object, int n2) throws RemoteException {\n String string = null;\n Object var7_6 = null;\n Object object2 = null;\n switch (n) {\n default: {\n return super.onTransact(n, parcel, (Parcel)object, n2);\n }\n case 1598968902: {\n object.writeString(\"com.google.android.gms.playlog.internal.IPlayLogService\");\n return true;\n }\n case 2: {\n parcel.enforceInterface(\"com.google.android.gms.playlog.internal.IPlayLogService\");\n string = parcel.readString();\n object = parcel.readInt() != 0 ? nm.CREATOR.cY(parcel) : null;\n if (parcel.readInt() != 0) {\n object2 = ni.CREATOR.cX(parcel);\n }\n this.a(string, (nm)object, (ni)object2);\n return true;\n }\n case 3: {\n parcel.enforceInterface(\"com.google.android.gms.playlog.internal.IPlayLogService\");\n object2 = parcel.readString();\n object = string;\n if (parcel.readInt() != 0) {\n object = nm.CREATOR.cY(parcel);\n }\n this.a((String)object2, (nm)object, parcel.createTypedArrayList(ni.CREATOR));\n return true;\n }\n case 4: \n }\n parcel.enforceInterface(\"com.google.android.gms.playlog.internal.IPlayLogService\");\n object2 = parcel.readString();\n object = var7_6;\n if (parcel.readInt() != 0) {\n object = nm.CREATOR.cY(parcel);\n }\n this.a((String)object2, (nm)object, parcel.createByteArray());\n return true;\n }",
"abstract public void enableLogCollection(LogCollectionState state);",
"private void RecordStoreLockFactory() {\n }",
"@Override\r\n\tpublic void step(SimState state) {\r\n\r\n\t}",
"<R> R transactNew(Supplier<R> work) {\n // Wrap the Work in a CommitLoggedWork so that we can give transactions a frozen view of time\n // and maintain commit logs for them.\n return transactCommitLoggedWork(new CommitLoggedWork<>(work, getClock()));\n }",
"protected void sequence_LogicalStatefulSource(ISerializationContext context, LogicalStatefulSource semanticObject) {\n\t\tgenericSequencer.createSequence(context, semanticObject);\n\t}",
"int insertSelective(NjOrderCallbackLog record);",
"@Override\r\n\tpublic void updateLog(Log log) throws RuntimeException {\n\t\tlogMapper.updateLog(log);\r\n\t}",
"@Override\n public void onAddBreadRaised() {\n }",
"private OrderBustReinstateReportStruct processOrderBustReinstateReport(\n\t\t\tExecutionReport execReport, FixSessionImpl session)\n\tthrows DataValidationException {\n\t\treturn FixExecutionReportToCmiMapper.mapToOrderBustReinstateReportStruct(\n\t\t\t\texecReport, session.getDoNotSendValue());\n\t}",
"@Override\r\n public void enableStreamFlow() {\r\n SwitchStates.setPassivateTrgINT(false);\r\n }"
] | [
"0.54942065",
"0.53308773",
"0.5320914",
"0.5280818",
"0.52719533",
"0.5265651",
"0.52027804",
"0.51894724",
"0.5184152",
"0.5180227",
"0.51797384",
"0.51460516",
"0.5131922",
"0.5104884",
"0.5098523",
"0.5085945",
"0.5079711",
"0.5076994",
"0.5075932",
"0.50515175",
"0.5032963",
"0.50213915",
"0.50136554",
"0.4998721",
"0.4998148",
"0.49981448",
"0.49960548",
"0.4991613",
"0.4985761",
"0.49676508",
"0.49594015",
"0.49578232",
"0.4950816",
"0.49324003",
"0.49261415",
"0.49177188",
"0.4884961",
"0.4870285",
"0.48669013",
"0.48591292",
"0.48587978",
"0.48352382",
"0.48312753",
"0.48302922",
"0.48204985",
"0.48170438",
"0.48045117",
"0.4801657",
"0.47901002",
"0.47893083",
"0.4769497",
"0.4769485",
"0.47649273",
"0.47622865",
"0.47605503",
"0.47564542",
"0.47542048",
"0.4751863",
"0.47501233",
"0.47441173",
"0.47395808",
"0.47370455",
"0.47268775",
"0.47252002",
"0.47208452",
"0.47125903",
"0.47042635",
"0.46958634",
"0.46853855",
"0.46831715",
"0.4682754",
"0.4665784",
"0.46657282",
"0.466376",
"0.46542427",
"0.46497902",
"0.46461967",
"0.46426654",
"0.46421987",
"0.46389735",
"0.4631118",
"0.46305647",
"0.46300393",
"0.46296927",
"0.4628891",
"0.4628625",
"0.46271577",
"0.46227622",
"0.4617826",
"0.4615731",
"0.4614357",
"0.46118456",
"0.46111095",
"0.460785",
"0.46061432",
"0.46052173",
"0.46011388",
"0.45997342",
"0.45966753",
"0.45961753"
] | 0.46195376 | 88 |
Called to notify the state machine that the Transaction passed cannot be appended (or synced). The exception field will indicate whether there was an exception or not. | TransactionContext cancelTransaction() throws IOException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected boolean shouldSendThrowException() {\n return false;\n }",
"void onSynchronizationFailed(SyncException e);",
"@Override\n\t\t\t\t\tpublic void onAddFail() {\n\t\t\t\t\t\tMZLog.e(\"J\", \"同步到购物车失败\");\n\t\t\t\t\t}",
"public void checkForTransaction() throws SystemException;",
"@Entao(\"^nao sera possivel por falta de estoque$\")\n\tpublic void naoSeraPossivelPorFaltaDeEstoque() throws Throwable {\n\t throw new PendingException();\n\t}",
"public void errorWhenCommitting();",
"public void mailStoreRequestFailed(MailStoreRequest request, Throwable exception, boolean isFinal) {\n folderMessageCache.commit();\r\n mailStoreServices.fireFolderMessagesAvailable(folderTreeItem, null, false);\r\n }",
"@RequiresLock(\"SeaLock\")\r\n protected void dependentInvalidAction() {\r\n // by default do nothing\r\n }",
"public void checkExcn() throws Exception\n { This is called from the main thread context to re-throw any saved\n // exception.\n //\n if (ex != null) {\n throw ex;\n }\n }",
"void checkExcn() throws Exception\n { This is called from the main thread context to re-throw any saved\n // exception.\n //\n if (ex != null) {\n throw ex;\n }\n }",
"public void mailStoreRequestFailed(MailStoreRequest request, Throwable exception, boolean isFinal) {\n endFolderRefreshOperation(false);\r\n }",
"public void maybeThrow() {\n if (exception != null)\n throw this.exception;\n }",
"@Override\n protected void onExceptionSwallowed(RuntimeException exception) {\n throw exception;\n }",
"private void notifyUploadFail() {\n numberOfFail++;\n notificationBuilder.setContentText(getNotificationContent());\n notificationManger.notify(0, notificationBuilder.build());\n }",
"@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }",
"void markFailed(Execution execution, Throwable cause);",
"TransactionContext setException(Exception exception);",
"public void markAsFailed() {\n \n \t\texecutionStateChanged(ExecutionState.FAILED, \"Execution thread died unexpectedly\");\n \t}",
"@Override\n\t\t\t\t\t\tpublic void onSyncErr() {\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}",
"@SuppressWarnings(\"unchecked\")\n public void checkTransactionIntegrity(TransactionImpl transaction) {\n Set threads = transaction.getAssociatedThreads();\n String rollbackError = null;\n synchronized (threads) {\n if (threads.size() > 1)\n rollbackError = \"Too many threads \" + threads + \" associated with transaction \"\n + transaction;\n else if (threads.size() != 0) {\n Thread other = (Thread) threads.iterator().next();\n Thread current = Thread.currentThread();\n if (current.equals(other) == false)\n rollbackError = \"Attempt to commit transaction \" + transaction + \" on thread \"\n + current\n + \" with other threads still associated with the transaction \"\n + other;\n }\n }\n if (rollbackError != null) {\n log.error(rollbackError, new IllegalStateException(\"STACKTRACE\"));\n markRollback(transaction);\n }\n }",
"public void checkError() {\n if (this.threadError != null) {\n throw new EncogError(this.threadError);\n }\n }",
"@Transactional(Transactional.TxType.NOT_SUPPORTED)\n\tpublic void notSupported() {\n\t System.out.println(getClass().getName() + \"Transactional.TxType.NOT_SUPPORTED\");\n\t // Here the container will make sure that the method will run in no transaction scope and will suspend any transaction started by the client\n\t}",
"@Override\n\t\t\tpublic void onFail() {\n\t\t\t\tcallBack.onCheckUpdate(-1, null); // 检查出错\n\t\t\t}",
"void notifyUnexpected();",
"public void pendingRecordFailed() {\n pendingRecordFailed(0);\n }",
"public void failedWithdraw(){\n\t\tstate = ATM_State.WITHDRAWALNOTIFICATION;\n\t\tgui.setDisplay(\"Invalid withdrawal amount.\");\n\t}",
"private void sendOldError(Exception e) {\n }",
"public void addException(Exception exception);",
"public void processBlockwiseResponseTransferFailed() {\n //to be overridden by extending classes\n }",
"public ItemNotAvailableForUpdateException() {\r\n\t\tsuper();\r\n\t}",
"void throwEvents();",
"public void beforeCompletion()\n {\n \n boolean success = false;\n try\n {\n flush();\n // internalPreCommit() can lead to new updates performed by usercode \n // in the Synchronization.beforeCompletion() callback\n internalPreCommit();\n flush();\n success = true;\n }\n finally\n {\n if (!success) \n {\n // TODO Localise these messages\n NucleusLogger.TRANSACTION.error(\"Exception flushing work in JTA transaction. Mark for rollback\");\n try\n {\n jtaTx.setRollbackOnly();\n }\n catch (Exception e)\n {\n NucleusLogger.TRANSACTION.fatal(\n \"Cannot mark transaction for rollback after exception in beforeCompletion. PersistenceManager might be in inconsistent state\", e);\n }\n }\n }\n }",
"protected abstract String insufficientParameterExceptionMessage(TransactionCommand transactionCommand);",
"protected abstract void handleRealtimeLinkCommitException(Throwable t);",
"void notifyReject(final TradeInstruction instruction);",
"static final void throwIllegalMonitorStateException0X()\n {\n throw new IllegalMonitorStateException();\n }",
"public void markAsFailed() {\n execution.setErrorReported();\n }",
"@Override\n public Transaction suspend() throws SystemException {\n throw new UnsupportedOperationException();\n }",
"private void insertNodesCatalogTransactionsPendingForPropagation(NodesCatalogTransaction transaction) throws CantInsertRecordDataBaseException {\n\n /*\n * Save into the data base\n */\n getDaoFactory().getNodesCatalogTransactionsPendingForPropagationDao().create(transaction);\n }",
"@Test public void testTransactionExclusion() throws Exception {\n server.begin(THREAD1);\n\n try {\n server.start(THREAD1, XID1, XAResource.TMNOFLAGS, 100, false);\n fail(\"exception expected\"); //$NON-NLS-1$\n } catch (XATransactionException ex) {\n assertEquals(\"TEIID30517 Client thread already involved in a transaction. Transaction nesting is not supported. The current transaction must be completed first.\", //$NON-NLS-1$\n ex.getMessage());\n }\n }",
"protected void failed()\r\n {\r\n //overwrite\r\n }",
"@Override\n\t\t\t\tpublic void onAddFail() {\n\t\t\t\t\tif (addListener != null) {\n\t\t\t\t\t\taddListener.onAddFail();\n\t\t\t\t\t}\n\t\t\t\t}",
"protected void raiseRequestError(Exception e) {\n\t\tmThrowedExceptions.add(e);\n\t}",
"public void indicateNot() {\r\n notIndicated = true;\r\n }",
"final void ensureOngoingTransaction() throws SQLException {\n if (!transactionLock.isHeldByCurrentThread()) {\n throw new SQLNonTransientException(Errors.getResources(getLocale())\n .getString(Errors.Keys.ThreadDoesntHoldLock));\n }\n }",
"private void notifyTaskFailure(Intent baseIntent, Exception exception) {\n int action = baseIntent.getIntExtra(ACTION, ACTION_NONE);\n Intent intent = new Intent(LocalAction.ACTION_BACKUP_SERVICE_FAILED);\n intent.putExtra(ACTION, action);\n intent.putExtra(EXCEPTION, exception);\n intent.putExtra(CALLER_ID, mCallerId);\n mBroadcastManager.sendBroadcast(intent);\n // update the notification if required\n if (mNotificationBuilder != null || mAutoBackup) {\n mNotificationBuilder = getBaseNotificationBuilder(NotificationContract.NOTIFICATION_CHANNEL_ERROR)\n .setContentTitle(getNotificationContentTitle(action, true))\n .setCategory(NotificationCompat.CATEGORY_ERROR);\n if (exception instanceof WiFiNotConnectedException) {\n // create a copy of the arguments used in this service\n Bundle intentArguments = new Bundle();\n intentArguments.putInt(ACTION, action);\n intentArguments.putString(BACKEND_ID, baseIntent.getStringExtra(BACKEND_ID));\n intentArguments.putBoolean(AUTO_BACKUP, baseIntent.getBooleanExtra(AUTO_BACKUP, DEFAULT_AUTO_BACKUP));\n intentArguments.putBoolean(ONLY_ON_WIFI, baseIntent.getBooleanExtra(ONLY_ON_WIFI, DEFAULT_ONLY_ON_WIFI));\n intentArguments.putBoolean(RUN_FOREGROUND, baseIntent.getBooleanExtra(RUN_FOREGROUND, DEFAULT_RUN_FOREGROUND));\n intentArguments.putString(PASSWORD, baseIntent.getStringExtra(PASSWORD));\n intentArguments.putParcelable(PARENT_FOLDER, baseIntent.getParcelableExtra(PARENT_FOLDER));\n intentArguments.putParcelable(BACKUP_FILE, baseIntent.getParcelableExtra(BACKUP_FILE));\n // prepare the pending intent for the notification receiver\n Intent retryIntent = new Intent(this, NotificationBroadcastReceiver.class);\n retryIntent.setAction(NotificationBroadcastReceiver.ACTION_RETRY_BACKUP_CREATION);\n retryIntent.putExtra(NotificationBroadcastReceiver.ACTION_INTENT_ARGUMENTS, intentArguments);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, retryIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n // finish to setup the notification body\n mNotificationBuilder.setContentText(getString(R.string.notification_content_backup_error_wifi_network));\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.notification_content_backup_error_wifi_network)));\n mNotificationBuilder.addAction(R.drawable.ic_refresh_black_24dp, getString(R.string.notification_action_retry), pendingIntent);\n } else if (exception instanceof BackendException) {\n if (((BackendException) exception).isRecoverable()) {\n // create a copy of the arguments used in this service\n Bundle intentArguments = new Bundle();\n intentArguments.putInt(ACTION, action);\n intentArguments.putString(BACKEND_ID, baseIntent.getStringExtra(BACKEND_ID));\n intentArguments.putBoolean(AUTO_BACKUP, baseIntent.getBooleanExtra(AUTO_BACKUP, DEFAULT_AUTO_BACKUP));\n intentArguments.putBoolean(ONLY_ON_WIFI, baseIntent.getBooleanExtra(ONLY_ON_WIFI, DEFAULT_ONLY_ON_WIFI));\n intentArguments.putBoolean(RUN_FOREGROUND, baseIntent.getBooleanExtra(RUN_FOREGROUND, DEFAULT_RUN_FOREGROUND));\n intentArguments.putString(PASSWORD, baseIntent.getStringExtra(PASSWORD));\n intentArguments.putParcelable(PARENT_FOLDER, baseIntent.getParcelableExtra(PARENT_FOLDER));\n intentArguments.putParcelable(BACKUP_FILE, baseIntent.getParcelableExtra(BACKUP_FILE));\n // prepare the pending intent for the notification receiver\n Intent retryIntent = new Intent(this, NotificationBroadcastReceiver.class);\n retryIntent.setAction(NotificationBroadcastReceiver.ACTION_RETRY_BACKUP_CREATION);\n retryIntent.putExtra(NotificationBroadcastReceiver.ACTION_INTENT_ARGUMENTS, intentArguments);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, retryIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n // finish to setup the notification body\n mNotificationBuilder.setContentText(getString(R.string.notification_content_backup_error_backend_recoverable));\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.notification_content_backup_error_backend_recoverable)));\n mNotificationBuilder.addAction(R.drawable.ic_refresh_black_24dp, getString(R.string.notification_action_retry), pendingIntent);\n } else {\n mNotificationBuilder.setContentText(getString(R.string.notification_content_backup_error_backend));\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.notification_content_backup_error_backend)));\n }\n } else {\n String message = getString(R.string.notification_content_backup_error_internal, exception.getMessage());\n mNotificationBuilder.setContentText(message);\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(message));\n }\n // use the notification service instead of the foreground service\n // because when the intent service has finished the notification\n // is removed even if the stopForeground is set to false\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);\n notificationManager.notify(NotificationContract.NOTIFICATION_ID_BACKUP_ERROR, mNotificationBuilder.build());\n }\n }",
"public void reportIrreversibleChange() {\r\n Assert.isTrue(isReceiving());\r\n irreversibleChangeReported = true;\r\n }",
"public synchronized void sendInvalid() {\r\n\t\tbeginMessage();\r\n\t\tsend(ServerConst.ANS + ServerConst.ANS_INVALID);\r\n\t\tendMessage();\r\n\t}",
"private void ensureChangesAllowed() {\n if (lifecycle.started() == false) {\n throw new IllegalStateException(\"Can't make changes to indices service, node is closed\");\n }\n }",
"public void \n\twriteFailed( \n\t\t\tDiskManagerWriteRequest \trequest, \n\t\t\tThrowable\t\t \t\t\tcause )\n\t{\n\t}",
"@Override\n\tpublic void brokenSubscription() {\n\t\t\n\t}",
"private static synchronized void writeTransaction( StmTransaction transaction ) {\n\n // Check for conflicts.\n for ( AbstractVersionedItem versionedItem : transaction.versionedItemsRead ) {\n versionedItem.ensureNotWrittenByOtherTransaction();\n }\n\n // Set the revision number to a committed value.\n transaction.targetRevisionNumber.set( lastCommittedRevisionNumber.incrementAndGet() );\n\n }",
"@Test(expected = VendingMachineException.class)\r\n\tpublic void testInsertMoney_invalid_amount() {\r\n\t\tvendMachine.insertMoney(-10.0);\r\n\t}",
"@RequiresLock(\"SeaLock\")\r\n protected void deponentInvalidAction(Drop invalidDeponent) {\r\n invalidate();\r\n }",
"public void assertNotInState(T forbidden) {\n synchronized (this) {\n if (state == forbidden) {\n throw new IllegalStateException(\"Should not be in state \" + forbidden + \".\");\n }\n }\n }",
"@Override\r\n protected void invalidMessage(RemoteGENASubscription sub,\r\n UnsupportedDataException ex) {\n }",
"void markFailed(Throwable t) {\n\t}",
"public static void needException() throws IllegalStateException {\n check(false);\n }",
"@Override\n boolean canFail() {\n return true;\n }",
"public Exception getException() {\n return transactionFailure;\n }",
"@Override\n boolean isFailed() {\n return false;\n }",
"@Transactional(propagation=Propagation.REQUIRES_NEW)\r\n\tpublic void createError(){\r\n\t\tOrder newOrder = new Order( );\r\n\t\tnewOrder.setDescription(\"Service layer added \"+Calendar.getInstance().getTime());\r\n\t\tspringOrderDao.errorSave(newOrder);\r\n\t}",
"public void lockAdd(){\n\t\tthis.canAdd = false;\n\t}",
"public void testAddBlock_NoGame() throws Exception {\n try {\n dao.addBlock(1, 1);\n fail(\"EntryNotFoundException expected\");\n } catch (EntryNotFoundException e) {\n // should land here\n }\n }",
"@Test public void testTransactionExclusion2() throws Exception {\n server.start(THREAD1, XID1, XAResource.TMNOFLAGS, 100,false);\n\n try {\n server.start(THREAD2, XID1, XAResource.TMNOFLAGS, 100,false);\n fail(\"exception expected\"); //$NON-NLS-1$\n } catch (XATransactionException ex) {\n assertEquals(\"TEIID30522 Global transaction Teiid-Xid global:1 branch:null format:0 already exists.\", ex.getMessage()); //$NON-NLS-1$\n }\n }",
"public void addTransaction(Transaction transaction) throws TransactionFailedException,\n\tLowBalanceException,AccountDoesNotExistException {\n\t\t\n\t\tint amount = 0;\n\t\t\n\t\tAccount account = accountDAO.listByAccountId(transaction.getAccountId());\n\t\n\t\tif(account== null){\n\t\t\tthrow new AccountDoesNotExistException(\"Account with \"+ transaction.getAccountId() +\" does not exists\");\n\t\t}\n\t\tif (transaction.getType().equals(\"D\")) {\n\n\t\t\tif (account.getAmount() >= transaction.getAmount())\n\t\t\t\tamount = account.getAmount() - transaction.getAmount();\n\t\t\telse {\n\t\t\t\tthrow new LowBalanceException(\"Low Balance..!!\");\n\t\t\t}\n\n\t\t} else {\n\t\t\tamount = account.getAmount() + transaction.getAmount();\n\t\t}\n\t\taccount.setAmount(amount);\n\t\taccountDAO.update(account);\n\t\ttransactionDAO.save(transaction);\n\t}",
"private void checkValid()\n {\n synchronized (lock)\n {\n if (!valid)\n {\n throw new RuntimeException(\"MessageClient has been invalidated.\"); // TODO - localize\n }\n }\n }",
"void failed (Exception e);",
"@Test(expected = VendingMachineException.class)\r\n\tpublic void testAddItem_already_occupied() {\r\n\t\tVendingMachineItem test = new VendingMachineItem(\"test\", 10.0);\r\n\t\tvendMachine.addItem(test, \"A\");\r\n\t\tVendingMachineItem test2 = new VendingMachineItem(\"test\", 10.0);\r\n\t\tvendMachine.addItem(test2, \"A\");\r\n\r\n\t}",
"public VertexExistsException() {\r\n\t\tsuper(\"The VextexExistsException occured!\");\r\n\t}",
"@Test\n public void handleSavvyTaskerChangedEvent_exceptionThrown_eventRaised() throws IOException {\n Storage storage = new StorageManager(new XmlAddressBookStorageExceptionThrowingStub(\"dummy\"), new JsonUserPrefsStorage(\"dummy\"));\n EventsCollector eventCollector = new EventsCollector();\n storage.handleSavvyTaskerChangedEvent(new SavvyTaskerChangedEvent(new SavvyTasker()));\n assertTrue(eventCollector.get(0) instanceof DataSavingExceptionEvent);\n }",
"@Test\n void exceptionThrown() {\n Flux<Integer> source = Flux.range(1, 50).concatWith(\n Mono.error(new IllegalArgumentException())\n );\n\n // FIXME: Verify Flux source using StepVerifier\n }",
"void addTransaction(Transaction transaction, long timestamp) throws TransactionNotInRangeException;",
"@Override\r\n\tpublic void onFail() {\n\t\tif(bSendStatus)\r\n\t\t\tnativeadstatus(E_ONFAIL);\r\n\t}",
"@Override\n @Transactional\n public void addTryWithErrorByCardNumber(String cardNumber) {\n logger.info(\"add try with error by \" + cardNumber);\n cardRepository.addTryWithErrorByCardNumber(cardNumber);\n }",
"public void reportNothingToUndoYet() {\r\n Assert.isTrue(isReceiving());\r\n setNothingToUndoReported(true);\r\n }",
"public void knobGenerationFailed( final BumpGenerator generator, final Exception exception );",
"public EntityTransactionException() {\r\n\t\tsuper();\r\n\t}",
"public static void ignoreTransaction() {\n if (active) {\n TransactionAccess.ignore();\n }\n }",
"public ConceptPersistException( Exception cause )\r\n {\r\n super( cause );\r\n }",
"public void rollbackTx()\n\n{\n\n}",
"void nodeFailedToStart(Exception e);",
"@Override\n public void rollback()\n throws TransactionException\n {\n Iterator<Buffer> it=branchBuffers.iterator();\n while (it.hasNext())\n { \n it.next().rollback();\n it.remove();\n }\n state=State.ABORTED;\n \n }",
"private void modificationCheck() {\n if (this.expectedMod != modCount) {\n throw new ConcurrentModificationException(\"The Simple Array List was changed its structure!\");\n }\n }",
"protected void checkState()\n {\n if (getParentNode() != null)\n {\n throw new IllegalStateException(\n \"Node cannot be modified when added to a parent!\");\n }\n }",
"@Override\n public void rollbackTx() {\n \n }",
"public boolean addTransaction(Transaction trans) {\n if (trans == null) {\n return false;\n }\n if (!previousHash.equals(\"0\")) {\n if (!trans.processTransaction()) {\n System.out.println(\"Transaction failed to process. Transaction discarded!\");\n return false;\n }\n }\n transactions.add(trans);\n System.out.println(\"Transaction successfully added to the block\");\n return true;\n }",
"@Test public void testTransactionExclusion1() throws Exception {\n server.start(THREAD1, XID1, XAResource.TMNOFLAGS, 100, false);\n\n try {\n server.begin(THREAD1);\n fail(\"exception expected\"); //$NON-NLS-1$\n } catch (XATransactionException ex) {\n assertEquals(\"TEIID30517 Client thread already involved in a transaction. Transaction nesting is not supported. The current transaction must be completed first.\", //$NON-NLS-1$\n ex.getMessage());\n }\n }",
"public void communicationChannelBroken() {\n\n }",
"@Override\n\tpublic boolean isBusinessException() {\n\t\treturn false;\n\t}",
"public WalletItemAlreadyExistsException(IndyError error) {\n\t\tsuper(message + error.buildMessage(), ErrorCode.WalletItemAlreadyExists.value());\n\t}",
"public interface MonitorTransaction {\n\n void success();\n\n void failure(Throwable cause);\n\n void complete();\n}",
"public void beginTransaction() throws Exception;",
"protected boolean isTransactionAllowedToRollback() throws SystemException\n {\n return this.getTransactionStatus() != Status.STATUS_COMMITTED &&\n this.getTransactionStatus() != Status.STATUS_NO_TRANSACTION &&\n this.getTransactionStatus() != Status.STATUS_UNKNOWN;\n }",
"public void fail() {\n _siteStatus = false;\n _lockTable.clear();\n _accessedTransactions.clear();\n _uncommitDataMap.clear();\n _lastFailTime = _tm.getCurrentTime();\n }",
"public LocalTransactionException( String reason ) {\n super( reason );\n }",
"protected void connectionException(Exception exception) {}",
"void addTransaction(Transaction transaction) throws SQLException, BusinessException;",
"@Override\n public void onAcknowledgement(RecordMetadata recordMetadata, Exception e) {\n }",
"public void checkForMod() {\n if (modCount != expectedModCount) {\n throw new ConcurrentModificationException();\n }\n }",
"private void validateTransactionId(String transactionId) throws LedgerException {\n // Create the Exception\n LedgerException e = new LedgerException(\n \"validate transaction ID\",\n \"This transaction already exists.\"\n );\n\n // Check committed Blocks\n Iterator<Map.Entry<Integer, Block>> blocks = listBlocks();\n while( blocks.hasNext() ) {\n Block block = blocks.next().getValue();\n\n if (block.getTransaction(transactionId) != null) {\n throw e;\n }\n }\n\n // Also check the current block's transactions\n if (this.currentBlock.getTransaction(transactionId) != null) {\n throw e;\n }\n\n return;\n }"
] | [
"0.5662649",
"0.56463975",
"0.5595031",
"0.5546416",
"0.5475952",
"0.54308575",
"0.53073055",
"0.52944803",
"0.5255848",
"0.5234222",
"0.5224827",
"0.5207989",
"0.5173593",
"0.51548046",
"0.51434135",
"0.51374394",
"0.5104995",
"0.5097255",
"0.5040374",
"0.50379324",
"0.50302094",
"0.5027506",
"0.5017717",
"0.5017221",
"0.50085413",
"0.5004917",
"0.5004869",
"0.4997853",
"0.4992167",
"0.4960286",
"0.49402946",
"0.49346834",
"0.490763",
"0.4901377",
"0.48984483",
"0.4896557",
"0.48808512",
"0.48753452",
"0.4871629",
"0.48614106",
"0.48612314",
"0.48361504",
"0.48310152",
"0.4819534",
"0.48112985",
"0.48064056",
"0.47978947",
"0.47964883",
"0.47737902",
"0.47633272",
"0.47603393",
"0.475105",
"0.47470474",
"0.47441393",
"0.4741249",
"0.4734484",
"0.47343335",
"0.47274506",
"0.47269854",
"0.47222674",
"0.47204822",
"0.47158745",
"0.47140974",
"0.47128338",
"0.470477",
"0.47019517",
"0.46994042",
"0.4698664",
"0.46959403",
"0.46938086",
"0.46936005",
"0.4691667",
"0.469014",
"0.4688885",
"0.46843755",
"0.46820134",
"0.46794784",
"0.46763116",
"0.46704385",
"0.46690702",
"0.4666044",
"0.4652745",
"0.4650629",
"0.46506053",
"0.4649574",
"0.46482894",
"0.46467897",
"0.46436855",
"0.46391445",
"0.46373996",
"0.46334124",
"0.46274197",
"0.46215275",
"0.46205872",
"0.46189982",
"0.46164215",
"0.4613903",
"0.4613825",
"0.46109444",
"0.46083733",
"0.46079132"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public Permission getPermission(int id) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public List<Permission> getAllPermissions() {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int addPermission(Permission perms) {
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int updPermission(Permission perms) {
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public int delPermission(int id) {
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
The string may contain nonbracket characters as well. These strings have balanced brackets: "[LaunchCode]", "Launch[Code]", "[]LaunchCode", "", "[]" While these do not: "[LaunchCode", "Launch]Code[", "[", "][" | @Test
public void nonBracket(){
assertTrue(BalancedBrackets.hasBalancedBrackets(""));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static boolean validBrackets(String s){\n ArrayList<Character> arr = new ArrayList<Character>();\n for(int i = 0; i < s.length(); i++){\n if(s.charAt(i) == '{' || s.charAt(i) == '[' || s.charAt(i) == '('){\n arr.add(s.charAt(i));\n }else if(s.charAt(i) == '}'){\n if(arr.get(arr.size()-1) != '{'){\n return false;\n }\n arr.remove(arr.size()-1);\n }else if(s.charAt(i) == ']'){\n if(arr.get(arr.size()-1) != '['){\n return false;\n }\n arr.remove(arr.size()-1);\n }else if(s.charAt(i) == ')'){\n if(arr.get(arr.size()-1) != '('){\n return false;\n }\n arr.remove(arr.size()-1);\n }\n }\n return arr.isEmpty();\n }",
"public static boolean balancedBrackets(String str) {\n Hashtable < Character, Character > lookUpClosingBracket = new Hashtable < Character, Character > ();\n lookUpClosingBracket.put('{', '}');\n lookUpClosingBracket.put('(', ')');\n lookUpClosingBracket.put('[', ']');\n\n Stack < Character > stack = new Stack < Character > ();\n\n for (int i = 0; i < str.length(); i++) {\n char currentBracket = str.charAt(i);\n\n if (currentBracket == '{' || currentBracket == '(' || currentBracket == '[')\n stack.push(currentBracket);\n else if (currentBracket == '}' || currentBracket == ')' || currentBracket == ']') {\n if (stack.isEmpty())\n return false;\n\n char openingBracket = (Character) stack.pop();\n\n char expectedClosingBracket = lookUpClosingBracket.get(openingBracket);\n\n if (currentBracket != expectedClosingBracket)\n return false;\n }\n\n }\n\n if (!stack.isEmpty())\n return false;\n\n return true;\n }",
"private static boolean balancedBrackets(String str) {\n String openingBrackets = \"({[\";\n String closingBrackets = \")}]\";\n HashMap<Character, Character> matchingBrackets = new HashMap<>();\n matchingBrackets.put(')', '(');\n matchingBrackets.put('}', '{');\n matchingBrackets.put(']', '[');\n Stack<Character> stack = new Stack<>();\n for (int i = 0; i < str.length(); i++) {\n char c = str.charAt(i);\n if (openingBrackets.indexOf(c) != -1) {\n stack.push(c);\n } else if (closingBrackets.indexOf(c) != -1) {\n if (stack.isEmpty()) return false;\n if (stack.pop() != matchingBrackets.get(c)) return false;\n }\n }\n return stack.isEmpty();\n }",
"public boolean parseBracket(String s) {\n return false;\n }",
"private static boolean Question5(String s) {\n\t\t// take a empty stack of characters\n\t\tStack<Character> st = new Stack<Character>();\n\t\t\n\t\t// traverse the input expression\n\t\tfor(int i=0, n = s.length(); i<n ; i++) {\n\t\t\t\n\t\t\tchar curr = s.charAt(i);\n\t\t\t\n\t\t\t// if current char in the expression is a opening brace,\n\t\t\t// push it to the stack\n\t\t\tif(curr == '(' || curr == '{' || curr == '[' ) {\n\t\t\t\tst.push(curr);\n\t\t\t}\t\t\t\n\t\t\telse { // Its } or ) or ]\n\t\t\t\t\n\t\t\t\t// return false if mismatch is found (i.e. if stack is\n\t\t\t\t// empty, the number of opening braces is less than number\n\t\t\t\t// of closing brace, so expression cannot be balanced)\n\t\t\t\tif(st.isEmpty())\n\t\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t\t// pop character from the stack\n\t\t\t\tchar top = st.pop();\n\t\t\t\tif( top == '(' && curr != ')' ||\n\t\t\t\t\ttop == '[' && curr != ']' ||\n\t\t\t\t\ttop == '{' && curr != '}' )\n\t\t\t\t\treturn false;\t\t\t\n\t\t\t}\n\t\t}\n\t\t// expression is balanced only if stack is empty at this point\n\t\treturn st.isEmpty();\n\t}",
"static boolean checkingBalanceBrackets(String brac) {\r\n\t\t\r\n\t\tStack <Character> inputString = new Stack<Character>();\r\n\t\t\r\n\t\tfor(int i=0;i<brac.length();i++) {\r\n\t\t\tchar bracChar = brac.charAt(i);\r\n\t\t\tif(bracChar == '(' || bracChar == '{' || bracChar == '[') {\r\n\t\t\t\tinputString.push(bracChar);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\t\r\n\t\t\tif(inputString.isEmpty()) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//Check if we had inputed closing braces and start check for matching Open braces\r\n\t\t\tchar localChar;\r\n\t\t\tswitch(bracChar) \r\n\t\t\t{\r\n\t\t\t\tcase')' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '{' || localChar == '[') {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\t\r\n\t\t\t\t}\r\n\t\t\t\tcase '}' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '(' || localChar == '[') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\r\n\t\t\t\tcase ']' :\r\n\t\t\t\t{\r\n\t\t\t\t\tlocalChar = inputString.pop();\r\n\t\t\t\t\tif(localChar == '(' || localChar == '{') \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\treturn (inputString.isEmpty());\r\n\t}",
"public static void main(String[] args) {\n String s=\"[()]{}{[()()]()}\";\n char s1[]=s.toCharArray();\n Stack<Character> a=new Stack<>();\n \n for (int i = 0; i < s.length(); i++) {\n \t char x=s.charAt(i);\n// \t if(a.isEmpty()) {\n// \t\t a.push(x);\n// \t }\n \t \n\t\tif(x=='{'||x=='['||x=='('){\n\t\t\ta.push(x);\n\t\t}\n\t\telse if(x=='}'||x==']'||x==')'&& !a.isEmpty()) {\n//\t\t\tif(a.peek()=='}'||a.peek()==']'||a.peek()==')')\n\t\t\ta.pop();\n\t\t}\n\t}\n System.out.println(a.toString());\n if(a.isEmpty()) {\n \t System.out.println(\"balanced\");\n }\n else\n {\n \t System.out.println(\"Unbalanced\"); \t \n }\n\t}",
"public boolean isValid(String s) {\n if (s.isEmpty()) {\n return true;\n }\n\n HashMap<Character, Character> p = new HashMap<>();\n p.put('{', '}');\n p.put('(', ')');\n p.put('[', ']');\n\n Stack<Character> st = new Stack<>();\n\n for (char c : s.toCharArray()) {\n if (p.containsKey(c)) { // open\n st.push(p.get(c)); // lest push closed bracket to the stack\n } else { // close\n // we've got unexpected bracket\n if (st.empty() || !st.pop().equals(c)) {\n return false;\n }\n }\n }\n\n return st.empty();\n }",
"private void skipBrackets(char openingChar, char closingChar) {\r\n int nestedLevel = 0;\r\n int length = sourceCode.length();\r\n char stringType = 0;\r\n do {\r\n char character = sourceCode.charAt(index);\r\n if (stringType != 0) {\r\n // Currently in string skipping mode.\r\n if (character == stringType) {\r\n // Exit string skipping mode.\r\n stringType = 0;\r\n } else if (character == '\\\\') {\r\n // Skip escaped character.\r\n ++index;\r\n }\r\n } else if (character == '/') {\r\n // Skip the comment if there is any.\r\n skipComment();\r\n // skipComment skips to the first character after the comment but\r\n // the index is already incremented by this loop, so decrement it\r\n // to compensate.\r\n --index;\r\n } else if (character == openingChar) {\r\n // Entering brackets.\r\n ++nestedLevel;\r\n } else if (character == closingChar) {\r\n // Exiting brackets.\r\n --nestedLevel;\r\n } else if (character == '\\'' || character == '\"') {\r\n // Enter string skipping mode.\r\n stringType = character;\r\n }\r\n // Keep going until the end of the string or if all brackets are matched.\r\n } while (++index < length && nestedLevel > 0);\r\n }",
"public static boolean isValid(String str) {\n\n if (null == str || \"\".equals(str.trim()))\n return false;\n\n Stack<Character> stack = new Stack();\n\n for (char ch : str.toCharArray()) {\n if (ch == '(' || ch == '[' || ch == '{') {\n stack.push(ch);\n }\n if (ch == ')' || ch == ']' || ch == '}') {\n if (stack.isEmpty()) return false;\n switch (ch) {\n case ')':\n ch = '(';\n break;\n case ']':\n ch = '[';\n break;\n case '}':\n ch = '{';\n break;\n }\n if (stack.peek() != ch) {\n return false;\n } else {\n stack.pop();\n }\n }\n }\n return stack.isEmpty();\n }",
"@Test\n\tpublic void testBracketsWithoutOperators() throws BcException, IOException {\n\t\tString[] params = { \"((5)0)\" };\n\t\tbcApp.run(params, inStream, outStream);\n\t\tfail(\"Should have thrown exception but did not!\");\n\n\t}",
"private static String removeInvalid(String str){\n char[] chrArr = str.toCharArray();\n int val = 0;\n for(int i = 0; i < chrArr.length; i++){\n if(chrArr[i] == '(') val ++;\n else if(chrArr[i] == ')') val --;\n if(val < 0) {\n chrArr[i] = '#';\n val = 0;\n }\n }\n val = 0;\n for(int i = chrArr.length - 1; i >= 0; i--){\n if(chrArr[i] == ')') val ++;\n else if(chrArr[i] == '(') val --;\n if(val < 0){\n chrArr[i] = '#';\n val = 0;\n }\n }\n StringBuilder sb = new StringBuilder();\n for(int i = 0; i < chrArr.length; i++){\n if(chrArr[i] != '#') sb.append(chrArr[i]);\n }\n return sb.toString();\n}",
"public boolean isValidString(String data) { \n String blackList = \"[<>;/@#$%^&+=]\";\n p = Pattern.compile(blackList);\n m = p.matcher(data);\n isValid = m.find(); \n if(isValid)\n \tisValid = containsScriptTag(data);\n return isValid;\n }",
"static boolean areParanthesisBalanced(String str) \r\n\t\t{ \r\n\t\t\t// Using ArrayDeque is faster than using Stack class \r\n\t\t\tDeque<Character> stack = new ArrayDeque<Character>(); \r\n\t\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar ch = str.charAt(i);\r\n\t\t\tif (ch == '[' || ch == '(' || ch == '{') {\r\n\t\t\t\tstack.push(ch);\r\n\t\t\t} else if ((ch == ']' || ch == '}' || ch == ')')\r\n\t\t\t\t\t&& (!stack.isEmpty())) {\r\n\t\t\t\tif (((char) stack.peek() == '(' && ch == ')')\r\n\t\t\t\t\t\t|| ((char) stack.peek() == '{' && ch == '}')\r\n\t\t\t\t\t\t|| ((char) stack.peek() == '[' && ch == ']')) {\r\n\t\t\t\t\tstack.pop();\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ((ch == ']' || ch == '}' || ch == ')')) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\t}\r\n\t\t\treturn (stack.isEmpty());\r\n\t\t\t}",
"public static boolean isBalancedParentheses(String str) {\r\n\t\tStack<Character> stk = new Stack<Character>();\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\t\t\tchar ch = str.charAt(i);\r\n\t\t\tif (ch == '(' || ch == '[') {\r\n\t\t\t\tstk.push(ch);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (ch == ')' || ch == ']') {\r\n\t\t\t\tif (!stk.isEmpty() && (stk.peek() == '(' || stk.peek() == '[')) {\r\n\t\t\t\t\tstk.pop();\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tstk.push(ch);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn stk.isEmpty();\r\n\t}",
"private boolean syntaxOkay(String in){\n\t\tint numOpenBraces = 0;\n\t\tint numCloseBraces = 0;\n\t\tint countQuote = 0;\n\t\tfor(int i = 0; i < in.length(); i++){\n\t\t\tchar currentChar = in.charAt(i);\n\t\t\tif(currentChar == '{'){\n\t\t\t\tint open = i;\n\t\t\t\tnumOpenBraces++;\n\t\t\t}else if(currentChar == '}'){\n\t\t\t\tint close = i;\n\t\t\t\tnumCloseBraces++;\n\t\t\t}else if(currentChar == '\"'){\n\t\t\t\tcountQuote++;\n\t\t\t}\n\t\t}\n\t\treturn numOpenBraces == numCloseBraces && countQuote % 2 == 0;\n\t}",
"private boolean isValidString(String str){\r\n\t\tString allowedChars=\"! \\\" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\\\ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~\";\r\n\t\tfor(int i=0;i<str.split(\"\").length;i++){\r\n\t\t\tif(allowedChars.indexOf(str.split(\"\")[i]) == -1){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"default Boolean validateInput(String input){\n if (input.contains(\"(\") || input.contains(\")\") || input.contains(\"[\") || input.contains(\"}\") || input.contains(\"{\") || input.contains(\"}\") )\n {\n return true;\n }else{\n return false;\n }\n }",
"public static boolean validateCharacters(String s) {\n if(s.length() % 2 != 0) {\n return false;\n }\n Stack<Character> stack = new Stack();\n for(char c : s.toCharArray()) {\n if(c == '(' || c == '[' || c == '{') {\n stack.push(c);\n } else if (c == ')' && !stack.isEmpty() && stack.peek() == '(') {\n stack.pop();\n } else if (c == ']' && !stack.isEmpty() && stack.peek() == '[') {\n stack.pop();\n } else if (c == '}' && !stack.isEmpty() && stack.peek() == '{') {\n stack.pop();\n } else {\n return false;\n }\n }\n\n return stack.isEmpty();\n }",
"public boolean isValid(String s) {\n Stack<Character> st = new Stack<>();\n for (int i = 0; i < s.length(); i++) {\n char input = s.charAt(i);\n if (input == '(' || input == '[' || input == '{') {\n st.push(input);\n } else {\n if (!st.isEmpty()) {\n char bracket = st.pop();\n switch (bracket) {\n case '[':\n if (input != ']') {\n return false;\n }\n break;\n case '(':\n if (input != ')') {\n return false;\n }\n break;\n default:\n if (input != '}') {\n return false;\n }\n\n }\n } else {\n return false;\n }\n }\n }\n return st.isEmpty();\n }",
"public static void main(String[] args) {\n\t\tString s = \"((({}{}[])))\";\n\t\tValidBrackets vb = new ValidBrackets();\n\t\tSystem.out.println(vb.isValid(s));\n\t\t\n\t}",
"public boolean isValid(String s) {\n if (s.charAt(0) == ')' || s.charAt(0) == ']' || s.charAt(0) == '}') {\n return false;\n }\n Stack<Character> stack = new Stack<>();\n for (char c : s.toCharArray()) {\n switch (c) {\n case '(':\n case '[':\n case '{':\n stack.push(c);\n break;\n case ')':\n if (stack.isEmpty() || stack.pop() != '(') {\n return false;\n }\n break;\n case '}':\n if (stack.isEmpty() || stack.pop() != '{') {\n return false;\n }\n break;\n case ']':\n if (stack.isEmpty() || stack.pop() != '[') {\n return false;\n }\n break;\n }\n }\n return stack.isEmpty();\n }",
"public static String isMatching(String str){\n\t\tint l=str.length();\n\t\tSolution obj = new Solution();\n\t\tfor(int i=0;i<l;i++){\n\t\t\tchar temp = str.charAt(i);\n\t\t\tif(temp=='{' || temp=='[' || temp=='('){\n\t\t\t\tobj.push(temp);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tchar top=obj.peek();\n\t\t\t\tif((top=='{' && temp=='}') || (top=='(' && temp==')') ||(top=='[' && temp==']'))\n\t\t\t\t\tobj.pop();\n\t\t\t\telse\n\t\t\t\t\treturn \"NO\";\n\t\t\t}\n\t\t}\n\t\tif(obj.isEmpty()){\n\t\t\treturn \"YES\";\n\t\t}\n\t\telse{\n\t\t\treturn \"NO\";\n\t\t}\n\t}",
"public boolean isValid(String s) {\n\n if (s.length() % 2 != 0){\n return false;\n }\n\n HashMap<String, String> map = new HashMap<>();\n Stack st = new Stack();\n\n map.put(\"(\", \")\");\n map.put(\"{\", \"}\");\n map.put(\"[\", \"]\");\n\n for (int i = 0; i < s.length(); i++){\n String cur = String.valueOf(s.charAt(i));\n if (st.empty() && !map.containsKey(cur)){\n return false;\n }\n if (map.containsKey(cur)){\n st.push(cur);\n }\n else{\n String popElement = (String) st.pop();\n String expect = map.get(popElement);\n if (!expect.equals(cur)){\n return false;\n }\n }\n }\n return true ? st.empty() : false;\n }",
"public boolean isValid_(String s) {\n\n if (s.length() % 2 != 0){\n return false;\n }\n\n Stack st = new Stack();\n\n for (int i = 0; i < s.length(); i++){\n\n String cur = String.valueOf(s.charAt(i));\n\n if (cur.equals(\"(\")){\n st.push(\")\");\n continue;\n }\n else if (cur.equals(\"{\")){\n st.push(\"}\");\n continue;\n }\n else if (cur.equals(\"[\")){\n st.push(\"]\");\n continue;\n }\n else{\n if (st.empty()){\n return false;\n }else{\n String _cur = (String) st.pop();\n if (!_cur.equals(cur)){\n return false;\n }\n }\n }\n\n }\n return true ? st.empty() : false;\n }",
"private static final int skipBrackets(StringBuffer b) {\n\t\tint len1 = b.length()-1;\n\t\tint ini1 = 0;\n\t\tif (len1 <= 0) return(0);\n\t\twhile ((b.charAt(ini1) == '(') && (b.charAt(len1) == ')')) {\n\t\t\twhile (b.charAt(--len1) == ' ');\n\t\t\twhile (b.charAt(++ini1) == ' ');\n\t\t\tb.setLength(++len1);\n\t\t}\n\t\treturn(ini1);\n\t}",
"public boolean isValid(String s) {\n \tif (s == null || s.length() == 0) {\n \t\treturn false;\n \t}\n \t\n \tStack<Character> st = new Stack<Character>();\n \tst.push(s.charAt(0));\n \tfor (int i = 1; i < s.length(); ++i) {\n \t\tif (st.empty()) {\n \t\t\tst.push(s.charAt(i));\n \t\t\tcontinue;\n \t\t}\n \t\tchar c = st.peek();\n \t\tif (c == '{') {\n\t\t\t\tif (s.charAt(i) == '}') {\n\t\t\t\t\tst.pop();\n\t\t\t\t} else {\n\t\t\t\t\tst.push(s.charAt(i));\n\t\t\t\t}\n \t\t} else if (c == '(') {\n \t\t\tif (s.charAt(i) == ')') {\n \t\t\t\tst.pop();\n \t\t\t} else {\n \t\t\t\tst.push(s.charAt(i));\n \t\t\t}\n \t\t} else if (c == '[') {\n \t\t\tif (s.charAt(i) == ']') {\n \t\t\t\tst.pop();\n \t\t\t} else {\n \t\t\t\tst.push(s.charAt(i));\n \t\t\t}\n \t\t} else {\n \t\t\tst.push(s.charAt(i));\n \t\t}\n \t}\n \t\n \treturn st.size() == 0;\n }",
"private static String fixBrackets(String reg) {\n while (reg.contains(\"()*\"))\n reg = removeChars(reg, reg.indexOf(\"()*\"), \"()*\".length());\n\n int i = reg.indexOf(\"(\");\n do {\n if (reg.charAt(i) == '(') {\n int j = 1;\n boolean leave = false;\n boolean removeBracket = true;\n do {\n if (reg.charAt(i + j) == '(') {\n bracketStack.push(i);\n bracketRemove.push(removeBracket);\n i = i + j;\n j = 1;\n removeBracket = true;\n } else if (reg.charAt(i + j) == ')') {\n if (removeBracket) {\n if (j == 2 && reg.contains(String.valueOf(QUOTE)))\n leave = false;\n else if (j > 2 && i + j + 1 < reg.length()\n && reg.charAt(i + j + 1) == '*') {\n i = i + j + 1;\n leave = true;\n }\n if (!leave) {\n reg = removeChars(reg, i + j, 1);\n reg = removeChars(reg, i, 1);\n if (bracketStack.size() > 0) {\n i = bracketStack.pop();\n removeBracket = bracketRemove.pop();\n j = 1;\n } else\n leave = true;\n }\n } else {\n if (bracketStack.size() > 0) {\n j = i + j + 1;\n i = bracketStack.pop();\n j = j - i;\n removeBracket = bracketRemove.pop();\n } else {\n i = i + j;\n leave = true;\n }\n }\n } else if (reg.charAt(i + j) == '|' && reg.charAt(i + j - 1) != QUOTE) {\n removeBracket = false;\n j++;\n } else\n j++;\n } while (!leave);\n }\n i++;\n } while (i < reg.length());\n\n return reg;\n }",
"private static String validateBinaryStr(String binStr) throws UnsignedBigIntUtilsException {\n String tmpStr = RegExp.replaceAll(\"[ \\\\|\\\\t\\\\n]+\", binStr, \"\");\n tmpStr = RegExp.replaceFirst(\"0b\", tmpStr, \"\");\n if (tmpStr.matches(\"[0-1]+\") == false) {\n String msg = \"ERROR: Invalid BINARY characters in input => \" + tmpStr + \"\\n\";\n throw new UnsignedBigIntUtilsException(msg);\n }\n return (tmpStr);\n }",
"public boolean balancedparantheses(String exp) {\n\t\tStack<Character> stack = new Stack<Character>();\n\t\tfor (int i = 0; i < exp.length(); i++) {\n\t\t\tchar charValue = exp.charAt(i);\n\t\t\tif (charValue == '[' || charValue == '(' || charValue == '{') {\n\t\t\t\tstack.push(charValue);\n\t\t\t} else if (charValue == ']') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '[') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (charValue == ')') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '(') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else if (charValue == '}') {\n\t\t\t\tif (stack.isEmpty()) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (stack.pop() != '{') {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn stack.isEmpty();\n\t}",
"String removeBrackets( String reference ) {\n return new String( reference.replace(\"[\", \"\").replace(\"]\", \"\").trim() );\n }",
"@Test\r\n public void test() {\r\n assertEquals(Arrays.asList(\"()()()\", \"(())()\"), removeInvalidParentheses(\"()())()\"));\r\n assertEquals(Arrays.asList(\"(a)()()\", \"(a())()\"), removeInvalidParentheses(\"(a)())()\"));\r\n assertEquals(Arrays.asList(\"\"), removeInvalidParentheses(\")(\"));\r\n }",
"public static boolean isValidSymbolPattern(String s) throws Exception{\n Stack<Character> stack = new Stack<Character>();\n if(s == null || s.length() == 0){\n return true;\n }\n for(int i = 0; i < s.length(); i++){\n if(s.charAt(i) == ')'){\n if(!stack.isEmpty() && stack.peek() == '('){\n stack.pop();\n }else{\n return false;\n }\n }else if(s.charAt(i) == ']'){\n if(!stack.isEmpty() && stack.peek() == '['){\n stack.pop();\n }else{\n return false;\n }\n }else if(s.charAt(i) == '}'){\n if(!stack.isEmpty() && stack.peek() == '{'){\n stack.pop();\n }else{\n return false;\n }\n }else{\n stack.push(s.charAt(i));\n }\n }\n if(stack.isEmpty()){\n return true;\n }else{\n return false;\n }\n }",
"public static boolean isBalanced(String str) {\n int count = 0;\n\n for (int i = 0; i < str.length() && count >= 0; i++) {\n if (str.charAt(i) == '(')\n count++;\n else if (str.charAt(i) == ')')\n count--;\n }\n\n return count == 0;\n}",
"private boolean parseOpeningBracket() {\n if (index < end && source.charAt(index) == '[') {\n index++;\n return true;\n }\n return false;\n }",
"protected String escapeBrackets(String input) {\n\t\tString replacement = \"\\\\\\\\[{group1}\\\\\\\\]\";\n\t\treturn RegexUtil.loopRegex(input, doubleBrackets, replacement);\n\t}",
"@Test(timeout = 4000)\n public void test098() throws Throwable {\n String string0 = \"{3&b()u=\\\"9(/N;Cfw?\";\n JSONTokener jSONTokener0 = new JSONTokener(\"{3&b()u=\\\"9(/N;Cfw?\");\n JSONObject jSONObject0 = null;\n try {\n jSONObject0 = new JSONObject(jSONTokener0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Unterminated string at character 18 of {3&b()u=\\\"9(/N;Cfw?\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }",
"private void SolveCondition() {\n Pattern pt = Pattern.compile(\"(?<!\\\")\\\\[(.*?)\\\\](?<!\\\")\");\n //another greedy matching will be \\[([^}]+)\\]\n Matcher ma = pt.matcher(Input);\n while(ma.find()) {\n if(ma.groupCount()>0){\n System.out.println(ma.group(1));\n }\n }\n\n }",
"public static boolean isValid(String s) {\n Deque<Character> stack = new LinkedList<>();\n if (s == null || s.length() == 0) return true;\n for (char c : s.toCharArray()) {\n if (c == '(' || c == '{' || c == '[') {\n stack.push(c);\n continue;\n }\n if (stack.isEmpty()) {\n return false;\n }\n if (c == ')' && stack.pop() != '(') {\n return false;\n } else if (c == '}' && stack.pop() != '{') {\n return false;\n } else if (c == ']' && stack.pop() != '[') {\n return false;\n }\n }\n return stack.size() == 0;\n }",
"@Test\n public void testRegexWithNonEscapedCurlyBraces() throws Exception {\n final String html = \"<html><head><title>foo</title><script>\\n\"\n + \" function test() {\\n\"\n + \" var regexp = /(^|{)#([^}]+)(}|$)/;\\n\"\n + \" var str = '|{#abcd}|';\\n\"\n + \" alert(str.match(regexp))\\n\"\n + \" }\\n\"\n + \"</script></head><body onload='test()'>\\n\"\n + \"</body></html>\";\n \n final String[] expectedAlerts = {\"{#abcd},{,abcd,}\"};\n final List<String> collectedAlerts = new ArrayList<String>();\n createTestPageForRealBrowserIfNeeded(html, expectedAlerts);\n loadPage(html, collectedAlerts);\n assertEquals(expectedAlerts, collectedAlerts);\n }",
"public boolean checkValidString(String s) {\n int cmin = 0;\n int cmax = 0;\n for (char c: s.toCharArray()) {\n if (c == '(') {\n cmax++;\n cmin++;\n } else if (c == ')') {\n cmax--;\n cmin = Math.max(cmin - 1, 0);\n } else {\n cmax++;\n cmin = Math.max(cmin - 1, 0);\n }\n if (cmax < 0) return false;\n }\n return cmin == 0;\n }",
"@Test\n public void testWithNonEmptyJsonArrayAsString() throws org.nfunk.jep.ParseException\n {\n Stack<Object> parameters = CollectionsUtils.newParametersStack(\"[\\\"test\\\"]\");\n function.run(parameters);\n assertEquals(FALSE, parameters.pop());\n }",
"private static boolean checkValue(String rawValue) {\n\t\trawValue = rawValue.trim();\n\t\tif (!rawValue.startsWith(\"\\\"\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!rawValue.endsWith(\"\\\"\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}",
"public static String chopBraces(String s) {\n\t\tif(s.startsWith(STRSQBRACKETSTART) && s.endsWith(STRSQBRACKETEND))\n\t\t\treturn s.substring(1,s.length()-1);\n//\t\tboolean changed;\n//\t\tdo {\n//\t\t\tchanged=true;\n//\t\t\tif(s.startsWith(STRSQBRACKETSTART)) s=s.substring(1);\n//\t\t\telse if(s.startsWith(STRCURLYSTART)) s=s.substring(1);\n//\t\t\telse if(s.startsWith(STRLT)) s=s.substring(1);\n//\t\t\telse if(s.endsWith(STRSQBRACKETEND)) s=s.substring(0,s.length()-1);\n//\t\t\telse if(s.endsWith(STRCURLYEND)) s=s.substring(0,s.length()-1);\n//\t\t\telse if(s.endsWith(STRGT)) s=s.substring(0,s.length()-1);\n//\t\t\telse changed=false;\n//\t\t} while(changed);\n\t\t\n\t\treturn s;\n//\t\t\n//\t\tif(s==null || (s.indexOf('[')<0 && s.indexOf('{')<0)) return s;\n//\t\treturn s.substring(1,s.length()-1);\t\t\n\t}",
"private boolean isPair(StringBuilder input) {\n\t\tboolean isPair = false;\n\t\tStack<String> balancedStack = new Stack<String>();\n\t\t\n\t\tfor(int i = 0; i < input.length(); i++)\n\t\t{\n\t\t\tif(input.charAt(i) =='(')\n\t\t\t{\n\t\t\t\tchar tempVal = input.charAt(i);\n\t\t\t\tbalancedStack.push(Character.toString(tempVal));\n\t\t\t}\n\t\t\telse if(input.charAt(i) ==')')\n\t\t\t{\n\t\t\t\tbalancedStack.pop();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(balancedStack.empty() == true)\n\t\t{\n\t\t\tisPair = true;\n\t\t}\n\t\t\n\t\treturn isPair;\n\t}",
"public boolean FromString(String string) {\n if (string.length() >= 38 && string.charAt(0) == '{' && string.charAt(37) == '}') {\n string = string.substring(1, 37);\n } else if (string.length() > 36) {\n string = string.substring(0, 36);\n }\n if (string.length() == 36) {\n string = string.substring(0, 36).replaceAll(\"-\", \"\");\n }\n if (string.length() != 32) {\n string = string.substring(0, 32);\n }\n data = new byte[16];\n for (int i = 0; i < 16; ++i) {\n data[i] = (byte) Integer.parseInt(string.substring(i * 2, (i * 2) + 2), 16);\n }\n return true;\n }",
"public Nawiasy(String str) {\r\n super(str);\r\n openBracket = str.equals(\"(\");\r\n }",
"public static void main(String[] args) {\n String s=\"[()]{}{[()()]()}\";\n \n System.out.println(isBalanced(s));\n String s1=\"[(])\";\n System.out.println(isBalanced(s1));\n \n \n }",
"void parseQrCode(String qrCodeData);",
"public static boolean isBalanced(String exp) {\n\t\tStack<Character> stack = new Stack<>(exp.length());\n\t\tfor (int i = 0; i < exp.length(); i++) {\n\t\t\tchar ch = exp.charAt(i);\n\t\t\tswitch (ch) {\n\t\t\tcase '(':\n\t\t\tcase '{':\n\t\t\tcase '[':\n\t\t\t\tstack.push(ch);\n\t\t\t\tbreak;\n\t\t\tcase ')': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '(')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase '}': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '{')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ']': {\n\t\t\t\tchar ch1 = stack.pop();\n\t\t\t\tif (ch1 != '[')\n\t\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\treturn stack.isEmpty();\n\t}",
"@Test\n\tvoid testMinimumRemoveToMakeValidParentheses() {\n\t\tMinimumRemoveToMakeValidParentheses tester = new MinimumRemoveToMakeValidParentheses();\n\t\tassertEquals(\"lee(t(c)o)de\", tester.minRemoveToMakeValid(\"lee(t(c)o)de)\"));\n\t\tassertEquals(\"ab(c)d\", tester.minRemoveToMakeValid(\"a)b(c)d\"));\n\t\tassertEquals(\"\", tester.minRemoveToMakeValid(\"))((\"));\n\t\tassertEquals(\"a(b(c)d)\", tester.minRemoveToMakeValid(\"(a(b(c)d)\"));\n\t\tassertEquals(\"\", tester.minRemoveToMakeValid(\"\"));\n\t}",
"public boolean validCheck(String input) {\n\n int open= 0, closed = 0; //To count number of open and closed brackets\n\n if (input.length() >= 3 && input.length() <= 20) {\n inputArray = input.toCharArray(); //Convert the string to a Char Array\n\n if(!Character.isDigit(inputArray[0])) //If the first character isn't a number, it's not valid e.g +3*6\n return false;\n\n for (int i = 0; i < inputArray.length; i++) {\n\n if(inputArray[i] == '(') //if open bracket increment the open value..\n open +=1;\n if(inputArray[i] == ')') //same but with closed bracket\n closed+=1;\n\n if(i+1 < inputArray.length){ //to avoid array index out of bounds exception\n if (Character.isDigit(inputArray[i]) && Character.isDigit(inputArray[i + 1])) { //This makes sure no double digits\n return false;\n } else if ((validOperator(inputArray[i])) && (validOperator(inputArray[i + 1]) && inputArray[i+1] != '(')){ //no 2 operators in a row BUT ok if operator and open bracket\n if(inputArray[i] != ')'){ //To allow operand after a closed bracket e.g (3+1)+2\n return false;\n }\n\n }\n }\n if (!Character.isDigit(inputArray[i]) && !validOperator(inputArray[i])) { //not a number AND not a valid operator\n return false;\n }\n }\n\n if(open!= closed){ //Make sure the all open brackets are closed\n return false;\n }\n return true;\n\n }\n\n return false;\n }",
"protected String replaceAngleBrackets(String inString)\n {\n\tStringBuffer outString = new StringBuffer(inString.length());\n\tint p1 = 0; \n\tint p2 = 0;\n\tp1 = inString.indexOf(\"<\");\n\twhile (p1 >= 0)\n\t {\n outString.append(inString.substring(p2,p1));\n\t outString.append(\"<\");\n\t p2 = p1 + 1;\n \t p1 = inString.indexOf(\"<\",p2);\n\t }\n if (p2 < inString.length())\n outString.append(inString.substring(p2));\n\treturn outString.toString();\n\t}",
"private String cleanString(String data){\n Pattern ptn = Pattern.compile(\"//.*\");\n Matcher mc = ptn.matcher(data);\n while(mc.find())data = data.replace(mc.group(),\"\");\n ptn = Pattern.compile(\"/\\\\*(.|\\n)*?\\\\*/\");\n mc = ptn.matcher(data);\n while(mc.find()) data = data.replace(mc.group(),\"\");\n return data.trim();\n }",
"public boolean checkRedundancy(String str) {\n Stack<Character> stack = new Stack<>();\n for(char ch : str.toCharArray()) {\n if(ch == ')') {\n if(stack.isEmpty()) return false;\n if(stack.peek() == '(') return true;\n int elementInside = 0;\n while(stack.pop() != '(') {\n elementInside++;\n stack.pop();\n }\n stack.pop();\n if(elementInside < 2) {\n return false;\n }\n\n }else{\n stack.push(ch);\n }\n }\n return true;\n }",
"static private String removeSpesificationPart(String S) {\n if (S.endsWith(\"]\")) {\n int pos = S.lastIndexOf(\"[\");\n if (pos != -1) {\n return S.substring(0, pos);\n }\n }\n return S;\n }",
"private void emptyBracket() {\n\n\t\twhile (!stack.peek().matches(\"[(]\")) {\n\t\t\tqueue.add(stack.pop());\n\t\t}\n\t\t// Remove opening bracket from the stack.\n\t\tstack.pop();\n\t}",
"@Test\n\tvoid testDecodeString() {\n\t\tassertEquals(\"aaabcbc\", new DecodeString().decodeString(\"3[a]2[bc]\"));\n\t\tassertEquals(\"accaccacc\", new DecodeString().decodeString(\"3[a2[c]]\"));\n\t\tassertEquals(\"abcabccdcdcdef\", new DecodeString().decodeString(\"2[abc]3[cd]ef\"));\n\t\tassertEquals(\"absabcabccdcdcdef\", new DecodeString().decodeString(\"abs2[abc]3[cd]ef\"));\n\t\tassertEquals(\"f\", new DecodeString().decodeString(\"f\"));\n\t\tassertEquals(\"\", new DecodeString().decodeString(\"\"));\n\t\tassertEquals(\"abababababababababababab\", new DecodeString().decodeString(\"12[ab]\"));\n\t}",
"private boolean m29108b(String str) {\n if (str != null) {\n if (str.endsWith(\"\\n\")) {\n str = str.substring(0, str.length() - 1);\n }\n return 24 == str.length() && !this.f22553a.matcher(str).find();\n }\n }",
"public static void main(String[] args) {\n\n String test1 = \"{}\";\n System.out.println(isValid(test1));\n\n String test2 = \"{}[]()[({})]\";\n System.out.println(isValid(test2));\n\n String test3 = \"{{{]]]\";\n System.out.println(!isValid(test3));\n }",
"private boolean isValidBarcode(String barcode) {\n if (barcode.length() != isbnBarcodeLength) {\n return false;\n }\n final char[] barcodeChars = barcode.toCharArray();\n for (char i : barcodeChars) {\n if (i < isbnBarcodeValidStart || i > isbnBarcodeValidEnd) {\n return false;\n }\n }\n return true;\n }",
"public static boolean isBalanced(String expression) {\n if ((expression.length() % 2) == 1) return false;\n else {\n char[] brackets = expression.toCharArray();\n LinkedList<Character> cList = new LinkedList<>();\n for (char bracket : brackets) {\n switch (bracket) {\n case '{':\n cList.addFirst('}');\n break;\n case '(':\n cList.addFirst(')');\n break;\n case '[':\n cList.addFirst(']');\n break;\n default:\n if (cList.isEmpty() || bracket != cList.removeFirst()) return false;\n }\n }\n return cList.isEmpty();\n }\n }",
"private String removeOuterBrackets(String expr) {\r\n int openPos = expr.indexOf(BRACKET_OPEN);\r\n if (openPos == -1) {\r\n throw new IllegalArgumentException(\"No opening bracket\");\r\n }\r\n \r\n int closePos = expr.lastIndexOf(BRACKET_CLOSE);\r\n if (closePos == -1) {\r\n throw new IllegalArgumentException(\"No closing bracket\");\r\n }\r\n \r\n String before = expr.substring(0, openPos);\r\n String middle = expr.substring(openPos + 1, closePos);\r\n String after = expr.substring(closePos + 1, expr.length());\r\n \r\n return before + middle + after;\r\n }",
"@Test\r\n\t\tpublic void testParseNoWhitespace() {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tdriver.findElement(By.id(\"code_code\")).sendKeys(\"a = 5\\nb = 6\\nc = a + (b * 4)\");;\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tWebElement submitButton = driver.findElement(By.xpath(\"(//input[@name='commit'])[2]\"));\r\n\t\t\tsubmitButton.click();\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tWebElement e = driver.findElement(By.tagName(\"code\"));\r\n\t\t\t\tString elementText = e.getText();\r\n\t\t\t\tassertFalse(elementText.contains(\":on_sp\") || elementText.contains(\":op_nl\"));\r\n\t\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\t\tfail();\r\n\t\t\t}\r\n\t\t}",
"public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\r\n\t\twhile(sc.hasNext()){\r\n\t\t\tString str = sc.nextLine();\r\n\t\t\tStack<String> digit = new Stack<>();\r\n\t\t\tStringBuffer buffer = new StringBuffer();\r\n\t\t\tchar ch;\r\n\t\t\tboolean isHasOperator = false;\r\n\t\t\tboolean isLegal = true;\r\n\t\t\tint len = str.length();\r\n\t\t\tint i = 0;\r\n\t\t\twhile(i<len){\r\n\t\t\t\tch = str.charAt(i);\r\n\t\t\t\tswitch (ch) {\r\n\t\t\t\tcase '[':\r\n\t\t\t\tcase '{':\r\n\t\t\t\tcase '(':\r\n\t\t\t\tcase '+':\r\n\t\t\t\tcase '-':\r\n\t\t\t\tcase '*':\r\n\t\t\t\tcase '/':\r\n\t\t\t\t\tdigit.push(ch+\"\");\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase ']':\r\n\t\t\t\tcase '}':\r\n\t\t\t\tcase ')':\r\n\t\t\t\t\tString second = null;\r\n\t\t\t\t\twhile(digit.size()>1){\r\n\t\t\t\t\t\t//!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")\r\n\t\t\t\t\t\tif(!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")&&!digit.peek().equals(\")\")\r\n\t\t\t\t\t\t\t\t&&!digit.peek().equals(\"]\")&&!digit.peek().equals(\"}\")&&!digit.peek().equals(\"+\")&&!digit.peek().equals(\"-\")&&!digit.peek().equals(\"*\")&&!digit.peek().equals(\"/\")){\r\n\t\t\t\t\t\t\tsecond = digit.pop();\r\n\t\t\t\t\t\t\tif (digit.size()>0&&(digit.peek().equals(\"+\")||digit.peek().equals(\"-\")||digit.peek().equals(\"*\")||digit.peek().equals(\"/\"))) {\r\n\t\t\t\t\t\t\t\tisHasOperator = true;\r\n\t\t\t\t\t\t\t\tdigit.pop();\r\n\t\t\t\t\t\t\t\tif (digit.size()>0) {\r\n\t\t\t\t\t\t\t\t\tsecond = digit.pop();\r\n\t\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\t\tisLegal = false;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tisLegal = false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tString first = digit.pop();\r\n\t\t\t\t\t\tif (digit.size()>0&&!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")) {\r\n\t\t\t\t\t\t\tif (digit.peek().equals(\"+\")||digit.peek().equals(\"-\")||digit.peek().equals(\"*\")||digit.peek().equals(\"/\")) {\r\n\t\t\t\t\t\t\t\tisHasOperator = true;\r\n\t\t\t\t\t\t\t\tdigit.pop();\r\n\t\t\t\t\t\t\t\tif (isHasOperator&&!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")&&!digit.peek().equals(\")\")\r\n\t\t\t\t\t\t\t\t\t\t&&!digit.peek().equals(\"]\")&&!digit.peek().equals(\"}\")&&!digit.peek().equals(\"+\")&&!digit.peek().equals(\"-\")&&!digit.peek().equals(\"*\")&&!digit.peek().equals(\"/\")) {\r\n\t\t\t\t\t\t\t\t\tsecond = digit.pop();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (second==null) {\r\n\t\t\t\t\t\tisLegal = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdigit.pop();\r\n\t\t\t\t\t\tdigit.push(second);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbuffer.append(ch);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\twhile(i<len&&ch!='+'&&ch!='-'&&ch!='*'&&ch!='/'&&ch!='['&&ch!='{'&&ch!='('&&ch!=')'&&ch!=']'&&ch!='}'){\r\n\t\t\t\t\t\tch = str.charAt(i);\r\n\t\t\t\t\t\tbuffer.append(ch);\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdigit.push(buffer.toString());\r\n\t\t\t\t\tbuffer.setLength(0);\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (!isLegal) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (digit.size()==1&&!digit.peek().equals(\"{\")&&!digit.peek().equals(\"[\")&&!digit.peek().equals(\"(\")) {\r\n\t\t\t\t\r\n\t\t\t}else {\r\n\t\t\t\tisLegal = false;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(isLegal);\r\n\t\t}\r\n\t}",
"@Test\n void shouldRenderValidTags() throws Exception {\n MatcherAssert.assertThat(\n new Variable(\n new SquareIndicate()\n ).render(\n \"[[ aA0._ ]] \",\n new MapOf<>(\"aA0._\", \"XX\")\n ),\n Matchers.is(\"XX \")\n );\n }",
"@Test\n public void shouldGiveSingleElementArrayOnNoColonString() {\n String decodeString = \"QnVybWEh\";\n assertThat(\"Only one element is present\", BasicAuth.decode(decodeString), is(arrayWithSize(1)));\n assertThat(\"Input string is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"Burma!\")));\n }",
"private static boolean isStartTag(String line) {\n final char c = line.charAt(line.length() - 2);\n return brackets(line) && line.charAt(1) != '/' && (c != '/' && c != '?');\n }",
"private static boolean m66068b(String str) {\n for (int i = 0; i < str.length(); i++) {\n char charAt = str.charAt(i);\n if (charAt <= 31 || charAt >= 127 || \" #%/:?@[\\\\]\".indexOf(charAt) != -1) {\n return true;\n }\n }\n return false;\n }",
"public Object[] invalidParams() {\n\t\treturn new Object[] {\n\t\t\t// backslash\n\t\t\tnew Object[] {\"abc\\\\\", \"missing character after '\\\\'\"},\n\t\t\t// \\Q...\\E\n\t\t\tnew Object[] {\"a\\\\\\\\Q\\\\E\", \"missing '\\\\Q' before '\\\\E'\"},\n\t\t\tnew Object[] {\"\\\\Qab\\\\Q*\\\\E*\\\\E\", \"missing '\\\\Q' before '\\\\E'\"},\n\t\t\t// octal and hexadecimal escapes\n\t\t\tnew Object[] {\"\\\\0\", \"invalid octal value\"},\n\t\t\tnew Object[] {\"\\\\0a\", \"invalid octal value\"},\n\t\t\tnew Object[] {\"\\\\0\\\\\", \"invalid octal value\"},\n\t\t\tnew Object[] {\"\\\\08\", \"invalid octal value\"},\n\t\t\tnew Object[] {\"\\\\xfg\", \"invalid hexadecimal value\"},\n\t\t\tnew Object[] {\"\\\\ufffg\", \"invalid hexadecimal value\"},\n\t\t\tnew Object[] {\"\\\\u\\\\1111\", \"invalid hexadecimal value\"},\n\t\t\tnew Object[] {\"\\\\x{}\", \"invalid hexadecimal value\"},\n\t\t\tnew Object[] {\"\\\\x{g}\", \"invalid hexadecimal value\"},\n\t\t\tnew Object[] {\"\\\\x{10ffffg}\", \"invalid hexadecimal value\"},\n\t\t\tnew Object[] {\"\\\\x{10ffff\", \"missing '}' after hexadecimal value\"},\n\t\t\t// control characters\n\t\t\tnew Object[] {\"\\\\c\", \"missing control character\"},\n\t\t\tnew Object[] {\"\\\\c0\", \"invalid control character\"},\n\t\t\tnew Object[] {\"\\\\c\\\\0010\", \"invalid control character\"},\n\t\t\tnew Object[] {\"\\\\c\\\\0101\", \"invalid control character\"},\n\t\t\tnew Object[] {\"\\\\c@\", \"invalid control character\"},\n\t\t\tnew Object[] {\"\\\\c[\", \"invalid control character\"},\n\t\t\tnew Object[] {\"\\\\c`\", \"invalid control character\"},\n\t\t\tnew Object[] {\"\\\\c{\", \"invalid control character\"},\n\t\t\t// character classes\n\t\t\tnew Object[] {\"\\\\[[abc\\\\]\\\\)}\", \"character class not closed\"},\n\t\t\tnew Object[] {\"[abc\\\\Q]\\\\E\\\\[[x])}\", \"character class not closed\"},\n\t\t\tnew Object[] {\"[]\", \"character class not closed\"},\n\t\t\tnew Object[] {\"asdf[\", \"character class not closed\"},\n\t\t\tnew Object[] {\"[^]\", \"character class not closed\"}\n\t\t};\n\t}",
"private static boolean checkParanthesesIfBalanced(String input) throws Exception {\r\n\t\tStack<Character> stack = new Stack<>();\r\n\t\tchar[] charArray = input.toCharArray();\r\n\t\tfor (char c : charArray) {\r\n\t\t\tif (checkIfCharIsOpenParantheses(c)) {\r\n\t\t\t\tstack.push(c);\r\n\t\t\t} else {\r\n\t\t\t\tif (stack.isEmpty()) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t} else if (!isMatchingPair(stack.pop(), c)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn stack.isEmpty();\r\n\t}",
"public boolean isValidSerialization(String preorder) {\n Stack<String> stack = new Stack<>();\n String[] arr = preorder.split(\",\");\n for (String str : arr) {\n stack.push(str);\n\n while(stack.size() >= 3 &&\n stack.get(stack.size() - 1).equals(\"#\") &&\n stack.get(stack.size() - 2).equals(\"#\") &&\n !stack.get(stack.size() - 3).equals(\"#\")) {\n stack.pop();\n stack.pop();\n stack.pop();\n stack.push(\"#\");\n }\n }\n return stack.size() == 1 && stack.peek().equals(\"#\");\n }",
"protected String[] arrayParser(String item){\n return item.replaceAll(\"\\\\{|\\\\}|\\\\[|\\\\]|(\\\\d+\\\":)|\\\"|\\\\\\\\\", \"\").split(\",\");\n }",
"static boolean isMatchingPair(char character1, char character2) \n { \n if (character1 == '(' && character2 == ')') \n return true; \n else if (character1 == '{' && character2 == '}') \n return true; \n else if (character1 == '[' && character2 == ']') \n return true; \n else\n return false; \n }",
"String remEscapes(String str){\n StringBuilder retval = new StringBuilder();\n\n // remove leading/trailing \" or '\r\n int start = 1, end = str.length() - 1;\n\n if ((str.startsWith(SQ3) && str.endsWith(SQ3)) ||\n (str.startsWith(SSQ3) && str.endsWith(SSQ3))){\n // remove leading/trailing \"\"\" or '''\r\n start = 3;\n end = str.length() - 3;\n }\n\n for (int i = start; i < end; i++) {\n\n if (str.charAt(i) == '\\\\' && i+1 < str.length()){\n i += 1;\n switch (str.charAt(i)){\n\n case 'b':\n retval.append('\\b');\n continue;\n case 't':\n retval.append('\\t');\n continue;\n case 'n':\n retval.append('\\n');\n continue;\n case 'f':\n retval.append('\\f');\n continue;\n case 'r':\n retval.append('\\r');\n continue;\n case '\"':\n retval.append('\\\"');\n continue;\n case '\\'':\n retval.append('\\'');\n continue;\n case '\\\\':\n retval.append('\\\\');\n continue;\n }\n\n }\n else {\n retval.append(str.charAt(i));\n }\n }\n\n return retval.toString();\n }",
"@Test(timeout = 4000)\n public void test109() throws Throwable {\n StringReader stringReader0 = new StringReader(\"]\");\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n Token token0 = javaParserTokenManager0.getNextToken();\n assertEquals(0, javaCharStream0.bufpos);\n assertEquals(82, token0.kind);\n }",
"@BeforeEach\n\tvoid setUpInvalidRE(){\n\t\tinvalidRE= new String[lengthInvalid];\n\t\t// (ab\n\t\tinvalidRE[0] = \"(ab\";\n\t\t// ab)\n\t\tinvalidRE[1] = \"ab)\";\n\t\t// *\n\t\tinvalidRE[2] = \"*\";\n\t\t// ?\n\t\tinvalidRE[3] = \"?\";\n\t\t// +\n\t\tinvalidRE[4] = \"+\";\n\t\t// a | b | +c\n\t\tinvalidRE[5] = \"a | b | +c\";\n\t\t// a | b | *c\n\t\tinvalidRE[6] = \"a | b | *c\";\n\t\t// a | b | ?c\n\t\tinvalidRE[7] = \"a | b | ?c\";\n\t\t// a | b | | c\n\t\tinvalidRE[8] = \"a | b | | c\";\n\t\t// uneven parenthesis\n\t\tinvalidRE[9] = \"(a(b(c(d)*)+)*\";\n\t\t// a | b |\n\t\tinvalidRE[10] = \"a | b | \";\n\t\t// invalid symbols\n\t\tinvalidRE[11] = \"a | b | $ | -\";\n\t\t// (*)\n\t\tinvalidRE[12] = \"(*)\";\n\t\t// (|a)\n\t\tinvalidRE[13] = \"(|a)\";\n\t\t// (.b)\n\t\tinvalidRE[14] = \"(.b)\";\n\t}",
"static String isBalanced(String s) {\n\n Stack<Integer> stackChars = new Stack<Integer>();\n char arr[] = s.toCharArray();\n int topElement= 0;\n for(int i=0;i<s.length();i++){\n if(i>0 && !stackChars.isEmpty()){\n topElement = stackChars.peek();\n }\n stackChars.push((int)arr[i]);\n if(topElement!=0 && stackChars.size() > 1){\n if((topElement==91 && stackChars.peek() ==93) || (topElement==123 && stackChars.peek() ==125) || \n (topElement== 40 && stackChars.peek() ==41)\n ){\n stackChars.pop();\n stackChars.pop();\n }\n }\n }\n String result = \"\";\n if(stackChars.isEmpty()){\n result = \"YES\";\n }else{\n result = \"NO\";\n }\n return result;\n }",
"@Test\r\n\tpublic void testParseSpace() {\r\n\r\n\t\t// Enter the code\r\n\r\n\t\tdriver.findElement(By.name(\"code[code]\"))\r\n\t\t\t\t.sendKeys(\"the_best_cat = \\\"Noogie Cat\\\"\\nputs \\\"The best cat is: \\\" + the_best_cat\");\r\n\r\n\t\t// Look for the \"Parse\" button and click\r\n\r\n\t\tdriver.findElements(By.name(\"commit\")).get(1).click();\r\n\r\n\t\t// Check that there contains space and newlines\r\n\r\n\t\ttry {\r\n\t\t\tWebElement code = driver.findElement(By.tagName(\"code\"));\r\n\t\t\tassertFalse(code.getText().contains(\":op_nl\"));\r\n\t\t\tassertFalse(code.getText().contains(\":op_sp\"));\r\n\t\t} catch (NoSuchElementException nseex) {\r\n\t\t\tfail();\r\n\t\t}\r\n\t}",
"@Test\n public void shouldIgnoreMoreThanOneColon() {\n String decodeString = \"U2VyZ2VhbnQgQ29sb246b3dlZCB0aGlydHkgeWVhcnMgb2YgaGFwcHkgbWFycmlhZ2UgdG8gdGhlIGZhY3QgdGhhdCBNcnMuIENvbG9uOndvcmtlZCBhbGwgZGF5IGFuZCBTYXJnZW50IENvbG9uIHdvcmtlZCBhbGwgbmlnaHQu\";\n assertThat(\"Two elements is present\", BasicAuth.decode(decodeString), is(arrayWithSize(2)));\n assertThat(\"Username is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"Sergeant Colon\")));\n assertThat(\"Password is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"owed thirty years of happy marriage to the fact that Mrs. Colon:worked all day and Sargent Colon worked all night.\")));\n\n // Encoded \"They:communicated:by:means:of:notes.:They:had:three:grown-up:children,:all:born,:Vimes:had:assumed,:as:a:result:of:extremely:persuasive:handwriting.\" as Base64\n decodeString = \"VGhleTpjb21tdW5pY2F0ZWQ6Ynk6bWVhbnM6b2Y6bm90ZXMuOlRoZXk6aGFkOnRocmVlOmdyb3duLXVwOmNoaWxkcmVuLDphbGw6Ym9ybiw6VmltZXM6aGFkOmFzc3VtZWQsOmFzOmE6cmVzdWx0Om9mOmV4dHJlbWVseTpwZXJzdWFzaXZlOmhhbmR3cml0aW5nLg==\";\n assertThat(\"Two elements is present\", BasicAuth.decode(decodeString), is(arrayWithSize(2)));\n assertThat(\"Username is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"They\")));\n assertThat(\"Password is contained\", BasicAuth.decode(decodeString), is(hasItemInArray(\"communicated:by:means:of:notes.:They:had:three:grown-up:children,:all:born,:Vimes:had:assumed,:as:a:result:of:extremely:persuasive:handwriting.\")));\n }",
"@Override\n\t\tprotected boolean handleIrregulars(String s) {\n\t\t\treturn false;\n\t\t}",
"private boolean isBracketAhead() {\r\n\t\treturn expression[currentIndex] == '(' || expression[currentIndex] == ')';\r\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(bb(\"{{}\"));\n\t\tSystem.out.println(bb(\"[[]\"));\n\t\tSystem.out.println(bb(\"({}[])\"));\n\t}",
"private static void testBadStrLiterals() throws IOException {\n\t// say what output is expected\n\tSystem.err.println(\"\\nTEST BAD STRING LITERALS: BAD ESCAPED CHARS ON LINES 2-5; UNTERM ON LINES 6-11, BOTH ON LINES 12-14\");\n\n\t// open input file\n\tFileReader inFile = null;\n\ttry {\n\t inFile = new FileReader(\"inBadStrLiterals\");\n\t} catch (FileNotFoundException ex) {\n\t System.err.println(\"File inBadStrLiterals not found.\");\n\t System.exit(-1);\n\t}\n\n\t// create and call the scanner\n\tYylex scanner = new Yylex(inFile);\n\tSymbol token = scanner.next_token();\n\twhile (token.sym != sym.EOF) {\n\t if (token.sym != sym.STRINGLITERAL) {\n\t\tSystem.err.println(\"ERROR TESTING BAD STRING LITERALS: bad token: \" +\n\t\t\t\t token.sym);\n\t }\n\t token = scanner.next_token();\n\t}\n }",
"private static boolean needSingleQuotation(char paramChar)\n/* */ {\n/* 2498 */ return ((paramChar >= '\\t') && (paramChar <= '\\r')) || ((paramChar >= ' ') && (paramChar <= '/')) || ((paramChar >= ':') && (paramChar <= '@')) || ((paramChar >= '[') && (paramChar <= '`')) || ((paramChar >= '{') && (paramChar <= '~'));\n/* */ }",
"@Test(timeout = 4000)\n public void test072() throws Throwable {\n String string0 = \"{*+HgP:6|49HQ~Jn\";\n JSONObject jSONObject0 = null;\n try {\n jSONObject0 = new JSONObject(\"{*+HgP:6|49HQ~Jn\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // Expected a ',' or '}' at character 16 of {*+HgP:6|49HQ~Jn\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }",
"private JSONDocument parseString(String data){\n JSONDocument temp = null;\n int pointer = 0;\n boolean firstValidCharReached = false;\n do{\n char c = data.charAt(pointer ++);\n switch (c) {\n case '{':\n HashMap thm = this.parseMap(this.getFull(data.substring(pointer),0));\n temp = new JSONDocument(thm);\n firstValidCharReached = true;\n break;\n case '[':\n ArrayList tal = this.parseList(this.getFull(data.substring(pointer),1));\n temp = new JSONDocument(tal);\n firstValidCharReached = true;\n break;\n }\n }while (!firstValidCharReached);\n return temp;\n }",
"private boolean isContainsCountBrackets(String withoutExtension){\n if (withoutExtension.contains(\"(\") && withoutExtension.contains(\")\")){\n int openBracket = withoutExtension.lastIndexOf(\"(\");\n int closeBracket = withoutExtension.lastIndexOf(\")\");\n if (closeBracket==withoutExtension.length()-1 && openBracket<closeBracket){\n try{\n Integer.parseInt(withoutExtension.substring(openBracket+1, closeBracket));\n return true;\n } catch (NumberFormatException ex){\n return false;\n }\n }\n }\n return false;\n }",
"public static boolean isValid(String string){\n\t\tint count = 0;\n\t\t//start count at 0, which resets to 0 every time the string is valid\n\t\tfor(int i = 0; i < string.length(); i++){\n\t\t\t//iterate through the whole string\n\t\t\tif(string.charAt(i) == '('){\n\t\t\t\t//if it is an opening parentheses sign, increment count\n\t\t\t\tcount++;\n\t\t\t} else{\n\t\t\t\t/*\n\t\t\t\t * otherwise, if count is zero, then it is valid until this character which\n\t\t\t\t * is a closing parentheses\n\t\t\t\t */\n\t\t\t\tif(count == 0){\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t//last case: decrement count, so it is still valid\n\t\t\t\t\tcount--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//return true if the count is 0\n\t\t} return count == 0;\n\t}",
"@Test\n public void testWithEmptyJsonArrayAsString() throws org.nfunk.jep.ParseException\n {\n Stack<Object> parameters = CollectionsUtils.newParametersStack(\"[]\");\n function.run(parameters);\n assertEquals(TRUE, parameters.pop());\n }",
"private String avoidErrorChar (String original) {\n\t\tStringBuffer modSB = new StringBuffer();\n\t\tfor (int j=0; j < original.length(); j++) {\n\t\t\tchar c = original.charAt(j);\n\t\t\tif (c == '\\n') {\n\t\t\t\tmodSB.append(\"\\\\n\"); // rimpiazzo il ritorno a capo con il simbolo \\n\n\t\t\t} else if (c == '\"') {\n\t\t\t\tmodSB.append(\"''\"); // rimpiazzo le doppie virgolette (\") con due apostofi ('')\n\t\t\t} else if ((int)c > 31 || (int)c !=127){ // non stampo i primi 32 caratteri di controllo\n\t\t\t\tmodSB.append(c);\n\t\t\t}\n\t\t}\n\t\treturn modSB.toString();\n\t}",
"private String StringFilter(String str) {\n String regEx = \"[` !@#$%^&*()+=|《{}':;',//[//]. ̄<o╥﹏╥o>/?!@#¥%……&*~~。∀。》()・゜・ノД・゜・∠ ͡° ͜ʖ ͡° ᐛ 」∠_——+|{}【】σ°∀°σ‘⊙▽⊙;≧∇≦ヾ〃∇ノヽ´∀`ノ:ω”“’。,、ヽ●´∀●ノ?ヾ´∀`ノ[\\\\s][0-9][\\\\uD83E\\uDD70\\\\uD83E\\uDD2A\\\\uD83E\\uDD23\\\\uD83E\\uDD22\\\\uD83E\\uDD2E\\\\uD83E\\uDDD0\\\\uD83E\\uDD11\\\\uD83E\\uDD2A\\\\uD83E\\uDD23\\\\uD83E\\uDD2A\\\\uD83E\\uDD74\\\\ud83c\\\\udc00-\\\\ud83c\\\\udfff]|[\\\\ud83d\\\\udc00-\\\\ud83d\\\\udfff]|[\\\\u2600-\\\\u27ff]]\";\n Pattern pattern = Pattern.compile(regEx);\n Matcher matcher = pattern.matcher(str);\n String trim = matcher.replaceAll(\"\").trim();\n return trim;\n }",
"@Test\n public void testEscapeCurlyBraces() {\n assertEquals(\"\\\\{\", HtmlUnitRegExpProxy.escapeJSCurly(\"{\"));\n assertEquals(\"\\\\{\", HtmlUnitRegExpProxy.escapeJSCurly(\"\\\\{\"));\n assertEquals(\"\\\\}\", HtmlUnitRegExpProxy.escapeJSCurly(\"}\"));\n assertEquals(\"\\\\}\", HtmlUnitRegExpProxy.escapeJSCurly(\"\\\\}\"));\n assertEquals(\"(^|\\\\{)#([^\\\\}]+)(\\\\}|$)\", HtmlUnitRegExpProxy.escapeJSCurly(\"(^|{)#([^}]+)(}|$)\"));\n\n assertEquals(\"a{5}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5}\"));\n assertEquals(\"a{5,}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5,}\"));\n assertEquals(\"a{5,10}\", HtmlUnitRegExpProxy.escapeJSCurly(\"a{5,10}\"));\n }",
"private boolean isOK(char ch) {\n if(String.valueOf(ch).matches(\"[<|\\\\[|\\\\-|\\\\||&|a-z|!]\")){\n return true;\n }\n return false;\n }",
"public List<String> removeInvalidParentheses(String s) {\n int leftCount = 0;\n int rightCount = 0;\n for(char c : s.toCharArray()) {\n if (c == '(') {\n leftCount++;\n }\n if (leftCount == 0) {\n if (c == ')') {\n rightCount++;\n }\n } else {\n if (c == ')') {\n leftCount--;\n }\n }\n }\n List<String> result = new ArrayList<String>();\n if (isValid(s)) {\n result.add(s);\n return result;\n }\n findValidParentheses(s, 0, leftCount, rightCount, result);\n return result;\n }",
"@Test\n public void shouldNotFindSubstringWithMismatchedFirstCharacterAtTheEndOfThString() {\n // Given\n String string = \"123ABc\";\n CharSequence charSequence = new StringBuilder(\"cBc\");\n\n // When\n boolean containsCharSequence = string.contains(charSequence);\n\n // Then\n assertFalse(containsCharSequence);\n }",
"public int solution(String S){\n if(S.length() == 0) return 1;\n if(S.length() % 2 != 0) return 0;\n\n // new Stack<Character>()\n Stack<Character> stack = new Stack<>();\n // scan the string (just one pass)\n for(int i=0; i< S.length(); i++){\n // note: push \"its pair\"\n if( S.charAt(i) == '(' ){\n stack.push(')');\n }\n else if( S.charAt(i) == '[' ){\n stack.push(']');\n }\n else if( S.charAt(i) == '{' ){\n stack.push('}');\n }\n // pop and check\n else if( S.charAt(i) == ')' || S.charAt(i) == ']' || S.charAt(i) == '}'){\n // important: check if the stack is empty or not (be careful)\n if(stack.isEmpty()){\n return 0;\n }\n else{\n if(stack.pop() != S.charAt(i)){ // not a pair\n return 0;\n }\n }\n }\n }\n // note: check if the stack is empty or not\n if(stack.isEmpty())\n return 1;\n return 0;\n\n }",
"public List<String> removeInvalidParentheses(String s) {\r\n List<String> result = new ArrayList<>();\r\n if (s == null) {\r\n return result;\r\n }\r\n Queue<String> queue = new LinkedList<>();\r\n Set<String> invalid = new HashSet<>();\r\n queue.offer(s);\r\n while (!queue.isEmpty()) {\r\n int size = queue.size();\r\n for (int i = 0; i < size; i++) {\r\n String cur = queue.poll();\r\n if (isValid(cur)) {\r\n result.add(cur);\r\n continue;\r\n } else {\r\n for (int j = 0; j < cur.length(); j++) {\r\n if (cur.charAt(j) != '(' && cur.charAt(j) != ')') {\r\n continue;\r\n }\r\n invalid.add(cur);\r\n String sub = cur.substring(0, j) + cur.substring(j + 1);\r\n if (invalid.add(sub)) {\r\n queue.offer(sub);\r\n }\r\n }\r\n }\r\n }\r\n if (result.size() != 0) {\r\n break;\r\n }\r\n }\r\n return result;\r\n }",
"protected Element parseString(String str){\n\t\ttry {\n\t\t\tparser.parse(str);\n\t\t\treturn parser.getDocument().getDocumentElement();\n\t\t} catch (SAXException e) {\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn el(\"failure\", text(\"The workflow instrumenter could not insert an activity here, because\" +\n\t\t\t\"the code for the activitiy, that was supplied in the requirement specification was not correct!\"));\n\t}",
"private int doCheckBrackets(String text) {\n int countLeftBracket = 0;\n int countRightBracket = 0;\n\n String[] members = text.split(\"\");\n for (int i = 0; i < members.length; i++){\n if (members[i].equals(\"(\")){\n countLeftBracket++;\n }else if (members[i].equals(\")\")){\n countRightBracket++;\n }\n }\n\n return countLeftBracket - countRightBracket;\n }"
] | [
"0.6177617",
"0.5783923",
"0.5620764",
"0.55940294",
"0.55179054",
"0.5508954",
"0.5502974",
"0.54638284",
"0.5406803",
"0.53620166",
"0.53553206",
"0.5274771",
"0.52738285",
"0.52710766",
"0.5267215",
"0.5243784",
"0.52311397",
"0.5226691",
"0.5214151",
"0.5202506",
"0.5197996",
"0.51796484",
"0.5158013",
"0.51567024",
"0.51412797",
"0.51361275",
"0.51346856",
"0.5104554",
"0.5082433",
"0.50601256",
"0.5030849",
"0.5005457",
"0.5003877",
"0.49678975",
"0.49615815",
"0.493689",
"0.49308673",
"0.49299932",
"0.49261248",
"0.49251065",
"0.49099082",
"0.48761424",
"0.4861708",
"0.48521206",
"0.48502848",
"0.48255184",
"0.48014438",
"0.47945914",
"0.4785507",
"0.47802493",
"0.47785395",
"0.4773677",
"0.4767037",
"0.476607",
"0.47640732",
"0.47464037",
"0.47443274",
"0.47314507",
"0.4724982",
"0.47185406",
"0.4711763",
"0.46931037",
"0.4682235",
"0.46762237",
"0.46738282",
"0.46653128",
"0.4658946",
"0.46567932",
"0.46552774",
"0.46542096",
"0.4641727",
"0.46327093",
"0.462629",
"0.46113586",
"0.46072453",
"0.45899248",
"0.4574981",
"0.45697674",
"0.45689633",
"0.45650864",
"0.45489326",
"0.45432273",
"0.4542474",
"0.45155537",
"0.45086664",
"0.45046577",
"0.45015603",
"0.44969964",
"0.4491105",
"0.4483613",
"0.44746798",
"0.44623876",
"0.44617462",
"0.44606286",
"0.44599372",
"0.44589198",
"0.44570866",
"0.44523826",
"0.44492373",
"0.444428"
] | 0.5374773 | 9 |
Creates an IntentService. Invoked by your subclass's constructor. | public ActivityRecognitionListener(String name) {
super(name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MyIntentService() {\n super(\"MyIntentServiceName\");\n }",
"public MyIntentService() {\n super(\"MyIntentService\");\n }",
"public MyIntentService() {\n super(\"\");\n }",
"public MyIntentService() {\n super(MyIntentService.class.getName());\n }",
"public MyIntentService(String name){\n super(name);\n }",
"public HelloIntentService() {\n super(\"HelloIntentService\");\n }",
"public MyIntentService() {\n //调用父类的构造函数\n //参数 = 工作线程的名字\n super(\"myIntentService\");\n }",
"public RegistrationIntentService() {\n super(TAG);\n }",
"public IntentStartService(String name) {\n super(name);\n }",
"public MessageIntentService(String name) {\n super(name);\n }",
"public GCMIntentService() {\n super(\"GCMIntentService\");\n\n }",
"private void initService() {\n connection = new AppServiceConnection();\n Intent i = new Intent(this, AppService.class);\n boolean ret = bindService(i, connection, Context.BIND_AUTO_CREATE);\n Log.d(TAG, \"initService() bound with \" + ret);\n }",
"@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n Process.THREAD_PRIORITY_BACKGROUND);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n mServiceLooper = thread.getLooper();\r\n mServiceHandler = new ServiceHandler(mServiceLooper);\r\n }",
"public FetchAddressIntentService() {\n super(\"FetchAddressIntentService\");\n }",
"public StockWidgetIntentService() {\n super(\"StockWidgetIntentService\");\n }",
"@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n 10);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n serviceLooper = thread.getLooper();\r\n serviceHandler = new ServiceHandler(serviceLooper);\r\n }",
"@Override\n\tpublic void onCreate() {\n\t\t\n\t\tHandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\n\t\t\t\tProcess.THREAD_PRIORITY_BACKGROUND);\n\t\tthread.start();\n\t\t// Get the HandlerThread's Looper and use it for our Handler\n\t\tmServiceLooper = thread.getLooper();\n\t\tmServiceHandler = new ServiceHandler(mServiceLooper);\n\t}",
"@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", Process.THREAD_PRIORITY_BACKGROUND);\n thread.start();\n\n //Get the HandlerThread's Looper and use it for ur Handler\n mServiceLooper = thread.getLooper();\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }",
"@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\");\n thread.start();\n\n // Get the HandlerThread's Looper and use it for our Handler\n mLooper = thread.getLooper();\n mServiceHandle = new ServiceHandle(mLooper);\n }",
"public AlarmService(String name) {\n super(name);\n }",
"@Override\n\tpublic void onCreate() {\n\t\tLog.i(TAG, \"service on create\");\n\t\tsuper.onCreate();\n\t}",
"@Override\n public void onClick(View v) {\n startService(new Intent(MainActivity.this, MyService.class));\n }",
"@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", THREAD_PRIORITY_BACKGROUND);\n thread.start();\n Log.d(\"LOG19\", \"DiscoveryService onCreate\");\n\n this.mLocalBroadCastManager = LocalBroadcastManager.getInstance(this);\n // Get the HandlerThread's Looper and use it for our Handler\n mServiceLooper = thread.getLooper();\n\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }",
"public LoadIntentService(String name) {\n super(name);\n }",
"public GroundyIntentService(String name) {\n super();\n mName = name;\n mAsyncLoopers = new ArrayList<Looper>();\n }",
"@Override\n\tprotected void onStart() {\n\t\tsuper.onStart();\n\t\tIntent i = new Intent(this, M_Service.class);\n\t\tbindService(i, mServiceConn, Context.BIND_AUTO_CREATE);\n\t}",
"public Service(){\n\t\t\n\t}",
"public void startService() {\r\n Log.d(LOG, \"in startService\");\r\n startService(new Intent(getBaseContext(), EventListenerService.class));\r\n startService(new Intent(getBaseContext(), ActionService.class));\r\n getListenerService();\r\n\r\n }",
"public void onCreate() {\n super.onCreate();\n // An Android handler thread internally operates on a looper.\n mHandlerThread = new HandlerThread(\"HandlerThreadService.HandlerThread\", Process.THREAD_PRIORITY_BACKGROUND);\n mHandlerThread.start();\n // An Android service handler is a handler running on a specific background thread.\n mServiceHandler = new ServiceHandler(mHandlerThread.getLooper());\n\n // Get access to local broadcast manager\n mLocalBroadcastManager = LocalBroadcastManager.getInstance(this);\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tLog.e(\"androidtalk\", \"service created\") ;\n\t\tSystem.out.println(\"androidtalk-service created\") ;\n\t\t\n\t}",
"public CallService() {\n super(\"My\");\n }",
"protected void startService() {\n\t\t//if (!isServiceRunning(Constants.SERVICE_CLASS_NAME))\n\t\tthis.startService(new Intent(this, LottoService.class));\n\t}",
"public void createServiceRequest() {\n getMainActivity().startService(new Intent(getMainActivity(), RequestService.class));\n }",
"protected void startIntentService() {\n Intent intent = new Intent(this.getActivity(), FetchAddressIntentService.class);\n intent.putExtra(Constants.RECEIVER, mResultReceiver);\n intent.putExtra(Constants.LOCATION_DATA_EXTRA, mLastLocation);\n this.getActivity().startService(intent);\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\t\n\t\tIntent odmIntent = new Intent(this, OdmService.class);\n this.startService(odmIntent); \n\t\tmHandler.post(mStartRunnable);\n\t}",
"@Override\r\n public void onStart(Intent intent, int startId) {\n }",
"private void initService() {\n \tlog_d( \"initService()\" );\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) return;\n // Initialize the BluetoothChatService to perform bluetooth connections\n if ( mBluetoothService == null ) {\n log_d( \"new BluetoothService\" );\n \t\tmBluetoothService = new BluetoothService( mContext );\n\t }\n\t\tif ( mBluetoothService != null ) {\n log_d( \"set Handler\" );\n \t\tmBluetoothService.setHandler( sendHandler );\n\t }\t\t\n }",
"public ReceiveTransitionsIntentService() {\n super(\"ReceiveTransitionsIntentService\");\n }",
"@Override\r\n public void onCreate() {\r\n Log.d(TAG, \"on service create\");\r\n }",
"public StartedService() {\n super(\"StartedService\");\n }",
"private Service() {}",
"public UploadReportIntentService() {\n super(TAG);\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.intentdemo);\n\t\tfinal Button button = (Button)findViewById(R.id.btnStart);\n\t\tbutton.setOnClickListener(new OnClickListener()\n\t\t{\n\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tbIsStart = !bIsStart;\n\t\t\t\tif(bIsStart)\n\t\t\t\t{\n\t\t\t\t\tstartMyService();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif(service!=null)\n\t\t\t\t\t{\n\t\t\t\t\t\t stopService(intentMyService);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t);\n\t}",
"@Override\n public void onStart(Intent intent, int startid) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n context.startService(new Intent(context, MyService.class));\n }",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\n\t\tcontext = this;\n\t\tstartService();\n\t}",
"private void registerService(Context context) {\r\n Intent intent = new Intent(context, CustomIntentService.class);\r\n\r\n /*\r\n * Step 2: We pass the handler via the intent to the intent service\r\n * */\r\n handler = new CustomHandler(new AppReceiver() {\r\n @Override\r\n public void onReceiveResult(Message message) {\r\n /*\r\n * Step 3: Handle the results from the intent service here!\r\n * */\r\n switch (message.what) {\r\n //TODO\r\n }\r\n }\r\n });\r\n intent.putExtra(\"handler\", new Messenger(handler));\r\n context.startService(intent);\r\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n Log.d(TAG, \"Service started\");\n\n self = this;\n\n return super.onStartCommand(intent, flags, startId);\n }",
"@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tnew RunnableService(new runCallBack(){\n\n\t\t\t@Override\n\t\t\tpublic void start() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tinitResource();\n\t\t\t\t//获取通讯录信息\n\t\t\t\tinitContactsData();\n\t\t\t\t//同步通讯录\n\t\t\t\tupLoadPhones();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void end() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}, true);\n\t\n\t\t\n\t\tsuper.onStart(intent, startId);\n\t}",
"@Override\n\tprotected void onCreate (Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tAndroidApplicationConfiguration config = new AndroidApplicationConfiguration();\n\t\tinitialize(new MainClass(), config);\n\t\tstartService(new Intent(getBaseContext(),MyServices.class));\n\t}",
"@Override\n public void onCreate() {\n Log.d(\"ServiceTest\", \"Service created!\");\n workoutID = -1;\n\n }",
"public InitService() {\n super(\"InitService\");\n }",
"public NotificationReceiverService() {\n }",
"@Override\n\tpublic int onStartCommand( Intent intent, int flags, int startId )\n\t{\n\t\tsuper.onStartCommand( intent, flags, startId );\n\n\t\tString action = null;\n\t\tif( intent != null )\n\t\t\taction = intent.getAction();\n\n\t\t\tLog.i(LOG_TAG,\"Received action of \" + action );\n\n\t\tif( action == null )\n\t\t{\n\t\t\tLog.w(LOG_TAG,\"Starting service with no action\\n Probably from a crash, \"\n\t\t\t\t\t+ \"or service had to restart\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tswitch (action)\n\t\t\t{\n\t\t\t\tcase ACTION_START:\n\t\t\t\t\tLog.i(LOG_TAG, \"Received ACTION_START\");\n\t\t\t\t\tstart();\n\t\t\t\t\tbreak;\n\t\t\t\tcase ACTION_STOP:\n\t\t\t\t\tLog.i(LOG_TAG, \"Received ACTION_STOP\");\n\t\t\t\t\tstop();\n\t\t\t\t\tbreak;\n\t\t\t} // switch\n\n\t\t} // if...else\n\n\t\t//return START_REDELIVER_INTENT; // Mqtt version\n\t\treturn START_STICKY; // Notification version - Run until explicitly stopped.\n\n\t}",
"public ServiceTask() {\n\t}",
"@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\tmContext = this;\n\t\tLogUtils.i(\"tr069Service onCreate is in >>>>>\");\n\t\tLogUtils.writeSystemLog(\"tr069Service\", \"onCreate\", \"tr069\");\n\t\tinitService();\n\t\tinitData();\n\t\tregisterReceiver();\n\t\t\t\t\n\t\tif(JNILOAD){\n\t\t\tTr069ServiceInit();\n\t\t}\n\t}",
"public BroadcastService(String name) {\n super(name);\n }",
"@Override\n\tpublic void onCreate() {\n\t\tLog.d(\"MyService\", \"OnCreat() get called\");\n\t\t\n\t\tIntent intent = new Intent(this, MainActivity.class);\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);\n\t\t\n\t\tNotification.Builder builder = new Notification.Builder(this);\n\t\tbuilder.setSmallIcon(R.drawable.ic_launcher);\n\t\tbuilder.setTicker(\"This is ticker text\");\n\t\tbuilder.setContentTitle(\"This is notification title\");\n\t\tbuilder.setContentText(\"This is content body\");\n\t\tbuilder.setContentIntent(pendingIntent);\n\t\tbuilder.setAutoCancel(true);\n\t\tbuilder.setOngoing(false);\n\t\tbuilder.setSubText(\"This is subtext\");\n\t\tbuilder.setNumber(100);\n\t\tbuilder.setWhen(SystemClock.currentThreadTimeMillis());\n\t\tNotification notification = builder.build();\n\t\tstartForeground(1, notification);\n\t\tsuper.onCreate();\n\t}",
"Service newService();",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.test_service_activity);\n\n\t\tIntent intent = new Intent(\n\t\t\t\t\"com.demo.androidontheway.testservice.MSG_ACTION\");\n\t\tbindService(intent, conn, Context.BIND_AUTO_CREATE);\n\n\t\tmProgressBar = (ProgressBar) findViewById(R.id.pro_service);\n\t\tButton mButton = (Button) findViewById(R.id.btn_start_service);\n\t\tmButton.setOnClickListener(new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// start download at service\n\t\t\t\tmsgService.startDownLoad();\n\t\t\t}\n\t\t});\n\t}",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n mHandler = new Handler();\n // Execute a runnable task as soon as possible\n mHandler.post(runnableService);\n return START_STICKY;\n }",
"public static void startService(Context context, String intentAction) {\n context.startService(new Intent(intentAction));\n }",
"@Override\n public void onStart(Intent intent, int startid) {\n Log.d(\"ServiceTest\", \"Service started by user.\");\n }",
"public boolean bindService(Intent intent, ServiceConnection connection, int mode);",
"@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tLog.i(TAG, \"service on start id = \"+startId);\n\t\tsuper.onStart(intent, startId);\n\t}",
"@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tsuper.onStart(intent, startId);\n\t\tLog.e(\"androidtalk\", \"service started\") ;\n\t\tSystem.out.println(\"androidtalk-service started\") ;\n\t}",
"public static Intent newStartIntent(Context context) {\n\n Intent intent = new Intent(context, RadioPlayerService.class);\n intent.setAction(START_SERVICE);\n\n return intent;\n }",
"public static Intent makeIntent(Context context) {\n mContext = context;\n return new Intent(context, MagpieService.class);\n }",
"@Override\n protected void onCreate(Bundle pSavedInstanceState) {\n\n if (activitiesLaunched.incrementAndGet() > 1) { finish(); }\n\n super.onCreate(pSavedInstanceState);\n\n serviceIntent = new Intent(this, TallyDeviceService.class);\n\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n //action set by setAction() in activity\n String action = intent.getAction();\n if (action.equals(START_SERVER)) {\n //start your server thread from here\n this.serverThread = new Thread(new ServerThread());\n this.serverThread.start();\n }\n if (action.equals(STOP_SERVER)) {\n //stop server\n if (serverSocket != null) {\n try {\n serverSocket.close();\n } catch (IOException ignored) {}\n }\n }\n\n //configures behaviour if service is killed by system, see documentation\n return START_REDELIVER_INTENT;\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n serviceStartNormalMethod = intent.getBooleanExtra(BC_SERVICE_START_METHOD, false);\n\n // This is actually where we receive \"pings\" from activities to start us\n // and keep us running\n pingStamp = System.currentTimeMillis();\n\n // Log.i(TAG, \"SERVICE onStartCommand()\");\n\n return Service.START_NOT_STICKY;\n }",
"@Override\n\tpublic IBinder onBind(Intent intent) {\n\t\treturn serviceBinder;\n\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(MainActivity.this, MyService.class);\n//\t\t\t\t// startService(intent);\n\t\t\t\tbindService(intent, conn, BIND_AUTO_CREATE);\n\n\t\t\t}",
"@Override\n public void onStart(Intent intent, int startId) {\n\n super.onStart(intent, startId);\n }",
"@Override\n\tpublic int onStartCommand(Intent intent, int flags, int startId) {\n\t\tmEngin=new SplEngine(mh, getApplicationContext());\n\t\tmEngin.start_engine();\n\t\t\n\t\treturn START_STICKY;\n\t}",
"Intent createNewIntent(Class cls);",
"public void startService(View view) {\r\n startService(new Intent(this, CustomService.class));\r\n }",
"@Override\n public void onClick(View v) {\n Log.i(\"ServiceExam\",\"start\");\n Intent i = new Intent(\n getApplicationContext(),\n Example17Sub_LifeCycleService.class\n );\n\n i.putExtra(\"MSG\",\"HELLO\");\n // Start Service\n // 만약 서비스 객체가 메모리에 없으면 생성하고 수행\n // onCreate() -> onStartCommand()\n // 만약 서비스 객체가 이미 존재하고 있으면\n // onStartCommand()\n startService(i);\n }",
"@Override\n public void onCreate() {\n if (messageServiceUtil == null)\n messageServiceUtil = new MessageServiceUtil();\n messageServiceUtil.startMessageService(this);\n keepService2();\n }",
"public NotificationService() {\n super(\"NotificationService\");\n }",
"public void InitListener()\n {\n Intent listener = new Intent(this, SmsListener.class);\n listener.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n startService(listener);\n }",
"@SuppressWarnings({ \"static-access\", \"deprecation\" })\n\t@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\tsuper.onStart(intent, startId);\n\n\t\tLog.d(\"MAD\", \"Service Started\");\n\t\t\n\t\t\n\t\t// create intent, set a flag\n\t\tIntent alertIntent = new Intent(MyAlarmService.this,\n\t\t\t\tMyAlarmResponse.class);\n\t\talertIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\n\n\t\t//Make a notification sound\n\t\ttry {\n\t\t Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\t\t Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification);\n\t\t \n\t\t //play sound\n\t\t r.play();\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n\t\t\n\t\t// start intent\n\t\tstartActivity(alertIntent);\n\n\t}",
"@Override\n\tpublic void onStart(Intent intent, int startId) {\n\t\n\t\tsuper.onStart(intent, startId);\n\t}",
"public MySOAPCallActivity()\n {\n }",
"protected abstract Intent createOne();",
"private void startService() {\n startService(new Intent(this, BackgroundMusicService.class));\n }",
"private ServiceFactory() {}",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n super.onStartCommand(intent, flags, startId);\n // Tapping the notification will open the specified Activity.\n// Intent activityIntent = new Intent(this, MainActivity.class);\n if (intent == null)\n intent = new Intent(this, RNTrafficStatsModule.class);\n\n pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0,\n intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n // This always shows up in the notifications area when this Service is running.\n not = new Notification.Builder(this).\n setContentTitle(\"TrueService\").\n setContentText(\"Running Speed Tests\")\n .setSmallIcon(R.drawable.random_pic).\n setContentIntent(pendingIntent).\n// addAction(action).\n build();\n startForeground(1, not);\n\n // Other code goes here...\n\n return START_REDELIVER_INTENT;//super.onStartCommand(intent, flags, startId);\n }",
"@Override\n public void onCreate()\n {\n super.onCreate();\n Toast.makeText(this, \"I am in Service !!!\", Toast.LENGTH_SHORT).show();\n }",
"@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n startService(getIntent().setClass(this, MetronomeService.class));\n finish();\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n\n return super.onStartCommand(intent, flags, startId);\n }",
"@Override\n\tpublic int onStartCommand(Intent intent, int flags, int startId) {\n\t\tBundle bundle = intent.getExtras();\n\t\t\n\t\t// Intents from Main Activity\n\t\tif(bundle.containsKey(SensiLoc.KEY_METHOD)) {\n\t\t\t// Get Intent extras\n\t\t\tutfreq = bundle.getInt(SensiLoc.KEY_UTFREQ);\n\t\t\trdfreq = bundle.getInt(SensiLoc.KEY_RDFREQ);\n\t\t\tmethod = bundle.getString(SensiLoc.KEY_METHOD);\n\t\t\tString filename = bundle.getString(SensiLoc.KEY_RECORD_FILE);\n\t\t\tLog.d(SensiLoc.LOG_TAG, \"LocateService get filename \" + filename);\n\t\t\t\n\t\t\tif(method.equals(\"Adaptive\")) {\n\t\t\t\tturn_delay = bundle.getInt(SensiLoc.KEY_TURN_DELAY);\n\t\t\t}\n\t\t\t// Start HandlerThread for location recording\n\t\t\tif(sdhelper == null) {\n\t\t\t\tsdhelper = new SDRecordHelper();\n\t\t\t\t//sdhelper.createFiles();\n\t\t\t}\n\t\t\tif(!sdhelper.t.isAlive()) {\n\t\t\t\tsdhelper.t.start();\n\t\t\t}\n\t\t\t// Create record files and request update\n\t\t\tif(method.equals(\"GPS\")) {\n\t\t\t\t\n\t\t\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, utfreq*1000, 0, listener);\n\t\t\t\tcurMethod = LocateMethod.LOCATE_GPS;\n\t\t\t\t\n\t\t\t} else if(method.equals(\"Network\")) {\n\t\t\t\tlm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, utfreq*1000, 0, listener);\n\t\t\t\tcurMethod = LocateMethod.LOCATE_NETWORK;\n\t\t\t\t\n\t\t\t} else { // Adaptive \n\t\t\t\tlm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, utfreq*1000, 0, listener);\n\t\t\t\t\n\t\t\t\tAdaptLocationThread thread = new AdaptLocationThread();\n\t\t\t\tthread.start();\n\t\t\t\tcurMethod = LocateMethod.LOCATE_ADAPTIVE;\n\t\t\t}\n\t\t\t// Create new record file and record start level\n\t\t\tsdhelper = new SDRecordHelper();\n\t\t\tsdhelper.createFiles(filename);\n\t\t/*\tToast.makeText(this, \"Locate service:\\n\\tUpdate frequency: \" + utfreq\n\t\t\t\t\t+ \"\\n\\tmethod: \" + method, Toast.LENGTH_SHORT).show();*/\n\t\t\t\n\t\t\t// Start time task for periodically recording location\n\t\t\tif(locateTimer==null) {\n\t\t\t\t\n\t\t\t\tlocateTimer = new Timer();\n\t\t\t\tlocateTimer.schedule(locateTask, (utfreq+1)*1000, rdfreq*1000);\n\t\t\t\t//locateTimer.schedule(locateTask, 0, rdfreq*1000);\n\t\t\t}\n\t\t} else {\n\t\t\t// Intent from SensiService\n\t\t\t// Change location source\n\t\t\tint moving_status = bundle.getInt(KEY_MOVING_STATUS);\n\t\t\tLog.i(LOG_TAG, \"SensiService moving status \" + moving_status);\n\t\t\t\n\t\t\tif(method.equals(\"Adaptive\") && (moving_status == VAL_TURNING)) {\n\t\t\t\t\n\t\t\t\tif(curStatus == MovingStatus.STRAIGHT) {\n\t\t\t\t\tcurStatus = MovingStatus.TURNING;\n\t\t\t\t\tadaptHandler.sendEmptyMessage(MSG_GPS);\n\t\t\t\t\t\n\t\t\t\t\tturn_timer = new Timer();\n\t\t\t\t\t// Recover to request location update by network after 2 minutes\n\t\t\t\t\tturn_timer.schedule(new TimerTask() {\n\t\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tadaptHandler.sendEmptyMessage(MSG_NETWORK);\n\t\t\t\t\t\t\tcurStatus = MovingStatus.STRAIGHT;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}, turn_delay*1000);\n\t\t\t\t}\n\t\t\t} // VAL_TURNING\n\t\t}\n\t\t\n\t\tsuper.onStartCommand(intent, flags, startId);\n\t\treturn START_REDELIVER_INTENT;\n\t}",
"public void startService(View view) {\n startService(new Intent(getBaseContext(), Myservice.class));\n }",
"@Override\r\n public int onStartCommand(Intent intent, int flags, int startId) {\n return super.onStartCommand(intent, flags, startId);\r\n }",
"@Override\n public int onStartCommand(Intent intent, int flags, int startId) {\n return super.onStartCommand(intent, flags, startId);\n }",
"public AddFavouriteService() {\n super(\"AddFavouriteService\");\n }",
"@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState){\n\t\tmStart.setOnClickListener(new OnClickListener(){\n\t\t\t@Override\n\t\t\tpublic void onClick(View v){\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (receiver==null) {\n\t\t\t\t\treceiver = new myReceiver();\n\t\t\t\t\tIntentFilter filter=new IntentFilter();\n\t\t\t\t\tfilter.addAction(\"com.chris.hadoop v\");\n\t\t\t\t\tmActivity.registerReceiver(receiver, filter);\n\t\t\t\t}\n\t\t\t\tIntent intent=new Intent(getActivity(),trafficMonitorService.class);\n\t\t\t\tmActivity.startService(intent);\n\t\t\t\tToast.makeText(mActivity,\" \",Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\t\tmStop.setOnClickListener(new OnClickListener(){\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v){\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (receiver!=null) {\n\t\t\t\t\tmActivity.unregisterReceiver(receiver);\n\t\t\t\t\treceiver=null;\n\t\t\t\t}\n\t\t\t\tIntent intent=new Intent(mActivity,trafficMonitorService.class);\n\t\t\t\tmActivity.stopService(intent);\n\t\t\t\tToast.makeText(mActivity, \"ֹͣ\",Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}",
"@Override\n public void onClick(View v) {\n\n checkAccessibility();\n Intent intent = new Intent(MainActivity.this, FloatBallService.class);\n Bundle data = new Bundle();\n data.putInt(\"type\", FloatBallService.TYPE_ADD);\n intent.putExtras(data);\n startService(intent);\n }",
"public static Service newInstance() {\n return newInstance(DEFAULT_PROVIDER_NAME);\n }",
"@Override\r\n public int onStartCommand(Intent intent, int flags, int startId) {\n Message msg = mServiceHandler.obtainMessage();\r\n msg.arg1 = startId;\r\n msg.obj = intent;\r\n mServiceHandler.sendMessage(msg);\r\n\r\n // If we get killed, after returning from here, restart\r\n return START_STICKY;\r\n }",
"public void startService(View view) {\n startService(new Intent(getBaseContext(), MyFirstService.class));\n }"
] | [
"0.8280781",
"0.8213187",
"0.80132484",
"0.7954963",
"0.78675824",
"0.7616548",
"0.7522625",
"0.715798",
"0.7155414",
"0.6938953",
"0.6776343",
"0.6630227",
"0.66172403",
"0.66161776",
"0.6569701",
"0.65577745",
"0.64851856",
"0.6444905",
"0.64208555",
"0.6402491",
"0.6334728",
"0.6327789",
"0.6321244",
"0.62654954",
"0.62649745",
"0.62647265",
"0.6250138",
"0.62166333",
"0.6211399",
"0.61940867",
"0.6175626",
"0.61676186",
"0.61629397",
"0.6159433",
"0.6142708",
"0.6135205",
"0.61304456",
"0.61292315",
"0.6121369",
"0.61191225",
"0.6113512",
"0.6109028",
"0.60955155",
"0.6094938",
"0.60943496",
"0.6089225",
"0.60720783",
"0.6052231",
"0.60163164",
"0.6014727",
"0.6000743",
"0.5998217",
"0.5998011",
"0.5995162",
"0.5994043",
"0.5988922",
"0.59859735",
"0.59792006",
"0.59733176",
"0.59724927",
"0.59615415",
"0.59569865",
"0.5955576",
"0.5934061",
"0.5915367",
"0.5911769",
"0.5904384",
"0.5896932",
"0.5887159",
"0.5886646",
"0.5872944",
"0.58643305",
"0.5862065",
"0.58540666",
"0.5837592",
"0.5832177",
"0.5829355",
"0.58276546",
"0.58264244",
"0.5816874",
"0.5815347",
"0.57916355",
"0.5790486",
"0.578955",
"0.57877654",
"0.57855546",
"0.5783855",
"0.5778216",
"0.5773941",
"0.5770529",
"0.5762924",
"0.5752532",
"0.5747055",
"0.5746113",
"0.5739161",
"0.57380325",
"0.57324266",
"0.5725863",
"0.5716827",
"0.5707356",
"0.5706478"
] | 0.0 | -1 |
TODO add support for rendering nested indexed field references | @Test // DATAMONGO-774
@Disabled
void shouldRenderNestedIndexedFieldReference() {
assertThat(transformValue("foo[3].bar")).isEqualTo("$foo[3].bar");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasFieldNested();",
"public int getFieldIndex() { return _fldIndex; }",
"@Test\n public void fieldIndexFormatting() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side,\n // and the number of the page that contains the XE field on the right.\n // If the XE fields have the same value in their \"Text\" property,\n // the INDEX field will group them into one entry.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n index.setLanguageId(\"1033\");\n\n // Setting this property's value to \"A\" will group all the entries by their first letter,\n // and place that letter in uppercase above each group.\n index.setHeading(\"A\");\n\n // Set the table created by the INDEX field to span over 2 columns.\n index.setNumberOfColumns(\"2\");\n\n // Set any entries with starting letters outside the \"a-c\" character range to be omitted.\n index.setLetterRange(\"a-c\");\n\n Assert.assertEquals(\" INDEX \\\\z 1033 \\\\h A \\\\c 2 \\\\p a-c\", index.getFieldCode());\n\n // These next two XE fields will show up under the \"A\" heading,\n // with their respective text stylings also applied to their page numbers.\n builder.insertBreak(BreakType.PAGE_BREAK);\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apple\");\n indexEntry.isItalic(true);\n\n Assert.assertEquals(\" XE Apple \\\\i\", indexEntry.getFieldCode());\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apricot\");\n indexEntry.isBold(true);\n\n Assert.assertEquals(\" XE Apricot \\\\b\", indexEntry.getFieldCode());\n\n // Both the next two XE fields will be under a \"B\" and \"C\" heading in the INDEX fields table of contents.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Banana\");\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Cherry\");\n\n // INDEX fields sort all entries alphabetically, so this entry will show up under \"A\" with the other two.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Avocado\");\n\n // This entry will not appear because it starts with the letter \"D\",\n // which is outside the \"a-c\" character range that the INDEX field's LetterRange property defines.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Durian\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Formatting.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Formatting.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\"1033\", index.getLanguageId());\n Assert.assertEquals(\"A\", index.getHeading());\n Assert.assertEquals(\"2\", index.getNumberOfColumns());\n Assert.assertEquals(\"a-c\", index.getLetterRange());\n Assert.assertEquals(\" INDEX \\\\z 1033 \\\\h A \\\\c 2 \\\\p a-c\", index.getFieldCode());\n Assert.assertEquals(\"\\fA\\r\" +\n \"Apple, 2\\r\" +\n \"Apricot, 3\\r\" +\n \"Avocado, 6\\r\" +\n \"B\\r\" +\n \"Banana, 4\\r\" +\n \"C\\r\" +\n \"Cherry, 5\\r\\f\", index.getResult());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apple \\\\i\", \"\", indexEntry);\n Assert.assertEquals(\"Apple\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertTrue(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apricot \\\\b\", \"\", indexEntry);\n Assert.assertEquals(\"Apricot\", indexEntry.getText());\n Assert.assertTrue(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(3);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Banana\", \"\", indexEntry);\n Assert.assertEquals(\"Banana\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(4);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Cherry\", \"\", indexEntry);\n Assert.assertEquals(\"Cherry\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(5);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Avocado\", \"\", indexEntry);\n Assert.assertEquals(\"Avocado\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(6);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Durian\", \"\", indexEntry);\n Assert.assertEquals(\"Durian\", indexEntry.getText());\n Assert.assertFalse(indexEntry.isBold());\n Assert.assertFalse(indexEntry.isItalic());\n }",
"public List<String> getIndexedFields() {\n\t\t\tList<String> indexedFields = new ArrayList<>();\n\t\t\t\n\t\t\tindexedFields.add(field);\n\t\t\tindexedFields.add(field + \".folded\");\n\t\t\t\n\t\t\treturn indexedFields;\n\t\t}",
"com.sagas.meta.model.MetaFieldData getFields(int index);",
"boolean hasNestedField();",
"@Test\n public void fieldIndexCrossReferenceSeparator() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side,\n // and the number of the page that contains the XE field on the right.\n // The INDEX entry will collect all XE fields with matching values in the \"Text\" property\n // into one entry as opposed to making an entry for each XE field.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n\n // We can configure an XE field to get its INDEX entry to display a string instead of a page number.\n // First, for entries that substitute a page number with a string,\n // specify a custom separator between the XE field's Text property value and the string.\n index.setCrossReferenceSeparator(\", see: \");\n\n Assert.assertEquals(\" INDEX \\\\k \\\", see: \\\"\", index.getFieldCode());\n\n // Insert an XE field, which creates a regular INDEX entry which displays this field's page number,\n // and does not invoke the CrossReferenceSeparator value.\n // The entry for this XE field will display \"Apple, 2\".\n builder.insertBreak(BreakType.PAGE_BREAK);\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Apple\");\n\n Assert.assertEquals(\" XE Apple\", indexEntry.getFieldCode());\n\n // Insert another XE field on page 3 and set a value for the PageNumberReplacement property.\n // This value will show up instead of the number of the page that this field is on,\n // and the INDEX field's CrossReferenceSeparator value will appear in front of it.\n // The entry for this XE field will display \"Banana, see: Tropical fruit\".\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Banana\");\n indexEntry.setPageNumberReplacement(\"Tropical fruit\");\n\n Assert.assertEquals(\" XE Banana \\\\t \\\"Tropical fruit\\\"\", indexEntry.getFieldCode());\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.CrossReferenceSeparator.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.CrossReferenceSeparator.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX, \" INDEX \\\\k \\\", see: \\\"\",\n \"Apple, 2\\r\" +\n \"Banana, see: Tropical fruit\\r\", index);\n Assert.assertEquals(\", see: \", index.getCrossReferenceSeparator());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Apple\", \"\", indexEntry);\n Assert.assertEquals(\"Apple\", indexEntry.getText());\n Assert.assertNull(indexEntry.getPageNumberReplacement());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE Banana \\\\t \\\"Tropical fruit\\\"\", \"\", indexEntry);\n Assert.assertEquals(\"Banana\", indexEntry.getText());\n Assert.assertEquals(\"Tropical fruit\", indexEntry.getPageNumberReplacement());\n }",
"protected String _getFieldName(java.lang.reflect.Field fld, boolean rich){\r\n\t\tString name=fld.getName();\r\n\t\tif (fld.isAnnotationPresent(IndexKey.class)) {\r\n\t\t\tif (rich) name=INDEX_+name;\r\n\t\t} \r\n\t\telse\r\n\t\tif (fld.isAnnotationPresent(NumIndex.class)) {\r\n\t\t\tif (rich) name=NUMINDEX_+name;\r\n\t\t} \r\n\t\telse\r\n\t\tif (fld.isAnnotationPresent(FullBody.class)) {\r\n\t\t\tif (rich) name=FULLBODY_+name;\r\n\t\t} \r\n\t\telse\r\n\t\tif (fld.isAnnotationPresent(CategoryKey.class)) {\r\n\t\t\tif (rich) name=CATEGORY_+name;\r\n\t\t} \r\n\t\telse \r\n\t\tif (fld.isAnnotationPresent(FullText.class)) {\r\n\t\t\tif (rich) name=FULLTEXT_+name;\r\n\t\t} \r\n\t\telse \r\n\t\tif (fld.isAnnotationPresent(DateIndex.class)) {\r\n\t\t\tif (rich) name=DATEINDEX_+name;\r\n\t\t} \r\n\t\telse \r\n\t\tif (fld.isAnnotationPresent(TimestampIndex.class)) {\r\n\t\t\tif (rich) name=TIMESTAMP_+name;\r\n\t\t}\r\n\t\treturn name;\r\n\t}",
"private Object decorateNestedObject(Field field) {\n\t\tDefaultElementLocatorFactory newFactory = (DefaultElementLocatorFactory) this.factory;\n\t\ttry {\n\t\t\tObject obj = newFactory.initNestedPageObject(field);\t\t\t\n\t\t\treturn obj;\n\t\t} catch (InstantiationException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalAccessException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvocationTargetException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"java.lang.String getField1043();",
"public IndexInfo(IndexInfo other, MetaRelationship field) {\n\t\tString prefix = field.getName();\n\t\tthis.indexName = prefix + \".\" + other.indexName;\n\t\tthis.options = new HashSet<IndexOptionEnum>(other.options);\n\t\t// since the embed field might not have field, it must be spare for\n\t\t// unique index\n\t\tif (this.options.contains(IndexOptionEnum.unique)) {\n\t\t\tthis.options.add(IndexOptionEnum.sparse);\n\t\t}\n\t\tthis.keyList = new LinkedList<String>();\n\t\tfor (String key : other.keyList) {\n\t\t\tkeyList.add(prefix + \".\" + key);\n\t\t}\n\t\tthis.internal = true;\n\t}",
"public interface FieldReference {\n\n /**\n *\n * @return variable name of the field\n */\n String getVariableName();\n\n /**\n *\n * @return type of the field\n */\n Type getType();\n\n /**\n * @return additional template parameters\n */\n default Map<String, Object> getTemplateParameter() {\n return null;\n }\n}",
"protected GWikiFragmentLink getLinkForField(final GWikiContext ctx, int index, String[] contentArray)\n {\n GWikiFragmentLink link = null;\n GWikiWikiParser wkparse = new GWikiWikiParser();\n GWikiContent gwikiContent = wkparse.parse(ctx, contentArray[index]);\n\n GWikiCollectFragmentTypeVisitor links = new GWikiCollectFragmentTypeVisitor(GWikiFragmentLink.class);\n gwikiContent.iterate(links);\n\n if (!links.getFound().isEmpty()) {\n link = (GWikiFragmentLink) links.getFound().get(0);\n }\n\n return link;\n }",
"Field getFields(int index);",
"private void showRelatedFields( Long selectedEntityId ) {\n final BBDEntityFieldBroker<EntityFieldBean, BBDBeanArrayList<EntityFieldBean>> jpaFieldBroker = new BBDEntityFieldBroker<>();\n jpaFieldBroker.setPrincipal( getRootUser(), getRootPW() );\n\n EntityFieldBean efb = new EntityFieldBean();\n efb.setBbdjpaobjectId( selectedEntityId );\n BBDBeanArrayList<EntityFieldBean> selectedRows = jpaFieldBroker.select( efb );\n \n @SuppressWarnings( \"unchecked\" )\n final BBDBeanJTable<EntityFieldBean, BBDBeanArrayList<EntityFieldBean>> fieldListTable\n = new BBDBeanJTable<>( selectedRows );\n \n fieldListTable.setAutoResizeMode( JTable.AUTO_RESIZE_LAST_COLUMN );\n for( int i = 0; i < 3; i++ ) {\n fieldListTable.getColumnModel().getColumn( i ).setPreferredWidth( 85 );\n fieldListTable.getColumnModel().getColumn( i ).setMaxWidth( 85 );\n }\n\n entityFieldsScrollPane.setViewportView( fieldListTable );\n\n }",
"public interface ComplexField {\n\tpublic abstract int numberOfTokens();\n\n\tpublic abstract void addProperty(String name, TokenFilterAdder filterAdder);\n\n\tpublic abstract void addPropertyAlternative(String sourceName, String altPostfix);\n\n\tpublic abstract void addPropertyAlternative(String sourceName, String altPostfix,\n\t\t\tTokenFilterAdder filterAdder);\n\n\tpublic abstract void addProperty(String name);\n\n\tpublic abstract void addValue(String value);\n\n\tpublic abstract void addStartChar(int startChar);\n\n\tpublic abstract void addEndChar(int endChar);\n\n\tpublic abstract void addPropertyValue(String name, String value);\n\n\tpublic abstract void addToLuceneDoc(Document doc);\n\n\tpublic abstract void clear();\n\n\tpublic abstract void addAlternative(String altPostfix);\n\n\tpublic abstract void addAlternative(String altPostfix, TokenFilterAdder filterAdder);\n\n\tpublic abstract void addTokens(TokenStream c) throws IOException;\n\n\tpublic abstract void addPropertyTokens(String propertyName, TokenStream c) throws IOException;\n\n\tpublic abstract List<String> getPropertyValues(String name);\n}",
"public void testResolveDereferenceDotCollection()\r\n {\r\n _field _count = _field.of( \"public int count;\" );\r\n _field _name = _field.of( \"public String name;\" );\r\n \r\n Form f = ForML.compile( \"{+field.type+} {+field.name+}, \");\r\n \r\n List<_field> l = new ArrayList<_field>();\r\n l.add( _count );\r\n l.add( _name );\r\n \r\n assertEquals( 2, f.getCardinality( \r\n VarContext.of( \"field\", l ) ) );\r\n \r\n String str = f.author( \r\n VarContext.of( \"field\", l ) );\r\n \r\n assertEquals( \"int count, String name\", str );\r\n }",
"java.lang.String getField1610();",
"@Override\n\tpublic void VisitGetFieldNode(GetFieldNode Node) {\n\n\t}",
"boolean hasNestedOuterField();",
"java.lang.String getField1016();",
"java.lang.String getField1843();",
"protected String getReferenceNameElement(WebElement elemento) {\n \tField[] fields = (Field[]) ArrayUtils.addAll(\n \t\t\tgetClass().getSuperclass().getDeclaredFields(),\n getClass().getDeclaredFields());\n \t\n \tfor (Field field : fields) {\n \tif(field.getType().getName().toLowerCase().contains(\"menu\")) {\n \t\tfor (Field fieldMenu: field.getType().getDeclaredFields()) {\n if (fieldMenu.getType().getName().toString().contains(\"pageObject\")) {\n \tfields = (Field[]) ArrayUtils.add(fields,fieldMenu);\n }\t\t\t\t\t\n\t\t\t\t}\t\n \t}\n\t\t}\n \treturn \"<b>\" + getFieldFinder(fields, elemento) + \"</b>\";\n }",
"java.lang.String getField1729();",
"java.lang.String getField1339();",
"@Test\n public void setFieldIndexFormat() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n builder.write(\"A\");\n builder.insertBreak(BreakType.LINE_BREAK);\n builder.insertField(\"XE \\\"A\\\"\");\n builder.write(\"B\");\n\n builder.insertField(\" INDEX \\\\e \\\" · \\\" \\\\h \\\"A\\\" \\\\c \\\"2\\\" \\\\z \\\"1033\\\"\", null);\n\n doc.getFieldOptions().setFieldIndexFormat(FieldIndexFormat.FANCY);\n doc.updateFields();\n\n doc.save(getArtifactsDir() + \"Field.SetFieldIndexFormat.docx\");\n //ExEnd\n }",
"public String getFieldText(String fieldName, int index);",
"java.lang.String getField1792();",
"@Test(enabled = false, description = \"WORDSNET-18068\")\n public void fieldRD() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Use a document builder to insert a table of contents,\n // and then add one entry for the table of contents on the following page.\n builder.insertField(FieldType.FIELD_TOC, true);\n builder.insertBreak(BreakType.PAGE_BREAK);\n builder.getCurrentParagraph().getParagraphFormat().setStyleName(\"Heading 1\");\n builder.writeln(\"TOC entry from within this document\");\n\n // Insert an RD field, which references another local file system document in its FileName property.\n // The TOC will also now accept all headings from the referenced document as entries for its table.\n FieldRD field = (FieldRD) builder.insertField(FieldType.FIELD_REF_DOC, true);\n field.setFileName(\"ReferencedDocument.docx\");\n field.isPathRelative(true);\n\n Assert.assertEquals(field.getFieldCode(), \" RD ReferencedDocument.docx \\\\f\");\n\n // Create the document that the RD field is referencing and insert a heading. \n // This heading will show up as an entry in the TOC field in our first document.\n Document referencedDoc = new Document();\n DocumentBuilder refDocBuilder = new DocumentBuilder(referencedDoc);\n refDocBuilder.getCurrentParagraph().getParagraphFormat().setStyleName(\"Heading 1\");\n refDocBuilder.writeln(\"TOC entry from referenced document\");\n referencedDoc.save(getArtifactsDir() + \"ReferencedDocument.docx\");\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.RD.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.RD.docx\");\n\n FieldToc fieldToc = (FieldToc) doc.getRange().getFields().get(0);\n\n Assert.assertEquals(\"TOC entry from within this document\\t\\u0013 PAGEREF _Toc36149519 \\\\h \\u00142\\u0015\\r\" +\n \"TOC entry from referenced document\\t1\\r\", fieldToc.getResult());\n\n FieldPageRef fieldPageRef = (FieldPageRef) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_PAGE_REF, \" PAGEREF _Toc36149519 \\\\h \", \"2\", fieldPageRef);\n\n field = (FieldRD) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_REF_DOC, \" RD ReferencedDocument.docx \\\\f\", \"\", field);\n Assert.assertEquals(\"ReferencedDocument.docx\", field.getFileName());\n Assert.assertTrue(field.isPathRelative());\n }",
"Fields fields();",
"@Override\n\tpublic String toString() {\n\t\treturn level+\":\"+title + \":\"+refId+\"::\"+childElems;\n\t}",
"java.lang.String getField1727();",
"java.lang.String getField1721();",
"@Override\n boolean areNestedRefsProhibited() {\n return true;\n }",
"java.lang.String getField1229();",
"java.lang.String getField1764();",
"@Test\n public void fieldIndexFilter() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n // Create an INDEX field which will display an entry for each XE field found in the document.\n // Each entry will display the XE field's Text property value on the left side\n // and the page containing the XE field on the right.\n // If the XE fields have the same value in their \"Text\" property,\n // the INDEX field will group them into one entry.\n FieldIndex index = (FieldIndex) builder.insertField(FieldType.FIELD_INDEX, true);\n\n // Configure the INDEX field only to display XE fields that are within the bounds\n // of a bookmark named \"MainBookmark\", and whose \"EntryType\" properties have a value of \"A\".\n // For both INDEX and XE fields, the \"EntryType\" property only uses the first character of its string value.\n index.setBookmarkName(\"MainBookmark\");\n index.setEntryType(\"A\");\n\n Assert.assertEquals(\" INDEX \\\\b MainBookmark \\\\f A\", index.getFieldCode());\n\n // On a new page, start the bookmark with a name that matches the value\n // of the INDEX field's \"BookmarkName\" property.\n builder.insertBreak(BreakType.PAGE_BREAK);\n builder.startBookmark(\"MainBookmark\");\n\n // The INDEX field will pick up this entry because it is inside the bookmark,\n // and its entry type also matches the INDEX field's entry type.\n FieldXE indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Index entry 1\");\n indexEntry.setEntryType(\"A\");\n\n Assert.assertEquals(\" XE \\\"Index entry 1\\\" \\\\f A\", indexEntry.getFieldCode());\n\n // Insert an XE field that will not appear in the INDEX because the entry types do not match.\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Index entry 2\");\n indexEntry.setEntryType(\"B\");\n\n // End the bookmark and insert an XE field afterwards.\n // It is of the same type as the INDEX field, but will not appear\n // since it is outside the bookmark's boundaries.\n builder.endBookmark(\"MainBookmark\");\n builder.insertBreak(BreakType.PAGE_BREAK);\n indexEntry = (FieldXE) builder.insertField(FieldType.FIELD_INDEX_ENTRY, true);\n indexEntry.setText(\"Index entry 3\");\n indexEntry.setEntryType(\"A\");\n\n doc.updatePageLayout();\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.INDEX.XE.Filtering.docx\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"Field.INDEX.XE.Filtering.docx\");\n index = (FieldIndex) doc.getRange().getFields().get(0);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX, \" INDEX \\\\b MainBookmark \\\\f A\", \"Index entry 1, 2\\r\", index);\n Assert.assertEquals(\"MainBookmark\", index.getBookmarkName());\n Assert.assertEquals(\"A\", index.getEntryType());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(1);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Index entry 1\\\" \\\\f A\", \"\", indexEntry);\n Assert.assertEquals(\"Index entry 1\", indexEntry.getText());\n Assert.assertEquals(\"A\", indexEntry.getEntryType());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(2);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Index entry 2\\\" \\\\f B\", \"\", indexEntry);\n Assert.assertEquals(\"Index entry 2\", indexEntry.getText());\n Assert.assertEquals(\"B\", indexEntry.getEntryType());\n\n indexEntry = (FieldXE) doc.getRange().getFields().get(3);\n\n TestUtil.verifyField(FieldType.FIELD_INDEX_ENTRY, \" XE \\\"Index entry 3\\\" \\\\f A\", \"\", indexEntry);\n Assert.assertEquals(\"Index entry 3\", indexEntry.getText());\n Assert.assertEquals(\"A\", indexEntry.getEntryType());\n }",
"protected String buildFieldExp(Field field) {\n final StringBuilder sb = new StringBuilder();\n sb.append(field.getDeclaringClass().getSimpleName());\n final Type genericType = field.getGenericType();\n final String typeExp = genericType != null ? genericType.getTypeName() : field.getType().getSimpleName();\n sb.append(\"@\").append(field.getName()).append(\": \").append(typeExp);\n final Class<?> genericBeanType = getFieldGenericType(field);\n sb.append(genericBeanType != null ? \"<\" + genericBeanType.getSimpleName() + \">\" : \"\");\n return sb.toString();\n }",
"java.lang.String getField1702();",
"java.lang.String getField1078();",
"java.lang.String getField1793();",
"java.lang.String getField1217();",
"public void testResolveDereferenceDotArray()\r\n {\r\n _field _count = _field.of( \"public int count;\" );\r\n _field _name = _field.of( \"public String name;\" );\r\n \r\n Form f = ForML.compile( \"{+field.type+} {+field.name+}, \");\r\n \r\n assertEquals( 2, f.getCardinality( \r\n VarContext.of( \"field\", new _field[]{_count, _name} ) ) );\r\n \r\n String str = f.author( \r\n VarContext.of( \"field\", new _field[]{_count, _name} ) );\r\n \r\n assertEquals( \"int count, String name\", str );\r\n }",
"java.lang.String getField1529();",
"java.lang.String getField1029();",
"java.lang.String getField1048();",
"java.lang.String getField1739();",
"java.lang.String getField1336();",
"java.lang.String getField1031();",
"public interface CollectionField extends RelationField {\n\n}",
"java.lang.String getField1725();",
"java.lang.String getField1784();",
"java.lang.String getField1338();",
"public void setFieldIndex(final int fieldIndex) { _fldIndex = fieldIndex; }",
"java.lang.String getField1734();",
"java.lang.String getField1429();",
"java.lang.String getField1337();",
"java.lang.String getField1829();",
"java.lang.String getField1066();",
"java.lang.String getField1773();",
"java.lang.String getField1713();",
"java.lang.String getField1731();",
"java.lang.String getField1015();",
"public interface FieldSerializer {\n\n boolean serializeField(JsonSerializerInternal serializer, Object parent, FieldAccess fieldAccess, CharBuf builder );\n\n}",
"java.lang.String getField1021();",
"java.lang.String getField1711();",
"java.lang.String getField1738();",
"@Test//ExSkip\n public void fieldRef() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n\n builder.startBookmark(\"MyBookmark\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"MyBookmark footnote #1\");\n builder.write(\"Text that will appear in REF field\");\n builder.insertFootnote(FootnoteType.FOOTNOTE, \"MyBookmark footnote #2\");\n builder.endBookmark(\"MyBookmark\");\n builder.moveToDocumentStart();\n\n // We will apply a custom list format, where the amount of angle brackets indicates the list level we are currently at.\n builder.getListFormat().applyNumberDefault();\n builder.getListFormat().getListLevel().setNumberFormat(\"> \\u0000\");\n\n // Insert a REF field that will contain the text within our bookmark, act as a hyperlink, and clone the bookmark's footnotes.\n FieldRef field = insertFieldRef(builder, \"MyBookmark\", \"\", \"\\n\");\n field.setIncludeNoteOrComment(true);\n field.setInsertHyperlink(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\f \\\\h\");\n\n // Insert a REF field, and display whether the referenced bookmark is above or below it.\n field = insertFieldRef(builder, \"MyBookmark\", \"The referenced paragraph is \", \" this field.\\n\");\n field.setInsertRelativePosition(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\p\");\n\n // Display the list number of the bookmark as it appears in the document.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's paragraph number is \", \"\\n\");\n field.setInsertParagraphNumber(true);\n\n Assert.assertEquals(\" REF MyBookmark \\\\n\", field.getFieldCode());\n\n // Display the bookmark's list number, but with non-delimiter characters, such as the angle brackets, omitted.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's paragraph number, non-delimiters suppressed, is \", \"\\n\");\n field.setInsertParagraphNumber(true);\n field.setSuppressNonDelimiters(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\n \\\\t\");\n\n // Move down one list level.\n builder.getListFormat().setListLevelNumber(builder.getListFormat().getListLevelNumber() + 1)/*Property++*/;\n builder.getListFormat().getListLevel().setNumberFormat(\">> \\u0001\");\n\n // Display the list number of the bookmark and the numbers of all the list levels above it.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's full context paragraph number is \", \"\\n\");\n field.setInsertParagraphNumberInFullContext(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\w\");\n\n builder.insertBreak(BreakType.PAGE_BREAK);\n\n // Display the list level numbers between this REF field, and the bookmark that it is referencing.\n field = insertFieldRef(builder, \"MyBookmark\", \"The bookmark's relative paragraph number is \", \"\\n\");\n field.setInsertParagraphNumberInRelativeContext(true);\n\n Assert.assertEquals(field.getFieldCode(), \" REF MyBookmark \\\\r\");\n\n // At the end of the document, the bookmark will show up as a list item here.\n builder.writeln(\"List level above bookmark\");\n builder.getListFormat().setListLevelNumber(builder.getListFormat().getListLevelNumber() + 1)/*Property++*/;\n builder.getListFormat().getListLevel().setNumberFormat(\">>> \\u0002\");\n\n doc.updateFields();\n doc.save(getArtifactsDir() + \"Field.REF.docx\");\n testFieldRef(new Document(getArtifactsDir() + \"Field.REF.docx\")); //ExSkip\n }",
"java.lang.String getField1720();",
"java.lang.String getField1787();",
"java.lang.String getField1284();",
"java.lang.String getField1794();",
"java.lang.String getField1723();",
"java.lang.String getField1769();",
"@Beta\npublic interface FieldInfo {\n\n /** Returns the name of this field or field set. */\n String name();\n\n Field.Type type();\n\n /** Returns whether this field or field set is attribute(s), i.e. does indexing: attribute. */\n boolean isAttribute();\n\n /** Returns whether this field is index(es), i.e. does indexing: index. */\n boolean isIndex();\n\n}",
"java.lang.String getField1762();",
"java.lang.String getField1227();",
"private static void addFieldMapping(String fieldName, Map<String, Object> typeProperty, Map<String, Object> indexFieldProperties) {\n if (indexFieldProperties.isEmpty()) {\n indexFieldProperties.put(\"properties\", new HashMap<String, Object>());\n }\n ((Map<String, Object>) indexFieldProperties.get(\"properties\")).put(fieldName, typeProperty);\n }",
"java.lang.String getField1779();",
"java.lang.String getField1839();",
"private Map<Field, ValueRef> createFieldValueRefMap() {\n Map<Field, ValueRef> map = new IdentityHashMap<>(fields.size() + 1);\n map.put(NormalField.MISSING, new ValueRef(0, 0));\n return map;\n }",
"java.lang.String getField1334();",
"java.lang.String getField1008();",
"java.lang.String getField1746();",
"java.lang.String getField1025();",
"java.lang.String getField1293();",
"java.lang.String getField1743();",
"java.lang.String getField1527();",
"java.lang.String getField1492();",
"@Override\n\tpublic FieldDetail getFieldDetail() {\n\t\treturn field;\n\t}",
"@Test\r\n\tpublic void setRelatedField() {\r\n\t\ttestObj.addNativeField(1);\r\n\t\ttestObj.makeArrays();\r\n\t\ttestObj.setRelatedField(0, 100);\r\n\t\tassertEquals(\"relatedFields at 0 should be 100\", 100, testObj.getRelatedFieldsArray()[0]);\r\n\t}",
"java.lang.String getField1714();",
"java.lang.String getField1733();",
"java.lang.String getField1592();",
"java.lang.String getField1717();",
"java.lang.String getField1782();",
"java.lang.String getField1744();",
"java.lang.String getField1084();",
"java.lang.String getField1273();",
"java.lang.String getField1728();"
] | [
"0.5628414",
"0.55917364",
"0.5518219",
"0.5491727",
"0.545219",
"0.54093134",
"0.5351107",
"0.5333832",
"0.5307111",
"0.5247536",
"0.5238063",
"0.51884574",
"0.5144208",
"0.51414216",
"0.51209956",
"0.5119006",
"0.5106234",
"0.51010835",
"0.50773424",
"0.50733435",
"0.50728387",
"0.5062999",
"0.5055962",
"0.50326234",
"0.50173885",
"0.4998329",
"0.49977705",
"0.4996658",
"0.49961042",
"0.4995829",
"0.49868456",
"0.49862066",
"0.4986038",
"0.49846828",
"0.4982869",
"0.49815854",
"0.49772832",
"0.49771708",
"0.49730727",
"0.496938",
"0.4965467",
"0.49596092",
"0.49564162",
"0.4953326",
"0.49487087",
"0.49477452",
"0.49466163",
"0.4946447",
"0.49407542",
"0.49398375",
"0.49378568",
"0.49369487",
"0.49359977",
"0.4934318",
"0.49339196",
"0.49334764",
"0.4932669",
"0.49325657",
"0.49322113",
"0.49264944",
"0.49256697",
"0.49232122",
"0.49215853",
"0.49157545",
"0.49145693",
"0.49134302",
"0.49129882",
"0.49113315",
"0.49102917",
"0.49065173",
"0.49058744",
"0.49036852",
"0.49002814",
"0.48958784",
"0.48920232",
"0.48866436",
"0.48863956",
"0.48863006",
"0.48852727",
"0.48831797",
"0.4881319",
"0.48790252",
"0.48766834",
"0.48750442",
"0.48745325",
"0.4870336",
"0.48700714",
"0.48684302",
"0.48678157",
"0.48652568",
"0.48622563",
"0.48621425",
"0.48618206",
"0.48615313",
"0.4860192",
"0.48600653",
"0.4860033",
"0.48587957",
"0.48557666",
"0.4851865"
] | 0.73541427 | 0 |
/ Reference IdentityCoreInitializedEvent service to guarantee that this component will wait until identity core is started | @Reference(
name = "identity.core.init.event.service",
service = IdentityCoreInitializedEvent.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetIdentityCoreInitializedEventService"
)
protected void setIdentityCoreInitializedEventService(IdentityCoreInitializedEvent identityCoreInitializedEvent) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected void unsetIdentityCoreInitializedEventService(IdentityCoreInitializedEvent identityCoreInitializedEvent) {\n }",
"@Override\n public void onCoreInitFinished() {\n }",
"@Override\n public void onCoreInitFinished() {\n }",
"@Override\n public void onCoreInitFinished() {\n }",
"@Override\n public void autonomousInit() {\n }",
"@Override\n public void autonomousInit() {\n }",
"public void autonomousInit() {\n }",
"public void autonomousInit() {\n }",
"@Override\n public void autonomousInit() {\n \n }",
"@Override\n\tpublic void autonomousInit() {\n\t}",
"public void autonomousInit() {\n \n }",
"public void autonomousInit() {\n\t\t\n\t}",
"public void initialize() {\n\n getStartUp();\n }",
"public void initialize() {\n //TODO: Initialization steps\n\n initialized = true;\n }",
"public void onInitializeComplete() {\n }",
"public static void setApplicationInitialized() {\n applicationInitialized = true;\n }",
"@Override\n\tpublic void contextInitialized(ServletContextEvent sce) {\n\t\tstartupEvt.fire(new ContainerStartupEvent());\n\t}",
"@Override\n public void startup() {\n }",
"@Override\r\n\tpublic boolean initialize(ICore core) {\n\t\treturn false;\r\n\t}",
"private void initAuthListener() {\n\n mAuthStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n\n mExecutors.networkIO().execute(() -> {\n mFirebaseUser = firebaseAuth.getCurrentUser();\n mFirebaseUserLiveData.postValue(mFirebaseUser);\n if (mFirebaseUser != null) {\n initUserReference(mFirebaseUser);\n }\n });\n\n }\n };\n mFirebaseAuth.addAuthStateListener(mAuthStateListener);\n }",
"public void contextInitialized(ServletContextEvent contextEvent) {\n super.serviceInitialization(contextEvent,SERVICE_NAME);\n }",
"@Override\n public void firstApplicationStartup()\n {\n System.out.println(\"firstApplicationStartup\");\n \n }",
"public void autonomousInit() {\n\t\tautonomousCommand.start();\r\n\t}",
"@PostConstruct\n public void init() {\n oAuthProviders.registerProvider(this);\n }",
"@Override\n\tpublic void earlyStartup() {\n\t}",
"public void contextInitialized(final ServletContextEvent event) {\n ObjectifyService.register(ClusterGroup.class);\n ObjectifyService.register(Cluster.class);\n ObjectifyService.register(GoalGroup.class);\n ObjectifyService.register(Goal.class);\n }",
"@Override\n\tpublic void onInitialize() {\n\t\titemregistry.registeritems();\n\t\tentityregister.registerEntityAttribute();\n\t\tSystem.out.println(\"Project Azure: Starting up...\");\n\n\t}",
"public void autonomousInit() {\n if (autonomousCommand != null) autonomousCommand.start();\n }",
"@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }",
"@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }",
"public void init(@Observes @Initialized(ApplicationScoped.class) Object init) {\n }",
"@ServiceInit\n public void init() {\n }",
"void initialize() {\n refreshIntents();\r\n\r\n initialized = true;\r\n\r\n }",
"@Override\n public void contextInitialized( ServletContextEvent sce ) {\n LOG.debug( \"Initializing EMF\" );\n EMFactory.initializeEMF();\n LOG.debug( \"EMF initialized\" );\n }",
"@Override\n public void onAdded() {\n /**\n * EventsBus: Fetching data.\n */\n EventBus.getDefault().post(new Authenticating());\n }",
"@Override\n\tpublic void contextInitialized(ServletContextEvent sce) {\n\t\tSystem.out.println(\"MyListener.contextInitialized() 初始化\");\n//\t\t当server启动时 就初始化applic\n\t\t\n\t}",
"public void onStart() {\n super.onStart();\n this.mAuth.addAuthStateListener(this.mAuthStateListener);\n }",
"@Override\n public void onStart() {\n super.onStart();\n // Check if user is signed in (non-null) and update UI accordingly.\n currentUser = firebaseAuth.getCurrentUser();\n firebaseAuth.addAuthStateListener(authStateListener);\n\n\n }",
"protected void onInit() {\n super.onInit();\n securityManager = (com.sustain.security.SustainSecurityManager) getBean(\"securityManager\");\n }",
"@PostConstruct\r\n\tpublic void doMyStartUpStuff() {\r\n\t\t\r\n\t\tSystem.out.println(\"TennisCoach : -> Inside of doMyStartUpStuff()\");\r\n\t}",
"@Override\n public void onStart() {\n super.onStart();\n auth.addAuthStateListener(authListener);\n }",
"@OnInit\n public void init() {\n }",
"@Override\r\n\tpublic void startup() {\n\t\tif(!initialized)\r\n\t\t\tinitOperation();\r\n\t\tregisterMBean();\r\n\t}",
"public void initialize() {\n // TODO\n }",
"@Override\n public void preStart() {\n cluster.subscribe(getSelf(), RoleLeaderChanged.class);\n }",
"@PostConstruct\n public void init() {\n eventBus.register(this);\n }",
"@Override\n protected void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }",
"@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(authListener);\n }",
"@PostConstruct\n\tpublic void doMyStartupStfff() {\n\t\tSystem.out.println(\">> TennisCoach: inside of doMyStartupStuff\");\n\t}",
"@Override\n protected void onStart() {\n checkUserStatus();\n\n super.onStart();\n }",
"@Override\n protected void onStart() {\n checkUserStatus();\n super.onStart();\n }",
"@Override\n\tpublic void onApplicationEvent(ContextRefreshedEvent arg0) {\n\t\tinitData();\n\t}",
"@Override\n\tpublic void onApplicationEvent(ContextRefreshedEvent arg0) {\n\t\tinitData();\n\t}",
"public abstract void onInit();",
"@PostConstruct\n\tpublic void initialize()\n\t{\n\t\tSystem.out.println(\"Circle initialization\");\n\t}",
"@Override\r\n\tprotected void onManagedInitialize(final IEntity pEntity) {\r\n\r\n\t}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void runInit() {\n }",
"@Override\r\n\tpublic void serviceInit(ServiceInitEvent event) {\r\n\t\tevent.getSource().addUIInitListener(uiEvent -> {\r\n\t\t\tfinal UI ui = uiEvent.getUI();\r\n\t\t\tui.addBeforeEnterListener(this::beforeEnter); // Vor dem Betreten von View wird beforeEnter-Methode\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ausgefuehrt\r\n\t\t});\r\n\t}",
"protected void onOSGiConnected() {\n osgiNotified = true;\n }",
"public static void initClient() {\n BundleEvents.register();\n }",
"public static void init() {\n\n\t\tsnapshot = new SnapshotService();\n\t\tlog.info(\"App init...\");\n\t}",
"protected void initialize() {\n drivebase.engageOmni();\n }",
"protected void onInit() {\n onEnable();\n }",
"@Override\n\tpublic void initialize() {\n\t\tsuper.initialize();\n\t}",
"@Override\n public void initialize()\n {\n super.initialize();\n log.info(\"Initialize \" + name);\n Map<String, Collection<?>> beans;\n generator = service.getRandomSeedRepo().\n getRandomSeed(\"EvSocialClass-\" + name, 1, \"initialize\");\n\n Config.recycle();\n config = Config.getInstance();\n config.configure(service.getServerConfiguration());\n\n beans = config.getBeans();\n unpackBeans(beans);\n\n // Create and set up the customer instances\n evCustomers = new ArrayList<EvCustomer>();\n if (null == customerAttributeList) {\n // boot session - dynamic configuration\n configureForBoot(beans);\n }\n else {\n // sim session - restore from boot record\n configureForSim(beans);\n }\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void onStart(Application app) {\n if (User.find.findRowCount() == 0) {\n Ebean.save((List<?>) Yaml.load(\"initial-data.yml\"));\n }\n initializeVerificationDetails();\n }",
"@Override\n public void onApplicationEvent(ContextRefreshedEvent event) {\n\n //Prevent double bootstrap\n String systemUserName = \"user\";\n if (userRepository.findUserByName(systemUserName).isPresent()) {\n return;\n }\n\n User user = user(systemUserName, \"password\", asList(\"ROLE_USER\"));\n user.addCharacter(\"Avicus\");\n\n user(\"admin\", \"password\", asList(\"ROLE_USER\", \"ROLE_ADMIN\"));\n }",
"public void initialize() {\r\n }",
"@Override\r\n public void initialize()\r\n {\n }",
"public void ensureInitialized() {\r\n\t\ttry {\r\n\t\t\tif (this.getGroup() != null)\r\n\t\t\t\t// Success\r\n\t\t\t\treturn;\r\n\t\t} catch (EJBException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tUtil.redirectToRoot();\r\n\t}",
"default public void onInitialize() {\n\t\t// noop by default\n\t}",
"@Override\n\tpublic void onActivate() {\n\t\tsetCurrentPageWhenReady(StaticPageNames.Core_UserLogin, 30, pageName -> {\n\t\t\t//TODO: Show error popup\n\t\t\tlogger.severe(\"Failed to load Login page, timed out while waiting for page!\");\n\t\t});\n\t}",
"@Override\n\tpublic void Initialize()\n\t{\n\t\t// TODO: Add your initialization logic here\n\t\t\n\t\tsuper.Initialize();\n\t}",
"@PostConstruct\n public void init() {\n rest.put(\"http://authenticationServer:8080/bot\", info);\n AuthServerChecker checker = new AuthServerChecker(name);\n checker.start();\n }",
"@Override\n\tpublic void init() throws Exception {\n //the code present in this method is executed as soon as the application loads that is even before it starts\n\t\tsuper.init(); //super keyword invokes the init methods as per the definition in the Application class\n \n\t}",
"@Override\n\tpublic void initialize() {\n\t}",
"@Override\n\tpublic void initialize() {\n\t}",
"@Override\n\tpublic void initialize() {\n\t}",
"@Override\r\n\tpublic void contextInitialized(ServletContextEvent event) {\r\n\t\tinvoke(\"contextInitialized\", event);\r\n\t}",
"@Override\n\tpublic void setup()\n\t{\n\t\tCoreNotifications.get().addListener(this, ICoreContextOperationListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureInputListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureRuntimeListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureOperationListener.class);\n\t}",
"@Override\n protected void afterAuthenticating() {\n }",
"@Override\n public void onApplicationEvent(ContextRefreshedEvent event) {\n\n appContext = event.getApplicationContext();\n System.out.println(appContext.getId());\n\n\n log.info(\"api-web初始化\");\n try {\n ApiUtils_.init(appContext);\n } catch (Exception e) {\n log.warn(\"初始化异常!\", e);\n }\n log.info(\"api-web初始化完成\");\n }",
"public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"public void initialize() {\n }"
] | [
"0.744809",
"0.6511219",
"0.64295626",
"0.64295626",
"0.64093506",
"0.64093506",
"0.63085467",
"0.63085467",
"0.63076186",
"0.6297885",
"0.6288461",
"0.61545396",
"0.59996873",
"0.59627783",
"0.59474564",
"0.5823413",
"0.5816442",
"0.5788156",
"0.57064193",
"0.5695863",
"0.568903",
"0.5660394",
"0.56453353",
"0.5632033",
"0.56317717",
"0.56232554",
"0.56183326",
"0.55736166",
"0.5561872",
"0.5561872",
"0.55577296",
"0.5546879",
"0.55385655",
"0.55341446",
"0.55304223",
"0.55222744",
"0.5515004",
"0.5514535",
"0.55073166",
"0.5505521",
"0.5502688",
"0.55001515",
"0.54890084",
"0.54817134",
"0.5481281",
"0.54761803",
"0.54750925",
"0.5466791",
"0.54626745",
"0.5459889",
"0.54460204",
"0.5443731",
"0.5443731",
"0.5441246",
"0.5429714",
"0.54112595",
"0.5405997",
"0.5405997",
"0.5405997",
"0.53946215",
"0.53742397",
"0.5363261",
"0.5362741",
"0.53612787",
"0.5360746",
"0.5358611",
"0.5349804",
"0.5347269",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.53450245",
"0.5341871",
"0.53260547",
"0.5325788",
"0.5325559",
"0.53233206",
"0.53208923",
"0.53203523",
"0.5319714",
"0.53133434",
"0.531075",
"0.53089726",
"0.53089726",
"0.53089726",
"0.53054965",
"0.5304814",
"0.5303961",
"0.5303857",
"0.5300931",
"0.53002775",
"0.53002775",
"0.53002775",
"0.52967846"
] | 0.7715537 | 0 |
/ Reference IdentityCoreInitializedEvent service to guarantee that this component will wait until identity core is started | protected void unsetIdentityCoreInitializedEventService(IdentityCoreInitializedEvent identityCoreInitializedEvent) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Reference(\n name = \"identity.core.init.event.service\",\n service = IdentityCoreInitializedEvent.class,\n cardinality = ReferenceCardinality.MANDATORY,\n policy = ReferencePolicy.DYNAMIC,\n unbind = \"unsetIdentityCoreInitializedEventService\"\n )\n protected void setIdentityCoreInitializedEventService(IdentityCoreInitializedEvent identityCoreInitializedEvent) {\n }",
"@Override\n public void onCoreInitFinished() {\n }",
"@Override\n public void onCoreInitFinished() {\n }",
"@Override\n public void onCoreInitFinished() {\n }",
"@Override\n public void autonomousInit() {\n }",
"@Override\n public void autonomousInit() {\n }",
"public void autonomousInit() {\n }",
"public void autonomousInit() {\n }",
"@Override\n public void autonomousInit() {\n \n }",
"@Override\n\tpublic void autonomousInit() {\n\t}",
"public void autonomousInit() {\n \n }",
"public void autonomousInit() {\n\t\t\n\t}",
"public void initialize() {\n\n getStartUp();\n }",
"public void initialize() {\n //TODO: Initialization steps\n\n initialized = true;\n }",
"public void onInitializeComplete() {\n }",
"public static void setApplicationInitialized() {\n applicationInitialized = true;\n }",
"@Override\n\tpublic void contextInitialized(ServletContextEvent sce) {\n\t\tstartupEvt.fire(new ContainerStartupEvent());\n\t}",
"@Override\n public void startup() {\n }",
"@Override\r\n\tpublic boolean initialize(ICore core) {\n\t\treturn false;\r\n\t}",
"private void initAuthListener() {\n\n mAuthStateListener = new FirebaseAuth.AuthStateListener() {\n @Override\n public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\n\n mExecutors.networkIO().execute(() -> {\n mFirebaseUser = firebaseAuth.getCurrentUser();\n mFirebaseUserLiveData.postValue(mFirebaseUser);\n if (mFirebaseUser != null) {\n initUserReference(mFirebaseUser);\n }\n });\n\n }\n };\n mFirebaseAuth.addAuthStateListener(mAuthStateListener);\n }",
"public void contextInitialized(ServletContextEvent contextEvent) {\n super.serviceInitialization(contextEvent,SERVICE_NAME);\n }",
"@Override\n public void firstApplicationStartup()\n {\n System.out.println(\"firstApplicationStartup\");\n \n }",
"public void autonomousInit() {\n\t\tautonomousCommand.start();\r\n\t}",
"@PostConstruct\n public void init() {\n oAuthProviders.registerProvider(this);\n }",
"@Override\n\tpublic void earlyStartup() {\n\t}",
"public void contextInitialized(final ServletContextEvent event) {\n ObjectifyService.register(ClusterGroup.class);\n ObjectifyService.register(Cluster.class);\n ObjectifyService.register(GoalGroup.class);\n ObjectifyService.register(Goal.class);\n }",
"@Override\n\tpublic void onInitialize() {\n\t\titemregistry.registeritems();\n\t\tentityregister.registerEntityAttribute();\n\t\tSystem.out.println(\"Project Azure: Starting up...\");\n\n\t}",
"public void autonomousInit() {\n if (autonomousCommand != null) autonomousCommand.start();\n }",
"@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }",
"@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }",
"public void init(@Observes @Initialized(ApplicationScoped.class) Object init) {\n }",
"@ServiceInit\n public void init() {\n }",
"void initialize() {\n refreshIntents();\r\n\r\n initialized = true;\r\n\r\n }",
"@Override\n public void contextInitialized( ServletContextEvent sce ) {\n LOG.debug( \"Initializing EMF\" );\n EMFactory.initializeEMF();\n LOG.debug( \"EMF initialized\" );\n }",
"@Override\n public void onAdded() {\n /**\n * EventsBus: Fetching data.\n */\n EventBus.getDefault().post(new Authenticating());\n }",
"@Override\n\tpublic void contextInitialized(ServletContextEvent sce) {\n\t\tSystem.out.println(\"MyListener.contextInitialized() 初始化\");\n//\t\t当server启动时 就初始化applic\n\t\t\n\t}",
"public void onStart() {\n super.onStart();\n this.mAuth.addAuthStateListener(this.mAuthStateListener);\n }",
"@Override\n public void onStart() {\n super.onStart();\n // Check if user is signed in (non-null) and update UI accordingly.\n currentUser = firebaseAuth.getCurrentUser();\n firebaseAuth.addAuthStateListener(authStateListener);\n\n\n }",
"protected void onInit() {\n super.onInit();\n securityManager = (com.sustain.security.SustainSecurityManager) getBean(\"securityManager\");\n }",
"@PostConstruct\r\n\tpublic void doMyStartUpStuff() {\r\n\t\t\r\n\t\tSystem.out.println(\"TennisCoach : -> Inside of doMyStartUpStuff()\");\r\n\t}",
"@Override\n public void onStart() {\n super.onStart();\n auth.addAuthStateListener(authListener);\n }",
"@OnInit\n public void init() {\n }",
"@Override\r\n\tpublic void startup() {\n\t\tif(!initialized)\r\n\t\t\tinitOperation();\r\n\t\tregisterMBean();\r\n\t}",
"public void initialize() {\n // TODO\n }",
"@Override\n public void preStart() {\n cluster.subscribe(getSelf(), RoleLeaderChanged.class);\n }",
"@PostConstruct\n public void init() {\n eventBus.register(this);\n }",
"@Override\n protected void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(mAuthListener);\n }",
"@Override\n public void onStart() {\n super.onStart();\n mAuth.addAuthStateListener(authListener);\n }",
"@PostConstruct\n\tpublic void doMyStartupStfff() {\n\t\tSystem.out.println(\">> TennisCoach: inside of doMyStartupStuff\");\n\t}",
"@Override\n protected void onStart() {\n checkUserStatus();\n\n super.onStart();\n }",
"@Override\n protected void onStart() {\n checkUserStatus();\n super.onStart();\n }",
"@Override\n\tpublic void onApplicationEvent(ContextRefreshedEvent arg0) {\n\t\tinitData();\n\t}",
"@Override\n\tpublic void onApplicationEvent(ContextRefreshedEvent arg0) {\n\t\tinitData();\n\t}",
"public abstract void onInit();",
"@PostConstruct\n\tpublic void initialize()\n\t{\n\t\tSystem.out.println(\"Circle initialization\");\n\t}",
"@Override\r\n\tprotected void onManagedInitialize(final IEntity pEntity) {\r\n\r\n\t}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void initialize() {}",
"@Override\n public void runInit() {\n }",
"@Override\r\n\tpublic void serviceInit(ServiceInitEvent event) {\r\n\t\tevent.getSource().addUIInitListener(uiEvent -> {\r\n\t\t\tfinal UI ui = uiEvent.getUI();\r\n\t\t\tui.addBeforeEnterListener(this::beforeEnter); // Vor dem Betreten von View wird beforeEnter-Methode\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ausgefuehrt\r\n\t\t});\r\n\t}",
"protected void onOSGiConnected() {\n osgiNotified = true;\n }",
"public static void init() {\n\n\t\tsnapshot = new SnapshotService();\n\t\tlog.info(\"App init...\");\n\t}",
"protected void initialize() {\n drivebase.engageOmni();\n }",
"public static void initClient() {\n BundleEvents.register();\n }",
"protected void onInit() {\n onEnable();\n }",
"@Override\n\tpublic void initialize() {\n\t\tsuper.initialize();\n\t}",
"@Override\n public void initialize()\n {\n super.initialize();\n log.info(\"Initialize \" + name);\n Map<String, Collection<?>> beans;\n generator = service.getRandomSeedRepo().\n getRandomSeed(\"EvSocialClass-\" + name, 1, \"initialize\");\n\n Config.recycle();\n config = Config.getInstance();\n config.configure(service.getServerConfiguration());\n\n beans = config.getBeans();\n unpackBeans(beans);\n\n // Create and set up the customer instances\n evCustomers = new ArrayList<EvCustomer>();\n if (null == customerAttributeList) {\n // boot session - dynamic configuration\n configureForBoot(beans);\n }\n else {\n // sim session - restore from boot record\n configureForSim(beans);\n }\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void onStart(Application app) {\n if (User.find.findRowCount() == 0) {\n Ebean.save((List<?>) Yaml.load(\"initial-data.yml\"));\n }\n initializeVerificationDetails();\n }",
"public void initialize() {\r\n }",
"@Override\r\n public void initialize()\r\n {\n }",
"public void ensureInitialized() {\r\n\t\ttry {\r\n\t\t\tif (this.getGroup() != null)\r\n\t\t\t\t// Success\r\n\t\t\t\treturn;\r\n\t\t} catch (EJBException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tUtil.redirectToRoot();\r\n\t}",
"@Override\n public void onApplicationEvent(ContextRefreshedEvent event) {\n\n //Prevent double bootstrap\n String systemUserName = \"user\";\n if (userRepository.findUserByName(systemUserName).isPresent()) {\n return;\n }\n\n User user = user(systemUserName, \"password\", asList(\"ROLE_USER\"));\n user.addCharacter(\"Avicus\");\n\n user(\"admin\", \"password\", asList(\"ROLE_USER\", \"ROLE_ADMIN\"));\n }",
"default public void onInitialize() {\n\t\t// noop by default\n\t}",
"@Override\n\tpublic void Initialize()\n\t{\n\t\t// TODO: Add your initialization logic here\n\t\t\n\t\tsuper.Initialize();\n\t}",
"@Override\n\tpublic void onActivate() {\n\t\tsetCurrentPageWhenReady(StaticPageNames.Core_UserLogin, 30, pageName -> {\n\t\t\t//TODO: Show error popup\n\t\t\tlogger.severe(\"Failed to load Login page, timed out while waiting for page!\");\n\t\t});\n\t}",
"@PostConstruct\n public void init() {\n rest.put(\"http://authenticationServer:8080/bot\", info);\n AuthServerChecker checker = new AuthServerChecker(name);\n checker.start();\n }",
"@Override\n\tpublic void init() throws Exception {\n //the code present in this method is executed as soon as the application loads that is even before it starts\n\t\tsuper.init(); //super keyword invokes the init methods as per the definition in the Application class\n \n\t}",
"@Override\n\tpublic void initialize() {\n\t}",
"@Override\n\tpublic void initialize() {\n\t}",
"@Override\n\tpublic void initialize() {\n\t}",
"@Override\r\n\tpublic void contextInitialized(ServletContextEvent event) {\r\n\t\tinvoke(\"contextInitialized\", event);\r\n\t}",
"@Override\n\tpublic void setup()\n\t{\n\t\tCoreNotifications.get().addListener(this, ICoreContextOperationListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureInputListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureRuntimeListener.class);\n\t\tCoreNotifications.get().addListener(this, ICoreProcedureOperationListener.class);\n\t}",
"@Override\n protected void afterAuthenticating() {\n }",
"public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void initialize() {\n }",
"@Override\n public void onApplicationEvent(ContextRefreshedEvent event) {\n\n appContext = event.getApplicationContext();\n System.out.println(appContext.getId());\n\n\n log.info(\"api-web初始化\");\n try {\n ApiUtils_.init(appContext);\n } catch (Exception e) {\n log.warn(\"初始化异常!\", e);\n }\n log.info(\"api-web初始化完成\");\n }",
"public void initialize() {\n }"
] | [
"0.7714706",
"0.651232",
"0.6430521",
"0.6430521",
"0.6410693",
"0.6410693",
"0.631036",
"0.631036",
"0.6308898",
"0.6299452",
"0.6290263",
"0.6156435",
"0.60018593",
"0.5965738",
"0.59499526",
"0.5825283",
"0.5815506",
"0.57893056",
"0.57074755",
"0.56965417",
"0.56900424",
"0.56606454",
"0.56464785",
"0.56339556",
"0.563311",
"0.5624049",
"0.56189",
"0.5575179",
"0.5562373",
"0.5562373",
"0.5559325",
"0.554796",
"0.5541181",
"0.5533843",
"0.55304354",
"0.5522045",
"0.55156267",
"0.5514969",
"0.55081064",
"0.55070317",
"0.550317",
"0.55007225",
"0.5490437",
"0.54841405",
"0.5481681",
"0.5476622",
"0.54755354",
"0.546726",
"0.546398",
"0.54608345",
"0.5446939",
"0.5443411",
"0.5443411",
"0.5442553",
"0.5431576",
"0.5412121",
"0.5407693",
"0.5407693",
"0.5407693",
"0.5395984",
"0.53740615",
"0.5364183",
"0.5362526",
"0.53625107",
"0.536234",
"0.5359324",
"0.535161",
"0.53485125",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.53467786",
"0.5342991",
"0.5328198",
"0.5327474",
"0.53252584",
"0.532469",
"0.53224456",
"0.5321571",
"0.5321266",
"0.53153956",
"0.5311706",
"0.5311047",
"0.5311047",
"0.5311047",
"0.53058285",
"0.5305472",
"0.5305047",
"0.5303353",
"0.53023005",
"0.53023005",
"0.53023005",
"0.5302013",
"0.529913"
] | 0.74473464 | 1 |
TODO this method and createGetDeleteCommand method may be merged to single method createGetXXXCommand(String commandName, String httpMethod) | @Override
public void createGetPostCommand(String commandName) {
try {
writer.write("@Override\n");
writer.write("public String getPostCommand() {\n");
writer.write("\treturn \"" + commandName + "\";\n");
writer.write("}\n");
} catch (IOException e) {
throw new GeneratorException(e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract Command getCreateCommand(CreateRequest request);",
"Command createCommand();",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"public AbstractCommand getCommand(HttpServletRequest request) {\n LOGGER.info(\"request key is \" + request.getMethod() + request.getPathInfo());\n String method = request.getMethod();\n String pathInfo = request.getPathInfo();\n return command.get(method + pathInfo);\n }",
"Command createCommand() throws ServiceException, AuthException;",
"@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n @Override\n public Command command(@PathVariable String id) {\n try {\n Command cmd = repos.findOne(id);\n if (cmd == null)\n throw new NotFoundException(Command.class.toString(), id);\n return cmd;\n } catch (NotFoundException nfE) {\n throw nfE;\n } catch (Exception e) {\n logger.error(\"Error getting command: \" + e.getMessage());\n throw new ServiceException(e);\n }\n }",
"Commands createCommands();",
"@Override\n\tprotected Command getCreateCommand(CreateRequest request) {\n\t\treturn null;\n\t}",
"ICommand getCommand(String requestType, String title, String points, String source, String activity_id) throws Exception;",
"@RequestMapping(method = RequestMethod.GET)\n @Override\n public List<Command> commands() {\n try {\n if (repos.count() > maxLimit) {\n logger.error(\"Max limit exceeded in request for commands\");\n throw new LimitExceededException(\"Command\");\n }\n Sort sort = new Sort(Sort.Direction.DESC, \"_id\");\n return repos.findAll(sort);\n } catch (LimitExceededException lE) {\n throw lE;\n } catch (Exception e) {\n logger.error(\"Error getting commands: \" + e.getMessage());\n throw new ServiceException(e);\n }\n }",
"protected Command getCreateCommand(CreateRequest request) {\n\t\treturn null;\n\t}",
"IDbCommand createCommand();",
"String createCommand(String commandType, AttributeList properties);",
"public CommandFactory() {\n command = new HashMap<>();\n command.put(\"GET/login\", new EmptyCommand());\n command.put(\"POST/login\", new LoginCommand());\n command.put(\"GET/admin\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.USER_PATH));\n command.put(\"GET/user\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.USER_PATH));\n command.put(\"GET/profile\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.USER_PATH));\n command.put(\"POST/ban\", new BanUserCommand());\n command.put(\"POST/changelang\", new ChangeLanguageCommand());\n command.put(\"POST/unban\", new UnbanUserCommand());\n command.put(\"POST/add\", new AddPublicationCommand());\n command.put(\"POST/delete\", new DeletePublicationCommand());\n command.put(\"GET/main\", new ForwardToMainCommand());\n command.put(\"GET/controller/error\", new ForwardToErrorCommand());\n command.put(\"GET/logout\", new LogoutCommand());\n command.put(\"POST/subscribe\", new SubscribeCommand());\n command.put(\"POST/unsubscribe\", new UnsubscribeCommand());\n command.put(\"POST/changename\", new ChangeNameCommand());\n command.put(\"POST/changepassword\", new ChangePasswordCommand());\n command.put(\"POST/adminchangename\", new SetUserNameCommand());\n command.put(\"POST/changebalance\", new SetUserBalanceCommand());\n command.put(\"POST/changepublicationprice\", new SetPublicationPriceCommand());\n command.put(\"POST/changepublicationname\", new SetPublicationNameCommand());\n command.put(\"POST/changepublicationtype\", new SetPublicationTypeCommand());\n command.put(\"GET/admin/publications\", new ForwardToProfileCommand(Pages.PUBLICATIONS_PATH, Pages.USER_PATH));\n command.put(\"GET/user/payments\", new ForwardToProfileCommand(Pages.ADMIN_PATH, Pages.PAYMENTS_PATH));\n command.put(\"GET/admin/users\", new ForwardToProfileCommand(Pages.USERS_PATH, Pages.USERS_PATH));\n command.put(\"POST/login/restore\", new RestorePasswordCommand());\n\n }",
"public ICommand getCommand(HttpServletRequest request) {\n\n ICommand command = commands.get(request.getParameter(\"command\"));\n\n if (command == null) {\n command = new NoCommand();\n }\n\n return command;\n }",
"java.lang.String getCommand();",
"public abstract String getCommandName();",
"public abstract String getCommandName();",
"CommandsFactory getCommandsFactory();",
"@RequestMapping(value = \"/name/{name:.+}\", method = RequestMethod.GET)\n @Override\n public List<Command> commandForName(@PathVariable String name) {\n try {\n return repos.findByName(name);\n } catch (Exception e) {\n logger.error(\"Error getting command: \" + e.getMessage());\n throw new ServiceException(e);\n }\n }",
"java.lang.String getCommandName();",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"public abstract String getCommand();",
"private Command createCommand(String command) {\n\t\tString[] tokens = command.split(\" \");\n\t\tswitch(tokens[0].toLowerCase()) {\n\t\tcase DRAW:\n\t\t\treturn createDrawCommand(command);\n\t\t\n\t\tcase SKIP:\n\t\t\treturn createSkipCommmand(command);\n\t\t\t\n\t\tcase SCALE:\n\t\t\treturn createScaleCommand(command);\n\t\t\t\n\t\tcase ROTATE:\n\t\t\treturn createRotateCommand(command);\n\t\t\t\n\t\tcase PUSH:\n\t\t\treturn createPushCommand();\n\t\t\t\n\t\tcase POP:\n\t\t\treturn createPopCommand();\n\t\t\t\n\t\tcase COLOR:\n\t\t\treturn createColorCommand(command);\n\t\t\t\n\t\tdefault:\n\t\t\tthrow new IllegalArgumentException(\"Invalid command argument\");\n\t\t}\n\t}",
"protected abstract Command getAddCommand(ChangeBoundsRequest request);",
"@Override\n\tprotected HttpRequest createHttpRequest() {\n HttpGet httpGet = new HttpGet(getHost() + \"/repos/\" + owner + \"/\" + repo + \"/pulls?state=\" + state);\n httpGet.setHeader(\"Accept\", GITHUB_ACCEPT_HEADER);\n if (username != null && password != null) {\n \thttpGet.setHeader(\"Authentication\", AuthenticationUtils.getBasicAuthentication(username, password));\n }\n return httpGet;\n }",
"String getCommand();",
"Operations createOperations();",
"java.lang.String getServiceCmd();",
"public static ActionCommand getCommand(HttpServletRequest request) throws UnsupportedEncodingException {\n\t\tActionCommand current = new NoCommand();\t\t\n\t\trequest.setCharacterEncoding(\"UTF-8\");\n String action = request.getParameter(COMMAND);\n\t\tif (action == null || action.isEmpty()) {\n\t\t\t\n\t\t\treturn current;\n\t\t}\n\t\ttry {\n\t\t\tCommandEnum currentEnum = CommandEnum.valueOf(action.toUpperCase());\n\t\t\tcurrent = currentEnum.getCurrentCommand();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\trequest.setAttribute(WRONG_ACTION, action + MessageManager.getProperty(\"message.wrongaction\"));\n\t\t}\t\t\n\t\treturn current;\t\t\n\t}",
"OperationsClient getOperations();",
"String getCommandName();",
"public interface Command {\n /**\n * @param request {@link Request}\n * @param response {@link Response}\n * @return string name of page\n * @throws IOException in case, when params incorrect\n * @throws DAOException {@link DAOException}\n */\n String execute(Request request, Response response) throws DAOException, IOException;\n}",
"@Override\n public Command getCommand(Request req) {\n return UnexecutableCommand.INSTANCE;\n }",
"public void createDefaultCommands() {\n commands.put(\"Top 10 Items in logs serving 404s sorted by count\", \"grep 'HTTP/1.1\\\\\\\" 404' httpd-access.log | cut -d ' ' -f 7 | sort | uniq -c | sort -nr | head\");\n commands.put(\"Top 10 User agents\", \"cat httpd-access.log | cut -d '\\\\\\\"' -f 6 | sort | uniq -c | sort -nr | head\");\n commands.put(\"Most requested URLs\", \"awk -F\\\\\\\" '{print $2}' httpd-access.log | awk '{print $2}' | sort | uniq -c | sort -nr | head\");\n commands.put(\"Top 10 IP Addresses\", \"cat httpd-access.log | awk '{print $1}' | sort -n | uniq -c | sort -nr | head -10\");\n }",
"HospitalCommand provideCommand(String uri);",
"@Override\n\tpublic Command createCommand(String commandStr) {\n\t\tif(commandStr != null && !commandStr.equalsIgnoreCase(\"\")) {\n\t\t\tString[] args = commandStr.split(\"\\\\|\");\n\t\t\tif(args[0].trim().equalsIgnoreCase(\"time\")) {\n\t\t\t\tList<String> grepList = new ArrayList<String>();\n\t\t\t\tList<ShowColumn> scList = new ArrayList<ShowColumn>();\n\t\t\t\t\n\t\t\t\tCommand entity = new Command();\n\t\t\t\tscList.add(ShowColumn.All);\n\t\t\t\tentity.setCommandType(CommandType.Time);\n\t\t\t\t\n\t\t\t\tfor(int i=1; i<args.length; i++) {\n\t\t\t\t\tif(args[i].trim().startsWith(\"grep\")) {\n\t\t\t\t\t\tgrepList.add(args[i].trim().replaceFirst(\"grep \", \"\").trim());\n\t\t\t\t\t} else if(args[i].trim().startsWith(\"group\")) {\n\t\t\t\t\t\tentity.setGroup(Integer.parseInt(args[i].trim().replaceFirst(\"group \", \"\").trim()));\n\t\t\t\t\t} else if(args[i].trim().startsWith(\"column\")) {\n\t\t\t\t\t\tscList.clear();\n\t\t\t\t\t\tString cs = args[i].trim().replaceFirst(\"column -\", \"\");\n\t\t\t\t\t\tif(cs.indexOf(\"a\") >= 0) {\n\t\t\t\t\t\t\tif(!scList.contains(ShowColumn.All)) {\n\t\t\t\t\t\t\t\tscList.add(ShowColumn.All);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tString[] csAry = cs.split(\"\");\n\t\t\t\t\t\t\tfor(String item : csAry) {\n\t\t\t\t\t\t\t\tif(item.equalsIgnoreCase(\"t\")) {\n\t\t\t\t\t\t\t\t\tif(!scList.contains(ShowColumn.Time)) {\n\t\t\t\t\t\t\t\t\t\tscList.add(ShowColumn.Time);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(item.equalsIgnoreCase(\"k\")) {\n\t\t\t\t\t\t\t\t\tif(!scList.contains(ShowColumn.Key)) {\n\t\t\t\t\t\t\t\t\t\tscList.add(ShowColumn.Key);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else if(item.equalsIgnoreCase(\"d\")) {\n\t\t\t\t\t\t\t\t\tif(!scList.contains(ShowColumn.Description)) {\n\t\t\t\t\t\t\t\t\t\tscList.add(ShowColumn.Description);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tentity.setGrep(grepList);\n\t\t\t\tentity.setColumnList(scList);\n\t\t\t\treturn entity;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"private static Command<?> getCommand(@NonNull String inputStr) {\n int seperatorIndex = inputStr.indexOf(' ');\n String commandStr = seperatorIndex == -1 ? inputStr : inputStr.substring(0, seperatorIndex);\n String paramStr = seperatorIndex == -1 ? \"\" : inputStr.substring(seperatorIndex + 1).trim();\n\n if (\"Tag\".equalsIgnoreCase(commandStr)) {\n List<String> tagList = Splitter.on(\",\")\n .trimResults()\n .omitEmptyStrings()//可以 选择是否对 空字符串 做处理\n .splitToList(paramStr.replace(',', ','));\n return new TagCommand(tagList.toArray(new String[]{}));\n } else if (\"Name\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify file path\");\n }\n return new NameCommand(paramStr);\n } else if (\"Where\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify search criteria\");\n }\n return new WhereCommand(paramStr);\n } else if (\"Analyze\".equalsIgnoreCase(commandStr)) {\n return new AnalyzeCommand();\n } else if (\"Export\".equalsIgnoreCase(commandStr)) {\n if (isBlank(paramStr)) {\n throw new IllegalArgumentException(\"Need to specify export file path\");\n }\n return new ExportCommand(paramStr);\n } else {\n throw new IllegalArgumentException(\"Use either Tag, Where, Name, Export, or Analyze\");\n }\n }",
"public Command getCreateCommand() {\n\t\treturn null;\n\t}",
"public interface IActivityCommandFactory {\n /**\n * creates command to be executed.\n * @param requestType\n * @param title\n * @param points\n * @param source\n * @param activity_id\n * @return\n * @throws Exception\n */\n ICommand getCommand(String requestType, String title, String points, String source, String activity_id) throws Exception;\n}",
"public String cmdToGetter(String cmd) {\n if (cmd.length() == 0) {\n return \"\";\n }\n \n return \"get\" + cmd.substring(0,1).toUpperCase() + cmd.substring(1);\n }",
"Command createCommandWith(CommandCreator creator);",
"private void createCommands()\n{\n exitCommand = new Command(\"Exit\", Command.EXIT, 0);\n helpCommand=new Command(\"Help\",Command.HELP, 1);\n backCommand = new Command(\"Back\",Command.BACK, 1);\n}",
"@Override\n public MyBusinessObjectDeleteCommand getDeleteCommand() {\n return new MyBusinessObjectDeleteCommand(this);\n }",
"@Override\n public WebCommands webCommands() {\n return this._webCommands.get();\n }",
"@GetMapping(\"/provider-commands/{id}\")\n @Timed\n @Transactional\n public ResponseEntity<ProviderCommand> getProviderCommand(@PathVariable Long id) {\n log.debug(\"REST request to get ProviderCommand : {}\", id);\n ProviderCommand providerCommand = providerCommandService.findOne(id);\n Set<RequestParameter> requestParameters = new HashSet<RequestParameter>(requestParameterService.findByAllProviderCommandId(providerCommand.getId()));\n providerCommand.setRequestParameters(requestParameters);\n /*-for (RequestParameter parameter : providerCommand.getRequestParameters()) {\n parameter.getId();\n }*/\n for (ProviderResponse response : providerCommand.getProviderResponses()) {\n response.getId();\n }\n\n providerCommand.getServiceSecurity().getId();\n Set<SecurityParams> securityParams = new HashSet<>(securityParamsService.findByProviderCommandId(providerCommand.getId()));\n providerCommand.getServiceSecurity().setSecurityParams(securityParams);\n\n /*for(SecurityParams securityParams:providerCommand.getServiceSecurity().getSecurityParams()){\n securityParams.getId();\n }*/\n return ResponseUtil.wrapOrNotFound(Optional.ofNullable(providerCommand));\n }",
"public interface CliApi {\n\n @GET(\"/api/ping\")\n Pong ping();\n\n /**\n * Fetch and note by type.\n * <p>\n * <code>\n * http://localhost:5050/cli/cmd/update_docker?k=label&n=2\n * </code>\n *\n * @param key key for the fetching\n * @param keyType type of the key, default is 'id', could be 'id' or 'label'\n * @param num number of articles to return, default is 1\n * @return the note resource\n */\n @GET(\"/cli/cmd/{key}\")\n PagedResponse<NoteResult> getNote(@Path(\"key\") String key, @Query(\"k\") String keyType, @Query(\"n\") int num);\n\n @POST(\"/cli/cmd\")\n SaveCmdResponse saveCmd(@Body SaveCmdRequest request);\n\n @DELETE(\"/cli/cmd/{id}\")\n IdResponse deleteItem(@Path(\"id\") String id);\n\n @POST(\"/cli/search\")\n PagedResponse<NoteResult> search(@Body CliSearchRequest request);\n\n}",
"private void generateCommandResourceClass(String parentBeanName, CommandResourceMetaData metaData) {\n\n String commandResourceClassName = getClassName(parentBeanName + getBeanName(metaData.resourcePath));\n \n if (alreadyGenerated(commandResourceClassName)) {\n return;\n }\n\n String commandName = metaData.command;\n String commandDisplayName = metaData.resourcePath;\n String httpMethod = metaData.httpMethod;\n String commandAction = metaData.displayName;\n String baseClassName;\n\n if (\"GET\".equals(httpMethod)) {\n baseClassName = \"org.glassfish.admin.rest.resources.TemplateCommandGetResource\";\n } else if (\"DELETE\".equals(httpMethod)) {\n baseClassName = \"org.glassfish.admin.rest.resources.TemplateCommandDeleteResource\";\n } else if (\"POST\".equals(httpMethod)) {\n baseClassName = \"org.glassfish.admin.rest.resources.TemplateCommandPostResource\";\n } else {\n throw new GeneratorException(\"Invalid httpMethod specified: \" + httpMethod);\n }\n\n ClassWriter classWriter = getClassWriter(commandResourceClassName, baseClassName, null);\n\n if (classWriter != null) {\n boolean isLinkedToParent = false;\n if (metaData.commandParams != null) {\n for (CommandResourceMetaData.ParameterMetaData parameterMetaData : metaData.commandParams) {\n if (Constants.VAR_PARENT.equals(parameterMetaData.value)) {\n isLinkedToParent = true;\n }\n }\n }\n\n classWriter.createCommandResourceConstructor(commandResourceClassName, commandName, httpMethod,\n isLinkedToParent, metaData.commandParams, commandDisplayName, commandAction);\n classWriter.done();\n }\n }",
"public final com.francetelecom.admindm.model.Parameter createCommand()\n\t\t\tthrows Fault {\n\t\tcom.francetelecom.admindm.model.Parameter param;\n\t\tparam = data.createOrRetrieveParameter(basePath + \"Command\");\n\t\tparam.setNotification(0);\n\t\tparam.setStorageMode(StorageMode.DM_ONLY);\n\t\tparam.setType(ParameterType.STRING);\n\t\tparam.addCheck(new CheckLength(256));\n\t\tparam.setValue(\"\");\n\t\tparam.setWritable(false);\n\t\treturn param;\n\t}",
"private ConsoleCommand[] registerCommands(){\r\n\t\tHelpCommand help = new HelpCommand(this.application, \"Help\", \"?\");\r\n\t\t\r\n\t\tConsoleCommand[] commands = {\r\n\t\t\t\tnew WebServicesCommand(this.application, \"WebService\"),\r\n\t\t\t\tnew ScannerCommand(this.application, \"Scanner\"),\r\n\t\t\t\tnew ShowConfigCommand(this.application, \"System.Config\", \"Config\"),\r\n\t\t\t\tnew ShowStatsCommand(this.application, \"System.Stats\", \"Stats\"),\r\n\t\t\t\tnew ShutdownCommand(this.application, \"System.Shutdown\", \"Exit\", \"Shutdown\"),\r\n\t\t\t\tnew DisableUserCommand(this.application, \"User.Disable\"),\r\n\t\t\t\tnew EnableUserCommand(this.application, \"User.Enable\"),\r\n\t\t\t\tnew ListUsersCommand(this.application, \"User.List\"),\r\n\t\t\t\tnew SetPasswordCommand(this.application, \"User.SetPassword\"),\r\n\t\t\t\tnew UnlockUserCommand(this.application, \"User.Unlock\"),\r\n\t\t\t\tnew AddUserCommand(this.application, \"User.Add\"),\r\n\t\t\t\tnew ShowEventsCommand(this.application, \"ShowEvents\"),\r\n\t\t\t\tnew TaskListCommand(this.application, \"Task.List\"),\r\n\t\t\t\tnew TaskStopCommand(this.application, \"Task.Stop\"),\r\n\t\t\t\tnew EventLogLastCommand(this.application, \"EventLog.Last\"),\r\n\t\t\t\tnew EventLogViewCommand(this.application, \"EventLog.View\"),\r\n\t\t\t\thelp\r\n\t\t};\r\n\t\t\r\n\t\t\r\n\t\tdefaultCommand = help;\r\n\t\thelp.setCommands(commands);\r\n\t\t\r\n\t\treturn commands;\r\n\t}",
"public Request<E, T> buildHttpGet ()\n\t{\n\t\treturn new HttpGetRequest<E,T>(this);\n\t}",
"public interface AbstractCommandFactory {\n\n /**\n * Abstrakte Methode zur erzeugung eines Kommndos.\n *\n * @param param alle Parameter die zur Erzeugung benoetigt werden.\n * @return das entsprechende erzeugte Kommando.\n */\n public Command create(Object... param);\n}",
"private Command getCommand(String s) throws Exception {\n Class c = Class.forName(\"model.command.\" + this.getSymbol(this.getSymbol(s, translations), commandTranslations));\n Constructor ct = c.getConstructor();\n return (Command) ct.newInstance();\n }",
"@Override\n\t/**\n\t * @return commandName\n\t */\n\tpublic String getOperationName() {\n\t\treturn commandName;\n\t}",
"private final static HttpRequest createRequest() {\r\n\r\n HttpRequest req = new BasicHttpRequest\r\n (\"GET\", \"/\", HttpVersion.HTTP_1_1);\r\n //(\"OPTIONS\", \"*\", HttpVersion.HTTP_1_1);\r\n\r\n return req;\r\n }",
"public interface Command {\n\t public String execute(String[] request);\n}",
"@Override\n\tpublic CommandAction execute(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\treturn new CommandAction(false, \"delete.jsp\");\n\t}",
"public MonitorGetCommand mapGetCommand(String dottedName)\n throws MalformedNameException {\n ParsedDottedName result = parseDottedName(dottedName, CLI_COMMAND_GET);\n MonitorGetCommand command;\n if (result.monitoredObjectType != null) {\n command = new MonitorGetCommand(result.objectName,\n result.monitoredObjectType, result.attributeName);\n } else {\n command = new MonitorGetCommand(result.objectName,\n result.attributeName);\n }\n return command;\n }",
"public RestUtils setMethodGet()\n\t{\n\t\trestMethodDef.setHttpMethodPost(false);\n\t\treturn this;\n\t}",
"public ContainerHttpGet httpGet() {\n return this.httpGet;\n }",
"Operation createOperation();",
"Operation createOperation();",
"public interface CommandProvider {\n /**\n * Provide command hospital command.\n *\n * @param uri the uri\n * @return the hospital command\n */\n HospitalCommand provideCommand(String uri);\n}",
"private Command createPushCommand() {\n\t\treturn new PushCommand();\n\t}",
"public interface CommandManagerService {\n\n\t/**\n\t * This method gets the available command types on the edge server and the\n\t * ID of the ReaderFactory that the command type works with.\n\t * \n\t * @return A set of CommandConfigPluginDTOs\n\t */\n\tSet<CommandConfigFactoryDTO> getCommandConfigFactories();\n\n\t/**\n\t * Get all the CommandConfigFactoryID associated with a readerFactoryID.\n\t * \n\t * @param readerFactoryID\n\t * @return\n\t */\n\tSet<CommandConfigFactoryDTO> getCommandConfigFactoriesByReaderID(String readerFactoryID);\n\n\t/**\n\t * Get the CommandConfigurationFactory\n\t * @param commandFactoryID\n\t * @return\n\t */\n\tCommandConfigFactoryDTO getCommandConfigFactory(\n\t\t\tString commandFactoryID);\n\n\t/**\n\t * Gets the DTOs for configured commands.\n\t * \n\t * @return a set of configured commands\n\t */\n\tSet<CommandConfigurationDTO> getCommands();\n\n\t/**\n\t * Gets the DTO for a given Command Configuration.\n\t * \n\t * @param commandConfigurationID\n\t * The ID of the commandConfiguration to get\n\t * @return A DTO for the configured command, or null if no command\n\t * configuration is available for the given ID\n\t */\n\tCommandConfigurationDTO getCommandConfiguration(\n\t\t\tString commandConfigurationID);\n\n\t/**\n\t * Gets the meta information necessary to construct a new Command.\n\t * \n\t * @param commandType\n\t * the type of command to make\n\t * @return an MBeanInfo object that describes how to make a new command\n\t */\n\tMBeanInfo getCommandDescription(String commandType);\n\n\t/**\n\t * Create a new Command.\n\t * \n\t * @param commandType\n\t * The type of the Command to make\n\t * @param properties\n\t * the properties of a Command\n\t * @return the id of new created command\n\t */\n\tString createCommand(String commandType, AttributeList properties);\n\n\t/**\n\t * Sets the properties of a Command.\n\t * \n\t * @param commandID\n\t * the ID of the command to set\n\t * @param properties\n\t * the new properties of the command\n\t */\n\tvoid setCommandProperties(String commandID, AttributeList properties);\n\n\t/**\n\t * Delete a command configuration.\n\t * \n\t * @param commandConfigurationID\n\t * the ID of the commandConfiguration to delete\n\t */\n\tvoid deleteCommand(String commandID);\n}",
"public Command createOperationCommand(int operator, Operand operand1, Operand operand2);",
"public interface CommandInterface {\n\n\tpublic static class Commands\n\t{\n\t\tpublic static final String ABORT = \"ABOR\";\n\t\tpublic static final String ACCOUNT_INFO = \"ACCT\";\n\t\tpublic static final String AUTHENTICATION_DATA = \"ADAT\";\n\t\tpublic static final String ALLOCATE_DISK_SPACE = \"ALLO\";\n\t\tpublic static final String APPEND = \"APPE\";\n\t\tpublic static final String AUTHENTICATION_MECHANISM = \"AUTH\";\n\t\tpublic static final String GET_AVAILABLE_SPACE = \"AVBL\";\n\t\tpublic static final String CLEAR_COMMAND_CHANNEL = \"CCC\";\n\t\tpublic static final String CHANGE_TO_PARENT_DIRECTORY = \"CDUP\";\n\t\tpublic static final String CONFIDENTIALITY_PROTECTION_COMMAND = \"CONF\";\n\t\tpublic static final String SERVER_IDENTIFICATION = \"CSID\";\n\t\tpublic static final String CHANGE_WORKING_DIRECTORY = \"CWD\";\n\t\tpublic static final String DELETE_FILE = \"DELE\";\n\t\tpublic static final String GET_DIRECTORY_SIZE = \"DSIZ\";\n\t\tpublic static final String PRIVACY_PROTECTED = \"ENC\";\n\t\tpublic static final String SPECIFY_ADDRESS_AND_PORT = \"EPRT\";\n\t\tpublic static final String ENTER_EXTENDED_PASSIVE_MODE = \"EPSV\";\n\t\tpublic static final String GET_FEATURE_LIST = \"FEAT\";\n\t\tpublic static final String HELP = \"HELP\";\n\t\tpublic static final String GET_HOST_BY_NAME = \"HOST\";\n\t\tpublic static final String LANGUAGE_NEGOTIATION = \"LANG\";\n\t\tpublic static final String GET_FILES_LIST = \"LIST\";\n\t\tpublic static final String SPECIFY_LONGADDRESS_AND_PORT = \"LPRT\";\n\t\tpublic static final String ENTER_LONG_PASSIVE_MODE = \"LPSV\";\n\t\tpublic static final String GET_LAST_MODIFICATION_TIME = \"MDTM\";\n\t\tpublic static final String MODIFY_CREATION_TIME = \"MFCT\";\n\t\tpublic static final String MODIFY_FACT = \"MFF\";\n\t\tpublic static final String MODIFY_MODYFICATION_TIME = \"MFMT\";\n\t\tpublic static final String INTEGRITY_PROTECTION = \"MIC\";\n\t\tpublic static final String MAKE_DIRECTORY = \"MKD\";\n\t\tpublic static final String LIST_A_CONTENT = \"MLSD\";\n\t\tpublic static final String PROVIDES_DATA = \"MLST\";\n\t\tpublic static final String SET_TRANSFER_MODE = \"MODE\";\n\t\tpublic static final String LIST_OF_FILE_NAMES = \"NLST\";\n\t\tpublic static final String NO_OPERATION = \"NOOP\";\n\t\tpublic static final String SELECT_OPTIONS = \"OPTS\";\n\t\tpublic static final String AUTHENTICATION_PASSWORD = \"PASS\";\n\t\tpublic static final String ENTER_PASSIVE_MODE = \"PASV\";\n\t\tpublic static final String PROTECTION_BUFFER_SIZE = \"PBSZ\";\n\t\tpublic static final String SPECIFY_PORT = \"PORT\";\n\t\tpublic static final String DATA_CHANNEL_PROTECTION_LEVEL = \"PROT\";\n\t\tpublic static final String PRINT_WORKING_DIRECTORY = \"PWD\";\n\t\tpublic static final String DISCONNECT = \"QUIT\";\n\t\tpublic static final String REINITIALIZE = \"REIN\";\n\t\tpublic static final String RESTART = \"REST\";\n\t\tpublic static final String RETRIEVE_A_COPY = \"RETR\";\n\t\tpublic static final String REMOVE_DIRECTORY = \"RMD\";\n\t\tpublic static final String REMOVE_DIRECTORY_TREE = \"RMDA\";\n\t\tpublic static final String RENAME_FROM = \"RNFR\";\n\t\tpublic static final String RENAME_TO = \"RNTO\";\n\t\tpublic static final String SITE_SPECIFFIC_COMMAND = \"SITE\";\n\t\tpublic static final String SIZE_OF_FILE = \"SIZE\";\n\t\tpublic static final String MOUNT_FILE_STRUCTURE = \"SMNT\";\n\t\tpublic static final String USE_SINGLE_PORT_PASSIVE_MODE = \"SPSV\";\n\t\tpublic static final String GET_STATUS = \"STAT\";\n\t\tpublic static final String ACCEPT_AND_STORE = \"STOR\";\n\t\tpublic static final String STORE_FILE_UNIQUELY = \"STOU\";\n\t\tpublic static final String SET_FILE_TRANSFER_STRUCT = \"STRU\";\n\t\tpublic static final String GET_SYSTEM_TYPE = \"SYST\";\n\t\tpublic static final String GET_THUMBNAIL = \"THMB\";\n\t\tpublic static final String SET_TRANSFER_TYPE = \"TYPE\";\n\t\tpublic static final String AUTHENTICATION_USERNAME = \"USER\";\n\t}\n\t\n\t/**\n\t * Types of transmission.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class TransmissionTypes\n\t{\n\t\tpublic static final String BINARY = \"I\";\n\t\tpublic static final String ASCII = \"A\";\n\t}\n\n\t/**\n\t * Inner class for responses from server.\n\t * @author P.Gajewski\n\t *\n\t */\n\tpublic static class ServerResonses\n\t{\n\t\t/**\n\t\t * 1xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitivePreliminaryReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"100\";\n\t\t\tpublic static final String RESTART_REPLY = \"110\";\n\t\t\tpublic static final String SERVICE_READY = \"120\";\t\n\t\t\tpublic static final String DATA_CONNECTION_ALREADY_OPENED = \"125\";\n\t\t\tpublic static final String FILE_STATUS_OKAY = \"150\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 2xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PossitiveCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"200\";\n\t\t\tpublic static final String SYSTEM_STATUS = \"211\";\n\t\t\tpublic static final String DIRECTORY_STATUS = \"212\";\n\t\t\tpublic static final String FILE_STATUS = \"213\";\n\t\t\tpublic static final String HELP_MESSAGE = \"214\";\n\t\t\tpublic static final String NAME_SYSTEM_TYPE = \"215\";\n\t\t\tpublic static final String READY_FOR_NEW_USER = \"220\";\n\t\t\tpublic static final String SERVICE_CLOSING_CONTROL_CONNECTION = \"221\";\n\t\t\tpublic static final String OPEN_DATA_CONNECTION = \"225\";\t\t\t\n\t\t\tpublic static final String CLOSING_DATA_CONNECTION = \"226\";\n\t\t\tpublic static final String PASSIVE_MODE = \"227\";\n\t\t\tpublic static final String LONG_PASSIVE_MODE = \"228\";\n\t\t\tpublic static final String EXTENDED_PASSIVE_MODE = \"229\";\n\t\t\tpublic static final String USER_LOG_IN = \"230\";\n\t\t\tpublic static final String USER_LOG_OUT = \"231\";\n\t\t\tpublic static final String LOGOUT_NOTED = \"232\";\n\t\t\tpublic static final String REQUESTED_OK = \"250\";\n\t\t\tpublic static final String PATHNAME_CREATED = \"257\";\t\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 3xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PositiveIntermediateReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"300\";\n\t\t\tpublic static final String USERNAME_OK_PASSWORD_NEEDED = \"331\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_LOGIN = \"332\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION = \"350\";\n\t\t}\n\t\t\n\t\t/**\n\t\t * 4xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class TransientNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"400\";\n\t\t\tpublic static final String SERVICE_NOT_AVAILABLE = \"421\";\n\t\t\tpublic static final String CANT_OPEN_DATA_CONNECTION = \"425\";\n\t\t\tpublic static final String CONNECTION_CLOSED = \"426\";\n\t\t\tpublic static final String INVALID_USERNAME_OR_PASSWORD = \"430\";\n\t\t\tpublic static final String REQUESTED_HOST_UNAVAILABLE = \"434\";\n\t\t\tpublic static final String REQUESTED_FILE_ACTION_NOT_TAKEN = \"450\";\n\t\t\tpublic static final String LOCAL_ERROR = \"451\";\n\t\t\tpublic static final String FILE_BUSY = \"452\";\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 5xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class PermamentNegativeCompletionReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"500\";\n\t\t\tpublic static final String SYNTAX_ERROR = \"501\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED = \"502\";\n\t\t\tpublic static final String BAD_SEQUENCE_OF_COMMANDS = \"503\";\n\t\t\tpublic static final String COMMAND_NOT_IMPLEMENTED_FOR_THAT_PARAMETER = \"504\";\n\t\t\tpublic static final String NOT_LOGGED_IN = \"530\";\n\t\t\tpublic static final String NEED_ACCOUNT_FOR_STORING_FILES = \"532\";\n\t\t\tpublic static final String POLICY_REQUIRES_SSL = \"534\";\n\t\t\tpublic static final String FILE_NOT_FOUND = \"550\";\n\t\t\tpublic static final String PAGE_TYPE_UNKNOWN = \"551\";\t\t\t\n\t\t\tpublic static final String EXCEEDED_STORAGE_ALLOCATION = \"552\";\n\t\t\tpublic static final String FILE_NAME_NOT_ALLOWED = \"553\";\t\t\n\t\t}\n\t\t\n\t\t/**\n\t\t * 6xx replay codes.\n\t\t * @author P.Gajewski\n\t\t *\n\t\t */\n\t\tpublic static class ProtectedReply\n\t\t{\n\t\t\tpublic static final String GENERAL = \"600\";\n\t\t\tpublic static final String INTEGRITY_PROTECTED_REPLY = \"631\";\n\t\t\tpublic static final String CONFIDENTIALITY_AND_INTEGRITY_PROTECTED_REPLY = \"632\";\t\t\t\n\t\t\tpublic static final String CONFIDENTIALITY_PROTECTED_REPLY = \"633\";\t\t\t\n\t\t}\n\t}\n\t\n\t/**\n\t * Language controller.\n\t */\n\tpublic final static LanguageController lc = LanguageController.getInstance();\n\t\n\tpublic void execute(FTPLexer lexer);\n}",
"private RawHttpResponse<?> executeRequest(String method, String path) throws IOException {\r\n\t\tSocket socket = new Socket(\"localhost\", 8080);\r\n\t\treturn executeRequest(method, path, \"\", socket);\r\n\t}",
"public interface CommandFactory {\n\n /**\n * Create a command, to be executed later\n *\n * @return a command object\n * @throws ServiceException if error in creating object\n */\n Command createCommand() throws ServiceException, AuthException;\n\n}",
"StrCommand getFeatureNew();",
"Request _request(String operation);",
"Commands getCommandes();",
"private HttpUriRequest createHttpRequest(String url, String method,\n\t\t\tList<NameValuePair> params) throws UnsupportedEncodingException {\n\t\tHttpUriRequest request;\n\t\tif (method.toUpperCase().equals(\"GET\")) {\n\t\t\trequest = new HttpGet(url);\n\t\t} else if (method.toUpperCase().equals(\"POST\")) {\n\t\t\tHttpPost post = new HttpPost(url);\n\t\t\tpost.setEntity(new UrlEncodedFormEntity(params));\n\t\t\trequest = post;\n\t\t} else if (method.toUpperCase().equals(\"PUT\")) {\n\t\t\trequest = new HttpPut(url);\n\t\t} else if (method.toUpperCase().equals(\"DELETE\")) {\n\t\t\trequest = new HttpDelete(url);\n\t\t} else {\n\t\t\trequest = new HttpGet();\n\t\t}\n\n\t\treturn request;\n\t}",
"protected BackendCommandResponse createResponse(List<IBackendCommand> commands) {\n\t\treturn new BackendCommandResponse(ImmutableList.copyOf(commands));\n\t}",
"public String process(String query) {\r\n\t\tString command = query.split(\" \")[0].trim().toUpperCase();\r\n\t\tString response;\r\n\t\t\r\n\t\tswitch ( command ) {\r\n\t\t\tcase \"CREATE\":\r\n\t\t\t\tresponse = this.processCreate(query);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tresponse = this.processGet(query);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"ADD\":\r\n\t\t\t\tresponse = this.processAdd(query);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REMOVE\":\r\n\t\t\t\tresponse = this.processRemove(query);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tresponse = \"ERROR Unknow command - Available command CREATE, GET, ADD, REMOVE\\n\";\r\n\t\t}\r\n\t\t\r\n\t\treturn response;\r\n\t}",
"public interface MethodsHttpUtils {\n HttpResponse doGet(String url, String mediaType) throws AppServerNotAvailableException, IOException;\n HttpResponse doPost(String url, String mediaType, String dataJson) throws UnsupportedEncodingException, ClientProtocolException, AppServerNotAvailableException;\n HttpResponse doDelete(String url, String mediaType) throws AppServerNotAvailableException;\n HttpResponse doPut(String url, String mediaType, String dataJson) throws AppServerNotAvailableException;\n}",
"public DResult get(Get get, long startId) throws IOException;",
"@Override\n public Answer executeRequest(Command cmd) {\n return null;\n }",
"public interface ICommand {\r\n \r\n /**\r\n * method execute some command\r\n * @param request\r\n * @param response\r\n * @return\r\n * @throws ServletException\r\n * @throws IOException \r\n */\r\n public String execute(HttpServletRequest request, \r\n HttpServletResponse response) throws ServletException, IOException;\r\n}",
"public Command createInstance() {\n\t\t\n\t\tif(name == \"Direction\")\n\t\t\treturn new Direction();\n\t\t\n\t\tif(name == \"Gear\")\n\t\t\treturn new Gear();\n\t\t\n\t\tif(name == \"Pause\")\n\t\t\treturn new Pause();\n\t\t\n\t\treturn null;\n\t\t\n\t}",
"private GetLCCommand() {\n initFields();\n }",
"public static Command get(String commandName) {\n if (commandName == null || !commands.containsKey(commandName)) {\n log.trace(\"Command not found, name --> \" + commandName);\n return commands.get(\"noCommand\");\n }\n\n return commands.get(commandName);\n }",
"private DockerCommand<?> createCommand(Class<? extends DockerCommand<?>> commandType) {\n try {\n return commandType.newInstance();\n } catch (InstantiationException | IllegalAccessException e) {\n throw new BeanCreationException(\"Failed to create Docker command of type: \" + commandType, e);\n }\n }",
"protected Command asCommand(Object command) {\n\t\tif (command instanceof Command) {\n\t\t\treturn (Command) command;\n\t\t} else if (command instanceof CommandBuilder) {\n\t\t\treturn ((CommandBuilder) command).build();\n\t\t} else if (command instanceof Class<?>) {\n\t\t\treturn Commands.create((Class<?>) command).build();\n\t\t} else {\n\t\t\treturn CommandAdapters.createAdapter(command);\n\t\t}\n\t}",
"public Result get(Get get) throws IOException;",
"protected HttpResponse createAndExecuteRequest(URI uri, HttpEntity httpEntity, HttpMethod method)\r\n throws ServiceUnavailableException {\r\n\r\n boolean hasRetried = false;\r\n while (true) {\r\n try {\r\n ((DefaultHttpClientFactory) httpClientFactory).create(null, null);\r\n HttpRequestBase request = null;\r\n if (method == HttpMethod.POST) {\r\n request = new HttpPost(uri);\r\n } else if (method == HttpMethod.PATCH) {\r\n request = new HttpPatch(uri);\r\n } else if (method == HttpMethod.DELETE) {\r\n request = new HttpDelete(uri);\r\n } else {\r\n throw new HttpClientException(\"Unsupported operation:\" + method);\r\n }\r\n this.authStrategy.configureRequest(request);\r\n\r\n if (request instanceof HttpEntityEnclosingRequestBase) {\r\n ((HttpEntityEnclosingRequestBase) request).setEntity(httpEntity);\r\n }\r\n HttpResponse response = httpClientState.getHttpClient().execute(request);\r\n if (isResponseSuccess(response.getStatusLine().getStatusCode())) {\r\n request.releaseConnection();\r\n EntityUtils.consume(response.getEntity());\r\n return response;\r\n } else {\r\n if (response.getStatusLine().getStatusCode() == HttpStatus.SC_UNAUTHORIZED && !hasRetried) {\r\n this.authStrategy.refreshAuth();\r\n hasRetried = true;\r\n continue;\r\n }\r\n HttpEntity entity = response.getEntity();\r\n String message = null;\r\n if (entity != null) {\r\n message = odataClient.getDeserializer(ContentType.JSON).toError(entity.getContent()).getMessage();\r\n } else {\r\n message = response.getStatusLine().getReasonPhrase();\r\n }\r\n throw new HttpClientException(message);\r\n }\r\n } catch (Exception e) {\r\n throw new HttpClientException(e);\r\n }\r\n }\r\n }",
"public CommandDirector() {\n\t\t//factory = ApplicationContextFactory.getInstance();\n\t\t//context = factory.getClassPathXmlApplicationContext();\n\t\t\n\t\t//commands.put(\"createEntry\", context.getBean(\"creationEntryCommand\", CreationEntryCommand.class));\n\t\t//commands.put(\"searchEntry\", context.getBean(\"searchingEntryCommand\", SearchingEntryCommand.class));\n\t\t\n\t\tcommands.put(\"createEntry\", new CreationEntryCommand());\n\t\tcommands.put(\"searchEntry\", new SearchingEntryCommand());\n\t\t\n\t}",
"int getCommand();",
"private HorizontalPanel createCommands() {\n\t\tfinal HorizontalPanel bar = new HorizontalPanel();\n\t\tbar.addStyleName(AbstractField.CSS.cbtAbstractCommand());\n\t\t\n\t\t//-----------------------------------------------\n\t\t// Save button\n\t\t//-----------------------------------------------\n\t\tfinal CommandButton saveButton = new CommandButton(this, AbstractField.CONSTANTS.allSave(), actorUpdate, tab++);\n\t\tsaveButton.addStyleName(AbstractField.CSS.cbtCommandButtonTwo());\n\t\tsaveButton.addStyleName(AbstractField.CSS.cbtGradientBlue());\n\t\tsaveButton.setTitle(AbstractField.CONSTANTS.helpSave());\n\t\tbar.add(saveButton);\n\n\t\t//-----------------------------------------------\n\t\t// Delete button\n\t\t//-----------------------------------------------\n\t\tfinal CommandButton deleteButton = new CommandButton(this, AccessControl.DELETE_PERMISSION, AbstractField.CONSTANTS.allDelete(), actorDelete, tab++);\n\t\tdeleteButton.addStyleName(AbstractField.CSS.cbtCommandButtonTwo());\n\t\tdeleteButton.addStyleName(AbstractField.CSS.cbtGradientRed());\n\t\tdeleteButton.setTitle(AbstractField.CONSTANTS.helpDelete());\n\t\tbar.add(deleteButton);\n\n\t\t//-----------------------------------------------\n\t\t// Transition array that defines the finite state machine\n\t\t//-----------------------------------------------\n\t\tfsm = new ArrayList<Transition>();\n\t\tfsm.add(new Transition(Party.CREATED, saveButton, Party.CREATED));\n\t\tfsm.add(new Transition(Party.CREATED, deleteButton, Party.FINAL));\n\n\t\treturn bar;\n\t}",
"@CommandDescription(name=\"retrieveProduto\", kind=CommandKind.Retrieve, requestPrimitive=\"retrieveProduto\", responsePrimitive=\"retrieveProdutoResponse\")\npublic interface RetrieveProduto extends MessageHandler {\n \n public Produto retrieveProduto(Produto.Id id);\n \n}",
"public String getCommand() { return command; }",
"@Override\r\n\tpublic Command getCommand(Request request) {\n\t\tif (request.getType().equals(RequestConstants.REQ_RESIZE_CHILDREN)) {\r\n\t \tCommand cmd = RootEditPartUtils.getResizeCommand((ChangeBoundsRequest)request);\r\n\t \tif(cmd!=null) return cmd;\r\n\t }\r\n\t\tif (request.getType() == RequestConstants.REQ_CREATE) {\r\n\t\t\t// Use JDTSelUtils so that we get any spring elmts\r\n\t\t\tObject reqObj = ((CreateRequest)request).getNewObject();\r\n\t\t\tif(reqObj instanceof Comment )\r\n\t\t\t\treturn createCommentCommand((Comment) reqObj,(CreateRequest) request);\r\n\t\t\telse if(reqObj instanceof UserCreatedFragment ) {\r\n\t\t\t\tCompoundCommand cc = new CompoundCommand(\"Add User Created Class\");\r\n//\t\t\t\tStrataArtFragEditPart.addSingleUserCreatedArt(cc, ((CreateRequest) request).getLocation(), this, (UserCreatedFragment) reqObj, getRootModel());\r\n\t\t\t\tStrataArtFragEditPart.addSingleArt(cc, ((CreateRequest) request).getLocation(), this, (UserCreatedFragment) reqObj, getRootModel());\r\n\t\t\t\treturn cc;\r\n\t\t \t} else {\r\n\t\t\t\tList<IJavaElement> reqList = JDTSelectionUtils.getSelectedJDTElements(false);\r\n\t\t\t\tif(reqList.isEmpty() && reqObj instanceof List) {\r\n\t\t\t\t\t// request may have originated from selection(s) in Open Type dialog, in\r\n\t\t\t\t\t// which case reqList from JDTSelectionUtils will be empty and we\r\n\t\t\t\t\t// should open the reqObj list\r\n\t\t\t\t\tfor(Object o : (List<?>)reqObj)\r\n\t\t\t\t\t\tif(o instanceof IJavaElement) reqList.add((IJavaElement)o);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// create a compound command and add an \"Add command\" for each item selected \r\n\t\t\t\tif (BuildPreferenceUtils.selectionInBuild(reqList)) {\r\n\t\t\t\t\treturn ModelUtils.collectAndOpenItems(reqList, getRootModel(), ((CreateRequest) request).getLocation(), this);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Adds the requested item(s) to the NEW parent\r\n\t\t// Moving a part from its package to the root or to a different package\r\n\t\tif (request.getType() == RequestConstants.REQ_ADD ) {\r\n\t\t\treturn createMoveCommand((ChangeBoundsRequest)request);\r\n\t\t}\r\n\t\t// Used to move a ArtFrag to a different location in the same Layer within the same parent\r\n\t\t// reordering elements within the same layer\r\n\t\tif (request.getType() == RequestConstants.REQ_MOVE_CHILDREN ) {\r\n\t\t\treturn createMoveCommand((ChangeBoundsRequest)request);\r\n\t\t}\r\n\t\t// else\r\n\t\tif (request.getType() == RequestConstants.REQ_DELETE\r\n\t\t\t\t|| request.getType() == RequestConstants.REQ_MOVE\r\n\t\t\t\t|| request.getType() == RequestConstants.REQ_ORPHAN\r\n\t\t\t\t|| request.getType() == RequestConstants.REQ_ORPHAN_CHILDREN\r\n\t\t\t\t) {\r\n\t\t\t// these happen often\r\n\t\t\treturn super.getCommand(request);\r\n\t\t} else {\r\n\t\t\tlogger.info(\"CEP.getCommand: \" + request.getType() + \" EP: \" + this.getClass() + \" // Model: \" + this.getModel().getClass());\r\n\t\t\treturn super.getCommand(request);\r\n\t\t}\r\n\t}",
"java.lang.String getCommand(int index);",
"@SuppressWarnings(\"unchecked\")\n public static <T extends CommandBase> T getFromName(String cmdName,\n Class<T> cmdClass) throws CommandNotFoundException {\n T cmd = null;\n try {\n Method getFullClassName = cmdClass.getMethod(\"getFullClassName\", String.class);\n cmdName = (String)getFullClassName.invoke(null, cmdName);\n\n Class<?> specificClass = Class.forName(cmdName);\n cmd = (T) specificClass.newInstance();\n } catch (NoSuchMethodException e) {\n // Este tipo de erro nao pode passar em branco. Alguem esqueceu de implementar\n // o metodo estatico \"getFullClassName\" na superclasse de comando\n Logger.error(\"getFullClassName nao esta definifo - \" + cmdClass.getName());\n throw new RuntimeException(\"getFullClassName nao esta definido em \"\n + cmdClass.getName());\n } catch (Exception e) {\n // Qualquer outro problema durante a instanciacao do comando\n // e tratado como command not found\n Logger.error(\"Exception durante a criacao do comando!\", e);\n throw new CommandNotFoundException(e);\n }\n return cmd;\n }",
"private String interpredCommand(String[] data, String commandName) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {\n\n\t\tString ClassCommandName = String.valueOf(commandName.charAt(0)).toUpperCase() + commandName.substring(1);\n\t\tClass<?> commandClass = Class.forName(COMMAND_PATH + ClassCommandName + COMMAND_SUFIX_NAME);\n\n\t\tConstructor<?> declareContructor = commandClass.getDeclaredConstructor(String[].class, Repository.class,\n\t\t\t\tUnitFactory.class);\n\n\t\tExecutable command = (Executable) declareContructor.newInstance(data, this.repository, this.unitFactory);\n\t\treturn command.execute();\n\n\t}",
"private void mappingMethodGet() throws SecurityException, NoSuchMethodException{\n\t\tString aux = upFirstLetter();\n\t\tString methodGet = \"get\" + aux;\n\t\tthis.methodGet = this.classFather.getMethod(methodGet);\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic HttpDeleteRequest<E,String> buildHttpDelete ()\n\t{\n\t\treturn new HttpDeleteRequest<E,String>((HttpBuilder<E, String>) this);\n\t}",
"@NotNull\n String getCommandTemplate();",
"private Command() {\n initFields();\n }",
"private Command createUserCommand(Command command) {\n int count = command.getParameters().get(0).getParameters().size();\n var param = new ListBody();\n while(count > 0) {\n param.addParameter(getCommandTree());\n count--;\n }\n command.addParameter(param);\n return command;\n }"
] | [
"0.6788158",
"0.6325702",
"0.6230606",
"0.62296635",
"0.621277",
"0.618512",
"0.6165898",
"0.6133152",
"0.60898954",
"0.60777795",
"0.6075278",
"0.60366786",
"0.58721465",
"0.5843988",
"0.5804194",
"0.57654256",
"0.57645375",
"0.57645375",
"0.576222",
"0.56943357",
"0.5694145",
"0.56628835",
"0.56389993",
"0.5626828",
"0.5594381",
"0.55935735",
"0.5592444",
"0.5498041",
"0.54497486",
"0.5441544",
"0.5425087",
"0.5421645",
"0.54029834",
"0.53943825",
"0.53803885",
"0.5375818",
"0.5328357",
"0.53184694",
"0.5302259",
"0.5288225",
"0.5284849",
"0.5283864",
"0.5281266",
"0.5265748",
"0.52599746",
"0.52445126",
"0.52353024",
"0.5231775",
"0.5222685",
"0.52155495",
"0.5214341",
"0.5212879",
"0.52036005",
"0.5203576",
"0.51999664",
"0.5197302",
"0.5196468",
"0.5194779",
"0.51775885",
"0.51762354",
"0.5163421",
"0.5163421",
"0.51620585",
"0.5154742",
"0.51530045",
"0.5149379",
"0.5146021",
"0.51409805",
"0.5128148",
"0.5116244",
"0.510551",
"0.5104391",
"0.5094497",
"0.5076075",
"0.5071457",
"0.5070611",
"0.5069638",
"0.50655067",
"0.5060356",
"0.50600356",
"0.5056005",
"0.50557864",
"0.5054247",
"0.5052805",
"0.5045999",
"0.5038052",
"0.5037909",
"0.50180817",
"0.50145733",
"0.50126195",
"0.50069475",
"0.4990155",
"0.49896067",
"0.49888715",
"0.49793097",
"0.49785525",
"0.49761206",
"0.49712348",
"0.4968614",
"0.49669716"
] | 0.6138662 | 7 |
LISTA TODOS AS PARCELAS CADASTRADOS NO BANCO | public List<Parcela> readParcela() throws ClassNotFoundException {
java.sql.Connection con = ConnectionFactory.getConnection();
PreparedStatement stmt = null;
ResultSet rs = null;
List<Parcela> Parcela = new ArrayList<>();
try {
stmt = con.prepareStatement("SELECT codParcela, DATEDIFF(NOW(), dataVencParcela) as diasVencPar FROM tbparcela WHERE statusParcela = 1");
rs = stmt.executeQuery();
while (rs.next()) {
Parcela par = new Parcela();
par.setCodParcela(rs.getInt("codParcela"));
par.setDiasAtrasoPar(rs.getInt("diasVencPar"));
Parcela.add(par);
}
} catch (SQLException ex) {
Logger.getLogger(ParcelaDao.class.getName()).log(Level.SEVERE, null, ex);
} finally {
ConnectionFactory.closeConnection(con, stmt, rs);
}
return Parcela;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public List<ActDetalleActivo> listarDetalleActivoLaboratorio(long codigoSalaLaboratorio,long codigoTipo,String amie, int estado,int anio);",
"public void listar(){\n if (!esVacia()) {\n // Crea una copia de la lista.\n NodoEmpleado aux = inicio;\n // Posicion de los elementos de la lista.\n int i = 0;\n System.out.print(\"-> \");\n // Recorre la lista hasta llegar nuevamente al incio de la lista.\n do{\n // Imprime en pantalla el valor del nodo.\n System.out.print(i + \".[ \" + aux.getEmpleado() + \" ]\" + \" -> \");\n // Avanza al siguiente nodo.\n aux = aux.getSiguiente();\n // Incrementa el contador de la posi�n.\n i++;\n }while(aux != inicio);\n }\n }",
"private void listaContatos() throws SQLException {\n limpaCampos();\n BdLivro d = new BdLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\");\n\n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }",
"public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }",
"private static List<Billetes> generarBilletes(String fecha, Pasajero p){\n\t\tList<Billetes> billetes = new ArrayList<>();\n\t\t\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tBilletes billete = new Billetes();\n\t\t\tbillete.setId(i);\n\t\t\tbillete.setFecha(fecha);\n\t\t\t\n\t\t\tchar c1 = (char)new Random().nextInt(50);\n\t\t\tchar c2 = (char)new Random().nextInt(50);\n\t\t\t\n\t\t\t/*\n\t\t\t * \n\t\t\t */\n\t\t\tbillete.setAsiento(\"\" + c1 + c2 + new Random().nextInt(100) + new Random().nextInt(50));\n\t\t\tbillete.setPasajero(p); \n\t\t\tbillete.setVuelo(p.getVuelos().get(new Random().nextInt(p.getVuelos().size())));\n\t\t\t\n\t\t\tbilletes.add(billete);\n\t\t}\n\t\t\n\t\treturn billetes;\n\t}",
"private void listaContatos() throws SQLException {\n limpaCampos();\n DAOLivro d = new DAOLivro();\n livros = d.getLista(\"%\" + jTPesquisar.getText() + \"%\"); \n \n // Após pesquisar os contatos, executa o método p/ exibir o resultado na tabela pesquisa\n mostraPesquisa(livros);\n livros.clear();\n }",
"List<ParqueaderoEntidad> listar();",
"List<Persona> obtenerTodasLasPersona();",
"public List<Tripulante> buscarTodosTripulantes();",
"public void mostrarLista(){\n Nodo recorrer = inicio;\n while(recorrer!=null){\n System.out.print(\"[\"+recorrer.edad+\"]-->\");\n recorrer=recorrer.siguiente;\n }\n System.out.println(recorrer);\n }",
"private void listarDadosNaTelaEditora(ArrayList<Editora> lista) {\n DefaultTableModel modelEditoras = (DefaultTableModel) jTable_tabelaEditoras.getModel();\n jTable_tabelaEditoras.setRowSorter(new TableRowSorter(modelEditoras));\n //Limpando a tela\n modelEditoras.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[2];\n Editora aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = aux.getNome();\n modelEditoras.addRow(linha);\n }\n }",
"public List<Madeira> buscaCidadesEstado(String estado);",
"public List<Location> listarPorAnunciante() throws SQLException {\r\n \r\n //OBJETO LISTA DE COMODOS\r\n List<Location> enderecos = new ArrayList<>(); \r\n \r\n //OBJETO DE CONEXÃO COM O BANCO\r\n Connection conn = ConnectionMVC.getConnection();\r\n \r\n //OBJETO DE INSTRUÇÃO SQL\r\n PreparedStatement pStatement = null;\r\n \r\n //OBJETO CONJUNTO DE RESULTADOS DA TABELA IMOVEL\r\n ResultSet rs = null;\r\n \r\n try {\r\n \r\n //INSTRUÇÃO SQL DE LISTAR IMÓVEIS\r\n pStatement = conn.prepareStatement(\"select * from pessoa inner join anuncio inner join imagem inner join imovel inner join location inner join comodo\");\r\n \r\n //OBJETO DE RESULTADO DA INSTRUÇÃO\r\n rs = pStatement.executeQuery();\r\n \r\n //PERCORRER OS DADOS DA INSTRUÇÃO\r\n while(rs.next()) {\r\n \r\n //OBJETO UTILIZADO PARA BUSCA\r\n Location endereco = new Location();\r\n \r\n //PARAMETROS DE LISTAGEM\r\n endereco.setCep(rs.getString(\"cep\"));\r\n endereco.setRua(rs.getString(\"rua\"));\r\n endereco.setNumero(rs.getInt(\"numero\"));\r\n endereco.setBairro(rs.getString(\"bairro\"));\r\n endereco.setCidade(rs.getString(\"cidade\"));\r\n endereco.setUf(rs.getString(\"uf\"));\r\n\r\n //OBJETO ADICIONADO A LISTA\r\n enderecos.add(endereco); \r\n }\r\n \r\n //MENSAGEM DE ERRO\r\n } catch (SQLException ErrorSql) {\r\n JOptionPane.showMessageDialog(null, \"Erro ao listar do banco: \" +ErrorSql,\"erro\", JOptionPane.ERROR_MESSAGE);\r\n\r\n //FINALIZAR/FECHAR CONEXÃO\r\n }finally {\r\n ConnectionMVC.closeConnection(conn, pStatement, rs);\r\n } \r\n return enderecos;\r\n }",
"private void listarItems() {\r\n // Cabecera\r\n System.out.println(\"Listado de Items\");\r\n System.out.println(\"================\");\r\n\r\n // Criterio de Ordenación/Filtrado\r\n System.out.printf(\"Criterio de Ordenación .: %S%n\", criOrd.getNombre());\r\n System.out.printf(\"Criterio de Filtrado ...: %S%n\", criFil.getNombre());\r\n\r\n // Separados\r\n System.out.println(\"---\");\r\n\r\n // Filtrado > Selección Colección\r\n List<Item> lista = criFil.equals(Criterio.NINGUNO) ? CARRITO : FILTRO;\r\n\r\n // Recorrido Colección\r\n for (Item item : lista) {\r\n System.out.println(item.toString());\r\n }\r\n\r\n // Pausai\r\n UtilesEntrada.hacerPausa();\r\n }",
"List<Pacote> buscarPorTransporte(Transporte transporte);",
"List<Entidade> listarTodos();",
"public void mostrarlistafininicio(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=fin;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.anterior;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de fin a inicio\",JOptionPane.INFORMATION_MESSAGE);\n }}",
"public List<GrauParentesco> getListTodos();",
"private void mostraPesquisa(List<BeansLivro> livros) {\n // Limpa a tabela sempre que for solicitado uma nova pesquisa\n limparTabela();\n \n if (livros.isEmpty()) {\n JOptionPane.showMessageDialog(rootPane, \"Nenhum registro encontrado.\");\n } else { \n // Linha em branco usada no for, para cada registro é criada uma nova linha \n String[] linha = new String[] {null, null, null, null, null, null, null};\n // P/ cada registro é criada uma nova linha, cada linha recebe os campos do registro\n for (int i = 0; i < livros.size(); i++) {\n tmLivro.addRow(linha);\n tmLivro.setValueAt(livros.get(i).getId(), i, 0);\n tmLivro.setValueAt(livros.get(i).getExemplar(), i, 1);\n tmLivro.setValueAt(livros.get(i).getAutor(), i, 2);\n tmLivro.setValueAt(livros.get(i).getEdicao(), i, 3);\n tmLivro.setValueAt(livros.get(i).getAno(), i, 4);\n tmLivro.setValueAt(livros.get(i).getDisponibilidade(), i, 5); \n } \n }\n }",
"List<Plaza> consultarPlazas();",
"public void listarQuartos() {\n System.out.println(\"Quartos: \\n\");\n\n if (quartosCadastrados.size() > 0) {\n String esta = quartosCadastrados.toString();\n System.out.println(esta);\n } else {\n System.err.println(\"Não existem quartos cadastrados\");\n }\n\n }",
"public void mostrarlistafininicio(){\n if(!estaVacia()){\n String datos = \"<=>\";\n NodoBus auxiliar = fin;\n while(auxiliar!=null){\n datos = datos + \"(\" + auxiliar.dato +\")->\";\n auxiliar = auxiliar.ant;\n JOptionPane.showMessageDialog(null, datos, \"Mostrando lista de fin a inicio\", JOptionPane.INFORMATION_MESSAGE);\n }\n }\n }",
"private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }",
"List<Oficios> buscarActivas();",
"public void recebeDados(\n\tList<NotasFaltasModel> lista, String nome, String curso) {\n\t\tDefaultTableModel modelo = (DefaultTableModel) tbBoletim.getModel();\n\t\tlblNome.setText(nome);\n\t\tlblCurso.setText(curso);\n\t\t\n\tfor(NotasFaltasModel boletimAluno : lista) {\n\t\t\tmodelo.addRow(new Object[] {\n\t\t\t\tboletimAluno.getDisciplina(),\n\t\t\t\tboletimAluno.getNota(),\n\t\t\t\tboletimAluno.getFaltas()\n\t\t\t});\n\t\t}\n\t}",
"public void MostrarListafINInicio() {\n if(!estVacia()){\n String datos=\"<=>\";\n NodoDoble current=fin;\n while(current!=null){\n datos += \"[\"+current.dato+\"]<=>\";\n current = current.anterior;\n }\n JOptionPane.showMessageDialog(null, datos, \"Mostrando Lista de inicio a Fin\",JOptionPane.INFORMATION_MESSAGE);\n }\n }",
"public void exibeTodosPassageiros(TextArea x)\n\t{\n\t\ttry {\n\t\t\t\n\t\t\tstmt=con.prepareStatement(\" select idbilhete, nome,origem,destino from passageiro,bilhetes where idbilhete=id_bilhete \\r\\n\" + \n\t\t\t\t\t\"order by idbilhete;\");\n\t\t\t\n\t\t\t\n\t\t\tstmt.execute();\n\t\t\t\n\t\t\t\n\t\t\trs=stmt.getResultSet();\n\t\t\t\n\t\t\t\n\t\t\twhile(rs.next())\n\t\t\t\t\n\t\t\t{\n\t\t\t\t\n\t\t\t\tint bilhete = rs.getInt(1);\n\t\t\t\tString nome = rs.getString(2);\n\t\t\t\tString destino =rs.getString(3);\n\t\t\t\tString origem =rs.getString(4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t \n\n\t\t\t\tx.append(\"\\r\\n | \"+ bilhete + \" | - \" + nome+\" - \"+ origem +\" - \" + destino + \" \\t\\t\\r\\n\\t\\r\\n \");\n\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t\t\n\t\t\n\t}",
"private void cargarNotasAclaratorias() {\r\n\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\tparametros.put(\"nro_ingreso\", admision_seleccionada.getNro_ingreso());\r\n\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\tparametros.put(\"codigo_administradora\",\r\n\t\t\t\tadmision_seleccionada.getCodigo_administradora());\r\n\t\tparametros.put(\"id_plan\", admision_seleccionada.getId_plan());\r\n\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\tparametros.put(\"tipo\", INotas.NOTAS_ACLARATORIAS);\r\n\t\ttabboxContendor\r\n\t\t\t\t.abrirPaginaTabDemanda(false, \"/pages/nota_aclaratoria.zul\",\r\n\t\t\t\t\t\t\"NOTAS ACLARATORIAS\", parametros);\r\n\t}",
"public void MostrarListas (){\n Nodo recorrer=inicio; // esto sirve para que el elemento de la lista vaya recorriendo conforme se inserta un elemento\r\n System.out.println(); // esto nos sirve para dar espacio a la codificacion de la lista al imprimir \r\n while (recorrer!=null){ // esta secuencia iterativa nos sirve para repetir las opciones del menu\r\n System.out.print(\"[\" + recorrer.dato +\"]--->\");\r\n recorrer=recorrer.siguiente;\r\n }\r\n }",
"public void listarDadosNaTelaAreaDeConhecimento(ArrayList<AreaDeConhecimento> lista, DefaultTableModel model) {\n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[3];\n AreaDeConhecimento aux = lista.get(pos);\n linha[0] = \"\" + aux.getId();\n linha[1]=aux.getClassificacaoDecimalDireito();\n linha[2] = aux.getDescricao();\n model.addRow(linha);\n }\n }",
"List<TipoHuella> listarTipoHuellas();",
"public ComandosJuego() //constructor\n\t{\n\t\tlista = new ArrayList<String>();\n\t}",
"public ArrayList<Note> pedirTodasLasNotas(){\n ArrayList<Note> todasLasNotas = new ArrayList<>();\n Note nota;\n HashMap<Integer,String> misNotas = new HashMap<Integer,String>();\n ArrayList<String> tituloTratamiento = new ArrayList<String>();\n String[] campos = {\"_id\",\"titulo\",\"fecha\"};\n Cursor c = db.query(\"nota\",campos,null,null,null,null,null);\n if(c.moveToFirst()){\n\n do{\n nota = new Note();\n nota.setId(c.getInt(0));\n nota.setTitulo(c.getString(1));\n nota.setFechaFormateada(c.getString(2));\n todasLasNotas.add(nota);\n }while(c.moveToNext());\n return todasLasNotas;\n }\n\n return todasLasNotas;\n\n }",
"public List<Comentario> buscaPorTopico(Topico t);",
"public void mostrarLista(String tipo, String encabezado){\n System.out.println(\"\\n\" /*+ \"Departamento de \"*/ + tipo.concat(\"s\") + \"\\n\" + encabezado);\n for (Producto i: productos){\n if (tipo.compareToIgnoreCase(i.tipo) == 0)\n System.out.println(i);\n }\n }",
"List<Vehiculo>listar();",
"public static void main(String[] args) throws Exception {\n\t\tLista<Contato> vetor = new Lista<Contato>(20);\n\t\tLinkedList<Contato> listaEncadeada = new LinkedList<Contato>();\n\n\t\tContato c1 = new Contato(\"c1\", \"111-1111\", \"[email protected]\");\n\t\tContato c2 = new Contato(\"c2\", \"222-2222\", \"[email protected]\");\n\t\tContato c3 = new Contato(\"c3\", \"333-3333\", \"[email protected]\");\n\t\tContato c4 = new Contato(\"c4\", \"444-2344\", \"[email protected]\");\n\t\tContato c5 = new Contato(\"c5\", \"555-5585\", \"[email protected]\");\n\t\tContato c6 = new Contato(\"c6\", \"111-1911\", \"[email protected]\");\n\t\tContato c7 = new Contato(\"c7\", \"222-2322\", \"[email protected]\");\n\t\tContato c8 = new Contato(\"c8\", \"333-3333\", \"[email protected]\");\n\t\tContato c9 = new Contato(\"c9\", \"454-4644\", \"[email protected]\");\n\t\tContato c10 = new Contato(\"c10\", \"515-5235\", \"[email protected]\");\n\t\tContato c11 = new Contato(\"c11\", \"131-1411\", \"[email protected]\");\n\t\tContato c12 = new Contato(\"c12\", \"252-2672\", \"[email protected]\");\n\t\tContato c13 = new Contato(\"c13\", \"313-3433\", \"[email protected]\");\n\t\tContato c14 = new Contato(\"c14\", \"433-4334\", \"[email protected]\");\n\t\tContato c15 = new Contato(\"c15\", \"535-5355\", \"[email protected]\");\n\t\tContato c16 = new Contato(\"c16\", \"161-1516\", \"[email protected]\");\n\t\tContato c17 = new Contato(\"c17\", \"272-2272\", \"[email protected]\");\n\t\tContato c18 = new Contato(\"c18\", \"383-3993\", \"[email protected]\");\n\t\tContato c19 = new Contato(\"c19\", \"141-4949\", \"[email protected]\");\n\t\tContato c20 = new Contato(\"c20\", \"565-5565\", \"[email protected]\");\n\t\tContato c21 = new Contato(\"c21\", \"616-1611\", \"[email protected]\");\n\t\tContato c22 = new Contato(\"c22\", \"212-2121\", \"[email protected]\");\n\t\tContato c23 = new Contato(\"c23\", \"131-1331\", \"[email protected]\");\n\t\tContato c24 = new Contato(\"c24\", \"424-4444\", \"[email protected]\");\n\t\tContato c25 = new Contato(\"c25\", \"565-5555\", \"[email protected]\");\n\t\tContato c26 = new Contato(\"c26\", \"111-1611\", \"[email protected]\");\n\t\tContato c27 = new Contato(\"c27\", \"282-1252\", \"[email protected]\");\n\t\tContato c28 = new Contato(\"c28\", \"323-3433\", \"[email protected]\");\n\t\tContato c29 = new Contato(\"c29\", \"544-4464\", \"[email protected]\");\n\t\tContato c30 = new Contato(\"c30\", \"155-5455\", \"[email protected]\");\n\n\t\ttry {\n\t\t\t// ex5\n\t\t\tvetor.adiciona(c1);\n\t\t\tvetor.adiciona(c2);\n\t\t\tvetor.adiciona(c3);\n\t\t\tvetor.adiciona(c4);\n\t\t\tvetor.adiciona(c5);\n\t\t\tvetor.adiciona(c6);\n\t\t\tvetor.adiciona(c7);\n\t\t\tvetor.adiciona(c8);\n\t\t\tvetor.adiciona(c9);\n\t\t\tvetor.adiciona(c10);\n\t\t\tvetor.adiciona(c11);\n\t\t\tvetor.adiciona(c12);\n\t\t\tvetor.adiciona(c13);\n\t\t\tvetor.adiciona(c14);\n\t\t\tvetor.adiciona(c15);\n\t\t\tvetor.adiciona(c16);\n\t\t\tvetor.adiciona(c17);\n\t\t\tvetor.adiciona(c18);\n\t\t\tvetor.adiciona(c19);\n\t\t\tvetor.adiciona(c20);\n\t\t\tvetor.adiciona(c21);\n\t\t\tvetor.adiciona(c22);\n\t\t\tvetor.adiciona(c23);\n\t\t\tvetor.adiciona(c24);\n\t\t\tvetor.adiciona(c25);\n\t\t\tvetor.adiciona(c26);\n\t\t\tvetor.adiciona(c27);\n\t\t\tvetor.adiciona(c28);\n\t\t\tvetor.adiciona(c29);\n\t\t\tvetor.adiciona(c30);\n\t\t\t// ex3\n\t\t\tvetor.removerT(\"111-1111\");\n\t\t\t//ex4-vetor.RemoverTudo();\n\t\t\t\n\t\t\tSystem.out.println(vetor);\n\t\t\t// ex1\n\t\t\tSystem.out.println(\"Confirmar se o elemento na lista existe:\" + vetor.contem(c2));\n\t\t\t// ex2\n\t\t\tSystem.out.println(\"Retornar a posicao do elemento, se retornar -1 que dizer que o elemento não existe:\"\n\t\t\t\t\t+ vetor.indicio(c2));\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// ex6\n\t\tlistaEncadeada.add(c1);\n\t\tlistaEncadeada.add(c2);\n\t\tlistaEncadeada.add(c3);\n\t\tlistaEncadeada.add(c4);\n\t\tlistaEncadeada.add(c5);\n\t\tlistaEncadeada.add(c6);\n\t\tlistaEncadeada.add(c7);\n\t\tlistaEncadeada.add(c8);\n\t\tlistaEncadeada.add(c9);\n\t\tlistaEncadeada.add(c10);\n\t\tlistaEncadeada.add(c11);\n\t\tlistaEncadeada.add(c12);\n\t\tlistaEncadeada.add(c13);\n\t\tlistaEncadeada.add(c14);\n\t\tlistaEncadeada.add(c15);\n\t\tlistaEncadeada.add(c16);\n\t\tlistaEncadeada.add(c17);\n\t\tlistaEncadeada.add(c18);\n\t\tlistaEncadeada.add(c19);\n\t\tlistaEncadeada.add(c20);\n\t\tlistaEncadeada.add(c21);\n\t\tlistaEncadeada.add(c22);\n\t\tlistaEncadeada.add(c23);\n\t\tlistaEncadeada.add(c24);\n\t\tlistaEncadeada.add(c25);\n\t\tlistaEncadeada.add(c26);\n\t\tlistaEncadeada.add(c27);\n\t\tlistaEncadeada.add(c28);\n\t\tlistaEncadeada.add(c29);\n\t\tlistaEncadeada.add(c30);\n\n\t\tSystem.out.println(listaEncadeada);\n\n\t}",
"public Lista(int tam, byte tipoOrden) {\n this.tam = tam;\t\t\t\t\t//NOS AHORRAMOS UN METODO \n this.tipoOrden = tipoOrden;\t//NOS AHORRAMOS UN METODO\n tope = 0;\n listaLlena=false;\n listaVacia=true;\n lista = new int[tam];\t\t\t//NOS AHORRAMOS UN METODO\n listaClon = new int[tam]; //PARA EL RECORREDO HACIA DELANTE\n \n }",
"public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}",
"public void listarHospedes() {\n System.out.println(\"Hospedes: \\n\");\n if (hospedesCadastrados.isEmpty()) {\n// String esta = hospedesCadastrados.toString();\n// System.out.println(esta);\n System.err.println(\"Não existem hospedes cadastrados\");\n } else {\n String esta = hospedesCadastrados.toString();\n System.out.println(esta);\n // System.out.println(Arrays.toString(hospedesCadastrados.toArray()));\n }\n\n }",
"@Override\n public List<Pessoa> todas() {\n this.conexao = Conexao.abrirConexao();\n List<Pessoa> pessoas = new ArrayList<>();\n try {\n String consulta = \"SELECT * FROM pessoa;\";\n PreparedStatement statement = conexao.prepareStatement(consulta);\n ResultSet resut = statement.executeQuery();\n while (resut.next()) {\n pessoas.add(criarPessoa(resut));\n }\n } catch (SQLException ex) {\n Logger.getLogger(PessoasJDBC.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n Conexao.fecharConexao(conexao);\n }\n if (pessoas.size() > 0) {\n return Collections.unmodifiableList(pessoas);\n } else {\n return Collections.EMPTY_LIST;\n }\n\n }",
"private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }",
"private void prepararNoticias() {\n Noticia noticia = new Noticia(\n \"Novo Residencial perto de você!\",\n \"Venha conhecer nosso mais novo empreendimento.\"\n );\n noticias.add(noticia);\n\n noticia = new Noticia(\n \"As melhores condições para você adiquirir um imovel hoje mesmo\",\n \"Marque uma visita.\"\n );\n noticias.add(noticia);\n\n adapter.notifyDataSetChanged();\n }",
"public void MostrarListaInicioFin() {\n if(!estVacia()){\n String datos=\"<=>\";\n NodoDoble current=inicio;\n while(current!=null){\n datos += \"[\"+current.dato+\"]<=>\";\n current = current.siguiente;\n }\n JOptionPane.showMessageDialog(null, datos, \"Mostrando Lista de inicio a Fin\",JOptionPane.INFORMATION_MESSAGE);\n }\n }",
"private void mostraPesquisa(List<Livro> livros) {\n // Limpa a tabela sempre que for solicitado uma nova pesquisa\n limparTabela();\n\n if (livros.isEmpty()) {\n JOptionPane.showMessageDialog(rootPane, \"Nenhum registro encontrado.\");\n } else {\n // Linha em branco usada no for, para cada registro é criada uma nova linha \n String[] linha = new String[]{null, null, null, null, null, null, null, null, null};\n // P/ cada registro é criada uma nova linha, cada linha recebe os campos do registro\n for (int i = 0; i < livros.size(); i++) {\n tmLivro.addRow(linha);\n tmLivro.setValueAt(livros.get(i).getId(), i, 0);\n tmLivro.setValueAt(livros.get(i).getId_genero(), i, 1);\n tmLivro.setValueAt(livros.get(i).getExemplar(), i, 2);\n tmLivro.setValueAt(livros.get(i).getAutor(), i, 3);\n tmLivro.setValueAt(livros.get(i).getEdicao(), i, 4);\n tmLivro.setValueAt(livros.get(i).getAno(), i, 5);\n tmLivro.setValueAt(livros.get(i).getDisponibilidade(), i, 6);\n }\n }\n }",
"public ArrayList consultarTodo() {\n Cursor cursor = this.myDataBase.rawQuery(\"SELECT des_invfisico_tmp._id,des_invfisico_tmp.cod_ubicacion,des_invfisico_tmp.cod_referencia,des_invfisico_tmp.cod_plu,plu.descripcion FROM des_invfisico_tmp LEFT OUTER JOIN plu ON plu.cod_plu = des_invfisico_tmp.cod_plu \", null);\n ArrayList arrayList = new ArrayList();\n new ArrayList();\n if (cursor.moveToFirst()) {\n do {\n for (int i = 0; i <= 4; ++i) {\n if (cursor.isNull(i)) {\n arrayList.add(\"\");\n continue;\n }\n arrayList.add(cursor.getString(i));\n }\n } while (cursor.moveToNext());\n }\n\n return arrayList;\n }",
"public void listar() {\n\n if (!vacia()) {\n\n NodoEnteroSimple temp = head;\n\n int i = 0;\n\n while (temp != null) {\n\n System.out.print(i + \".[ \" + temp.getValor() + \" ]\" + \" -> \");\n\n temp = temp.getSiguiente();\n\n i++;\n }\n }\n \n }",
"public void mostrarlistainciofin(){\n if(!estavacia()){\n String datos=\"<=>\";\n nododoble auxiliar=inicio;\n while(auxiliar!=null){\n datos=datos+\"[\"+auxiliar.dato+\"]<=>\";\n auxiliar=auxiliar.siguiente;\n }\n JOptionPane.showMessageDialog(null,datos,\n \"Mostraando lista de incio a fin\",JOptionPane.INFORMATION_MESSAGE);\n } }",
"public ArrayList<DatosNombre> listaNombre(){\n \n ArrayList<DatosNombre> respuesta = new ArrayList<>();\n Connection conexion = null;\n JDBCUtilities conex = new JDBCUtilities();\n \n try{\n conexion= conex.getConnection();\n \n String query = \"SELECT usuario, contrasenia, nombre\"\n + \" FROM empleado\"\n + \" WHERE estado=true\";\n \n PreparedStatement statement = conexion.prepareStatement(query);\n ResultSet resultado = statement.executeQuery();\n \n while(resultado.next()){\n DatosNombre consulta = new DatosNombre();\n consulta.setUsuario(resultado.getString(1));\n consulta.setContrasenia(resultado.getString(2));\n consulta.setNombreAnt(resultado.getString(3));\n \n respuesta.add(consulta);\n }\n }catch(SQLException e){\n JOptionPane.showMessageDialog(null, \"Error en la consulta \" + e);\n }\n return respuesta;\n }",
"@Override\n\tprotected void doListado() throws Exception {\n\t\tList<Department> deptos = new DepartmentDAO().getAllWithManager();\n//\t\tList<Department> deptos = new DepartmentDAO().getAll();\n\t\tthis.addColumn(\"Codigo\").addColumn(\"Nombre\").addColumn(\"Manager\").newLine();\n\t\t\n\t\tfor(Department d: deptos){\n\t\t\taddColumn(d.getNumber());\n\t\t\taddColumn(d.getName());\n\t\t\taddColumn(d.getManager().getFullName());\n\t\t\tnewLine();\n\t\t}\n\t}",
"public List<Comentario> listaComentarioPorCodigo(Long codigo);",
"@Override\n public List<Dependente> todosOsDepentendes() {\n return dBC.todosOsDepentendes();\n\n }",
"public void mostrarLista() {\n\n Nodo recorrer = temp;\n while (recorrer != null) {\n\n System.out.println(\"[ \" + recorrer.getDato() + \"]\");\n recorrer = recorrer.getSiguiente();\n\n }\n\n }",
"public List<PerfilTO> buscarTodos();",
"public void consultarListaDeContatos() {\n\t\tfor (int i = 0; i < listaDeContatos.size(); i++) {\n\t\t\tSystem.out.printf(\"%d %s \\n\", i, listaDeContatos.get(i));\n\t\t}\n\t}",
"public List<Permiso> obtenerTodosActivos();",
"public List<Listas_de_las_Solicitudes> Mostrar_las_peticiones_que_han_llegado_al_Usuario_Administrador(int cedula) {\n\t\t//paso3: Obtener el listado de peticiones realizadas por el usuario\n\t\tEntityManagerFactory entitymanagerfactory = Persistence.createEntityManagerFactory(\"LeyTransparencia\");\n\t\tEntityManager entitymanager = entitymanagerfactory.createEntityManager();\n\t\tentitymanager.getEntityManagerFactory().getCache().evictAll();\n\t\tQuery consulta4=entitymanager.createQuery(\"SELECT g FROM Gestionador g WHERE g.cedulaGestionador =\"+cedula);\n\t\tGestionador Gestionador=(Gestionador) consulta4.getSingleResult();\n\t\t//paso4: Obtener por peticion la id, fecha y el estado\n\t\tList<Peticion> peticion=Gestionador.getEmpresa().getPeticions();\n\t\tList<Listas_de_las_Solicitudes> peticion2 = new ArrayList();\n\t\t//paso5: buscar el area de cada peticion\n\t\tfor(int i=0;i<peticion.size();i++){\n\t\t\tString almcena=\"\";\n\t\t\tString sarea=\"no posee\";\n\t\t\tBufferedReader in;\n\t\t\ttry{\n\t\t\t\tin = new BufferedReader(new InputStreamReader(new FileInputStream(\"C:/area/area\"+String.valueOf(peticion.get(i).getIdPeticion())+\".txt\"), \"utf-8\"));\n\t\t\t\ttry {\n\t\t\t\t\twhile((sarea=in.readLine())!=null){\n\t\t\t\t\t\tint s=0;\n\t\t\t\t\t\talmcena=sarea;\n\t\t\t\t\t}\n\t\t\t\t\tin.close();\n\t\t\t\t\tSystem.out.println(almcena);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\t//paso6: Mostrar un listado de peticiones observando el id, la fecha de realizacion de la peticion, hora de realizacion de la peticion, y el estado actual de la peticion\n\t\t\tListas_de_las_Solicitudes agregar=new Listas_de_las_Solicitudes();\n\t\t\tagregar.setId(String.valueOf(peticion.get(i).getIdPeticion()));\n\t\t\tagregar.setFechaPeticion(peticion.get(i).getFechaPeticion());\n\t\t\tagregar.setNombreestado(peticion.get(i).getEstado().getTipoEstado());\n\t\t\tagregar.setArea(almcena);\n\t\t\tpeticion2.add(agregar);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"el usuario existe\");\n\t\treturn peticion2;\n\t\t//aun no se\n\t}",
"public void listar_mais_pedidos(String tipo_pedido){\n \n \n OrdemCorteDAO dao = new OrdemCorteDAO();\n DefaultTableModel model = (DefaultTableModel) jTable_MaisPedidos.getModel(); \n \n model.setNumRows(0);\n \n for (OrdemCorteDTO mp : dao.getMaisPedidos(tipo_pedido)) {\n \n model.addRow(new Object[]{mp.getCodigo(), mp.getQtd_pedido()});\n }\n \n \n }",
"@Override\r\n public List<Assunto> buscarTodas() {\r\n EntityManager em = PersistenceUtil.getEntityManager();\r\n Query query = em.createQuery(\"FROM Assunto As a\");\r\n return query.getResultList();\r\n }",
"public void listarCarros() {\n System.err.println(\"Carros: \\n\");\n if (carrosCadastrados.isEmpty()) {\n System.err.println(\"Nao existem carros cadastrados\");\n } else {\n System.err.println(Arrays.toString(carrosCadastrados.toArray()));\n }\n }",
"public abstract List<TipoActividad> getTiposActividad() throws PersistenceException, ClassNotFoundException;",
"public String ottieniListaCodiceBilancio(){\n\t\tInteger uid = sessionHandler.getParametro(BilSessionParameter.UID_CLASSE);\n\t\tcaricaListaCodiceBilancio(uid);\n\t\treturn SUCCESS;\n\t}",
"public void CadastrarPassageiro(Connection con, List<Bilhetes> temporaria) {\n\t\t\n\t\ttry {\n\t\t\n\t\t\tstmt = con.prepareStatement(\"Select cpf from passageiro where cpf = ?\");\n\t\t\t\n\t\t\tstmt.setString(1, temporaria.get(0).getBilhete().get(0).getCpf() );\n\t\t\tstmt.execute();\n\t\t\t\n\t\t\trs=stmt.getResultSet();\n\t\t\t\n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\t\n\t\t\t\tJOptionPane.showMessageDialog(null, \"ERRO: CPF JA CADASTRADO\", \"Erro CADASTRO\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tstmt = con.prepareStatement(\n\t\t\t\t\t\" insert into BILHETES (Destino,Origem,Hpartida, Hembarque,Poltrona) values(?,?,?,?,NULL)\");\n\n\t\t\tstmt.setString(1, temporaria.get(0).getDestino());\n\t\t\tstmt.setString(2, temporaria.get(0).getOrigem());\n\t\t\tstmt.setString(3, temporaria.get(0).getHora_partida());\n\t\t\tstmt.setString(4, temporaria.get(0).getHora_embarque());\n\n\t\t\tstmt.execute();\n\n\t\t\tstmt = con.prepareStatement(\"select IDBILHETE FROM BILHETES WHERE poltrona is null \");\n\n\t\t\tstmt.execute();\n\n\t\t\trs = stmt.getResultSet();\n\n\t\t\twhile (rs.next()) {\n\t\t\t\tint idbilhete = rs.getInt(1);\n\t\t\t\ttemporaria.get(0).setIdbilhete(idbilhete);\n\t\t\t}\n\n\t\t\tstmt = con.prepareStatement(\"insert into Passageiro(nome,cpf,ID_BILHETE) values(?,?,?)\");\n\n\t\t\tstmt.setString(1, temporaria.get(0).getBilhete().get(0).getNome());\n\t\t\tstmt.setString(2, temporaria.get(0).getBilhete().get(0).getCpf());\n\t\t\tstmt.setInt(3, temporaria.get(0).getIdbilhete());\n\n\t\t\tstmt.execute();\n\n\t\t\t// VOLTANDO A CADEIRA PARA 0, PARA EVITAR ERRO NOS PROXIMOS USUARIOS CADASTRADOS\n\t\t\tstmt = con.prepareStatement(\"UPDATE BILHETES SET POLTRONA = 0 WHERE POLTRONA IS NULL\");\n\n\t\t\tstmt.execute();\n\n\t\t\t// Teste\n\n\t\t\tString nome = temporaria.get(0).getBilhete().get(0).getNome();\n\t\t\tString cpf = temporaria.get(0).getBilhete().get(0).getCpf();\n\n\t\t\tString destino = temporaria.get(0).getDestino();\n\t\t\tString Origem = temporaria.get(0).getOrigem();\n\n\t\t\tString hora_EMBARQUE = temporaria.get(0).getHora_embarque();\n\n\t\t\tString horasaida = temporaria.get(0).getHora_partida();\n\n\t\t\t// Instanciando valores\n\t\t\tBilhetes passagem = new Bilhetes(temporaria.get(0).getIdbilhete(), Origem, destino, hora_EMBARQUE,\n\t\t\t\t\thorasaida, null, 0);\n\n\t\t\tpassagem.adicionar(new Passageiro(nome, cpf));\n\n\t\t\tpassageiro.add(passagem);\n\n\t\t\t// Fim do teste antes do filme\n\n\t\t\tJOptionPane.showMessageDialog(null, \"Passageiro Cadastrado Com sucesso\");\n\n\t\t\tJOptionPane.showMessageDialog(null,\"CODIGO LOCALIZADOR DO BILHETE: \" + temporaria.get(0).getIdbilhete(),\" NÃO PERCA\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\n\t\n\t\t\t\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tJOptionPane.showMessageDialog(null, \"ERRO: CPF JA CADASTRADO\", \"Erro CADASTRO\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\n\n\t\t}\n\n\t}",
"void listarDadosNaTelaLivro(ArrayList<Livro> lista,DefaultTableModel model ) throws Exception {\n \n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[7];\n Livro aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+editora.recuperar(aux.getIdEditora());\n linha[2] = \"\"+autor.recuperar(aux.getIdAutor());\n linha[3] = \"\"+areaDeConhecimento.recuperar(aux.getIdAreaDeConhecimento());\n linha[4] = aux.getTituloDoLivro();\n linha[5] = \"\"+aux.getIsbn();\n model.addRow(linha);\n }\n }",
"private static void ListaProduto() throws IOException {\n \n if(ListaDProduto.isEmpty()){\n SaidaDados(\"Nenhum produto cadastrado\");\n return;\n }\n \n \n\t\tFileWriter arq = new FileWriter(\"lista_produto.txt\"); // cria o arquivo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// será criado o\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// arquivo para\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// armazenar os\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// dados\n\t\tPrintWriter gravarArq = new PrintWriter(arq); // imprimi no arquivo \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// dados.\n\n\t\tString relatorio = \"\";\n\n\t\tgravarArq.printf(\"+--LISTA DE PRODUTOS--+\\r\\n\");\n\n\t\tfor (int i = 0; i < ListaDProduto.size(); i++) {\n\t\t\tProduto Lista = ListaDProduto.get(i);\n\t\t\t\n\n\t\t\tgravarArq.printf(\n\t\t\t\t\t\" - |Codigo: %d |NOME: %s | VALOR COMPRA: %s | VALOR VENDA: %s | INFORMAÇÕES DO PRODUTO: %s | INFORMAÇÕES TÉCNICAS: %s\\r\\n\",\n\t\t\t\t\tLista.getCodigo(), Lista.getNome(), Lista.getPrecoComprado(),\n\t\t\t\t\tLista.getPrecoVenda(), Lista.getInformacaoProduto(), Lista.getInformacaoTecnicas()); // formatação dos dados no arquivos\n \n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\n\n\t\t\trelatorio += \"\\nCódigo: \" + Lista.getCodigo() +\n \"\\nNome: \" + Lista.getNome() +\n\t\t\t\t \"\\nValor de Compra: \" + Lista.getPrecoComprado() + \n \"\\nValor de Venda: \" + Lista.getPrecoVenda() +\n \"\\nInformações do Produto: \" + Lista.getInformacaoProduto() +\n \"\\nInformações Técnicas: \" + Lista.getInformacaoTecnicas() +\n \"\\n------------------------------------------------\";\n\n\t\t}\n \n \n\n\t\tgravarArq.printf(\"+------FIM------+\\r\\n\");\n\t\tgravarArq.close();\n\n\t\tSaidaDados(relatorio);\n\n\t}",
"public void MostrarDatos(){\n // En este caso, estamos mostrando la informacion necesaria del objeto\n // podemos acceder a la informacion de la persona y de su arreglo de Carros por medio de un recorrido\n System.out.println(\"Hola, me llamo \" + nombre);\n System.out.println(\"Tengo \" + contador + \" carros.\");\n for (int i = 0; i < contador; i++) {\n System.out.println(\"Tengo un carro marca: \" + carros[i].getMarca());\n System.out.println(\"El numero de placa es: \" + carros[i].getPlaca()); \n System.out.println(\"----------------------------------------------\");\n }\n }",
"void listarDadosNaTelaColaborador(ArrayList<Colaborador> lista,DefaultTableModel model ) {\n model.setNumRows(0);\n //Correr o ArrayList\n for (int pos = 0; pos < lista.size(); pos++) {\n String[] linha = new String[9];\n Colaborador aux = lista.get(pos);\n linha[0] = \"\"+aux.getId();\n linha[1] = \"\"+aux.getMatricula();\n linha[2] = aux.getNome();\n linha[3] = \"\"+aux.getNumeroOAB();\n linha[4] = \"\"+aux.getCpf();\n linha[5] = aux.getEmail();\n linha[6] = \"\"+aux.getTelefone();\n linha[7] = aux.getTipo().toString();\n linha[8] = aux.getStatus().toString();\n model.addRow(linha);\n }\n }",
"@Override\n\tpublic ArrayList<ClienteFisico> listar(String complemento)\n\t\t\tthrows SQLException {\n\t\treturn null;\n\t}",
"public Banco(String nome) { // essa linha é uma assinatura do metodo\n \tthis.nome = nome;\n }",
"public NodoArbolSintactico(String nombre, int tipo) {\r\n hijos = new ArrayList<>();\r\n this.nombre = nombre;\r\n accion = null;\r\n this.tipo = tipo;\r\n }",
"@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}",
"public void listarAlunosNaDisciplina(){\r\n for(int i = 0;i<alunos.size();i++){\r\n System.out.println(alunos.get(i).getNome());\r\n }\r\n }",
"private void listViewPendentes(List<Compra> listAll) {\n\t\t\n\t}",
"public List<TipoDocumento> listar() throws SQLException{\n ArrayList<TipoDocumento> tipodocumentos = new ArrayList();\n TipoDocumento tipodocumento;\n ResultSet resultado;\n String sentenciaSQL = \"SELECT documentoid, descripcion FROM tipodocumento;\";\n \n resultado = gestorJDBC.ejecutarConsulta(sentenciaSQL);\n while(resultado.next()){ \n //para hacer \"new Genero\" necesito tener un Construtor vacio.\n tipodocumento = new TipoDocumento();\n tipodocumento.setTipodocumentoid(resultado.getInt(\"documentoid\"));\n tipodocumento.setDescripcion(resultado.getString(\"descripcion\"));\n tipodocumentos.add(tipodocumento);\n }\n resultado.close();\n return tipodocumentos; \n }",
"public void listar() {\n\t\t\n\t}",
"public void cargarNotas() {\n\n notas.add(null);\n notas.add(null);\n notas.add(null);\n\n int nota, cont = 0;\n for (int i = 0; i <= 2; i++) {\n\n System.out.println(\"Indique nota \" + (i + 1));\n nota = leer.nextInt();\n notas.set(cont, nota);\n cont++;\n\n }\n\n cont = 0;\n\n }",
"@Override\n\tpublic ArrayList<String> partecipantiListaElettorale(String nome) {\n\t\tDB db = getDB();\n\t\tMap<Integer, Lista> map = db.getTreeMap(\"liste\");\n\n\t\tSet<Integer> keys = map.keySet();\n\t\tfor (int key : keys) {\n\t\t\tif (map.get(key).getNomeLista().equals(nome)) {\n\t\t\t\treturn map.get(key).getComponenti();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<CLIENTE> listarTodos() {\n\t\t\n\t\tString sql = \"SELECT * FROM CLIENTE\";\n\t\t\n\t\tList<CLIENTE> listaCliente = new ArrayList<CLIENTE>();\n\t\t\n\t\tConnection conexao;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tconexao = JdbcUtil.getConexao();\n\t\t\t\n\t\t\tPreparedStatement ps = conexao.prepareStatement(sql);\n\t\t\t\n\t\t\tResultSet res = ps.executeQuery();\n\t\t\t\n\t\t\twhile(res.next()){\n\t\t\t\t\n\t\t\t\tcliente = new CLIENTE();\n\t\t\t\tcliente.setNomeCliente(res.getString(\"NOME_CLIENTE\"));\n\t\t\t\t\n\t\t\t\tlistaCliente.add(cliente);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tps.close();\n\t\t\tconexao.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\t\n\t\treturn listaCliente;\n\t}",
"private void llenarListado1() {\r\n\t\tString sql1 = Sentencia1()\r\n\t\t\t\t+ \" where lower(cab.descripcion) = 'concurso' \" + \"and (\"\r\n\t\t\t\t+ \"\t\tdet.id_estado_det = (\" + \"\t\t\t\tselect est.id_estado_det \"\r\n\t\t\t\t+ \"\t\t\t\tfrom planificacion.estado_det est \"\r\n\t\t\t\t+ \"\t\t\t\twhere lower(est.descripcion)='libre'\" + \"\t\t) \"\r\n\t\t\t\t+ \"\t\tor det.id_estado_det is null\" + \"\t) \"\r\n\t\t\t\t+ \" and uo_cab.id_configuracion_uo = \"\r\n\t\t\t\t+ configuracionUoCab.getIdConfiguracionUo()\r\n\t\t\t\t+ \" AND det.activo=true\";\r\n\t\t/*\r\n\t\t * Tipo de concurso = CONCURSO SIMPLIFICADO Se despliegan los puestos\r\n\t\t * PERMANENTES o CONTRATADOS, con estado = LIBRE o NULO Los puestos\r\n\t\t * deben ser de nivel 1\r\n\t\t */\r\n\t\tif (concurso.getDatosEspecificosTipoConc().getDescripcion()\r\n\t\t\t\t.equalsIgnoreCase(CONCURSO_SIMPLIFICADO)) {\r\n\t\t\tsql1 += \" and cpt.nivel=1 and cpt.activo=true and (det.permanente is true or det.contratado is true) \";\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Tipo de concurso = CONCURSO INTERNO DE OPOSICION INSTITUCIONAL Se\r\n\t\t * despliegan los puestos PERMANENTE, con estado = LIBRE o NULO\r\n\t\t */\r\n\r\n\t\tif (concurso.getDatosEspecificosTipoConc().getDescripcion()\r\n\t\t\t\t.equalsIgnoreCase(CONCURSO_INTERNO_OPOSICION)) {\r\n\t\t\tsql1 += \" and det.permanente is true \";\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Tipo de concurso = CONCURSO INTERNO DE OPOSICION INTER INSTITUCIONAL\r\n\t\t * Se despliegan los puestos PERMANENTE, con estado = LIBRE o NULO\r\n\t\t */\r\n\r\n\t\tif (concurso.getDatosEspecificosTipoConc().getDescripcion()\r\n\t\t\t\t.equalsIgnoreCase(CONCURSO_INTERNO_INTERINSTITUCIONAL)) {\r\n\t\t\tsql1 += \" and det.permanente is true \";\r\n\t\t}\r\n\t\tString sql2 = Sentencia2()\r\n\t\t\t\t+ \" where lower(estado_det.descripcion) = 'en reserva' \"\r\n\t\t\t\t+ \"and uo_cab.id_configuracion_uo = \"\r\n\t\t\t\t+ configuracionUoCab.getIdConfiguracionUo()\r\n\t\t\t\t+ \" and concurso.id_concurso = \" + concurso.getIdConcurso()\r\n\t\t\t\t+ \" and puesto_det.activo=true\";\r\n\r\n\t\tcargarLista(sql1, sql2);\r\n\t}",
"default String getTodo(){\n\t\treturn getPerimetro() + \" - \"+ getNombre();\n\t}",
"public String listarSensores(){\r\n String str = \"\";\r\n for(PacienteNuvem x:pacientes){//Para cada paciente do sistema ele armazena uma string com os padroes do protocolo de comunicação\r\n str += x.getNick()+\"-\"+x.getNome()+\"#\";\r\n }\r\n return str;\r\n }",
"public static List<NotaDeCreditoDescuento> showForm(final List<Cargo> cargos){\n\t\tfinal NotasDeDescuentoModel model=new NotasDeDescuentoModel(cargos);\r\n\t\t//model.asignarFolio();\r\n\t\tfinal NotaDeDescuentoForm form=new NotaDeDescuentoForm(model);\r\n\t\tform.open();\r\n\t\tif(!form.hasBeenCanceled()){\r\n\t\t\treturn model.getNotas();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public static void criaListaCandidatos() {\n\t\tScanner sc = new Scanner(System.in);\t\n\t\tString id, numCandidatos, nomePessoa, nomeLista, tipoLista;\n\t\tArrayList<Pessoa> listaCandidatos = new ArrayList<>();\n\t\tint check = 0, num, i;\n\t\t\n\t\tSystem.out.println(\"\\nInsira o id da eleicao a qual pretende adicionar uma lista de candidatos:\");\n\t\tid = sc.nextLine();\n\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira numero de elementos (Min. 2):\");\n\t\t\tnumCandidatos = sc.nextLine();\n\t\t\tif(verificarNumeros(numCandidatos)) {\n\t\t\t\tif (Integer.parseInt(numCandidatos) >= 2) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO numero so pode conter digitos\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tnum = Integer.parseInt(numCandidatos);\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome da lista:\");\n\t\t\tnomeLista = sc.nextLine();\n\t\t\tif(verificarLetras(nomeLista) && nomeLista.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nEm que tipo se insere a lista?\\n(1) Estudantes (2) Funcionarios (3) Docentes\");\n\t\t\ttipoLista = sc.nextLine();\n\t\t\tif(verificarNumeros(tipoLista)) {\n\t\t\t\tif ( (tipoLista.equals(\"1\")) || (tipoLista.equals(\"2\")) || (tipoLista.equals(\"3\")) ) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"\\nA opcao so pode conter digitos de 1 a 3\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nA opcao so pode conter digitos\");\n\t\t\t}\n\t\t}while(check==0);\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome do presidente:\");\n\t\t\tnomePessoa = sc.nextLine();\n\t\t\tif(verificarLetras(nomePessoa) && nomePessoa.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tPessoa p = new Pessoa(nomePessoa);\n\t\tlistaCandidatos.add(p);\t\n\t\tnum--;\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tdo {\n\t\t\tSystem.out.println(\"\\nInsira o nome do vice-presidente:\");\n\t\t\tnomePessoa = sc.nextLine();\n\t\t\tif(verificarLetras(nomePessoa) && nomePessoa.length()>0) {\n\t\t\t\tcheck = 1;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t}\n\t\t}while(check==0);\n\t\tPessoa novap = new Pessoa(nomePessoa);\n\t\tlistaCandidatos.add(novap);\t\n\t\tnum--;\n\t\t\n\t\tcheck = 0;\n\t\t\n\t\tfor (i=0; i<num;i++) {\n\t\t\tdo {\n\t\t\t\tSystem.out.println(\"\\nInsira o nome do elemento seguinte:\");\n\t\t\t\tnomePessoa = sc.nextLine();\n\t\t\t\tif(verificarLetras(nomePessoa) && nomePessoa.length()>0) {\n\t\t\t\t\tcheck = 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"\\nO nome apenas pode conter letras\");\n\t\t\t\t}\n\t\t\t}while(check==0);\n\t\t\tPessoa novaPessoa = new Pessoa(nomePessoa);\n\t\t\tlistaCandidatos.add(novaPessoa);\n\t\t\tcheck = 0;\n\t\t}\n\t\t\n\t\tString msgServer = \"\";\n\t\t\n\t\tcheck = 0;\n\t\tint tries = 0;\n\t\tdo {\n\t\t\ttry {\n\t\t\t\tmsgServer = rmiserver.criaLista(id, tipoLista, nomeLista, listaCandidatos);\n\t\t\t\tSystem.out.println(msgServer);\n\t\t\t\tSystem.out.println(\"\\n\");\n\t\t\t\tcheck = 1;\n\t\t\t} catch (RemoteException e1) {\n\t\t\t\t// Tratamento da Excepcao da chamada RMI alteraFac\n\t\t\t\tif(tries == 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(6000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries > 0 && tries < 24) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t\t//faz novo lookup\n\t\t\t\t\t\trmiserver = (RMI_S_I) Naming.lookup(\"rmi://\"+registryIP+\":\"+registryPort+\"/rmi\");\n\t\t\t\t\t\trmiserver.subscribeConsola((ADMIN_C_I)consola);\n\t\t\t\t\t\ttries = 0;\n\t\t\t\t\t} catch (RemoteException | InterruptedException | MalformedURLException | NotBoundException e) {\n\t\t\t\t\t\t// FailOver falhou\n\t\t\t\t\t\ttries++;\n\t\t\t\t\t}\n\t\t\t\t}else if(tries >= 24) {\n\t\t\t\t\tSystem.out.println(\"Impossivel realizar a operacao devido a falha tecnica (Servidores RMI desligados).\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}while(check==0);\n\t\tcheck = 0;\n\t}",
"public Todoist()\n {\n tareas = new ArrayList<String>();\n }",
"public Todoist()\n {\n tareas = new ArrayList<String>();\n }",
"public void marcarTodos() {\r\n\t\tfor (int i = 0; i < listaPlantaCargoDto.size(); i++) {\r\n\t\t\tPlantaCargoDetDTO p = new PlantaCargoDetDTO();\r\n\t\t\tp = listaPlantaCargoDto.get(i);\r\n\t\t\tif (!obtenerCategoria(p.getPlantaCargoDet())\r\n\t\t\t\t\t.equals(\"Sin Categoria\"))\r\n\t\t\t\tp.setReservar(true);\r\n\t\t\tlistaPlantaCargoDto.set(i, p);\r\n\t\t}\r\n\t\tcantReservados = listaPlantaCargoDto.size();\r\n\t}",
"public Agenda(String nome) {\n\t\tthis.nome = nome;\n\t\tthis.compromisso = new ArrayList<>();\n\t}",
"public void executar() {\n\t\tSystem.out.println(dao.getListaPorNome(\"abacatão\"));\n\t}",
"public List<String> verCarrito(){\n\t\treturn this.compras;\n\t}",
"private void CargarListaFincas() {\n listaFincas = controlgen.GetComboBox(\"SELECT '-1' AS ID, 'Seleccionar' AS DESCRIPCION\\n\" +\n \"UNION\\n\" +\n \"SELECT `id` AS ID, `descripcion` AS DESCRIPCION\\n\" +\n \"FROM `fincas`\\n\"+\n \"/*UNION \\n\"+\n \"SELECT 'ALL' AS ID, 'TODOS' AS DESCRIPCION*/\");\n \n Utilidades.LlenarComboBox(cbFinca, listaFincas, \"DESCRIPCION\");\n \n }",
"public void menuListados() {\n\t\tSystem.out.println(\"MENU LISTADOS\");\n\t\tSystem.out.println(\"1. Personas con la misma actividad\");\n\t\tSystem.out.println(\"2. Cantidad de personas con la misma actividad\");\n\t\tSystem.out.println(\"0. Salir\");\n\t}",
"public List<ActDetalleActivo> listarPorSerial(String serial,String amie, int estado,Integer anio,int estadoActivo);",
"public static ArrayList<obj_dos_campos> carga_tipo_producto() {\n ArrayList<obj_dos_campos> lista = new ArrayList<obj_dos_campos>();\n Connection c=null;\n try {\n c = conexion_odbc.Connexion_datos();\n Statement s = c.createStatement();\n ResultSet rs = s.executeQuery(\"select tip_prod_idn as data, tip_prod_nombre as label from tipo_producto order by tip_prod_nombre desc\");\n lista.add(new obj_dos_campos(\"0\",\"-- Seleccione --\"));\n while (rs.next()){\n lista.add(new obj_dos_campos(rs.getString(\"data\"),rs.getString(\"label\")));\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n c.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n return lista;\n }",
"private void syncListFromTodo() {\r\n DefaultListModel<String> dlm = new DefaultListModel<>();\r\n for (Task task : myTodo.getTodo().values()) {\r\n if (!task.isComplete() || showCompleted) {\r\n String display = String.format(\"%1s DueDate: %10s %s %3s\", task.getName(), task.getDueDate(),\r\n task.isComplete() ? \" Completed!\" : \" Not Completed\", task.getPriority());\r\n dlm.addElement(display);\r\n list.setFont(new Font(\"TimesRoman\", Font.PLAIN, 15));\r\n }\r\n }\r\n list.setModel(dlm);\r\n }",
"public static List<Object> czytaniePogody(){\r\n Object[] elementyPogody = new Object[3];\r\n elementyPogody[0]=0;\r\n elementyPogody[1]=0;\r\n elementyPogody[2]=null;\r\n String line;\r\n OdczytZPliku plik = new OdczytZPliku();\r\n InputStream zawartosc = plik.pobierzZPliku(\"bazapogod.txt\");\r\n try (InputStreamReader odczyt = new InputStreamReader(zawartosc, StandardCharsets.UTF_8);\r\n BufferedReader czytaj = new BufferedReader(odczyt)) {\r\n String numerWStringu = String.valueOf(elementyPogody[0] = (int) (Math.random() * 4));\r\n while ((line = czytaj.readLine()) != null){\r\n if (line.equals(numerWStringu)){\r\n elementyPogody[1] = Integer.parseInt(czytaj.readLine());\r\n elementyPogody[2] = czytaj.readLine();\r\n System.out.println(\"\\nPogoda na dzis: \" + elementyPogody[2]);\r\n break;\r\n }\r\n else {\r\n for (int i = 0; i < 2; i++) {\r\n line = czytaj.readLine();\r\n }\r\n }\r\n }\r\n } catch (Exception ignored) {\r\n }\r\n return List.of(elementyPogody);\r\n }",
"List<CatalogoAprobadorDTO> buscarAprobador(int cveADM, String numEmpleado, Integer claveNivel, Integer centroCostoOP) throws SIATException;",
"@Override\n\tpublic List<Produto> listarTodos() throws ControleEstoqueSqlException {\n\t\treturn null;\n\t}",
"public List<IbBeneficiariosPjDTO> listarIbBeneficiariosPjDTO(Long idBeneficiario, Short estatusCarga, String idCanal, String codigoCanal);",
"private void preenchePeriodo() {\n PeriodoDAO pDAO = new PeriodoDAO();\n for (int i = 0; i < pDAO.listar().size(); i++) {\n cbPeriodo.addItem(pDAO.listar().get(i).getDescricao());\n }\n }",
"public Adaptador_Puntuaciones(ArrayList<Puntuacion> puntuaciones) {\n listaPuntuaciones = puntuaciones;\n }",
"public void listarNominasEmpleadoProfundidad(int idMecanico) throws BusinessException;"
] | [
"0.63436645",
"0.6311989",
"0.62841517",
"0.62362385",
"0.6224268",
"0.61944395",
"0.6193275",
"0.6156865",
"0.61194855",
"0.60432035",
"0.6042854",
"0.60378325",
"0.60289484",
"0.60281754",
"0.6024244",
"0.600513",
"0.6001965",
"0.5999441",
"0.59849435",
"0.59707296",
"0.5957401",
"0.59571844",
"0.5943663",
"0.59325355",
"0.5925063",
"0.59075487",
"0.5903904",
"0.5903655",
"0.59013635",
"0.5899519",
"0.58966917",
"0.58854467",
"0.588314",
"0.5878919",
"0.58748",
"0.5874705",
"0.58653426",
"0.5852891",
"0.58484393",
"0.5840552",
"0.5839489",
"0.5838606",
"0.5837193",
"0.58294654",
"0.582067",
"0.58202696",
"0.58189994",
"0.58137727",
"0.57950795",
"0.57926816",
"0.57857394",
"0.5776065",
"0.5761913",
"0.576186",
"0.5760807",
"0.575468",
"0.5751731",
"0.5746551",
"0.5743219",
"0.57393956",
"0.573859",
"0.57339436",
"0.57269907",
"0.57255274",
"0.57175225",
"0.5710513",
"0.5709867",
"0.5699565",
"0.56937146",
"0.56930375",
"0.5686796",
"0.56829023",
"0.56827694",
"0.56811273",
"0.568061",
"0.5677047",
"0.5675456",
"0.56753725",
"0.5674589",
"0.5667136",
"0.56583244",
"0.56545",
"0.5651611",
"0.5651466",
"0.5651466",
"0.56513083",
"0.5649352",
"0.56485385",
"0.564347",
"0.56427383",
"0.5637686",
"0.5632349",
"0.56305426",
"0.5629195",
"0.5627813",
"0.56232065",
"0.56225204",
"0.56139",
"0.5609342",
"0.5608818",
"0.56086683"
] | 0.0 | -1 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof ResolucaoPK)) {
return false;
}
ResolucaoPK other = (ResolucaoPK) object;
if (this.avaliacaoId != other.avaliacaoId) {
return false;
}
if (this.usuarioId != other.usuarioId) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void setId(int id) { this.id = id; }",
"public void setId(int id) { this.id = id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public void setId(long id) { this.id = id; }",
"public void setId(long id) { this.id = id; }",
"public int getId(){ return id; }",
"public int getId() {return id;}",
"public int getId() {return Id;}",
"public int getId(){return id;}",
"public void setId(long id) {\n id_ = id;\n }",
"private int getId() {\r\n\t\treturn id;\r\n\t}",
"public Integer getId(){return id;}",
"public int id() {return id;}",
"public long getId(){return this.id;}",
"public int getId(){\r\n return this.id;\r\n }",
"@Override public String getID() { return id;}",
"public Long id() { return this.id; }",
"public Integer getId() { return id; }",
"@Override\n\tpublic Integer getId() {\n return id;\n }",
"@Override\n public Long getId () {\n return id;\n }",
"@Override\n public long getId() {\n return id;\n }",
"public Long getId() {return id;}",
"public Long getId() {return id;}",
"public String getId(){return id;}",
"@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}",
"public Integer getId() { return this.id; }",
"@Override\r\n public int getId() {\n return id;\r\n }",
"@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}",
"public int getId() {\n return id;\n }",
"public long getId() { return _id; }",
"public int getId() {\n/* 35 */ return this.id;\n/* */ }",
"public long getId() { return id; }",
"public long getId() { return id; }",
"public void setId(Long id) \n {\n this.id = id;\n }",
"@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}",
"public void setId(String id) {\n this.id = id;\n }",
"@Override\n\tpublic void setId(Long id) {\n\t}",
"public Long getId() {\n return id;\n }",
"public long getId() { return this.id; }",
"public int getId()\n {\n return id;\n }",
"public void setId(int id){\r\n this.id = id;\r\n }",
"@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}",
"protected abstract String getId();",
"@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}",
"public int getID() {return id;}",
"public int getID() {return id;}",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public int getId ()\r\n {\r\n return id;\r\n }",
"@Override\n public int getField(int id) {\n return 0;\n }",
"public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }",
"public int getId(){\r\n return localId;\r\n }",
"void setId(int id) {\n this.id = id;\n }",
"@Override\n public Integer getId() {\n return id;\n }",
"@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"@Override\n public int getId() {\n return id;\n }",
"@Override\n public int getId() {\n return id;\n }",
"public void setId(int id)\n {\n this.id=id;\n }",
"@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }",
"@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}",
"public int getId()\r\n {\r\n return id;\r\n }",
"public void setId(Long id){\n this.id = id;\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"final protected int getId() {\n\t\treturn id;\n\t}",
"public abstract Long getId();",
"public void setId(Long id) \r\n {\r\n this.id = id;\r\n }",
"@Override\n public long getId() {\n return this.id;\n }",
"public String getId(){ return id.get(); }",
"@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }",
"public Long getId() \n {\n return id;\n }",
"@Override\n\tpublic void setId(int id) {\n\n\t}",
"public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }",
"@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}",
"public int getID(){\n return id;\n }",
"public int getId()\n {\n return id;\n }",
"public String getID(){\n return Id;\n }"
] | [
"0.68954784",
"0.68378097",
"0.6704338",
"0.66405046",
"0.66405046",
"0.6591173",
"0.6577649",
"0.6577649",
"0.657354",
"0.657354",
"0.657354",
"0.657354",
"0.657354",
"0.657354",
"0.65609664",
"0.65609664",
"0.6543523",
"0.65234846",
"0.6514877",
"0.6486739",
"0.64767367",
"0.642598",
"0.6418224",
"0.6416077",
"0.64008904",
"0.63655996",
"0.6354077",
"0.63503945",
"0.6346775",
"0.6323574",
"0.6318245",
"0.63005674",
"0.6292615",
"0.6292615",
"0.6282184",
"0.6270863",
"0.6265186",
"0.6264375",
"0.62613726",
"0.62583315",
"0.6255373",
"0.6250626",
"0.6246553",
"0.6246553",
"0.6243956",
"0.6238707",
"0.6238707",
"0.6230739",
"0.62232894",
"0.62195456",
"0.62184453",
"0.6210688",
"0.6208303",
"0.6201759",
"0.6200382",
"0.61917084",
"0.6188896",
"0.6188896",
"0.61881596",
"0.61881596",
"0.61881596",
"0.6183394",
"0.6182932",
"0.617465",
"0.6173436",
"0.6166611",
"0.6165045",
"0.61600006",
"0.61568975",
"0.61568975",
"0.61568975",
"0.61568975",
"0.61568975",
"0.61568975",
"0.61568975",
"0.6154626",
"0.6154626",
"0.6141511",
"0.61333525",
"0.61282176",
"0.6126933",
"0.6104891",
"0.61035514",
"0.61035514",
"0.6102866",
"0.6102238",
"0.61013037",
"0.6099772",
"0.6098166",
"0.6093518",
"0.6092529",
"0.6091996",
"0.6091996",
"0.60906154",
"0.6088676",
"0.60753924",
"0.6071486",
"0.60712415",
"0.6069405",
"0.6068963",
"0.6068712"
] | 0.0 | -1 |
TODO Autogenerated method stub | public int updateSetting(UserInfo userInfo, Object obj) {
if (SystemIdEnums.AUTHOR_SYS.getCode().equals(userInfo.getSystemId())) {
AuthorInfo authorInfo = (AuthorInfo)obj;
authorInfoManager.saveAuthorInfo(authorInfo);
} else if (SystemIdEnums.EXPERT_SYS.getCode().equals(userInfo.getSystemId())) {
ExpertInfo expertInfo = (ExpertInfo)obj;
expertInfoManager.saveExpertInfo(expertInfo);
} else if (SystemIdEnums.READER_SYS.getCode().equals(userInfo.getSystemId())) {
ReaderInfo readerInfo = (ReaderInfo)obj;
readerInfoManager.saveReaderInfo(readerInfo);
} else if (SystemIdEnums.EDIT_SYS.getCode().equals(userInfo.getSystemId())) {
// AuthorInfo authorInfo = (AuthorInfo)obj;
// authorInfoManager.saveAuthorInfo(authorInfo);
} else {
logger.info("系统不存在,你修改啥");
}
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public int updatePw(UserInfo userInfo,String password) {
userInfo.setId(userInfo.getId());
userInfo.setLogonPwd(password);
try{
userInfoManager.saveUserInfo(userInfo);
return 1;
}catch(Exception e){
e.printStackTrace();
return 0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public Object queryObject(String userId) {
UserInfoQuery userInfoQuery = new UserInfoQuery();
userInfoQuery.setUserId(userId);
List<UserInfo> userInfos = userInfoManager.queryList(userInfoQuery);
UserInfo userInfo = userInfos.get(0);
if(RoleIdEnums.AUTHOR.getCode().equals(userInfo.getRoleId())){
AuthorInfoQuery authorInfoQuery= new AuthorInfoQuery();
authorInfoQuery.setAuthorId(userInfo.getRefId());
List<AuthorInfo> authorInfos= authorInfoManager.queryList(authorInfoQuery);
AuthorInfo authorInfo = authorInfos.get(0);
return authorInfo;
}else if(RoleIdEnums.READER_P.getCode().equals(userInfo.getRoleId()) || RoleIdEnums.READER_E.getCode().equals(userInfo.getRoleId())){
//TODO:
ReaderInfoQuery readerInfoQuery= new ReaderInfoQuery();
readerInfoQuery.setReaderId(userInfo.getRefId());
List<ReaderInfo> readerInfos= readerInfoManager.queryList(readerInfoQuery);
ReaderInfo readerInfo = readerInfos.get(0);
return readerInfo;
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public UserInfo queryUserInfo(String userId) {
UserInfoQuery userInfoQuery = new UserInfoQuery();
userInfoQuery.setUserId(userId);
List<UserInfo> userInfos = userInfoManager.queryList(userInfoQuery);
UserInfo userInfo = userInfos.get(0);
return userInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
////////////////double sort testing\\\\\\\\\\\\\\\\\\\\\\ check findMax | public static void main(String[] args)
{
double[] a = {7, 6, 8, 4, 3, 2, 1};
System.out.println(a[findMax(a,a.length-1)]);
//check swap
print(a);
swap(a, 0, 6);
System.out.println("");
print(a);
//check sort
System.out.println("");
System.out.println("Sort");
print(a);
sort(a);
System.out.println("");
print(a);
//////////////////////////////string sort test
String[] array = {"apple", "bottle", "cat", "deer", "firetruck", "hi", "jar", "kite"};
//String[] array = {"a","b","c","d","e","f","g"};
print(array);
System.out.println("SWAP:");
swap(array, 0, array.length-1);
swap(array, 3, 6);
swap(array, 2, 4);
print(array);
System.out.println("FINDMAX:");
System.out.println(findMax(array, 5) + ", " + array[findMax(array,5)]);
System.out.println("SORT:");
print(array);
sort(array);
print(array);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\n int[] nums= {200,4,3,5,70,6,8,90};\n System.out.println( isMax( nums ));\n System.out.println(isMaxNoSort(nums));\n }",
"int max() {\n\t\t// added my sort method in the beginning to sort out array\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\n\t\t\t\tif (array[j - 1] > array[j]) {\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// finds the last term in the array --> if array is sorted then the last\n\t\t// term should be max\n\t\tint x = array[array.length - 1];\n\t\treturn x;\n\t}",
"void sort(double arr[], long start, long end) \n { \n double biggest = 0, temp;\n int biggestIndex = 0;\n for(int j = 0; j > arr.length+1; j++){\n for(int i = 0; i < arr.length-j; i++){\n if(arr[i] > biggest){\n biggest = arr[i];\n biggestIndex = i;\n }\n }\n temp = arr[arr.length-1];\n arr[arr.length-1] = biggest;\n arr[biggestIndex] = temp;\n biggest = 0;\n biggestIndex = 0;\n }\n }",
"Sort(int max) {\r\n\r\n\t\t/** Initialise global sort count variables **/\r\n\r\n\t\tcompIS = 0;\r\n\r\n\t\tcompQS = 0;\r\n\r\n\t\tcompNewS = 0;\r\n\r\n\t\t/** Initialise size variables **/\r\n\r\n\t\tusedSize = 0;\r\n\r\n\t\tsize = max;\r\n\r\n\t\t/** Create Array of Integers **/\r\n\r\n\t\tA = new int[size];\r\n\r\n\t}",
"public static void main(String[] args) {\n int[] arr = {123,100,200,345,456,678,89,90,10,56};\n Arrays.sort(arr);\n System.out.println(Arrays.toString(arr));\n int lastIndex = arr.length-1;\n int secondIndexNUm =lastIndex-1; //arr.length-1-1;\n int secondMaxNum = arr[secondIndexNUm];\n System.out.println(secondMaxNum);\n\n int[]arr2 = {1,2,3,4,5,6};\n int num2 =secondMax(arr2);\n System.out.println(num2 );\n\n }",
"public static void main(String[] args) {\n\t\tint arr[] = {2,4,11,5,8,1,9};\r\n\t\tint res = arr[1] - arr[0];\r\n\t\tfor(int i = 0; i < arr.length; i++) {\r\n\t\t\tfor(int j = i + 1; j < arr.length; j++) {\r\n\t\t\t\tres = Math.max(res, arr[j] - arr[i]);\r\n\t\t\t}\r\n\t\t}\r\n//\t\tSystem.out.println(first + \" : \" + last + \" : \" + max);\r\n\t\tSystem.out.println(res);\r\n\t}",
"public static int secondaryArgmax(double[] a) {\n\t\tint mi = argmax(a);\n\t\t// scan left until increasing\n\t\tint i;\n\t\tfor (i=mi-1; i>=0 && a[i]<=a[i+1]; i--);\n\t\tint l = argmax(a,0,i+1);\n\t\tfor (i=mi+1; i<a.length && a[i]<=a[i-1]; i++);\n\t\tint r = argmax(a,i,a.length);\n\t\tif (l==-1) return r;\n\t\tif (r==-1) return l;\n\t\treturn a[l]>=a[r]?l:r;\n\t}",
"public double biggest(ArrayList<Double> numbers) {\n\t\tif(numbers == null) {\n\t\t\treturn -1;\n\t\t} else if (numbers.size() < 3 || numbers.size() % 2 == 0) {\n\t\t\treturn -1;\n\t\t}\n\t\tdouble first = numbers.get(0);\n\t\tdouble middle = numbers.get((int) Math.floor(numbers.size() / 2));\n\t\tdouble last = numbers.get(numbers.size() -1);\n\t\tdouble maximum = (first > middle && first > last) ? first :\n\t\t(middle > last) ? middle :\n\t\tlast;\n\t\treturn maximum;\t\t// default return value to ensure compilation\n\t}",
"public static void main(String[] args) {\n int[] array = {5, 35, 75, 25, 95, 55, 45};\n // Arrays.sort(array);\n\n\n int j = array.length-1;\n for (int i = array.length-1; i >= 0; i--){\n array[j] = array[i];\n j--;\n //System.out.println(array[i]);\n }\n\n System.out.println(\"##########################\");\n //int max2 = array[array.length-1];\n\n //System.out.println(max2);\n double[] arr2 = {5.7, 35.0, 75.6, 25.3, 95.15, 55.88, 55.45};\n\n char[] ch = {'A', 'C', 'F', 'G', 'D', 'E', 'H', 'B'};\n\n\n maxNumber(array);\n\n maxNumber(arr2);\n\n System.out.println(\"><><><><><><><><><><><><><><><\");\n\n int[ ] des = Descending(array);\n System.out.println(Arrays.toString(des));\n\n double[] dess = Descending(arr2);\n System.out.println(Arrays.toString(dess));\n\n char[] desss = Descending(ch);\n System.out.println(Arrays.toString(desss));\n\n System.out.println(\"><><><><><><><><><><><><><><><\");\n\n }",
"include<stdio.h>\nint main()\n{\n int arr_size;\n scanf(\"%d\",&arr_size);\n int arr[10];\n // Get the array elements\n for(int idx = 0; idx <= arr_size - 1; idx++)\n {\n scanf(\"%d\",&arr[idx]);\n }\n // Get the searching element 1\n int max;\n if(arr[0]>arr[1])\n {\n max=arr[0];\n }\n else\n {\n max=arr[1];\n }\n \n for(int idx = 2; idx <= arr_size - 1; idx++)\n {\n if(max< arr[idx])\n {\n max= arr[idx];\n }\n }\n printf(\"%d\\n\",max);\n return 0;\n}",
"double largestNumber(double[] a) {\n\t\tdouble max = a[0];\n\t\tdouble no = 0;\n\t\tfor (int index = 1; index < a.length; index++) {\n\t\t\tif (max > a[index] && max > a[index + 1]) {\n\t\t\t\tno = max;\n\t\t\t\tbreak;\n\t\t\t} else if (a[index] > max && a[index] > a[index + 1]) {\n\t\t\t\tno = a[index];\n\t\t\t\tbreak;\n\t\t\t} else if (a[index + 1] > max && a[index + 1] > a[index]) {\n\t\t\t\tno = a[index + 1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn no;\n\t}",
"private int max(int i, int j)\r\n {\r\n if(i > j) return i;\r\n else return j;\r\n }",
"public static void main(String[] args) {\n int maxposition = -1;\n int i = 0;\n Random rnd = new Random();\n Scanner scanner = new Scanner(System.in);\n int arraylength = 0;\n while (arraylength < 2 || arraylength > 100){\n System.out.print(\"Enter desirable array range between 2 and 100 - \");\n arraylength = scanner.nextInt();\n }\n int array[] = new int[arraylength];\n for (i = 0; i <= (array.length - 1); i++) {\n array[i] = rnd.nextInt(255);\n }\n System.out.print(\"initial given array: \" + array[0]);\n for (i = 1; i <= (array.length - 1); i++) {\n System.out.print(\", \" + array[i]);\n }\n System.out.println(\";\");\n int max = array[0];\n//sorting\n // taking local maximums left\n while (maxposition != array.length - 1) {\n for (i = 1; maxposition < 0; i++) {\n if (i > array.length - 2) {\n maxposition = array.length - 1;\n }\n else {\n if (array[i] > array[i - 1]) {\n if (array[i] > array[i + 1]){\n max = array[i];\n maxposition = i;\n }\n }\n if (array[i] = array[i - 1]) {\n if (array[i] > array[i + 1]){\n max = array[i];\n maxposition = i;\n }\n }\n }\n }\n for (i = maxposition; i > 0; i--) {\n if (array[i] > array[i - 1]) {\n max = array[i];\n array[i] = array[i - 1];\n array[i - 1] = max;\n }\n }\n if (maxposition != array.length - 1) {\n maxposition = -1;\n }\n \n }\n // taking local minimums right\n maxposition = -1;\n max = array[0];\n while (maxposition != array.length - 1) {\n for (i = 1; maxposition < 0; i++) {\n if (i > array.length - 2) {\n maxposition = array.length - 1;\n }\n else {\n if (array[i] < array[i - 1]) {\n if (array[i] < array[i + 1]){\n max = array[i];\n maxposition = i;\n }\n }\n }\n }\n for (i = maxposition; i < arraylength -1; i++) {\n if (array[i] < array[i + 1]) {\n max = array[i];\n array[i] = array[i + 1];\n array[i + 1] = max;\n }\n }\n if (maxposition != array.length - 1) {\n maxposition = -1;\n }\n \n }\n\n // while (array[arraylength - 1] > array[arraylength - 2]) {\n // for (i = array.length - 1; i > 0; i--) {\n // if (array[i] > array[i - 1]) {\n // max = array[i];\n // array[i] = array[i - 1];\n // array[i - 1] = max;\n // }\n // }\n // }\n\n//showing user sorted array\n System.out.print(\"array sorted descending: \" + array[0]);\n for (i = 1; i <= (array.length - 1); i++) {\n System.out.print(\", \" + array[i]);\n }\n System.out.println(\";\");\n\t}",
"static double getMax(double a, double b) {\n\t\treturn (a > b) ? a : b;\n\t}",
"public static void main(String[] args) {\nint[] arr= {12,66,88,45,76,23,45,89,65,45,90,43};\n\n int largest=arr[0];\n int slargest=arr[0];\n int i;\n System.out.println(\"Display the Array \");\n for( i=0;i<arr.length;i++)\n {\n\t System.out.print(arr[i]+\" \");\n }\n for(i=0;i<arr.length;i++)\n {\n\t if(arr[i]>largest)\n\t {\n\t\t \n\t\t slargest=largest;\n\t\t largest=arr[i];\n\t\t \n\t }\n\t else if(arr[i]>slargest)\n\t {\n\t\t slargest=arr[i];\n\t }\n }\n System.out.println(\"second largest lement is \"+slargest);\n\t}",
"public T deleteMax()\n\t{\n\t\tint maxIndex = 0;\n\t\tboolean flag = false;\n\t\tboolean flag2 = false;\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tif(size == 1)\n\t\t{\n\t\t\tT temp = array[0];\n\t\t\tarray[0] = null;\n\t\t\tsize--;\n\t\t\treturn temp;\n\t\t}\n\t\tif(size == 2)\n\t\t{\n\n\t\t\tT wemp = array[1];\n\t\t\tarray[1] = null;\n\t\t\tsize--;\n\t\t\treturn wemp;\n\t\t}\n\t\tif(size == 3)\n\t\t{\n\t\t\tT femp ;\n\t\t\tif(object.compare(array[1], array[2]) >0)\n\t\t\t{\n\t\t\t\tfemp = array[1];\n\t\t\t\tarray[1] = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t\tsize--;\n\t\t\t\treturn femp;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfemp = array[2];\n\t\t\t\tarray[2] = null;\n\t\t\t\tsize--;\n\t\t\t\treturn femp;\n\t\t\t}\n\n\t\t}\n\t\tint index = 0;\n\t\tif(object.compare(array[1], array[2]) >= 0)\n\t\t{\n\t\t\tindex = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tindex = 2;\n\t\t}\n\n\t\tT temp = array[index];\n\t\tarray[index] = array[size -1];\n\t\tarray[size-1] = null;\n\t\tsize--;\n\n\t\tint max = max(index).get(0);\n\t\twhile(max != 0)\n\t\t{\n\t\t\tif(object.compare(array[index], array[max]) >= 0)\n\t\t\t{\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif( max(index).size() > 1)\n\t\t\t{\n\t\t\t\tflag2 = true;\n\t\t\t\t\n\t\t\t}\n\n\t\t\tT lemp = array[index];\n\t\t\tarray[index] = array[max];\n\t\t\tarray[max] = lemp;\n\n\n\t\t\tindex = max;\n\t\t\tmax = max(max).get(0);\n\t\t}\n\n\t\tif(flag == true)\n\t\t{\n\n\t\t}\n\t\telse if(flag2 == true)\n\t\t{\n\t\t\tint y = index;\n\t\t\tif(getLevel(index+1) % 2 == 1)\n\t\t\t{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) > 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t\t{\n\t\t\t\t\tT k = array[(y-3)/4];\n\t\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\t\tarray[y] = k;\n\t\t\t\t\ty = (y-3)/4;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if(object.compare(array[index], array[grandChildMax(2*index+1, 2*index+2)]) < 0 && grandChildMax(2*index+1, 2*index+2) != 0)\n\t\t{\n\t\t\tmaxIndex = grandChildMax(2*index+1, 2*index+2);\n\t\t\tT wemp = array[index];\n\t\t\tarray[index] = array[maxIndex];\n\t\t\tarray[maxIndex] = wemp;\n\t\t\tint y = maxIndex;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\t\telse if(object.compare(array[index], array[(index-1)/2]) < 0) \n\t\t{\n\n\t\t\tT femp = array[(index-1)/2];\n\t\t\tarray[(index-1)/2] = array[index];\n\t\t\tarray[index] = femp;\n\n\t\t\tint y = (index-1)/2;\n\t\t\twhile(object.compare(array[y], array[(y-3)/4]) < 0 && y > 2)\n\t\t\t{\n\t\t\t\tT demp = array[(y-3)/4];\n\t\t\t\tarray[(y-3)/4] = array[y];\n\t\t\t\tarray[y] = demp;\n\t\t\t\ty = (y-3)/4;\n\t\t\t}\n\t\t}\n\n\n\t\t\n\t\treturn temp;\n\t}",
"public static void main(String[] args) {\n\t\tint[] a = { -2, -3, 4, -1, -2, 1, 5, -3 }; \n\t\t int size = a.length; \n\t int max_so_far = Integer.MIN_VALUE, max_ending_here=0;\n\t for (int i = 0; i < size; i++) { \n\t max_ending_here = max_ending_here + a[i]; \n\t if (max_so_far < max_ending_here) \n\t max_so_far = max_ending_here; \n\t if (max_ending_here < 0) \n\t max_ending_here = 0; \n\t } \n\t // System.out.println(max_so_far);\n\t int product=1,max=0;\n\t for (int i = 0; i < size; i++) {\n\t \t\n\t \tproduct=product*a[i];\n\t \tif(product>max)\n\t \t\tmax=product;\n\t \t if (product < 0) \n\t \t\t product = 1; \n\t \t\n\t }\n\t // System.out.println(max);\n\t \n\t Arrays.sort(a);\n\t int i=0,j=a.length-1;\n\t while(i<a.length &&j<a.length)\n\t {\n\t \t if(a[i]+a[j]==3)\n\t \t {\n\t \t\t System.out.println(a[i]+\" \"+a[j]);\n\t \t\t i++;j--;\n\t \t }\n\t \t else if(a[i]+a[j]>3)\n\t \t\t j--;\n\t \t else if(a[i]+a[j]<3)\n\t \t\t i++;\n\t }\n\t \n\t \n\t }",
"public static void main(String[] args) {\n\t\t\n\t\tint a[]={1,2,5,6,3,2}; \n\t\t\n\t\tint temp, size;\n\t\tsize = a.length;\n\n\t for(int i = 0; i<size; i++ ){\n\t for(int j = i+1; j<size; j++){\n\n\t if(a[i]>a[j]){\n\t temp = a[i];\n\t a[i] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t System.out.println(\"Third second largest number is:: \"+a[size-2]);\n\n\t}",
"public static int pointFree(double[] numbers){\n String completeString = \"\";\n String redactedString = \"\";\n int newArray[] = new int[numbers.length];\n int greatestValue=0;\n \n \n \n for (double x : numbers) {\n int currentValue;\n \n completeString = String.valueOf(x);\n redactedString = completeString.replaceAll(\"\\\\.\",\"\");\n currentValue = Integer.parseInt(redactedString);\n for (int i = 0; i < newArray.length; i++) {\n \n newArray[i]=currentValue;\n \n \n }\n greatestValue=newArray[0];\n for (int i = 0; i < newArray.length; i++) {\n if(newArray[i]>greatestValue){\n greatestValue=newArray[i];\n \n }\n \n }\n \n \n }\n return greatestValue;\n \n }",
"public static void main(String[] args) {\nint arr[]=new int[] {10,20,36,50,30};\nint max=0,i;\nfor(i=0;i<arr.length;i++)\n{\n\tif(arr[i]>max)\n\t{\n\t\tmax=arr[i];\n\t}\n}\nSystem.out.println(max);\n\t}",
"public static void main(String[] args) {\n int[] arr={24,34,56,98,2,59};\r\n int val =arr [0];\r\n for(int i=0;i<arr.length;i++){\r\n \t if(arr[i]>val){\r\n \t\t val=arr[i];\r\n \t }\r\n }\r\n System.out.println(\"largest value\"+ val);\r\n\t}",
"public static void main(String args[]){\n\t\tint a[]={4,3,5,2,1,3,2,3};\n\t\t\n\t\t//Missed 1 part::\n\t\t//Need to skip the equals, as they don't satisfy the condition, a[i] < a[j] \n\t\tSystem.out.println(maxDistance(a));\t\n\t\t\n\t}",
"private static Pair<Double, Integer> findMaxEntry(double[] array) {\n int index = 0;\n double max = array[0];\n for (int i = 1; i < array.length; i++) {\n if ( array[i] > max ) {\n max = array[i];\n index = i;\n }\n }\n return new Pair<Double, Integer>(max, index);\n }",
"public static void main(String[] args) {\n\t\tint[] a={7,6,8,9,2,3};\n\t\tint temp;\n\t\t//外层循环,一共比较多少轮,没比较一轮,最大的那个数都排到最后\n\t\tfor(int i=0;i<a.length-1;i++){\n\t\t\tfor(int j=0;j<a.length-1-i;j++){\n\t\t\t\tif (a[j]>a[j+1]){\n\t\t\t\t\ttemp=a[j];\n\t\t\t\t\ta[j]=a[j+1];\n\t\t\t\t\ta[j+1]=temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int k=0;k<a.length;k++){\n\t\t\tSystem.out.println(a[k]);\n\t\t}\n\t}",
"public void wiggleSortSubOptimal(int[] nums) {\n Arrays.sort(nums);\n \n for (int i = 1; i < nums.length - 1; i += 2)\n swap(nums, i, i + 1);\n }",
"Double maxOfDisplacements(ArrayList<Double> dispA){\r\n\t\tObject minvalobj = Collections.min(dispA);\r\n\t\tObject maxvalobj = Collections.max(dispA);\r\n\t\tIJ.log(\"Max displacement\" + maxvalobj);\r\n\t\tIJ.log(\"Min displacement\" + minvalobj);\r\n\t\tdouble minval = (Double) minvalobj;\r\n\t\tdouble maxval = (Double) maxvalobj;\t\t\r\n\t\tdouble maxdisp = maxval;\r\n\t\tif (Math.abs(maxval) < Math.abs(minval)) \r\n\t\t\tmaxdisp = minval;\r\n\t\telse\r\n\t\t\tmaxdisp = maxval;\t\t\r\n\t\treturn maxdisp;\r\n\t}",
"@Test\n\tpublic void testMaxMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, max, max) );\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tint [] arr= {3,43,2,320,143,4};\n\t\t\n\t\tint temp=0;\n\t\tint lenth=arr.length;\n\t\t\n\t\tfor(int i=0;i<lenth;i++) {\n\t\t\t\n\t\t\tfor(int j=1;j<(lenth-i);j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(arr[j-1]>arr[j]) {\n\t\t\t\t\ttemp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tSystem.out.println(arr[j]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\n\t\t\n\n\t}",
"public static int max2(double[] mainArray2) {\r\n\t\tint max2 = 0;\r\n\t\tfor(int greaterThan = 1; greaterThan < mainArray2.length; greaterThan ++) {\r\n\r\n\t\t\tif(mainArray2[greaterThan]>mainArray2[max2]) {\r\n\t\t\t\tmax2 = greaterThan;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn max2;\r\n\t}",
"public int serachMaxOrMinPoint(int [] A){\r\n\t\r\n\tint mid, first=0,last=A.length-1;\r\n\t\r\n\twhile( first <= last){\r\n\t\tif(first == last){\r\n\t\t\treturn A[first];\r\n\t\t}\r\n\t\telse if(first == last-1){\r\n\t\t\treturn Math.max(A[first], A[last]);\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tmid= first + (last-first)/2;\r\n\t\t\t\r\n\t\t\tif(A[mid]>A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\treturn A[mid];\r\n\t\t\telse if(A[mid]>A[mid-1] && A[mid]<A[mid+1])\r\n\t\t\t\tfirst=mid+1;\r\n\t\t\telse if(A[mid]<A[mid-1] && A[mid]>A[mid+1])\r\n\t\t\t\tlast=mid-1;\r\n\t\t\telse return -1;\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n\t\r\n}",
"public static int findLargest(int[] data){\n\t\tint lo=0, hi=data.length-1;\n\t\tint mid = (lo+hi)/2;\n\t\tint N = data.length-1;\n\t\twhile (lo <= hi){\n\t\t\tint val = data[mid];\n\t\t\tif(mid == 0 ) return (val > data[mid+1]) ? mid : -1;\n\t\t\telse if(mid == N) return (val > data[mid-1]) ? mid : -1;\n\t\t\telse{\n\t\t\t\tint prev = data[mid-1];\n\t\t\t\tint next = data[mid+1];\n\t\t\t\tif(prev < val && val < next) lo=mid+1;\n\t\t\t\telse if(prev > val && val > next) hi = mid-1;\n\t\t\t\telse return mid; // prev > val && val > next // is the only other case\n\t\t\t\tmid = (lo+hi)/2;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}",
"@Test\n\tpublic void HeapExtractMaximumtestDifferentPriorities() {\n\t\t Job jarray[]=new Job[5];\n\t\t jarray[0]=new Job(\"job1\",50,1);\n\t\t jarray[1]=new Job(\"job2\",20,2);\n\t\t jarray[2]=new Job(\"job3\",80,3);\n\t\t jarray[3]=new Job(\"job4\",20,4);\n\t\t jarray[4]=new Job(\"job5\",1,5);\n\t\t \n\t\t Job actual=PQHeap.HeapExtractMaximum(jarray);\n\t\t //System.out.println(\"\"+actual);\n\t\t//assertTrue((new Job(\"job1\",20,1)).equals(actual));\n\t\t//assertEquals(new Job(\"job1\",20,1), actual);\n\t\t assertNotEquals(new Job(\"job3\",20,1), actual);\n\t\t//fail(\"Not yet implemented\");\n\t}",
"@Override public LinkedList<int[]> sortDescending(int[] sortArr) {\n return qSortDescending( sortArr, 0, sortArr.length-1 );\n }",
"int max(){\r\n int auxMax = array[0];\r\n for (int i=1;i<array.length;i++){\r\n if(array[i] > auxMax){\r\n auxMax = array[i];\r\n }\r\n }\r\n return auxMax;\r\n }",
"public static void main(String[] args) {\n MaxDistance max = new MaxDistance();\n //int arr[] = {9, 2, 3, 4, 5, 6, 7, 8, 18, 0};\n\n //int arr[] = {3, 5, 4, 2};\n //int arr[] = {3,2,1};\n //int arr[] = {1,10};\n int arr[] = {100, 100, 100}; //return 0, not checking equal value\n \n //int arr[] = { 83564666, 2976674, 46591497, 24720696, 16376995, 63209921, 25486800, 49369261, 20465079, 64068560, 7453256, 14180682, 65396173, 45808477, 10172062, 28790225, 82942061, 88180229, 62446590, 77573854, 79342753, 2472968, 74250054, 17223599, 47790265, 24757250, 40512339, 24505824, 30067250, 82972321, 32482714, 76111054, 74399050, 65518880, 94248755, 76948016, 76621901, 46454881, 40376566, 13867770, 76060951, 71404732, 21608002, 26893621, 27370182, 35088766, 64827587, 67610608, 90182899, 66469061, 67277958, 92926221, 58156218, 44648845, 37817595, 46518269, 44972058, 27607545, 99404748, 39262620, 98825772, 89950732, 69937719, 78068362, 78924300, 91679939, 52530444, 71773429, 57678430, 75699274, 5835797, 74160501, 51193131, 47950620, 4572042, 85251576, 49493188, 77502342, 3244395, 51211050, 44229120, 2135351, 47258209, 77312779, 37416880, 59038338, 96069936, 20766025, 35497532, 67316276, 38312269, 38357645, 41600875, 58590177, 99257528, 99136750, 4796996, 84369137, 54237155, 64368327, 94789440, 40718847, 12226041, 80504660, 8177227, 85151842, 36165763, 72764013, 36326808, 80969323, 22947547, 76322099, 7536094, 18346503, 65759149, 45879388, 53114170, 92521723, 15492250, 42479923, 20668783, 64053151, 68778592, 3669297, 73903133, 28973293, 73195487, 64588362, 62227726, 17909010, 70683505, 86982984, 64191987, 71505285, 45949516, 28244755, 33863602, 18256044, 25110337, 23997763, 81020611, 10135495, 925679, 98158797, 73400633, 27282156, 45863518, 49288993, 52471826, 30553639, 76174500, 28828417, 41628693, 80019078, 64260962, 5577578, 50920883, 16864714, 54950300, 9267396, 56454292, 40872286, 33819401, 75369837, 6552946, 26963596, 22368984, 43723768, 39227673, 98188566, 1054037, 28292455, 18763814, 72776850, 47192134, 58393410, 14487674, 4852891, 44100801, 9755253, 37231060, 42836447, 38104756, 77865902, 67635663, 43494238, 76484257, 80555820, 8632145, 3925993, 81317956, 12645616, 23438120, 48241610, 20578077, 75133501, 46214776, 35621790, 15258257, 20145132, 32680983, 94521866, 43456056, 19341117, 29693292, 38935734, 62721977, 31340268, 91841822, 22303667, 96935307, 29160182, 61869130, 33436979, 32438444, 87945655, 43629909, 88918708, 85650550, 4201421, 11958347, 74203607, 37964292, 56174257, 20894491, 33858970, 45292153, 22249182, 77695201, 34240048, 36320401, 64890030, 81514017, 58983774, 88785054, 93832841, 12338671, 46297822, 26489779, 85959340 };\n\n //int arr[] = { 46158044, 9306314, 51157916, 93803496, 20512678, 55668109, 488932, 24018019, 91386538, 68676911, 92581441, 66802896, 10401330, 57053542, 42836847, 24523157, 50084224, 16223673, 18392448, 61771874, 75040277, 30393366, 1248593, 71015899, 20545868, 75781058, 2819173, 37183571, 94307760, 88949450, 9352766, 26990547, 4035684, 57106547, 62393125, 74101466, 87693129, 84620455, 98589753, 8374427, 59030017, 69501866, 47507712, 84139250, 97401195, 32307123, 41600232, 52669409, 61249959, 88263327, 3194185, 10842291, 37741683, 14638221, 61808847, 86673222, 12380549, 39609235, 98726824, 81436765, 48701855, 42166094, 88595721, 11566537, 63715832, 21604701, 83321269, 34496410, 48653819, 77422556, 51748960, 83040347, 12893783, 57429375, 13500426, 49447417, 50826659, 22709813, 33096541, 55283208, 31924546, 54079534, 38900717, 94495657, 6472104, 47947703, 50659890, 33719501, 57117161, 20478224, 77975153, 52822862, 13155282, 6481416, 67356400, 36491447, 4084060, 5884644, 91621319, 43488994, 71554661, 41611278, 28547265, 26692589, 82826028, 72214268, 98604736, 60193708, 95417547, 73177938, 50713342, 6283439, 79043764, 52027740, 17648022, 33730552, 42851318, 13232185, 95479426, 70580777, 24710823, 48306195, 31248704, 24224431, 99173104, 31216940, 66551773, 94516629, 67345352, 62715266, 8776225, 18603704, 7611906 };\n\n int n = arr.length;\n int maxDiff = max.maxIndexDiff(arr, n);\n System.out.println(maxDiff);\n }",
"static List<Integer> longestBouncyList(List<Integer> arr) {\n List<Integer> results = new ArrayList<>();\r\n results.add(arr.get(0));\r\n \r\n // If the 1 element is the lowest 2, add the first 2 elements \r\n List<Integer> test = new ArrayList<>();\r\n if (arr.get(0) < arr.get(1)) {\r\n test.add(arr.get(0));\r\n test.add(arr.get(1));\r\n }\r\n\r\n // Traverse the arr\r\n for (int i = 1; i < arr.size() - 1; i++) {\r\n\r\n if (((arr.get(i) > arr.get(i - 1)) && (arr.get(i) > arr.get(i + 1)))\r\n || ((arr.get(i) < arr.get(i - 1)) && (arr.get(i) < arr.get(i + 1)))) {\r\n\r\n if (test.isEmpty()) {\r\n test.add(arr.get(i - 1));\r\n test.add(arr.get(i));\r\n }\r\n\r\n test.add(arr.get(i + 1));\r\n\r\n if (i == arr.size() - 2) {\r\n results = compareList(test, results);\r\n }\r\n\r\n } else {\r\n\r\n results = compareList(test, results);\r\n \r\n test = new ArrayList<>();\r\n }\r\n\r\n }\r\n return results;\r\n }",
"@Test\n\tpublic void HeapMaximumtest2() {\n\t\tJob jarray[]=new Job[5];\n\t\t jarray[0]=new Job(\"job1\",50,1);\n\t\t jarray[1]=new Job(\"job2\",20,2);\n\t\t jarray[2]=new Job(\"job3\",80,3);\n\t\t jarray[3]=new Job(\"job4\",20,4);\n\t\t jarray[4]=new Job(\"job5\",1,5);\n\t\t \n\t\tString actual=PQHeap.HeapMaximum(jarray);\n\t\t \n\t\tassertEquals(jarray[0].job, actual);\n\t\t//fail(\"Not yet implemented\");\n\t}",
"public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}",
"static long getMaxPairwiseProductScanLargest2(int[] numbers) {\n\n int n = numbers.length;\n int pointer1;\n int pointer2;\n\n // Initialize pointers to the first two values\n if (numbers[0] > numbers[1]) {\n pointer1 = 0;\n pointer2 = 1;\n }\n else {\n pointer1 = 1;\n pointer2 = 0;\n }\n\n // Find the largest two values\n for (int i = 2; i < n; i += 1) {\n if (numbers[i] > numbers[pointer1]) {\n\n // Old largest slides over to the number two position\n pointer2 = pointer1;\n pointer1 = i;\n }\n else if (numbers[i] > numbers[pointer2]) {\n pointer2 = i;\n }\n else {\n continue;\n }\n }\n\n return (long) numbers[pointer1] * numbers[pointer2];\n }",
"static void doubleSelectionSort (int [] array) {\n\t for (int i = 0, j = array.length - 1; (i < array.length && j >= 0); i++, j--)\n {\n int minIndex = i;\n int maxIndex = j;\n\n for (int a = i + 1; a < array.length; a++)\n if (array[a] < array[minIndex])\n minIndex = a;\n\n for (int b = j - 1; b >= 0; b--)\n if (array[b] > array[maxIndex])\n maxIndex = b;\n\n if (isSorted(array)) return;\n\n swap(array, minIndex, i);\n System.out.println(Arrays.toString(array));\n swap(array, maxIndex, j);\n System.out.println(Arrays.toString(array));\n }\n\t}",
"@Test\n\tpublic void testMinMaxMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(min, max, max) );\n\t}",
"@Test\n\tpublic void testMaxSmallerBigger(){\n\t int min=3, mid=5, max=10, bigger=Integer.MAX_VALUE, smaller=Integer.MIN_VALUE;\n\t assertEquals( bigger, MaxDiTre.max(max, smaller, bigger) );\n\t}",
"@Test\n public void testSort_intArr_IntComparator_Desc_half() {\n IntComparator comparator = IntComparatorDesc.getInstance();\n int[] expResult = DESC_CHECK_HALF_CHECK_ARRAY;\n sorter.sort(data, 0, 8, comparator);\n assertArrayEquals(\"Error testing class: \" + className, expResult, data);\n }",
"public static void main(String[] args) {\n\t\tint\tmax = x[0];\r\n\t\t\r\n\t\tfor (int value : x) {\r\n\t\t\tif (value > max) {\r\n\t\t\t\tmax = value;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.err.println(\"Max=\"+max);\r\n\r\n\t\tint\tfound = 0;\r\n\t\t\r\n\t\tfor (int place = 0; place < x.length; place++) {\r\n\t\t\tif (x[place] > max) {\r\n\t\t\t\tmax = x[place];\r\n\t\t\t\tfound = place;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.err.println(\"Max=\"+max+\", found=\"+found);\r\n\t}",
"static int[] Bubble_sort(int[] input) {\n\t\t//int n=input.length;\t\t\t\t\t//length of the array\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\t\t\t\t\t\t\t\t\n\t\t\tint pos=0;\t\t\t//setting the first element as the Max element\n\t\t\tint max=input[pos];\n\t\t\tfor(int j=0;j<input.length-i;j++)\n\t\t\t{\t\t\t\t\t//traversing the array to find the max element\n\t\t\t\tif(input[j]>max)\n\t\t\t\t{\n\t\t\t\t\tpos=j;\n\t\t\t\t\tmax=input[pos];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t//swapping the Max element with input.length-i-1 position\n\t\t\tinput[pos]=input[input.length-i-1];\n\t\t\tinput[input.length-i-1]=max;\n\t\t}\n\t\treturn input;\n\t}",
"public static void selectionSortDescendTrace(int [] numbers, int numElements) {\r\n int max;\r\n for(int j = 0; j < numElements; j++){ //finds first index of array at time\r\n max = j;\r\n for(int i = j; i < numElements; i++){\r\n if(numbers[max] < numbers[i]){\r\n max = i;\r\n }\r\n // System.out.print(max);\r\n }\r\n //System.out.println(max);\r\n if(j > 0){\r\n for (int num : numbers){\r\n System.out.print(num + \" \");\r\n }\r\n System.out.println();\r\n }\r\n\r\n int temp = numbers[max];\r\n numbers[max] = numbers[j];\r\n numbers[j] = temp;\r\n }\r\n }",
"private static int[] findGreatestNumInArray(int[] array) {\r\n\t\tint maxValue = Integer.MIN_VALUE;\r\n \r\n\t\tint secondValue = Integer.MIN_VALUE;\r\n\t\t\r\n\t\tint thirdValue = Integer.MIN_VALUE;\r\n\t\t\r\n\t int[] result = new int[2];\r\n\t \r\n\t int[] result2 = new int[3];\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tif (array[i] > maxValue) {\r\n\t\t\t\tthirdValue = secondValue;\r\n\t\t\t\tsecondValue = maxValue;\r\n\t\t\t\tmaxValue = array[i];\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if(array[i]>secondValue)\r\n\t\t\t{\r\n\t\t\t\tsecondValue = array[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse if(array[i]>thirdValue)\r\n\t\t\t{\r\n\t\t\t\tthirdValue = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\tallowResult( result,maxValue,secondValue);\r\n\t\t\r\n\t\tallowResult( result2,maxValue,secondValue,thirdValue);\r\n\t\t//return maxValue;\r\n\t\treturn result2;\r\n\t}",
"@Test\n\tpublic void testMaxMinMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( max, MaxDiTre.max(max, min, max) );\n\t}",
"static int maxIndexDiff(int arr[], int n) { \n int max = 0;\n int i = 0;\n int j = n - 1;\n while (i <= j) {\n if (arr[i] <= arr[j]) {\n if (j - i > max) {\n max = j - i;\n }\n i += 1;\n j = n - 1;\n }\n else {\n j -= 1;\n }\n }\n return max;\n // Your code here\n \n }",
"public void testFindMax() {\r\n assertNull(tree.findMax());\r\n tree.insert(\"apple\");\r\n tree.insert(\"bagel\");\r\n assertEquals(\"bagel\", tree.findMax());\r\n tree.remove(\"bagel\");\r\n assertEquals(\"apple\", tree.findMax());\r\n }",
"@Test\n\tpublic void HeapMaximumtest() {\n\t\tJob jarray[]=new Job[5];\n\t\t jarray[0]=new Job(\"job1\",20,1);\n\t\t jarray[1]=new Job(\"job2\",20,2);\n\t\t jarray[2]=new Job(\"job3\",20,3);\n\t\t jarray[3]=new Job(\"job4\",20,4);\n\t\t jarray[4]=new Job(\"job5\",20,5);\n\t\t \n\t\tString actual=PQHeap.HeapMaximum(jarray);\n\t\t \n\t\tassertEquals(jarray[0].job, actual);\n\t\t//fail(\"Not yet implemented\");\n\t}",
"public static double getMax(double[] arr) \n { \n double max = arr[0]; \n for(int i=1;i<arr.length;i++) \n { \n if(arr[i]>max) \n max = arr[i]; \n } \n return max; \n }",
"private static void p215() {\n// int[] nums = {5, 2, 1, 8, 3};\n// int[] nums = {5, 2, 1, 8, 3, 5, 7};\n int[] nums = {3, 2, 3, 1, 2, 4, 5, 5, 6};\n int k = 4;\n// int ret1 = findKthLargestUsingSort(nums, k);\n// System.out.println(ret1);\n int ret2 = findKthLargestUsingPQ(nums, k);\n// System.out.println(ret2);\n int ret3 = findKthLargestUsingQuickSort(nums, k);\n System.out.println(ret3);\n }",
"@Test\n\tpublic void testNegMaxNegMinNegMax(){\n\t int min=3, mid=5, max=10;\n\t assertEquals( -min, MaxDiTre.max(-max, -min, -max) );\n\t}",
"public static int getIndexOfMax(double[] array){\n\n int largest = 0;\n for ( int i = 1; i < array.length; i++ )\n {\n if ( array[i] > array[largest] ) largest = i;\n }\n return largest;\n\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }",
"public int Sort(){\n\tint nt ;\n\tint i ;\n\tint aux02 ;\n\tint aux04 ;\n\tint aux05 ;\n\tint aux06 ;\n\tint aux07 ;\n\tint j ;\n\tint t ;\n\ti = size - 1 ;\n\taux02 = 0 - 1 ;\n\twhile (aux02 < i) {\n\t j = 1 ;\n\t //aux03 = i+1 ;\n\t while (j < (i+1)){\n\t\taux07 = j - 1 ;\n\t\taux04 = number[aux07] ;\n\t\taux05 = number[j] ;\n\t\tif (aux05 < aux04) {\n\t\t aux06 = j - 1 ;\n\t\t t = number[aux06] ;\n\t\t number[aux06] = number[j] ;\n\t\t number[j] = t;\n\t\t}\n\t\telse nt = 0 ;\n\t\tj = j + 1 ;\n\t }\n\t i = i - 1 ;\n\t}\n\treturn 0 ;\n }"
] | [
"0.63866985",
"0.6370868",
"0.6274738",
"0.6271542",
"0.6179417",
"0.61197895",
"0.60479957",
"0.6026035",
"0.6020131",
"0.59810317",
"0.59660923",
"0.5966042",
"0.5939262",
"0.5930288",
"0.5925552",
"0.58721185",
"0.5871738",
"0.5855608",
"0.5847613",
"0.5844424",
"0.5842051",
"0.5831237",
"0.58149385",
"0.5806604",
"0.5789119",
"0.5776379",
"0.5776327",
"0.57750714",
"0.5760737",
"0.57591444",
"0.5724983",
"0.5709679",
"0.56997615",
"0.5694778",
"0.5694305",
"0.56844574",
"0.56843245",
"0.5682723",
"0.5678638",
"0.56695306",
"0.5656442",
"0.5653715",
"0.5652434",
"0.56522757",
"0.56493616",
"0.56443214",
"0.56432664",
"0.5633964",
"0.56336856",
"0.56324196",
"0.5631452",
"0.5627507",
"0.56171036",
"0.55971",
"0.55956715",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172",
"0.5592172"
] | 0.63178176 | 2 |
endregion region Push authentication notification | private void showNotification(String message) {
// Prepare intent which is triggered if the
// notification is selected
Intent intent = new Intent(this, LoginActivity.class);
int mNotificationId = (int) System.currentTimeMillis();
PendingIntent pIntent =
PendingIntent.getActivity(this,
mNotificationId,
intent,
PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_logo)
.setContentTitle(getString(R.string.app_name))
.setContentText(message)
.setContentIntent(pIntent)
.setAutoCancel(true);
NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
mNotifyMgr.notify(mNotificationId, mBuilder.build());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onAuthenticationSucceeded(String token);",
"public interface PushFireBaseTokenRequestListener {\n\n public void tokenPushed();\n}",
"public String getPushToken() {\n }",
"interface Auth extends RconConnectionEvent, Cancellable {}",
"@Override\n protected void onPushOpen(Context context, Intent intent) {\n }",
"protected void pushNotification(String userID, String message){\n }",
"@Override public void onReceiveNotification(Context context, PushMsg msg) {\n }",
"@Override\n public void onReceive(Context context, Intent intent)\n {\n if (intent.getAction().equals(Config.REGISTRATION_COMPLETE))\n {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n tokenGCM = intent.getStringExtra(\"token\");\n sharedPreferences.putString(\"TOKEN\",tokenGCM);\n\n // Toast.makeText(getApplicationContext(), \"GCM registration token: \" + tokenGCM, Toast.LENGTH_LONG).show();\n\n }\n\n else if (intent.getAction().equals(Config.SENT_TOKEN_TO_SERVER))\n {\n // gcm registration id is stored in our server's MySQL\n\n //Toast.makeText(getApplicationContext(), \"GCM registration token is stored in server!\", Toast.LENGTH_LONG).show();\n\n }\n\n else if (intent.getAction().equals(Config.PUSH_NOTIFICATION))\n {\n // new push notification is received\n\n Log.w(\"ALERTA\", \"Push notification is received!\");\n\n //Toast.makeText(getApplicationContext(), \"Push notification is received!\", Toast.LENGTH_LONG).show();\n }\n }",
"private void sendNotification() {\n ParsePush parsePush = new ParsePush();\n String id = ParseInstallation.getCurrentInstallation().getInstallationId();\n Log.d(\"Debug_id\", id);\n Log.d(\"Debug_UserName\", event.getHost().getUsername()); // host = event.getHost().getUsername();\n ParseQuery pQuery = ParseInstallation.getQuery(); // <-- Installation query\n Log.d(\"Debug_pQuery\", pQuery.toString());\n pQuery.whereEqualTo(\"username\", event.getHost().getUsername());// <-- you'll probably want to target someone that's not the current user, so modify accordingly\n parsePush.sendMessageInBackground(\"Hey your Event: \" + event.getTitle() + \" has a subscriber\", pQuery);\n\n }",
"public interface IAsynAuthenticationCallbackListener\r\n{\r\n void authenticate(G60002Bean g60002Bean);\r\n}",
"NotificationState signOnNotificationService(\n String token, String device, String certB64)\n throws SAXException, IOException;",
"T getPushNotification();",
"public interface IMessageAuthentication {\n void getMessageCode(String phone,IMessageAuth iMessageAuth);\n\n void submitMessageCode(String code,String phone,IMessageAuth iMessageAuth);\n\n //取消短信验证码注册\n void unRegisterMessage();\n\n}",
"private void signIn() {\n }",
"@Override\n public void onAuthenticated(AuthData authData) {\n Log.i(\"lt\", \"authed\");\n }",
"public void authenticate() {\n JSONObject jsonRequest = new JSONObject();\n try {\n jsonRequest.put(\"action\", \"authenticate\");\n jsonRequest.put(\"label\", \"label\");\n JSONObject dataObject = new JSONObject();\n dataObject.put(\"device_token\", CMAppGlobals.TOKEN);\n jsonRequest.put(\"data\", dataObject);\n\n if(CMAppGlobals.DEBUG) Logger.i(TAG, \":: AuthWsManager.authenticate : jsonRequest : \" + jsonRequest);\n\n // send JSON data\n WSManager.getInstance().con(mContext).sendJSONData(jsonRequest);\n\n\n } catch (JSONException e) {\n\n mContext.onWsFailure(e);\n }\n\n }",
"@Override\n public void onTokenRefresh(){\n // start Gcm registration service\n Intent intent = new Intent(this, GcmRegistrationIntentService.class);\n startService(intent);\n }",
"void pushOk(PushConnection pushConnection);",
"void redirectToNotification();",
"public interface ApnsNotification {\r\n\r\n /**\r\n * Returns the binary representation of the device token.\r\n */\r\n public byte[] getDeviceToken();\r\n\r\n /**\r\n * Returns the binary representation of the payload.\r\n *\r\n */\r\n public byte[] getPayload();\r\n\r\n /**\r\n * Returns the identifier of the current message. The\r\n * identifier is an application generated identifier.\r\n *\r\n * @return the notification identifier\r\n */\r\n public int getIdentifier();\r\n\r\n /**\r\n * Returns the expiry date of the notification, a fixed UNIX\r\n * epoch date expressed in seconds\r\n *\r\n * @return the expiry date of the notification\r\n */\r\n public int getExpiry();\r\n\r\n /**\r\n * Returns the binary representation of the message as expected by the\r\n * APNS server.\r\n *\r\n * The returned array can be used to sent directly to the APNS server\r\n * (on the wire/socket) without any modification.\r\n */\r\n public byte[] marshall();\r\n}",
"public interface Connection {\r\n\r\n static final String APP_SERVER_URL = \"http://www.softwaresunleashed.com/iots/sending-push-notifications.php?shareRegId=1\";\r\n static final String GOOGLE_PROJECT_ID = \"769537366212\";\r\n\r\n static final String MESSAGE_KEY = \"m\";\r\n\r\n}",
"@Override\n public void onLoggedIn() {\n\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n\n if (intent.getAction().endsWith(GCMRegistrationIntentService.REGISTRATION_SUCCESS)) {\n // Registration success\n String deviceToken = intent.getStringExtra(\"token\");\n\n // insert to database\n volleyGCM.storeAToken(deviceToken);\n\n // If the current logged in device doesn't match user's database token, update it\n if ((!deviceToken.equals(userLocalStore.getLoggedInUser().getToken())) && UserLocalStore.isUserLoggedIn) {\n\n // Update to the logged in device's token for push notification\n volleyGCM.updateGCMToken(userLocalStore.getLoggedInUser().getUserID(), deviceToken);\n }\n\n // if user is logged in, check to update their token\n\n //Toast.makeText(getApplicationContext(), \"GCM token \" + deviceToken, Toast.LENGTH_SHORT).show();\n } else if (intent.getAction().endsWith(GCMRegistrationIntentService.REGISTRATION_ERROR)) {\n // Registration error\n Toast.makeText(getApplicationContext(), \"GCM registration error \", Toast.LENGTH_SHORT).show();\n } else {\n // Tobe define\n }\n }",
"private void sendNotification() {\n }",
"@Override\r\n\t\t\t\t\tpublic void onLoginedNotify() {\n\t\t\t\t\t\tTypeSDKLogger.d( \"onLoginedNotify\");\r\n\t\t\t\t\t\thaimaLogout();\r\n\t\t\t\t\t\thaimaLogin();\r\n\t\t\t\t\t}",
"void signInComplete();",
"void notify(PushMessage m);",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n\n //setContentView(R.layout.main);\n try {\n //KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n //ks.load(getResources().openRawResource(R.raw.public_key), \"asdf\".toCharArray());\n\n mobile = new Mobile(1, \"192.168.105.129\", 7777);\n mobile.SetAuthFile(this.getFileStreamPath(\"netronics_auth\").getPath());\n mobile.On(\"hi\", new RecvOnListener() {\n @Override\n public void On(Mobile mobile, Object o) {\n mobile.Emit(\"hi2\", o);\n }\n });\n mobile.On(\"push_test\", new RecvOnListener() {\n @Override\n public void On(Mobile mobile, Object o) {\n Log.d(\"Netronics Push\", o.toString());\n }\n });\n mobile.AddPush(new GCM(this, \"568476072992\"));\n mobile.Run();\n mobile.Emit(\"hi\", \"test\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Config.REGISTRATION_COMPLETE)) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n String token = intent.getStringExtra(\"token\");\n\n //Toast.makeText(getContext().getApplicationContext(), \"GCM registration token: \" + token, Toast.LENGTH_LONG).show();\n\n } else if (intent.getAction().equals(Config.SENT_TOKEN_TO_SERVER)) {\n // gcm registration id is stored in our server's MySQL\n\n //Toast.makeText(getContext().getApplicationContext(), \"GCM registration token is stored in server!\", Toast.LENGTH_LONG).show();\n\n } else if (intent.getAction().equals(Config.PUSH_NOTIFICATION)) {\n // new push notification is received\n NotificationUtils notificationUtils = new NotificationUtils();\n notificationUtils.playNotificationSound();\n String message = intent.getStringExtra(\"message\");\n String from = intent.getStringExtra(\"from\");\n String time = intent.getStringExtra(\"time\");\n String other = intent.getStringExtra(\"otherId\");\n\n getHistory();\n\n //Toast.makeText(getApplicationContext(), from + \": \" + message + \" \" + other, Toast.LENGTH_LONG).show();\n //saveToPreferences(MainActivity.this,KEY_NOTIFICATIONS,null);\n }\n }",
"public interface NotificationPushPresenter {\n public void callingNotificationApi();\n public void callingMarkReadNotification(String messageId,int position);\n}",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Config.REGISTRATION_COMPLETE)) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n FirebaseMessaging.getInstance().subscribeToTopic(Config.TOPIC_GLOBAL);\n Log.e(TAG, \"USER_ID: \" + Preferences.get(Constants.USER_ID));\n if (Preferences.contains(Constants.USER_ID) && Preferences.get(Constants.USER_ID) != null) {\n if (!Preferences.get(Constants.USER_ID).equalsIgnoreCase(\"0\"))\n displayFirebaseRegId();\n }\n\n } else if (intent.getAction().equals(Config.PUSH_NOTIFICATION)) {\n // new push notification is received\n\n String message = intent.getStringExtra(\"message\");\n\n Toast.makeText(getApplicationContext(), \"Push notification: \" + message, Toast.LENGTH_LONG).show();\n }\n }",
"@Override\n public void onTokenRefresh() {\n // Fetch updated Instance ID token and notify of changes\n Intent intent = new Intent(this, RegistrationIntentService.class);\n intent.putExtra(\"SOURCE\", \"GCM\");\n startService(intent);\n }",
"private void authWithCustomToken(JSONArray data) {\n // Create a reference to a Firebase database URL\n String strURL = String.format(\"https://%s.firebaseio.com\", appName);\n String token;\n if ( data.length() >= 1 )\n {\n \ttry {\n \t\ttoken = data.getString(0);\n\t\t\t} catch (JSONException e) {\n\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, e.getMessage());\n\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn;\n\t\t\t}\n }\n else{\n \tPluginResult pluginResult = new PluginResult(Status.ERROR, \"authWithCustomToken : Parameter Error\");\n \tmCallbackContext.sendPluginResult(pluginResult);\n \treturn;\n }\n Firebase rootRef = new Firebase(strURL);\n rootRef.authWithCustomToken(token, new Firebase.AuthResultHandler() {\n\n\t\t\t@Override\n\t\t\tpublic void onAuthenticationError(FirebaseError arg0) {\n\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, \"authWithCustomToken : Error\");\n\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onAuthenticated(AuthData arg0) {\n JSONObject resultObj;\n\t\t\t\ttry {\n\t\t\t\t\tresultObj = new JSONObject(arg0.getAuth().toString());\t//NSDictionary *authDict = authData.auth;\n\t PluginResult pluginResult = new PluginResult(Status.OK, resultObj);\n\t //pluginResult.setKeepCallback(true);\n\t mCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, e.getMessage());\n\t\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n }",
"public interface Authentication {\n void signInWithEmailAndPassword(String user, String password, Activity a);\n void createUserWithEmailAndPassword (String user, String password, Activity a);\n void signOut();\n User getCurrentUser();\n void reloadCurrentUser(InvalidUserListener listener);\n}",
"public interface OnCallbackAuthenticationListener {\n void onSuccess();\n\n void onFailed();\n}",
"@Override\n public void onAuthenticationFailed() {\n }",
"@Override\r\n\t\t\tpublic void onLogin(String username, String password) {\n\r\n\t\t\t}",
"void notificationReceived(Notification notification);",
"@Override\n public void onTokenRefresh() {\n String refreshedToken = FirebaseInstanceId.getInstance().getToken();\n Log.d(TAG, \"REFRESHED TOKEN: \" + refreshedToken);\n JSONObject jsonbody = new JSONObject();\n try {\n jsonbody.put(\"UserID\",App.profileModel.UserID);\n jsonbody.put(\"GCMToken\",refreshedToken);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n if(refreshedToken != null)\n HttpCaller\n .getInstance()\n .updateGCMToken(\n jsonbody,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject o) {\n try {\n if(!o.getBoolean(\"Status\")) {\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError volleyError) {\n }\n },true);\n\n\n\n\n prefs = Prefs.getInstance();\n Gson gson = new Gson();\n userPrefsInance = prefs.init(getApplicationContext());\n userPrefsInance.edit().putString(prefs.GCM_TOKEN,refreshedToken);\n\n App.profileModel.GCMToken = refreshedToken;\n\n if(App.profileModel.UserID > 0) {\n HttpCaller.\n getInstance().\n updateGCMToken(\n null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject o) {\n try {\n if (!o.getBoolean(\"Status\")) {\n //Helper.showToast(\"Failed to update notification device token.\", ToastStyle.ERROR);\n\n }\n } catch (JSONException e) {\n e.printStackTrace();\n //Helper.showToast(\"Failed to update notification device token.\", ToastStyle.ERROR);\n }\n }\n },\n new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError volleyError) {\n //Helper.showToast(\"Failed to update notification device token.\", ToastStyle.ERROR);\n\n }\n },true);\n }\n\n // If you want to send messages to this application instance or\n // manage this apps subscriptions on the server side, send the\n // Instance ID token to your app server.\n }",
"public void signUpNew(String mail,String password){\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n String dateTime = simpleDateFormat.format(Calendar.getInstance().getTime());\n\n //device ID\n String deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);\n\n headers = new HashMap<>();\n headers.put(\"mail\",mail);\n headers.put(\"password\",password);\n headers.put(\"subscriptionDateTime\",dateTime);\n headers.put(\"deviceId\",deviceId);\n\n String url = serverUrl + \"/sign_up\";\n sendRequestNew(url,headers);\n }",
"private String pollForServerInitiatedToken(String returnedMessage, String notificationUrl) throws Exception {\n\n UriComponents urlComponent = null;\n try {\n urlComponent = UriComponentsBuilder.newInstance()\n .fromHttpUrl(notificationUrl + '/' + returnedMessage)\n .build().encode();\n log.info(\"===> si_callback URL: {}\", urlComponent.toString());\n } catch (Exception ex) {\n String message = String.format(\"Error building si_callback URL that attempts to obtain access token: %s\", ex.getMessage());\n log.error(message, ex);\n throw new Exception(message);\n }\n\n try {\n ResponseEntity<String> response = restTemplate.getForEntity(urlComponent.toString(), String.class);\n\n log.info(\"si_callback/{auth_req_id} endpoint: {}\", urlComponent.toString());\n log.info(\"si_callback Response {}\", response);\n returnedMessage = response.getBody();\n log.info(\"si_callback Response Body: {}\", returnedMessage);\n } catch (RestClientResponseException ex) {\n if (ex.getResponseBodyAsByteArray().length > 0) {\n returnedMessage = new String(ex.getResponseBodyAsByteArray());\n log.error(\"si_callback Response Message Byte Array: code: {} message: {}\", ex.getRawStatusCode() , returnedMessage);\n throw new Exception(returnedMessage);\n } else {\n log.error(\"si_callback Response Error Message: {}\", ex.getMessage());\n returnedMessage = ex.getMessage();\n throw new Exception(returnedMessage);\n }\n } catch (Exception e) {\n returnedMessage = \"Error in calling Token end point\" + e.getMessage();\n log.error(returnedMessage);\n throw new Exception(returnedMessage);\n }\n\n return returnedMessage;\n\n }",
"public interface IPushListener {\n /**\n * 获取push返回的数据\n * @param data\n * @param pushType 代表推送消息的类型,\n * PushType:1. 为CMD时,消息为透传消息,消息并未展示在通知栏\n * 2. 为NOTIFIY时,消息已经显示在通知栏了,业务端不用在通知栏展示消息了\n */\n public void onPushMessageReceive(MessageBean data,PushType pushType);\n\n\n /**\n * 返回推送是否在线,在线才能收到推送,否则收不到\n * 如果无其他需求可以不处理\n *\n * @param online\n */\n public void isOnline(boolean online);\n\n /**\n * 返回推送是开启还是关闭,当业务端设置推送开启/关闭成功时会调用\n * 设置推送的开启/关闭参考{@PushInterface#switchPush(boolean)}\n *\n * @param toggle 开启或者关闭push的回调\n */\n public void onPushToggle(boolean toggle);\n\n /**\n *\n * @param token 注册到服务端的token\n * @param status 注册到服务端的 platStatus\n * @param success true 注册push成功,false 注册失败\n * 如果返回失败,业务端需要考虑重新登录push。\n */\n public void onPushRegister(String token,PlatStatus status,boolean success);\n\n /**\n * 将注册的push token 和push 渠道返回给业务端\n * @param token\n * @param status\n */\n public void onPushTokenReceive(String token,PlatStatus status);\n\n\n}",
"void addPushApplication(PushApplication pushApp, LoggedInUser user) throws IllegalArgumentException;",
"@RequestMapping(value = \"/mqtt/auth\", method = { RequestMethod.POST, RequestMethod.GET })\r\n\tpublic String auth4MQTT(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tString r = new String();\r\n\t\tEnumeration<String> params = request.getParameterNames();\r\n\t\tString userName = request.getParameter(\"username\");\r\n\t\tString pwd = request.getParameter(\"password\");\r\n\t\tString clientid = request.getParameter(\"clientid\");\r\n\t\t// ACL access 方式,1: 发布 2:订阅\r\n\t\t// 3:发布/订阅,可用于判断是否是acl校验,null表示是auth校验,非空时表示是acl校验\r\n\t\tString access = request.getParameter(\"access\");\r\n\t\tString topic = request.getParameter(\"topic\");\r\n\t\tString ip = request.getParameter(\"ipaddr\");\r\n\t\tif (clientid != null) {\r\n\t\t\tif (userName != null) {\r\n\t\t\t\t// check user auth\r\n\t\t\t\t// ....\r\n\t\t\t\t// check silo self\r\n\t\t\t\tif (!offlineMsgService.checkAuthForSilo(userName, pwd)) {\r\n\t\t\t\t\tresponse.setStatus(HttpServletResponse.SC_FORBIDDEN);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tresponse.setStatus(HttpServletResponse.SC_FORBIDDEN);\r\n\t\t\t}\r\n\t\t}\r\n\t\tlog.info(\"=======Mqtt auth clientId:{},user:{},access:{},topic:{},ip:{}========\", clientid, userName, access,\r\n\t\t\t\ttopic, ip);\r\n\t\treturn r;\r\n\t}",
"@Override\n public void clientAuthenticate()\n throws HubIntegrationException {\n try {\n final ArrayList<String> segments = new ArrayList<>();\n segments.add(\"j_spring_security_check\");\n final HttpUrl httpUrl = createHttpUrl(segments, null);\n\n final Map<String, String> content = new HashMap<>();\n final String username = hubServerConfig.getGlobalCredentials().getUsername();\n String password = hubServerConfig.getGlobalCredentials().getEncryptedPassword();\n if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(password)) {\n try {\n password = hubServerConfig.getGlobalCredentials().getDecryptedPassword();\n\n content.put(\"j_username\", username);\n content.put(\"j_password\", password);\n final Request request = createPostRequest(httpUrl, createEncodedRequestBody(content));\n Response response = null;\n try {\n logRequestHeaders(request);\n response = getClient().newCall(request).execute();\n logResponseHeaders(response);\n if (!response.isSuccessful()) {\n throw new HubIntegrationException(response.message());\n }\n } finally {\n if (response != null) {\n response.close();\n }\n }\n } catch (IllegalArgumentException | EncryptionException e) {\n throw new HubIntegrationException(e.getMessage(), e);\n }\n }\n } catch (final IOException e) {\n throw new HubIntegrationException(e.getMessage(), e);\n }\n }",
"protected void onPrivateMessage(String sender, String login, String hostname, String message) {}",
"@Override\n public void onNewToken(String token) {\n //Log.d(TAG, \"Refreshed token: \" + token);\n\n // If you want to send messages to this application instance or\n // manage this apps subscriptions on the server side, send the\n // Instance ID token to your app server.\n sendRegistrationToServer(token);\n\n }",
"@Override\n public void onTokenRefresh(){\n if (FirebaseAuth.getInstance().getCurrentUser() != null) {\n String token = FirebaseInstanceId.getInstance().getToken();\n Log.v(TAG, \"success in getting instance \"+ token);\n onSendRegistrationToServer(token);\n }\n }",
"@Override\n public void onAuthenticationError(FirebaseError firebaseError) {\n }",
"public interface NexmoAuthListener extends AuthListeners {\n int AUTH_CODE_LENGTH = 4;\n\n void onAuthCompleted(String phoneNumber);\n}",
"public void TC_04_Authentication_Alert() {\n\n\t\tdriver.get(\"http://admin:[email protected]/basic_auth\");\n\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Config.REGISTRATION_COMPLETE)) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n FirebaseMessaging.getInstance().subscribeToTopic(Config.TOPIC_GLOBAL);\n\n FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener( Homescreen.this, new OnSuccessListener<InstanceIdResult>() {\n @Override\n public void onSuccess(InstanceIdResult instanceIdResult) {\n String updatedToken = instanceIdResult.getToken();\n Log.e(\"Updated Token\",updatedToken);\n if (!TextUtils.isEmpty(updatedToken))\n register_device(updatedToken);\n else\n Toast.makeText(getApplicationContext(), \"Firebase Reg Id is not received yet!\", Toast.LENGTH_SHORT).show();\n\n }\n });\n\n } else if (intent.getAction().equals(Config.PUSH_NOTIFICATION)) {\n // new push notification is received\n\n String message = intent.getStringExtra(\"message\");\n\n Toast.makeText(getApplicationContext(), \"Push notification: \" + message, Toast.LENGTH_LONG).show();\n\n }\n }",
"@Override\n public void onTokenRefresh() {\n // Get updated InstanceID token.\n device_id = Settings.Secure.getString(this.getContentResolver(),\n Settings.Secure.ANDROID_ID);\n String refreshedToken = FirebaseInstanceId.getInstance().getToken();\n Log.d(TAG, \"Refreshed token: \" + refreshedToken);\n\n // If you want to send messages to this application instance or\n // manage this apps subscriptions on the server side, send the\n // Instance ID token to your app server.\n\n //**************need to modify the code such that it can update exisiting user data***********************\n sendRegistrationToServer(refreshedToken);\n //**************need to modify the code such that it can update exisiting user data***********************\n }",
"@Override\n public void onTokenRefresh() {\n Log.d(\"MyInstanceIDService\", \"onTokenRefresh\");\n// new GCMDoRequest().execute(new GCMRequest(this, GCMCommand.GET_TOKEN));\n }",
"@Override\n public void onLoginRequired() throws RemoteException {\n final PoyntError error = new PoyntError(PoyntError.CODE_API_ERROR);\n listener.onResponse(transaction, requestId, error);\n }",
"@Override\n public void onTokenRefresh() {\n try {\n if (Build.VERSION.SDK_INT < 26) {\n LeanplumNotificationHelper.startPushRegistrationService(this, \"GCM\");\n } else {\n LeanplumNotificationHelper.scheduleJobService(this,\n LeanplumGcmRegistrationJobService.class, LeanplumGcmRegistrationJobService.JOB_ID);\n }\n } catch (Throwable t) {\n Log.e(\"Failed to update GCM token.\", t);\n }\n }",
"@Override\n public void onAuthenticated(AuthData authData) {\n Log.d(TAG, \"Google user authenticated: \" + authData.getUid());\n mFirebaseAuthCallback.onReceivedFirebaseAuth(authData, null);\n }",
"public String getPushEvent();",
"@Override\r\n\t\t\t\t\tpublic void onLoginSuccessed(CPUserInfo userInfo) {\n\t\t\t\t\t\tTypeSDKLogger.d( \"LOGIN_SUCCESS\");\r\n\t\t\t\t\t\tTypeSDKLogger.d( \"getUdid:\" + userInfo.getUid());\r\n\t\t\t\t\t\tTypeSDKLogger.d( \"getLoginToken:\" + userInfo.getvToken());\r\n\t\t\t\t\t\t// 发送登录SDK成功广播通知\r\n\t\t\t\t\t\ttoken = userInfo.getvToken();\r\n\t\t\t\t\t\tuid = userInfo.getUid();\r\n\t\t\t\t\t\tTypeSDKNotify_haima notify = new TypeSDKNotify_haima();\r\n\t\t\t\t\t\tnotify.sendToken(userInfo.getvToken(), userInfo.getUid());\r\n\t\t\t\t\t}",
"private void sendRegistrationToServer(String token) {\n EventBuilder.withItemAndType(\n Item.PUSH_NOTIFICATION, Event.EVT_SEND)\n .addParam(EventParam.PRM_VALUE, token)\n .send();\n }",
"@Override\n public void onAuthenticationFailed() {\n }",
"public interface OcmCredentialCallback {\n void onCredentialReceiver(String accessToken);\n void onCredentailError(String code);\n}",
"@Override\n public void run() {\n PreferenceManager.getDefaultSharedPreferences(AuthenticatorExample.this)\n .edit().putBoolean(\"is_authenticated\", true).commit();\n // Notify the service that authentication is complete\n notifyAuthenticated();\n // Close the Activity\n finish();\n }",
"public interface PushCallBack {\n void onSuccess();\n\n void onTimeout();\n}",
"@Override\n\t\t\tpublic void authenticated(AuthResponse r) {\n\t\t\t\tif (r != null && r.error() == null) {\n//\t\t\t\t\tSystem.out.println(\" auth making api call\");\n\t\t\t\t\ttrigger.setEnabled(false); // .removeFromParent(); // .setEnabled(false);//.getStyle().setProperty(\"visibility\", \"hidden\");\n\t\t\t\t\tready.authenticated(r); \n//\t\t\t\t\tready.run();\n\t\t\t\t} else {\n//\t\t\t\t\tSystem.out.println(\" auth not making api call\");\n\t\t\t\t\ttrigger.setEnabled(true);\n\t\t\t\t\ttrigger.addTriggerHandler(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t// handleAuthClick();\n\t\t\t\t\t\t\tGAPI.get()\n\t\t\t\t\t\t\t\t\t.auth()\n\t\t\t\t\t\t\t\t\t.authorize(AuthRequest.create().client_id(clientId).scope(scope).immediate(false),\n\t\t\t\t\t\t\t\t\t\t\thandleAuthResult);\n\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(\"registrationComplete\")) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n FirebaseMessaging.getInstance().subscribeToTopic(\"VaahanMessages\");\n Toast.makeText(vehicle_list.this,\"Subscribed To Notification Server\",Toast.LENGTH_SHORT).show();\n\n } else if (intent.getAction().equals(\"pushNotification\")) {\n\n }\n }",
"@Override\n\t\t\t\t\t\tpublic void onSyncSuccess() {\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Config.REGISTRATION_COMPLETE)) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n FirebaseMessaging.getInstance().subscribeToTopic(Config.TOPIC_GLOBAL);\n\n displayFirebaseRegId();\n\n } else if (intent.getAction().equals(Config.PUSH_NOTIFICATION)) {\n // new push notification is received\n\n String message = intent.getStringExtra(\"message\");\n\n Toast.makeText(getApplicationContext(), \"Push notification: \" + message, Toast.LENGTH_LONG).show();\n\n\n }\n }",
"@Override\n public void onAdded() {\n /**\n * EventsBus: Fetching data.\n */\n EventBus.getDefault().post(new Authenticating());\n }",
"java.lang.String getAuth();",
"java.lang.String getAuth();",
"java.lang.String getAuth();",
"@Override\n public void onAnonymousLoginButtonClick() {\n AGConnectAuth.getInstance().signInAnonymously()\n .addOnSuccessListener(signInResult -> {\n AGConnectUser user = signInResult.getUser();\n Toast.makeText(MainActivity.this, user.getUid(), Toast.LENGTH_LONG).show();\n onLoginCorrect();\n }).addOnFailureListener(e -> Toast.makeText(MainActivity.this, \"Anonymous SignIn Failed \" + e.getMessage(), Toast.LENGTH_LONG).show());\n }",
"public AuthenticationInterceptor() {\r\n super(Phase.RECEIVE);\r\n }",
"@Override\n public void onNewToken(@NonNull String token)\n {\n super.onNewToken(token);\n String currentUserId = getCurrentUserId();\n if (currentUserId != null)\n {\n sendRegistrationToServer(token, currentUserId);\n }\n }",
"public interface PushStatus\n {\n /**\n * not receive\n */\n String NOT_RECEIVE = \"0\";\n\n /**\n * receive\n */\n String RECEIVE = \"1\";\n }",
"@Override\n public void listenForLogins() {\n }",
"@Override\n public void onNewToken(String token) {\n Log.d(TAG, \"Refreshed token: \" + token);\n super.onNewToken(token);\n Log.e(\"newToken\", token);\n // If you want to send messages to this application instance or\n // manage this apps subscriptions on the server side, send the\n // Instance ID token to your app server.\n sendRegistrationToServer(token);\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(NotificationConfig.REGISTRATION_COMPLETE)) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notification\n FirebaseMessaging.getInstance().subscribeToTopic(NotificationConfig.TOPIC_GLOBAL);\n\n displayFirebaseRegId();\n\n } else if (intent.getAction().equals(NotificationConfig.PUSH_NOTIFICATION)) {\n // new push notification is received\n\n String message = intent.getStringExtra(\"message\");\n\n Toast.makeText(getApplicationContext(), \"Notification: \" + message, Toast.LENGTH_LONG).show();\n\n\n }\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(Config.REGISTRATION_COMPLETE)) {\n // gcm successfully registered\n // now subscribe to `global` topic to receive app wide notifications\n FirebaseMessaging.getInstance().subscribeToTopic(Config.TOPIC_GLOBAL);\n\n\n\n } else if (intent.getAction().equals(Config.PUSH_NOTIFICATION)) {\n // new push notification is received\n\n String message = intent.getStringExtra(\"message\");\n\n Toast.makeText(getApplicationContext(), \"Push notification: \" + message, Toast.LENGTH_LONG).show();\n\n\n }\n }",
"@Override\n public void onSuccess(AuthResult authResult) {\n\n }",
"private void sendRegistrationToServer(String token) {\n LoginManager loginManager = new LoginManager(this);\n loginManager.setFCM_KEY(token);\n }",
"public interface SwrvePushManager {\n void processMessage(final Bundle msg);\n}",
"@Override\n public void onLogin() {\n toast(\"You are logged in\");\n }",
"public void login () {\n\t\tGPPSignIn.sharedInstance().authenticate();\n\t}",
"public interface ServerAuthenticatorInterface {\n public String signIn(final String email, final String password);\n}",
"boolean authNeeded();",
"private byte[] handleAuthPt2(byte[] payload) { \n\t\tbyte[] message = ComMethods.decryptRSA(payload, my_n, my_d);\n\t\tComMethods.report(\"SecretServer has decrypted the User's message using SecretServer's private RSA key.\", simMode);\n\t\t\n\t\tif (!Arrays.equals(Arrays.copyOf(message, myNonce.length), myNonce)) {\n\t\t\tComMethods.report(\"ERROR ~ invalid third message in protocol.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Authentication done!\n\t\t\tcurrentSessionKey = Arrays.copyOfRange(message, myNonce.length, message.length);\n\t\t\tactiveSession = true;\n\t\t\tcounter = 11;\n\n\t\t\t// use \"preparePayload\" from now on for all outgoing messages\n\t\t\tbyte[] responsePayload = preparePayload(\"understood\".getBytes());\n\t\t\tcounter = 13;\n\t\t\treturn responsePayload;\n\t\t} \n\t}",
"private void sendRegistrationToServer(String token) {\n String json =\"{'email' : '\"\n + device_id\n + \"' ,'firebase_token': '\" + token + \"'}\";\n\n try {\n JSONObject jObj = new JSONObject(json);\n responseId = doPostRequest(\"https://iot-api.herokuapp.com/users\", jObj.toString());\n } catch (IOException e) {\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void onClick(final View vi) {\n SharedPreferences sp = getApplicationContext().getSharedPreferences(\"login\",MODE_PRIVATE);\n sp.edit().putBoolean(\"logged\",false).apply();\n // change notification status\n JSONObject tags = new JSONObject();\n try {\n tags.put(\"logged_in\",false);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n OneSignal.sendTags(tags);\n OneSignal.getTags(new OneSignal.GetTagsHandler() {\n @Override\n public void tagsAvailable(JSONObject tags) {\n OneSignal.deleteTag(\"key1\");\n OneSignal.deleteTag(\"matchID\");\n }\n });\n if ((dialog!=null)&&(dialog.isShowing())) {\n dialog.dismiss();\n }\n //show login screen\n Intent intent = new Intent(Profile.this, LogIn.class);\n// intent.putExtra(\"logged\",false);\n startActivity(intent);finish();\n Toast.makeText(Profile.this, \"Logged Out Successfully\", Toast.LENGTH_SHORT).show();\n }",
"public interface IWeChatSignInCallback {\n\n void onSignInSuccess(String userInfo);\n\n}",
"public interface PushNotificationResponse<T extends ApnsPushNotification> {\n\n /**\n * Returns the original push notification sent to the APNs gateway.\n *\n * @return the original push notification sent to the APNs gateway\n *\n * @since 0.5\n */\n T getPushNotification();\n\n /**\n * Indicates whether the push notification was accepted by the APNs gateway.\n *\n * @return {@code true} if the push notification was accepted or {@code false} if it was rejected\n *\n * @since 0.5\n */\n boolean isAccepted();\n\n /**\n * Returns the ID assigned to this push notification by the APNs server.\n *\n * @return the ID assigned to this push notification by the APNs server\n */\n UUID getApnsId();\n\n /**\n * Returns the HTTP status code reported by the APNs server.\n *\n * @return the HTTP status code reported by the APNs server\n *\n * @since 0.15.0\n */\n int getStatusCode();\n\n /**\n * Returns the reason for rejection reported by the APNs gateway. If the notification was accepted, the rejection\n * reason will be {@code null}.\n *\n * @return the reason for rejection reported by the APNs gateway, or empty if the notification was not rejected\n *\n * @since 0.5\n */\n Optional<String> getRejectionReason();\n\n /**\n * If the sent push notification was rejected because the destination token is no longer valid, returns \"the time at\n * which APNs confirmed the token was no longer valid for the topic.\" Callers should stop attempting\n * to send notifications to the expired token unless the token has been re-registered more recently than the\n * returned timestamp.\n *\n * @return the time at which APNs confirmed the token was no longer valid for the given topic, or empty if the push\n * notification was either accepted or rejected for a reason other than token invalidation\n *\n * @see <a href=\"https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns#2947616\">Sending\n * Notification Requests to APNs</a>\n *\n * @since 0.5\n */\n Optional<Instant> getTokenInvalidationTimestamp();\n}",
"@Override\r\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(\"[email protected]\",\"scm#2021\");\r\n\t\t\t}",
"@Override\r\n\t\t\tprotected PasswordAuthentication getPasswordAuthentication() {\n\t\t\t\treturn new PasswordAuthentication(\"[email protected]\",\"scm#2021\");\r\n\t\t\t}",
"@Override\n\tpublic void onAuthenticationSuccess(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Authentication authentication) throws IOException,\n\t\t\tServletException {\n\t\t\n\t\tStatusMessageDto statusMessageDto = new StatusMessageDto();\n\t\t\n\t\tstatusMessageDto.setStatus(HttpServletResponse.SC_OK);\n\t\tstatusMessageDto.setMessage(\"Authentication has been successful\");\n\t\t\n\t\t\n\t\tString json = new Gson().toJson(statusMessageDto);\n\t\t\n\t\tresponse.getWriter().print(json);\n\t\t\n\t\n\t\t\n\t}",
"public interface ImgurNotificationEndpoint {\n\t// todo finish this.\n}",
"public RNPushNotificationRegistrationService() {\n super();\n s_instance = this;\n }",
"@Override\n public void onTokenRefresh() {\n String refreshedToken = FirebaseInstanceId.getInstance().getToken();\n Log.d(TAG, \"Refreshed token: \" + refreshedToken);\n\n // If you want to send messages to this application instance or\n // manage this apps subscriptions on the server side, send the\n // Instance ID token to your app server.\n sendRegistrationToServer(refreshedToken);\n }",
"public void sendTokenToRemote() { }",
"@Override\n protected void onAuthenticationResponse(SAPeerAgent peerAgent, SAAuthenticationToken authToken, int error) {\n }",
"public void authenticationProcedure(){\n\t\tthrow new UnsupportedOperationException(\"TODO: auto-generated method stub\");\r\n\t}"
] | [
"0.617343",
"0.61186266",
"0.6077593",
"0.59633803",
"0.595161",
"0.5911781",
"0.58386433",
"0.57520896",
"0.575144",
"0.57501686",
"0.5702608",
"0.56802446",
"0.5673951",
"0.5669544",
"0.56594867",
"0.5653286",
"0.5650211",
"0.5637321",
"0.56362516",
"0.56059766",
"0.55951256",
"0.5585583",
"0.55628645",
"0.55269516",
"0.5524502",
"0.5518052",
"0.5506039",
"0.55055195",
"0.5495059",
"0.54879576",
"0.54766196",
"0.5476435",
"0.54757386",
"0.54738057",
"0.5471881",
"0.5439078",
"0.54308546",
"0.54242295",
"0.5414837",
"0.53972155",
"0.5394987",
"0.53925353",
"0.53912914",
"0.5391151",
"0.5380386",
"0.53642297",
"0.5359427",
"0.53510034",
"0.53468406",
"0.5346655",
"0.5338947",
"0.53383636",
"0.53321564",
"0.53254926",
"0.53217876",
"0.5321259",
"0.53208154",
"0.5315809",
"0.5312537",
"0.5312228",
"0.5305128",
"0.5303446",
"0.5294161",
"0.52926373",
"0.5292633",
"0.52910227",
"0.52894163",
"0.52878875",
"0.5286226",
"0.5279489",
"0.5279489",
"0.5279489",
"0.5279208",
"0.5266067",
"0.52507657",
"0.5250042",
"0.5249624",
"0.52479386",
"0.52448595",
"0.5241434",
"0.5240751",
"0.5239364",
"0.5238874",
"0.5237122",
"0.52339673",
"0.5232263",
"0.52313465",
"0.5217604",
"0.5215121",
"0.52039886",
"0.52022946",
"0.52006274",
"0.5198709",
"0.5198709",
"0.51979536",
"0.51977664",
"0.5196288",
"0.51951706",
"0.518479",
"0.5182438",
"0.51822877"
] | 0.0 | -1 |
Success already handled the widget is removed client side immediately Only on failure do we need to handle anything | @Override
public void onSuccess(Void result) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void cleanup(){\r\n\t\tif(errorMsgPanel!=null){\r\n\t\t\trsDialog.getDispatchDateLabel().setForeground(Color.BLACK);\r\n\t\t\trsDialog.getDispatchMethLabel().setForeground(Color.BLACK);\r\n\t\t\trsDialog.getAmountPaidLabel().setForeground(Color.BLACK);\r\n\t\t\trsDialog.getPaymentMethLabel().setForeground(Color.BLACK);\r\n\t\t\trsDialog.remove(errorMsgPanel);\r\n\t\t\trsDialog.validate();\r\n\t\t\trsDialog.repaint();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif(successPanel!=null){\r\n\t\t\trsDialog.remove(successPanel);\r\n\t\t\trsDialog.validate();\r\n\t\t\trsDialog.repaint();\r\n\t\t}\r\n\t}",
"@FXML\n\tprivate void handleOk() {\n\t\ttry {\n\t\t\ttypeDAO.supprimerType(new Type(listIdType.get(comboboxtype.getSelectionModel().getSelectedIndex()),\"\",\"\"));\n\t\t\tnew Popup(\"Type \"+comboboxtype.getValue()+\" supprimer !\");\n\t\t} catch (ConnexionBDException e) {\n\t\t\tnew Popup(e.getMessage());\n\t\t}\n\t\tokClicked = true;\n\t\tdialogStage.close();\n\t}",
"@Override\r\n\tprotected void onDestroy() {\n\t\tsuper.onDestroy();\r\n\t\tUiUpdater.unregisterClient(handler);\r\n\t}",
"@Override\n public void run() {\n snackbar.setVisibility(View.GONE); //This will remove the View. and free s the space occupied by the View\n }",
"@Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n dialog.dismiss();\n\n }",
"@Override\n\tpublic boolean remove(Widget w) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void onGuiClosed() {\n\t\tfield_154330_a.removed();\n\t\tsuper.onGuiClosed();\n\t}",
"@Override\n public void run() {\n if (!AddClient.this.isFinishing() && progressDialog != null) {\n progressDialog.dismiss();\n }\n }",
"@Override\n public void onSuccess()\n {\n mItems.remove(position);\n notifyItemRemoved(position);\n notifyItemRangeChanged(position, mItems.size());\n }",
"@Override\n public void onSuccess()\n {\n mItems.remove(position);\n notifyItemRemoved(position);\n notifyItemRangeChanged(position, mItems.size());\n }",
"private void onOK() {\n OKDisposalProcess();\n }",
"private void dataReservationTypeCancelHandle() {\n reservationController.dialogStage.close();\r\n }",
"public abstract void removedFromWidgetTree();",
"@Override\n public void onButtonClick(View view) {\n successDialog.dismiss();\n }",
"private void onOK() {\n dispose();\n }",
"private void onOK() {\n dispose();\n }",
"private void onOK() {\n dispose();\n }",
"private void onOK ()\n {\n dispose();\n }",
"@Override\n public void onSuccess(Void unused) {\n Toast.makeText(AgregarSerie.this, \"La imagen anterior ha sido eliminada\"\n , Toast.LENGTH_SHORT).show();\n SubirNuevaImagen();\n }",
"@Override\r\n public void run() {\n dialog.dismiss();\r\n }",
"@Override\r\n\t\t\t\t\t\tpublic void result(ResposneBundle b) {\n\t\t\t\t\t\t\tLog.e(\"result\", b.getContent());\r\n\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tJSONObject job = new JSONObject(b.getContent());\r\n\t\t\t\t\t\t\t\tif (job.getInt(\"code\") == -1) {\r\n\t\t\t\t\t\t\t\t\tact.showToast(job.getString(\"msg\"));\r\n\t\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\t\tlist.remove(position);\r\n\t\t\t\t\t\t\t\t\tnotifyDataSetChanged();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} catch (JSONException e) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}",
"@Override\npublic void removeFromParentUIContainer() {\n\t\n}",
"@Override\n\tprotected void deInitUIandEvent()\n\t{\n\t}",
"public void processRemoveStation() {\n AppYesNoDialogSingleton dialog = AppYesNoDialogSingleton.getSingleton();\n \n // POP UP THE DIALOG\n dialog.show(\"Remove Station\", \"Are you sure you want to remove this station?\");\n \n // DO REMOVE LINE \n dataManager.removeStation(); \n }",
"public boolean remove(Widget w) {\n client.unregisterPaintable((Paintable) w);\n String location = getLocation(w);\n if (location != null) {\n locationToWidget.remove(location);\n }\n CaptionWrapper cw = (CaptionWrapper) widgetToCaptionWrapper.get(w);\n if (cw != null) {\n widgetToCaptionWrapper.remove(w);\n return super.remove(cw);\n } else if (w != null) {\n return super.remove(w);\n }\n return false;\n }",
"@Override\r\n\tpublic void onRemove() {\n\r\n\t}",
"@Override\r\n\t\t\t\t\t\t\tpublic void handle(ActionEvent arg0) {\n\t\t\t\t\t\t\t\troot.getChildren().remove(product);\r\n\t\t\t\t\t\t\t}",
"@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\thandler.removeCallbacks(updateThread);\r\n\t\t\t\t\r\n\t\t\t}",
"@Override\n protected void onDestroy() {\n handler.removeCallbacks(run);\n super.onDestroy();\n }",
"public void widgetSelected(SelectionEvent e)\n {\n tree.getChildren().clear();\n // Refresh\n listFormat.refresh();\n // Remove req id\n deleteReqId();\n controller.removeDocumentType();\n }",
"@Override\n public void onCancel() {\n\n }",
"@Override\n\t\t\tpublic void onCancelled() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void onCancelled() {\n\t\t\t\t\n\t\t\t}",
"@Override\n public void onCancel() {\n }",
"@Override\n\tpublic void onRemove() {\n\n\t}",
"@Override\r\n\t\t\t\t\tpublic void onCancel() {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\n public void onCancel() {\n\n }",
"@Override\n public void onCancel() {\n\n }",
"private void removeRcmButtonHandler() {\n\t\tTitledBorder border = new TitledBorder(\" REMOVE RCM\");\n\t\tborder.setTitleFont(new Font(\"TimesNewRoman\", Font.BOLD, 12));\n\t\tdisplayPanel.setBorder(border);\n\t\t\n\t\tdisplayPanel.removeAll();\n\t\tdisplayPanel.add(new RemoveRcmPanel(rmos, rmosManager, statusManager));\n\t\tdisplayPanel.revalidate();\n\t\tdisplayPanel.repaint();\n\t}",
"public void run() {\n\t\t\t\t\tif (_uiContainer.isDisposed()) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tsetStatusMessage(UI.EMPTY_STRING);\r\n\t\t\t\t}",
"private void onCancel() {\n dispose();\r\n }",
"private void onCancel() {\n\t\tdispose();\n\t}",
"@Override\r\n\tprotected void onStop() {\n\t\tsuper.onStop();\r\n\t\tUiUpdater.unregisterClient(handler);\r\n\t}",
"@Override\n public void onCancel() {\n\n }",
"@Override\n public void onCancel() {\n\n }",
"@Override\n public void onClick(View v) {\n switch (v.getId()){\n case R.id.remove_yes_id:\n DBConnection dbConnection=new DBConnection(removeView.getContext());\n if(dbConnection.remove(id,type)==1){\n Toast.makeText(getActivity(),type+\" has been removed successfully\",Toast.LENGTH_LONG).show();\n updateFragment(CAT_ID);\n dismiss();\n }else{\n Toast.makeText(getActivity(),\"Remove Error \",Toast.LENGTH_LONG).show();\n dismiss();\n }\n break;\n case R.id.remove_cancel_id:\n dismiss();\n break;\n }\n }",
"@Override\n public void onSuccess(Void unused) {\n Snackbar.make(save, R.string.sucessfull_update, BaseTransientBottomBar.LENGTH_SHORT).show();\n }",
"@Override // com.android.server.wm.WindowContainer\n public boolean checkCompleteDeferredRemoval() {\n if (super.checkCompleteDeferredRemoval() || !this.mDeferredRemoval) {\n return true;\n }\n removeImmediately();\n return false;\n }",
"@Override\n public void run() {\n pDialog.dismiss();\n RoomCreationActivity.this.finish();\n }",
"public void onRemovePatientSuccess() {\n\t\t\t\ttablePatients.removePatientSummary(selectedRowIndex);\n\n\t\t\t\t// Unlocks the window\n\t\t\t\tunlock();\n\n\t\t\t\t// Calls the selection callback method\n\t\t\t\tonSelectPatient();\n\t\t\t}",
"@Override\n public void run() {\n viewDialog.hideDialog();\n }",
"public void removeGateway()\n {\n if(networkID == null || networkID.equals(\"Select a Network\"))\n {\n Toast.makeText(getApplicationContext(), \"You must select a network\", Toast.LENGTH_LONG).show();\n return;\n }\n if(gatewayID == null || gatewayID.length() == 0)\n {\n Toast.makeText(getApplicationContext(), \"You must select a gateway\", Toast.LENGTH_LONG).show();\n return;\n }\n\n //add the params to a RequestParams object\n //these will be used in the request\n RequestParams params = new RequestParams();\n params.put(\"gatewayID\", gatewayID);\n prgDialog.show();\n AsyncHttpClient client = new AsyncHttpClient();\n client.get(base_url + \"RemoveGateway/\" + authToken, params, new AsyncHttpResponseHandler() {\n\n public void onSuccess(String response) {\n prgDialog.hide();\n try\n {\n JSONObject obj = new JSONObject(response);\n String temp = obj.getString(\"Result\");\n if(temp.equals(\"Success\"))\n {\n Toast.makeText(getApplicationContext(), gatewayName + \" has been removed\", Toast.LENGTH_LONG).show();\n prgDialog.dismiss();\n finish();\n }\n else\n {\n Toast.makeText(getApplicationContext(), \"Something went wrong, no changes were made\", Toast.LENGTH_LONG).show();\n }\n } catch (JSONException e)\n {\n e.printStackTrace();\n }\n }\n\n public void onFailure(int statusCode, Throwable error, String content) {\n prgDialog.hide();\n // When Http response code is '404'\n if (statusCode == 404) {\n Toast.makeText(getApplicationContext(), \"Requested resource not found\", Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if (statusCode == 500) {\n Toast.makeText(getApplicationContext(), \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 404, 500\n else {\n Toast.makeText(getApplicationContext(), \"Unexpected Error occurred! [Most common Error: Device might not be connected to Internet or remote server is not up and running]\", Toast.LENGTH_LONG).show();\n }\n }\n });\n\n }",
"private void onCancel()\r\n {\n dispose();\r\n }",
"@Override\n\t\t\tpublic void onCancel() {\n\t\t\t\t\n\t\t\t}",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"private void onCancel() {\n dispose();\n }",
"void successUiUpdater();",
"private void onCancel()\n\t{\n\t\tdispose();\n\t}",
"private void onCancel() {\n data.put(\"cerrado\",true);\n dispose();\n }",
"private void execHandlerLost( Message msg ) {\n\t\tshowButtonConnect();\n\t\ttoast_short( mMsgLost );\n\t}",
"@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t\t\n\t\t}",
"@Override\r\n\tpublic void onCustomDestroy() {\n\t\t\r\n\t}",
"public void onUnFinishFetching() {\n\t\t\t\thideLoading();\n\t\t\t\tUiApplication.getUiApplication().invokeLater(new Runnable() {\n\t\t\t\t\t\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tUiApplication.getUiApplication().pushScreen(new HomeScreen());\n\t\t\t\t\t}\n\t\t\t\t});\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\t\tpublic void run(){\n\t\t\t\t\t\t//status of 1 is success\n\t\t\t\t\t\tif (status==1){\n\t\t\t\t\t\t\tmainDialog.dispose();\n\t\t\t\t\t\t\tbuildSuccessDialog();\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//else error\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tmainDialog.dispose();\n\t\t\t\t\t\t\tbuildErrorDialog(status);\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"@Override\n public void run() {\n myHandler.cancel(true);\n }",
"@FXML\n public void handheldsCancelLink(ActionEvent actionEvent) {\n //set a warning alert\n Alert alert = new Alert(Alert.AlertType.WARNING);\n\n // if a ticket was selected remove it from DB\n if(linksComboBox.getValue()!= null) {\n alert.setTitle(\"Link Cancel\");\n alert.setHeaderText(null);\n alert.setContentText(\"Are You Sure you want to cancel selected Link?\");\n alert.getButtonTypes().clear();\n alert.getButtonTypes().addAll(ButtonType.YES, ButtonType.NO);\n alert.showAndWait();\n\n //TODO: cancellation based on current time.\n if (alert.getResult() == ButtonType.YES)//delete operation from database\n {\n App.getOcsfClient(this).updateLinks(linksComboBox.getValue(), false);\n linksList.remove(linksComboBox.getValue());\n alert.setHeaderText(null);\n alert.setContentText(\"Link Canceled\");\n } else {\n alert.setHeaderText(null);\n alert.setContentText(\"Link Did Not Canceled\");\n }\n alert.getButtonTypes().clear();\n alert.getButtonTypes().addAll(ButtonType.OK);\n alert.showAndWait();\n updateScreen();\n }\n else{\n alert.setHeaderText(null);\n alert.setContentText(\"No Link Selected\");\n alert.getButtonTypes().clear();\n alert.getButtonTypes().addAll(ButtonType.OK);\n alert.showAndWait();\n }\n }",
"@Override\n protected void onCancel() {\n }",
"private void destroyDisplayEditOverlay() {\n\t}",
"@FXML // This method is configure from fxml file\n private void onCancelButtonClick() {\n this.selectableItem.removeListener(changeListener); // remove the listener when window is closed\n assert this.window != null;\n // close the dialog\n this.window.close();\n }",
"@Override\n\tprotected void onDestroy() {\n\t\tcancelDialog();\n\t\tsuper.onDestroy();\n\t}",
"@Override\n public void onSuccess(Void unused) {\n finish();\n }",
"@Override\n public void onSuccess(Void unused) {\n finish();\n }",
"@Override\n public void run() {\n waitDialog.dismiss();\n\n //show an error dialog\n\n\n }",
"public void on_remove(ActionEvent actionEvent) {\r\n\t\tif ( !remove())\r\n\t\t\treturn;\r\n\r\n\t\t_thumbnailListCallback.update();\r\n\t}",
"@Override\n public void onErrorResponse(VolleyError arg0) {\n mHandler.sendEmptyMessage(-1);\n loadingDialog.dismiss();\n }",
"@Override\n public void onErrorResponse(VolleyError arg0) {\n mHandler.sendEmptyMessage(-1);\n loadingDialog.dismiss();\n }",
"@Override\r\n public void onFailure(@NonNull Exception e) {\n Toast.makeText(MainActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\r\n hideProgress();\r\n }",
"@Override\r\n\tprotected void onCancelled() {\n\t\tsuper.onCancelled();\r\n\t}",
"@Override\n public void onClick(DialogInterface dialog, int which) {\n clean();\n }",
"@Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(getApplicationContext(),\"Servicio borrado correctamente...\",Toast.LENGTH_SHORT).show();\n }",
"@SuppressWarnings(\"serial\")\n\tprivate void cancelOkHandler(Button cancel,Button ok)\n\t{\n\t\tok.addClickListener(new ClickListener() \n {\n\t\t\t@Override\n\t\t\tpublic void buttonClick(com.vaadin.ui.Button.ClickEvent event) \n\t\t\t{\n\t\t\t\terrorMessages.setVisible(false);\n\t\t\t\tif (editable)\n\t\t\t\t{\n\t\t\t\t\tif (((!(tf0.getValue().toString().trim().length() > 0))||(tf0.getValue().toString().equals(\"\"))||(tf0.getValue()==null)||(sf6.getValue()==null)||(sf1.getValue()==null)||(df3.getValue()==null)))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((!(tf0.getValue().toString().trim().length() > 0))||(tf0.getValue().toString().equals(\"\"))||(tf0.getValue()==null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorMessages.setValue(\"Wrong input on Name field(Name can not be empty!).\");\n\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif((sf1.getValue()==null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorMessages.setValue(\"I need you to tell me the Customer!\");\n\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif((sf6.getValue()==null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorMessages.setValue(\"Active field can't be empty!\");\n\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ((df3.getValue()==null))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorMessages.setValue(\"I need the Start Date from you.\");\n\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif(!isfloat(tf7.getValue().toString())&&(!tf7.getValue().toString().equals(\"\"))||tf7.getValue().toString().length()>5)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorMessages.setValue(\"Budget should be a number with a max of 5 digits\");\n\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (!(checkdates(df3.getValue(),df4.getValue())&&checkdates(df3.getValue(),df5.getValue())&&checkdates(df5.getValue(),df4.getValue())))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(!checkdates(df3.getValue(),df4.getValue()))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\terrorMessages.setValue(\"End date can't be before Start date.\");\n\t\t\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!checkdates(df3.getValue(),df5.getValue()))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\terrorMessages.setValue(\"Deadline should be between start/end(check Deadline).\");\n\t\t\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(!checkdates(df5.getValue(),df4.getValue()))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\terrorMessages.setValue(\"Deadline should be between start/end(check Deadline).\");\n\t\t\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(( Mode.equals(\"New Project\"))||( Mode.equals(\"Edit\")))\n\t\t\t\t\t \t{\n\t\t\t\t\t\t\t\t\tsetProject();\n\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t//Chekare an oles oi hmeromhnies twn tasks sou einai swstes\n\t\t\t\t\t\t\t\tif (checkProjectTaskDates(project))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttry\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tdb.projectModifier(Mode, project, taskManager);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch (SQLException e) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tErrorWindow wind = new ErrorWindow(e); \n\t\t\t\t\t\t\t\t UI.getCurrent().addWindow(wind);\t\n\t\t\t\t\t\t\t\t e.printStackTrace();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tproject_container.removeAllItems();\n\t\t\t\t\t\t\t\t\tgntTraineeProjectUI.containerFiller(project_table,project_container);\n\t\t\t\t\t\t\t\t\tproject_table.setContainerDataSource(project_container);\n\t\t\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\terrorMessages.setValue(\"Tasks/project dates mismatch(check task/project dates).\");\n\t\t\t\t\t\t\t\t\terrorMessages.setVisible(true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tclose();\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t\n\t\t\t}\n });\n\t\t\n\t\tcancel.addClickListener(new ClickListener() \n {\n\t\t\t@Override\n\t\t\tpublic void buttonClick(com.vaadin.ui.Button.ClickEvent event) \n\t\t\t{\n\t\t\t\terrorMessages.setVisible(false);\n\t\t\t\t close();\n\t\t\t\t\n\t\t\t}\n });\n\t}",
"@Override\n public void onCancel() {\n }",
"@Override\n\t\t\t\tpublic boolean onCancel() {\n\t\t\t\t\treturn false;\n\t\t\t\t}",
"@Override\n public void onDelete() {\n mDialog.dismiss();\n ((FrameLayout) getParent()).removeView(this);\n }",
"@Override\n public void onDone() {\n /*try {\n mOverlay.remove(mEyesGraphic);\n }catch (NullPointerException e){\n e.printStackTrace();\n }*/\n }",
"@Override\n public void onSure() {\n\n }",
"@Override\n public void onClick(ClickEvent event) {\n onRemoveAction();\n }",
"@Override\r\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\t\tallPanel.unmask();\t\t\t\t\t\t\r\n\t\t\t\t\t\tabv30Panel.unmask();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tInfo.display(\"Error\", \"RPC Error\");\r\n\t\t\t\t\t}"
] | [
"0.6388507",
"0.6241718",
"0.6123716",
"0.6094962",
"0.6030771",
"0.60200715",
"0.5981181",
"0.59410733",
"0.5929023",
"0.5929023",
"0.58840984",
"0.58480066",
"0.5841734",
"0.5821797",
"0.58168966",
"0.58168966",
"0.58168966",
"0.5803985",
"0.5801436",
"0.5790827",
"0.57791746",
"0.5766506",
"0.57552946",
"0.5751635",
"0.5729984",
"0.56905806",
"0.56876856",
"0.5685504",
"0.568545",
"0.5685355",
"0.5681237",
"0.5679269",
"0.5679269",
"0.5659631",
"0.565728",
"0.56566876",
"0.5654401",
"0.5646242",
"0.5641756",
"0.5634608",
"0.56337523",
"0.5633455",
"0.5629976",
"0.56251776",
"0.56251776",
"0.56200475",
"0.5614182",
"0.5609824",
"0.5606879",
"0.5605536",
"0.5591481",
"0.55855787",
"0.5580441",
"0.55677813",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55649686",
"0.55638963",
"0.5562698",
"0.55621517",
"0.5552193",
"0.55503094",
"0.5543201",
"0.5541368",
"0.5540882",
"0.5531709",
"0.5529804",
"0.5517593",
"0.5515783",
"0.5515679",
"0.5505225",
"0.5497145",
"0.5497145",
"0.5495618",
"0.549089",
"0.54896414",
"0.54896414",
"0.5489238",
"0.548857",
"0.548485",
"0.5484438",
"0.5482385",
"0.547952",
"0.54775524",
"0.54670566",
"0.54668903",
"0.5463594",
"0.5461831",
"0.5461273"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onFailure(Throwable caught) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onSuccess(Void result) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
File files=new File("C:\\Users\\k74");
String filenames[]=files.list();
for(String filename :filenames)
System.out.println(filename);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Sign an APK with testkey. | public void signWithTestKey(@NonNull String inputPath, @NonNull String outputPath, @Nullable LogCallback callback) {
try (LogWriter logger = new LogWriter(callback)) {
long savedTimeMillis = System.currentTimeMillis();
PrintStream oldOut = System.out;
List<String> args = Arrays.asList(
"sign",
"--in",
inputPath,
"--out",
outputPath,
"--key",
new File(context.getFilesDir(), TESTKEY_DIR_IN_FILES + "testkey.pk8").getAbsolutePath(),
"--cert",
new File(context.getFilesDir(), TESTKEY_DIR_IN_FILES + "testkey.x509.pem").getAbsolutePath()
);
logger.write("Signing an APK file with these arguments: " + args);
/* If the signing has a callback, we need to change System.out to our logger */
if (callback != null) {
try (PrintStream stream = new PrintStream(logger)) {
System.setOut(stream);
}
}
try {
ApkSignerTool.main(args.toArray(new String[0]));
} catch (Exception e) {
callback.errorCount.incrementAndGet();
logger.write("An error occurred while trying to sign the APK file " + inputPath +
" and outputting it to " + outputPath + ": " + e.getMessage() + "\n" +
"Stack trace: " + Log.getStackTraceString(e));
}
logger.write("Signing an APK file took " + (System.currentTimeMillis() - savedTimeMillis) + " ms");
if (callback != null) {
System.setOut(oldOut);
}
} catch (IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\r\n public void testSign() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] result = instance.sign(data, keys);\r\n assertNotNull(result);\r\n }",
"public boolean ApkJarSigner(String apkname, String[] keyname) {\n Runtime rn=Runtime.getRuntime();\r\n try{\r\n \tSystem.out.println(\"JarSigner \"+apkname);\r\n \tProcess process = rn.exec(\"java -classpath \"+JarPath+\"../tools.jar sun.security.tools.JarSigner -keystore \"+\r\n \t\t\tkeyname[0]+\" -storepass \" +keyname[1]+\" -keypass \"+keyname[2]+\" -sigfile \"+keyname[4]+\" \"+apkname+\" \"+keyname[3]);\r\n \tprocess.waitFor();\r\n }catch(Exception e){\r\n \toutputstr(\"Error: JarSigner \"+apkname);\r\n \treturn false; \r\n } \t\t\t\r\n\t\treturn true;\r\n\t}",
"private static String sign(String data, String key)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tMac mac = Mac.getInstance(\"HmacSHA1\");\n\t\t\t\tmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA1\"));\n\t\t\t\treturn Base64.encodeBytes(mac.doFinal(data.getBytes(\"UTF-8\")));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new RuntimeException(new SignatureException(\"Failed to generate signature: \" + e.getMessage(), e));\n\t\t\t}\n\t\t}",
"@Override\n public String buildSignature(RequestDataToSign requestDataToSign, String appKey) {\n // find private key for this app\n final String secretKey = keyStore.getPrivateKey(appKey);\n if (secretKey == null) {\n LOG.error(\"Unknown application key: {}\", appKey);\n throw new PrivateKeyNotFoundException();\n }\n\n // sign\n return super.buildSignature(requestDataToSign, secretKey);\n }",
"@Test\r\n public void testSignInvalidSk() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n // signkey must be 64 bytes long\r\n CryptoService instance = new CryptoService();\r\n Keys keys = new Keys(\"8wZcEriaNLNKtteJvx7f8i\", \"5L2HBnzbu6Auh2pkDRbFt5f4prvgE2LzknkuYLsKkacp\");\r\n Assertions.assertThrows(CryptoException.class, () -> {\r\n instance.sign(data, keys);\r\n });\r\n }",
"public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }",
"@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }",
"private static String signSHA256RSA(String input,\n PrivateKey privateKey) throws Exception {\n Signature s = Signature.getInstance(\"SHA256withRSA\");\n s.initSign(privateKey);\n s.update(input.getBytes(\"UTF-8\"));\n byte[] signature = s.sign();\n //Base64.getEncoder().encode(\"Test\".getBytes());\n return Base64.getEncoder().encodeToString(signature);\n }",
"public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}",
"@Test\r\n public void testVerifyInvalidPk() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n keys.verkey = \"AnnxV4t3LUHKZaxVQDWoVaG44NrGmeDYMA4Gz6C2tCZd\";\r\n Assertions.assertThrows(SodiumException.class, () -> {\r\n instance.verify(data, sign, keys);\r\n });\r\n }",
"private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }",
"@org.junit.Test\n public void testAsymmetricSigned() throws Exception {\n\n SpringBusFactory bf = new SpringBusFactory();\n URL busFile = SamlTokenTest.class.getResource(\"client.xml\");\n\n Bus bus = bf.createBus(busFile.toString());\n BusFactory.setDefaultBus(bus);\n BusFactory.setThreadDefaultBus(bus);\n\n URL wsdl = SamlTokenTest.class.getResource(\"DoubleItSaml.wsdl\");\n Service service = Service.create(wsdl, SERVICE_QNAME);\n QName portQName = new QName(NAMESPACE, \"DoubleItAsymmetricSignedPort\");\n DoubleItPortType samlPort =\n service.getPort(portQName, DoubleItPortType.class);\n updateAddressPort(samlPort, test.getPort());\n\n samlPort.doubleIt(25);\n\n ((java.io.Closeable)samlPort).close();\n bus.shutdown(true);\n }",
"public void testX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);\n // builder.setUserInfo(\"john\", \"keypass\");\n LOG.info(\"Before Signing ThumbprintSHA1....\");\n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Signed message with ThumbprintSHA1 key identifier:\");\n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);\n LOG.debug(outputString);\n }\n LOG.info(\"After Signing ThumbprintSHA1....\");\n verify(signedDoc);\n }",
"public void initSign(Key paramKey) throws XMLSignatureException {\n/* 242 */ this.signatureAlgorithm.engineInitSign(paramKey);\n/* */ }",
"@Test\n public void testBaseCryptoRecordSyncKeyBundle() throws UnsupportedEncodingException, CryptoException {\n String key = \"6m8mv8ex2brqnrmsb9fjuvfg7y\";\n String user = \"c6o7dvmr2c4ud2fyv6woz2u4zi22bcyd\";\n \n // Check our friendly base32 decoding.\n assertTrue(Arrays.equals(Utils.decodeFriendlyBase32(key), Base64.decodeBase64(\"8xbKrJfQYwbFkguKmlSm/g==\".getBytes(\"UTF-8\"))));\n KeyBundle bundle = new KeyBundle(user, key);\n String expectedEncryptKeyBase64 = \"/8RzbFT396htpZu5rwgIg2WKfyARgm7dLzsF5pwrVz8=\";\n String expectedHMACKeyBase64 = \"NChGjrqoXYyw8vIYP2334cvmMtsjAMUZNqFwV2LGNkM=\";\n byte[] computedEncryptKey = bundle.getEncryptionKey();\n byte[] computedHMACKey = bundle.getHMACKey();\n assertTrue(Arrays.equals(computedEncryptKey, Base64.decodeBase64(expectedEncryptKeyBase64.getBytes(\"UTF-8\"))));\n assertTrue(Arrays.equals(computedHMACKey, Base64.decodeBase64(expectedHMACKeyBase64.getBytes(\"UTF-8\"))));\n }",
"public void printHashKey(){\n try {\n PackageInfo info = getPackageManager().getPackageInfo(\n \"net.simplifiedcoding.androidlogin\",\n PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"KeyHash:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n\n }\n } catch (PackageManager.NameNotFoundException e) {\n\n } catch (NoSuchAlgorithmException e) {\n\n }\n }",
"private void printKeyHash(){\n try {\n PackageInfo info = getPackageManager().getPackageInfo(\n \"andbas.ui3_0628\",\n PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"KeyHash:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException e) {\n\n } catch (NoSuchAlgorithmException e) {\n\n }\n\n }",
"public void printHashKey(){\n try {\n PackageInfo info = getPackageManager().getPackageInfo(\n \"com.credolabs.justcredo\",\n PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"Credo:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException e) {\n\n } catch (NoSuchAlgorithmException e) {\n\n }\n }",
"private void getHashKey(){\n try {\n PackageInfo info = getPackageManager().getPackageInfo(getString(R.string.app_package_name), PackageManager.GET_SIGNATURES);\n\n for (Signature signature : info.signatures)\n {\n try {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n\n md.update(signature.toByteArray());\n Log.d(\"KeyHash:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n } catch (NoSuchAlgorithmException nsa)\n {\n Log.d(\"exception\" , \"No algorithmn\");\n Assert.assertTrue(false);\n }\n }\n } catch (PackageManager.NameNotFoundException nnfe)\n {\n Log.d(\"exception\" , \"Name not found\");\n Assert.assertNull(\"Name not found\", nnfe);\n }\n }",
"@SuppressWarnings(\"all\")\n public static void main(String...args) throws Exception {\n FileInputStream pubKFile = new FileInputStream(\"C:\\\\Demo\\\\publicKey\");\n byte[] encKey = new byte[pubKFile.available()];\n pubKFile.read(encKey);\n pubKFile.close();\n\n // 2. decode the public key\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encKey);\n PublicKey publicKey = KeyFactory.getInstance(\"DSA\").generatePublic(spec);\n\n // 3. read the signature\n FileInputStream signatureFile = new FileInputStream(\"C:\\\\Demo\\\\signature\");\n byte[] sigByte = new byte[signatureFile.available()];\n signatureFile.read(sigByte);\n signatureFile.close();\n\n // 4. generate the signature\n Signature signature = Signature.getInstance(\"SHA1withDSA\");\n signature.initVerify(publicKey);\n\n // 5. supply the data\n FileInputStream dataFile = new FileInputStream(\"C:\\\\Demo\\\\code\");\n BufferedInputStream dataStream = new BufferedInputStream(dataFile);\n byte[] tmpBuf = new byte[dataStream.available()];\n int len;\n while ((len = dataStream.read(tmpBuf)) >= 0) {\n signature.update(tmpBuf, 0, len);\n }\n dataStream.close();\n\n // 6. verify\n boolean result = signature.verify(sigByte);\n System.out.println(\"Result:\" + result);\n }",
"public void initSign(Key paramKey, SecureRandom paramSecureRandom) throws XMLSignatureException {\n/* 255 */ this.signatureAlgorithm.engineInitSign(paramKey, paramSecureRandom);\n/* */ }",
"public static boolean testSignature(byte[] data, byte[] test) {\n return testSignature(data, 0, test);\n }",
"public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }",
"public void printHashKey(){\n try {\n PackageInfo info = getPackageManager().getPackageInfo(\"com.lostfind\", PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"KeyHash:\", \"KEYHASH::::\"+Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n }",
"@Test\r\n public void testVerifyCryptoType() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }",
"private void printKeyHash() {\n\n try {\n\n PackageInfo info = getPackageManager().getPackageInfo(\"com.example.androidnotification\", PackageManager.GET_SIGNATURES);\n\n for (Signature signature : info.signatures) {\n\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n\n Log.d(TAG, \"printKeyHash: \" + Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n\n } catch (PackageManager.NameNotFoundException e) {\n\n e.printStackTrace();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n }",
"public CadesSignatureDemo() {\n Security.addProvider(new IAIK());\n }",
"OpenSSLKey mo134201a();",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/253038666\"})\n @Test\n public void testSignVerifyWithParameters() {\n int keySizeInBits = 2048;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 20;\n KeyPair keypair;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n keypair = keyGen.genKeyPair();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] msg = new byte[4];\n RSAPublicKey pub = (RSAPublicKey) keypair.getPublic();\n RSAPrivateKey priv = (RSAPrivateKey) keypair.getPrivate();\n Signature signer;\n Signature verifier;\n try {\n signer = Signature.getInstance(\"RSASSA-PSS\");\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"RSASSA-PSS key generation is supported, but signature generation is not\");\n return;\n }\n // Signs the message. This part of the code constructs the PSS parameters\n // explicitely.\n try {\n signer.initSign(priv);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own private key\");\n return;\n }\n try {\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLength, 1);\n signer.setParameter(params);\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n fail(\"Parameters accepted as key generation parameters are rejected as algorithm parameters\");\n return;\n }\n byte[] signature;\n try {\n signer.update(msg);\n signature = signer.sign();\n } catch (SignatureException ex) {\n fail(\"Could not sign with RSAPSS-PSS:\" + ex.toString());\n return;\n }\n\n // Verifies the signature. This part of the code tries to copy the PSS parameters\n // from the public key. Ideally, just calling verifier.initVerify(pub) would\n // be sufficient, since the public key contains the parameters. Unfortunately,\n // copying the PSS parameters is necessary for OpenJDK, since OpenJDK does\n // not copy the algorithm parameters.\n // Even worse is BouncyCastle, where it is unclear if there is a simple way\n // to extract the algorithm parameters from the key.\n try {\n verifier.initVerify(pub);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own public key\");\n return;\n }\n \n try {\n verifier.setParameter(pub.getParams());\n verifier.update(msg);\n boolean verified = verifier.verify(signature);\n assertTrue(\"Signature did not verify\", verified);\n } catch (GeneralSecurityException ex) {\n throw new AssertionError(\"Provider could not verify its own signature\", ex);\n }\n }",
"public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}",
"@Test\n public void protectionKeyTest() {\n // TODO: test protectionKey\n }",
"private static String generateSignature(String data, String key) throws SignatureException {\n String result;\n try {\n // get an hmac_sha1 key from the raw key bytes\n SecretKeySpec signingKey = new SecretKeySpec(key.getBytes(StandardCharsets.UTF_8), \"HmacSHA1\");\n // get an hmac_sha1 Mac instance and initialize with the signing key\n Mac mac = Mac.getInstance(\"HmacSHA1\");\n mac.init(signingKey);\n // compute the hmac on input data bytes\n byte[] rawHmac = mac.doFinal(data.getBytes(StandardCharsets.UTF_8));\n result = Base64.encodeBase64String(rawHmac);\n }\n catch (Exception e) {\n throw new SignatureException(\"Failed to generate HMAC : \" + e.getMessage());\n }\n return result;\n }",
"public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }",
"BlsPoint sign(BigInteger privateKey, byte[] data);",
"public static void main(String[] args) throws IcbcApiException {\n\t\tUiIcbcClient client = new UiIcbcClient(APP_ID,IcbcConstants.SIGN_TYPE_RSA,\n\t\t\t\t\"MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAJCoQe/O+uqpOtyE/2CUjD7wosZw8jI1AlLNJCllOmlX+obA6h97b0JsEL0SjMCAR3xJyw7MKLqkcy5qQ/bBgw2XSrodmjzOVqfT1OXRii0xw0HiVkHR4cEWnEAAdfo0lDc4iuzCIQrnT5gM0+U+qeSV6JFfwVRjgYzBdHQRPCf1AgMBAAECgYAdQUoEe7GXH5591o/nMmOinvvscg8pRDsyD7bOgGBtyZMrCXzP3SDFKCHCeyvoColqg2oDlhpulK+OpYMVNlGQcO4eubOJp9MUc3m4A9RxkVr3dsVrmygM5czPfWHAPVQ4dECDruBJn9zoo1ci0myRTh4KSCq6SxpCE0Pbf3j7iQJBAOdMPFRfOkSQ1hsN9Mg4jd9on8r7+mF8gFPhkNI6qvEKw/prmU3obUWvZL42vRlLOQyyB92mBF24PStR/B6CjR8CQQCgGz0VoqCplurSCapGdgX3D7bNSDtMUmaLJYJxih8v+zghP0YtVgDeV3NjogVjOlz8/9Rebo0PoFcqyJnNA1RrAkEAul3dBoasZm7ldWsrXuDiv66HgoDB4Cb3J59Kl3oaHpp0CqUEI5gx48JNRE7K00SfNTGF0Pxh7Dn1X6Bxqwu6NQJADrdyPfLc4bnFi9jnleJzWepP2z6wdKt+UXv5KYaQp1BoMGYohTJKkiVnrdjOtfg/Y+IAG03+GVmbqYsW2AleUQJBANYQklohKtsmq8ptX3as6hjcuXcTpc2DSpVeOnCueNv107+dDJ+K14tbiVYzF3tkHBNMRkGtr6EuGKJ+A63sJ00=\",\n\t\t\t\tIcbcConstants.CHARSET_UTF8,IcbcConstants.ENCRYPT_TYPE_AES, \"xMh0xFsG7G80ziePFdnT8g==\");\n\t\tEaccountManageRequestV1 request = new EaccountManageRequestV1();\t\t\n\t\trequest.setServiceUrl(\"http://122.64.61.111:8081/ui/eaccount/manage/V1\");///\n\t\tEaccountManageRequestBizV1 bizContent = new EaccountManageRequestBizV1();\n\t\tbizContent.setMobileNo(\"13703878410\");//选输,手机号\n\t\tbizContent.setIdcode(\"128440810108044\");//选输,身份证号\n\t\tbizContent.setName(URLEncoder.encode(\"芡悠\"));//选输,用户姓名\n\t\tbizContent.setUserId(\"128440810108044\");//必输,需控制不能为空,用户唯一标识,送身份证号\n\t\tbizContent.setBacAddr(URLEncoder.encode(\"http://www.test.com\"));//选输,回调地址\n\t\tbizContent.setEpayflag(\"0\");//选输,工银e支付标志,0-短信、1-静态密码,集成客户端SDK的方式能送0-短信或1-静态密码,非APP方式只能送0-短信,不送默认为0-短信\n\t\t\n\t\tbizContent.setCorpAppid(APP_ID);//外公司合作方送APP_ID的值,行内应用如e支付等送外公司合作方的APPID\n\t\tlong systime = System.currentTimeMillis(); // 现时间戳\t\t\n\t\tString orderTimeStamp=new Long(systime).toString();\n\t\t\n\t\tSystem.out.println(\"orderTimeStamp:\"+orderTimeStamp);\n\t\tbizContent.setOrderTimeStamp(orderTimeStamp);//生成请求的时间,必输\n\t\t\n\t\tbizContent.setZoneno(\"00200\");//地区号号,选输,5位数字,上送值联系对接分行提供\n\t\tbizContent.setBrno(\"00260\");//网点号,选输,5位数字,上送值联系对接分行提供\n\t\t\n\t\trequest.setBizContent(bizContent);\n\t\tSystem.out.println(client.buildPostForm(request));// 实际调用时的相关返回结果及异常处理,请自行添加\n\t}",
"public void initSign(Key paramKey, AlgorithmParameterSpec paramAlgorithmParameterSpec) throws XMLSignatureException {\n/* 269 */ this.signatureAlgorithm.engineInitSign(paramKey, paramAlgorithmParameterSpec);\n/* */ }",
"@Test\n public void testPreSignDocumentIn() throws IOException, GeneralSecurityException\n {\n try ( InputStream resource = getClass().getResourceAsStream(\"document_in.pdf\");\n FileOutputStream os = new FileOutputStream(new File(RESULT_FOLDER, \"document_in-presigned.pdf\")) )\n {\n CertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\n Certificate maincertificate = cf.generateCertificate(getClass().getResourceAsStream(\"Samson_aut.cer\"));\n Certificate[] chain = new Certificate[] { maincertificate };\n String hashAlgorithm = \"SHA-256\";\n\n PdfReader reader = new PdfReader(resource);\n PdfSigner signer = new PdfSigner(reader, os, new StampingProperties());\n signer.setFieldName(\"certification\"); // this field already exists\n signer.setCertificationLevel(PdfSigner.CERTIFIED_FORM_FILLING);\n PdfSignatureAppearance sap = signer.getSignatureAppearance();\n sap.setReason(\"Certification of the document\");\n sap.setLocation(\"On server\");\n sap.setCertificate(maincertificate);\n BouncyCastleDigest digest = new BouncyCastleDigest();\n PdfPKCS7 sgn = new PdfPKCS7(null, chain, hashAlgorithm, null, digest,false);\n PreSignatureContainer external = new PreSignatureContainer(PdfName.Adobe_PPKLite,PdfName.Adbe_pkcs7_detached);\n signer.signExternalContainer(external, 8192);\n byte[] hash=external.getHash();\n sgn.getAuthenticatedAttributeBytes(hash, PdfSigner.CryptoStandard.CMS, null, null);\n }\n }",
"private void printKeyHash() {\n try {\n PackageInfo info =\n getPackageManager().getPackageInfo(\"in.peerreview.ping\", PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"KeyHash:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException e) {\n Log.e(\"KeyHash:\", e.toString());\n } catch (NoSuchAlgorithmException e) {\n Log.e(\"KeyHash:\", e.toString());\n }\n }",
"@Test\n public void testRandomization() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Set<String> signatures = new HashSet<String>();\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n signer.initSign(priv);\n signer.update(messageBytes);\n byte[] signature = signer.sign();\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"Failed to generat signatures:\" + ex);\n return;\n }\n }",
"@Deprecated\n @Override\n public BuildableAndSignable<TransactionOuterClass.Transaction> sign(KeyPair keyPair) {\n updatePayload();\n tx.addSignatures(Ed25519Sha3SignatureBuilder.getInstance().sign(this, keyPair));\n return this;\n }",
"private void startSignIn() {\n Intent intent = AuthUI.getInstance().createSignInIntentBuilder()\n .setIsSmartLockEnabled(!BuildConfig.DEBUG)\n .setAvailableProviders(Arrays.asList(\n new AuthUI.IdpConfig.EmailBuilder().build(),\n new AuthUI.IdpConfig.GoogleBuilder().build()))\n .setLogo(R.mipmap.ic_launcher)\n .build();\n\n startActivityForResult(intent, RC_SIGN_IN);\n }",
"@Override\n public boolean generateKeyPair(ComponentName who, String callerPackage, String algorithm,\n ParcelableKeyGenParameterSpec parcelableKeySpec, int idAttestationFlags,\n KeymasterCertificateChain attestationChain) {\n final int[] attestationUtilsFlags = translateIdAttestationFlags(idAttestationFlags);\n final boolean deviceIdAttestationRequired = attestationUtilsFlags != null;\n KeyGenParameterSpec keySpec = parcelableKeySpec.getSpec();\n final String alias = keySpec.getKeystoreAlias();\n\n Preconditions.checkStringNotEmpty(alias, \"Empty alias provided\");\n Preconditions.checkArgument(\n !deviceIdAttestationRequired || keySpec.getAttestationChallenge() != null,\n \"Requested Device ID attestation but challenge is empty\");\n\n final CallerIdentity caller = getCallerIdentity(who, callerPackage);\n final boolean isCallerDelegate = isCallerDelegate(caller, DELEGATION_CERT_INSTALL);\n final boolean isCredentialManagementApp = isCredentialManagementApp(caller);\n if (deviceIdAttestationRequired && attestationUtilsFlags.length > 0) {\n // TODO: replace enforce methods\n enforceCallerCanRequestDeviceIdAttestation(caller);\n enforceIndividualAttestationSupportedIfRequested(attestationUtilsFlags);\n } else {\n Preconditions.checkCallAuthorization((caller.hasAdminComponent()\n && (isProfileOwner(caller) || isDefaultDeviceOwner(caller)))\n || (caller.hasPackage() && (isCallerDelegate || isCredentialManagementApp)));\n if (isCredentialManagementApp) {\n Preconditions.checkCallAuthorization(\n isAliasInCredentialManagementAppPolicy(caller, alias),\n CREDENTIAL_MANAGEMENT_APP_INVALID_ALIAS_MSG);\n }\n }\n\n if (TextUtils.isEmpty(alias)) {\n throw new IllegalArgumentException(\"Empty alias provided.\");\n }\n // As the caller will be granted access to the key, ensure no UID was specified, as\n // it will not have the desired effect.\n if (keySpec.getUid() != KeyStore.UID_SELF) {\n Slogf.e(LOG_TAG, \"Only the caller can be granted access to the generated keypair.\");\n logGenerateKeyPairFailure(caller, isCredentialManagementApp);\n return false;\n }\n\n if (deviceIdAttestationRequired) {\n if (keySpec.getAttestationChallenge() == null) {\n throw new IllegalArgumentException(\n \"Requested Device ID attestation but challenge is empty.\");\n }\n KeyGenParameterSpec.Builder specBuilder = new KeyGenParameterSpec.Builder(keySpec);\n specBuilder.setAttestationIds(attestationUtilsFlags);\n specBuilder.setDevicePropertiesAttestationIncluded(true);\n keySpec = specBuilder.build();\n }\n\n final long id = mInjector.binderClearCallingIdentity();\n try {\n try (KeyChainConnection keyChainConnection =\n KeyChain.bindAsUser(mContext, caller.getUserHandle())) {\n IKeyChainService keyChain = keyChainConnection.getService();\n\n final int generationResult = keyChain.generateKeyPair(algorithm,\n new ParcelableKeyGenParameterSpec(keySpec));\n if (generationResult != KeyChain.KEY_GEN_SUCCESS) {\n Slogf.e(LOG_TAG, \"KeyChain failed to generate a keypair, error %d.\",\n generationResult);\n logGenerateKeyPairFailure(caller, isCredentialManagementApp);\n switch (generationResult) {\n case KeyChain.KEY_GEN_STRONGBOX_UNAVAILABLE:\n throw new ServiceSpecificException(\n DevicePolicyManager.KEY_GEN_STRONGBOX_UNAVAILABLE,\n String.format(\"KeyChain error: %d\", generationResult));\n case KeyChain.KEY_ATTESTATION_CANNOT_ATTEST_IDS:\n throw new UnsupportedOperationException(\n \"Device does not support Device ID attestation.\");\n default:\n return false;\n }\n }\n\n // Set a grant for the caller here so that when the client calls\n // requestPrivateKey, it will be able to get the key from Keystore.\n // Note the use of the calling UID, since the request for the private\n // key will come from the client's process, so the grant has to be for\n // that UID.\n keyChain.setGrant(caller.getUid(), alias, true);\n\n try {\n final List<byte[]> encodedCerts = new ArrayList();\n final CertificateFactory certFactory = CertificateFactory.getInstance(\"X.509\");\n final byte[] certChainBytes = keyChain.getCaCertificates(alias);\n encodedCerts.add(keyChain.getCertificate(alias));\n if (certChainBytes != null) {\n final Collection<X509Certificate> certs =\n (Collection<X509Certificate>) certFactory.generateCertificates(\n new ByteArrayInputStream(certChainBytes));\n for (X509Certificate cert : certs) {\n encodedCerts.add(cert.getEncoded());\n }\n }\n\n attestationChain.shallowCopyFrom(new KeymasterCertificateChain(encodedCerts));\n } catch (CertificateException e) {\n logGenerateKeyPairFailure(caller, isCredentialManagementApp);\n Slogf.e(LOG_TAG, \"While retrieving certificate chain.\", e);\n return false;\n }\n\n DevicePolicyEventLogger\n .createEvent(DevicePolicyEnums.GENERATE_KEY_PAIR)\n .setAdmin(caller.getPackageName())\n .setBoolean(/* isDelegate */ isCallerDelegate)\n .setInt(idAttestationFlags)\n .setStrings(algorithm, isCredentialManagementApp\n ? CREDENTIAL_MANAGEMENT_APP : NOT_CREDENTIAL_MANAGEMENT_APP)\n .write();\n return true;\n }\n } catch (RemoteException e) {\n Slogf.e(LOG_TAG, \"KeyChain error while generating a keypair\", e);\n } catch (InterruptedException e) {\n Slogf.w(LOG_TAG, \"Interrupted while generating keypair\", e);\n Thread.currentThread().interrupt();\n } finally {\n mInjector.binderRestoreCallingIdentity(id);\n }\n logGenerateKeyPairFailure(caller, isCredentialManagementApp);\n return false;\n }",
"public void createKeyStore(String master_key) throws AEADBadTagException {\n SharedPreferences.Editor editor = getEncryptedSharedPreferences(master_key).edit();\n editor.putString(MASTER_KEY, master_key);\n editor.apply();\n\n Log.d(TAG, \"Encrypted SharedPreferences created...\");\n }",
"public static boolean testSignature(byte[] data, String test) {\n return testSignature(data, 0, test.getBytes());\n }",
"private static void wxSignTest(){\n\t\t\n\t\tString sb=\"appid=wx791233ecd4e71c3f&attach=91_40090_3999&mch_id=1220845901&openid=oc9Xijt__DS0SyGDGqGnUPxSkDWQ&cash_fee=7600&fee_type=CNY\"+\n\t\t\t\t\"&time_end=20150831172810&bank_type=BOC_DEBIT&nonce_str\"+\n\t\t\t\t\"=5K8264ILTKCH16CQ2502SI8ZNMTM67VS&total_fee=7600&trade_type=JSAPI&result_code=SUCCESS&return_code=SUCCESS&is_subscribe=Y&out_trade_\"+\n\t\t\t\t\"no=2015083100400904657685188272&transaction_id=1007950222201508310755172159&key=48d15a39462fbe06f6391328ff685954\";\n\t\t\tString sign = DigestUtils.md5Hex(sb).toUpperCase();\n\t\t\tSystem.out.println(\"sign=\"+sign);\t\n\t}",
"SignatureSpi(com.android.org.bouncycastle.crypto.Digest r1, com.android.org.bouncycastle.crypto.DSA r2, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 0073 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.<init>(com.android.org.bouncycastle.crypto.Digest, com.android.org.bouncycastle.crypto.DSA, com.android.org.bouncycastle.jcajce.provider.asymmetric.util.DSAEncoder):void\");\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tdo_sign();// 图片签收\n\t\t\t}",
"protected void engineInitSign(java.security.PrivateKey r1) throws java.security.InvalidKeyException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.engineInitSign(java.security.PrivateKey):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.engineInitSign(java.security.PrivateKey):void\");\n }",
"public void generateNewKeyPair(String alias, Context context) throws Exception {\n Calendar start = Calendar.getInstance();\n Calendar end = Calendar.getInstance();\n // expires 1 year from today\n end.add(Calendar.YEAR, 1);\n KeyPairGeneratorSpec spec = new KeyPairGeneratorSpec.Builder(context)\n .setAlias(alias)\n .setSubject(new X500Principal(\"CN=\" + alias))\n .setSerialNumber(BigInteger.TEN)\n .setStartDate(start.getTime())\n .setEndDate(end.getTime())\n .build();\n // use the Android keystore\n KeyPairGenerator gen = KeyPairGenerator.getInstance(\"RSA\",ANDROID_KEYSTORE);\n gen.initialize(spec);\n // generates the keypair\n gen.generateKeyPair();\n }",
"public interface SignCallUseCase {\n\n String signature(String method, Map<String, String> params, String secret);\n\n}",
"@Test\n public void testNullRandom() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key generation is not supported.\" + ex);\n return;\n }\n Set<String> signatures = new HashSet<String>();\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n byte[] signature;\n try {\n signer.initSign(priv, null);\n signer.update(messageBytes);\n signature = signer.sign();\n } catch (GeneralSecurityException ex) {\n fail(\"Failed to sign. \" + ex);\n return;\n }\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n }",
"public static void main(String[] args) {\n KeyStore myStore = null;\n try {\n\n /* Note: could also use a keystore file, which contains the token label or slot no. to use. Load that via\n * \"new FileInputStream(ksFileName)\" instead of ByteArrayInputStream. Save objects to the keystore via a\n * FileOutputStream. */\n\n ByteArrayInputStream is1 = new ByteArrayInputStream((\"slot:\" + slot).getBytes());\n myStore = KeyStore.getInstance(keystoreProvider);\n myStore.load(is1, passwd.toCharArray());\n } catch (KeyStoreException kse) {\n System.out.println(\"Unable to create keystore object\");\n System.exit(-1);\n } catch (NoSuchAlgorithmException nsae) {\n System.out.println(\"Unexpected NoSuchAlgorithmException while loading keystore\");\n System.exit(-1);\n } catch (CertificateException e) {\n System.out.println(\"Unexpected CertificateException while loading keystore\");\n System.exit(-1);\n } catch (IOException e) {\n // this should never happen\n System.out.println(\"Unexpected IOException while loading keystore.\");\n System.exit(-1);\n }\n\n KeyPairGenerator keyGen = null;\n KeyPair keyPair = null;\n try {\n // Generate an ECDSA KeyPair\n /* The KeyPairGenerator class is used to determine the type of KeyPair being generated. For more information\n * concerning the algorithms available in the Luna provider please see the Luna Development Guide. For more\n * information concerning other providers, please read the documentation available for the provider in question. */\n System.out.println(\"Generating ECDSA Keypair\");\n /* The KeyPairGenerator.getInstance method also supports specifying providers as a parameter to the method. Many\n * other methods will allow you to specify the provider as a parameter. Please see the Sun JDK class reference at\n * http://java.sun.org for more information. */\n keyGen = KeyPairGenerator.getInstance(\"ECDSA\", provider);\n /* ECDSA keys need to know what curve to use. If you know the curve ID to use you can specify it directly. In the\n * Luna Provider all supported curves are defined in LunaECCurve */\n ECGenParameterSpec ecSpec = new ECGenParameterSpec(\"c2pnb304w1\");\n keyGen.initialize(ecSpec);\n keyPair = keyGen.generateKeyPair();\n } catch (Exception e) {\n System.out.println(\"Exception during Key Generation - \" + e.getMessage());\n System.exit(1);\n }\n\n // generate a self-signed ECDSA certificate.\n Date notBefore = new Date();\n Date notAfter = new Date(notBefore.getTime() + 1000000000);\n BigInteger serialNum = new BigInteger(\"123456\");\n LunaCertificateX509 cert = null;\n try {\n cert = LunaCertificateX509.SelfSign(keyPair, \"CN=ECDSA Sample Cert\", serialNum, notBefore, notAfter);\n } catch (InvalidKeyException ike) {\n System.out.println(\"Unexpected InvalidKeyException while generating cert.\");\n System.exit(-1);\n } catch (CertificateEncodingException cee) {\n System.out.println(\"Unexpected CertificateEncodingException while generating cert.\");\n System.exit(-1);\n }\n\n byte[] bytes = \"Some Text to Sign as an Example\".getBytes();\n System.out.println(\"PlainText = \" + com.safenetinc.luna.LunaUtils.getHexString(bytes, true));\n\n Signature ecdsaSig = null;\n byte[] signatureBytes = null;\n try {\n // Create a Signature Object and signUsingI2p the encrypted text\n /* Sign/Verify operations like Encrypt/Decrypt operations can be performed in either singlepart or multipart\n * steps. Single part Signing and Verify examples are given in this code. Multipart signatures use the\n * Signature.update() method to load all the bytes and then invoke the Signature.signUsingI2p() method to get the result.\n * For more information please see the class documentation for the java.security.Signature class with respect to\n * the version of the JDK you are using. */\n System.out.println(\"Signing encrypted text\");\n ecdsaSig = Signature.getInstance(\"ECDSA\", provider);\n ecdsaSig = Signature.getInstance(\"SHA256withECDSA\", provider);\n ecdsaSig.initSign(keyPair.getPrivate());\n ecdsaSig.update(bytes);\n signatureBytes = ecdsaSig.sign();\n\n // Verify the signature\n System.out.println(\"Verifying signature(via Signature.verify)\");\n ecdsaSig.initVerify(keyPair.getPublic());\n ecdsaSig.update(bytes);\n boolean verifies = ecdsaSig.verify(signatureBytes);\n if (verifies == true) {\n System.out.println(\"Signature passed verification\");\n } else {\n System.out.println(\"Signature failed verification\");\n }\n\n } catch (Exception e) {\n System.out.println(\"Exception during Signing - \" + e.getMessage());\n System.exit(1);\n }\n\n try {\n // Verify the signature\n System.out.println(\"Verifying signature(via cert)\");\n ecdsaSig.initVerify(cert);\n ecdsaSig.update(bytes);\n boolean verifies = ecdsaSig.verify(signatureBytes);\n if (verifies == true) {\n System.out.println(\"Signature passed verification\");\n } else {\n System.out.println(\"Signature failed verification\");\n }\n } catch (Exception e) {\n System.out.println(\"Exception during Verification - \" + e.getMessage());\n System.exit(1);\n }\n\n// // Logout of the token\n// HSM_Manager.hsmLogout();\n }",
"public void testX509EncryptionSHA1() throws Exception {\n WSSecEncrypt builder = new WSSecEncrypt();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n builder.setKeyIdentifierType(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);\n builder.setUseKeyIdentifier(true);\n \n LOG.info(\"Before Encrypting EncryptedKeySHA1....\");\n Document doc = unsignedEnvelope.getAsDocument();\n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc); \n Document encryptedDoc = builder.build(doc, crypto, secHeader);\n \n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Encrypted message with ENCRYPTED_KEY_SHA1_IDENTIFIER:\");\n LOG.debug(outputString);\n }\n assertTrue(outputString.indexOf(\"#EncryptedKeySHA1\") != -1);\n \n LOG.info(\"After Encrypting EncryptedKeySHA1....\");\n verify(encryptedDoc);\n }",
"@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }",
"private void checkAppKeySetup() {\n if (APP_KEY.startsWith(\"CHANGE\") ||\n APP_SECRET.startsWith(\"CHANGE\")) {\n showToast(\"You must apply for an app key and secret from developers.dropbox.com, and add them to the DBRoulette ap before trying it.\");\n finish();\n return;\n }\n\n // Check if the app has set up its manifest properly.\n Intent testIntent = new Intent(Intent.ACTION_VIEW);\n String scheme = \"db-\" + APP_KEY;\n String uri = scheme + \"://\" + AuthActivity.AUTH_VERSION + \"/test\";\n testIntent.setData(Uri.parse(uri));\n PackageManager pm = getPackageManager();\n if (0 == pm.queryIntentActivities(testIntent, 0).size()) {\n showToast(\"URL scheme in your app's \" +\n \"manifest is not set up correctly. You should have a \" +\n \"com.dropbox.client2.android.AuthActivity with the \" +\n \"scheme: \" + scheme);\n finish();\n }\n }",
"public static void main(String[] args) throws Exception {\n KeyPairGenerator kpGen = KeyPairGenerator.getInstance(\"RSA\"); //create RSA KeyPairGenerator \n kpGen.initialize(2048, new SecureRandom()); //Choose key strength\n KeyPair keyPair = kpGen.generateKeyPair(); //Generate private and public keys\n PublicKey RSAPubKey = keyPair.getPublic();\n PrivateKey RSAPrivateKey = keyPair.getPrivate();\n\n //Information for Certificate\n SecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\"); \n X500Name issuer = new X500Name(\"CN=\" + \"ExampleIssuer\"); // Issuer/Common Name\n X500Name subject = new X500Name(\"CN=\" + \"Client\"); //Subject\n Date notBefore = new Date(); //The date which the certificate becomes effective. \n long expiryDate = 1672437600000L; // expires 31 December 2022\n Date notAfter = new Date(expiryDate); //The date the certificate expires. \n BigInteger serialNumber = BigInteger.valueOf(Math.abs(random.nextInt())); //Cert Serial Number\n\n //Define the generator\n X509v3CertificateBuilder certGenerator \n = new JcaX509v3CertificateBuilder(\n issuer, \n serialNumber, \n notBefore,\n notAfter,\n subject,\n RSAPubKey\n );\n\n //Define how the certificate will be signed.\n //Usually with a hash algorithm and the Certificate Authority's private key. \n //Change argument x in .build(x) to not self-sign the cert.\n final ContentSigner contentSigner = new JcaContentSignerBuilder(\"SHA1WithRSAEncryption\").build(keyPair.getPrivate());\n\n //Generate a X.509 cert.\n X509CertificateHolder certificate = certGenerator.build(contentSigner);\n\n //Encode the certificate and write to a file. On Mac, you can open it with KeyChain Access\n //to confirm that it worked. \n byte[] encodedCert = certificate.getEncoded();\n FileOutputStream fos = new FileOutputStream(\"Example.cert\"); //Filename\n fos.write(encodedCert);\n fos.close();\n\n }",
"Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);",
"public void run(\n String encryptionPublicKeyHex,\n String outputFile,\n KeystoreKey keyToExport,\n Optional<KeystoreKey> keyToSignWith,\n boolean includeCertificate)\n throws Exception {\n KeyStore keyStoreForKeyToExport = keystoreHelper.getKeystore(keyToExport);\n PrivateKey privateKeyToExport =\n keystoreHelper.getPrivateKey(keyStoreForKeyToExport, keyToExport);\n byte[] privateKeyPem = privateKeyToPem(privateKeyToExport);\n byte[] encryptedPrivateKey = encryptPrivateKey(fromHex(encryptionPublicKeyHex), privateKeyPem);\n if (keyToSignWith.isPresent() || includeCertificate) {\n Certificate certificate = keystoreHelper.getCertificate(keyStoreForKeyToExport, keyToExport);\n Optional<byte[]> signature =\n keyToSignWith.isPresent()\n ? Optional.of(sign(encryptedPrivateKey, keyToSignWith.get()))\n : Optional.empty();\n writeToZipFile(outputFile, signature, encryptedPrivateKey, certificateToPem(certificate));\n } else {\n Files.write(Paths.get(outputFile), encryptedPrivateKey);\n }\n }",
"@Test\n public void producerEncryptionKeyNameTest() {\n // TODO: test producerEncryptionKeyName\n }",
"private void start(String filePath, String password) throws CmsCadesException,\n GeneralSecurityException, IOException, TspVerificationException {\n getKeyAndCerts(filePath, password);\n\n // sign some bytes\n byte[] somerandomdata = new byte[100];\n Random random = new Random();\n random.nextBytes(somerandomdata);\n byte[] signature = signData(somerandomdata);\n System.out.println(\"signed some random data\");\n\n System.out.println(\"verify the signature: \");\n verifyCadesSignature(signature, somerandomdata);\n\n // sign a file stream\n FileInputStream dataStream = new FileInputStream(fileToBeSigned);\n signDataStream(dataStream, signatureFile);\n dataStream.close();\n System.out.println(\n \"signed file \" + fileToBeSigned + \" and saved signature to \" + signatureFile);\n\n System.out.println(\"verify the signature contained in \" + signatureFile + \":\");\n FileInputStream sigStream = new FileInputStream(signatureFile);\n dataStream = new FileInputStream(fileToBeSigned);\n verifyCadesSignatureStream(sigStream, dataStream);\n sigStream.close();\n dataStream.close();\n }",
"public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }",
"private void signIn() {\n mGoogleSignInClient = buildGoogleSignInClient();\n startActivityForResult(mGoogleSignInClient.getSignInIntent(), REQUEST_CODE_SIGN_IN);\n }",
"@Test\n\tpublic void createNewMyKeys() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tboolean r1 = ks.createNewMyKeyPair(\"newkp\");\n\t\tboolean r2 = ks.createNewMyKeyPair(\"newtwo\");\n\t\tassertTrue(\"Should have added the key\", r1);\n\t\tassertTrue(\"Should have added the second key\", r2);\n\t}",
"protected void printFaceBookKeyHash() {\n try {\n PackageInfo info = getPackageManager().getPackageInfo(\"com.sakewiz.android\", PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"KeyHash: \", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException e) {\n e.printStackTrace();\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n }",
"public static byte [] sign(PrivateKey signatureKey, byte [] plainText){\r\n\t\ttry {\r\n\t\t\tSignature signer = Signature.getInstance(signatureAlgorithm);\r\n\t\t\tsigner.initSign(signatureKey);\r\n\t\t\tsigner.update(plainText);\r\n\t\t\treturn signer.sign();\r\n\t\t} catch (SignatureException | NoSuchAlgorithmException | InvalidKeyException e) {\r\n\t\t\t// should not happen\r\n\t\t\tthrow new ModelException(\"Unable to sign message \"+new String(Arrays.copyOf(plainText, 10))+\"...\",e);\r\n\t\t}\r\n\t}",
"public void onClickPKCS15(View view) {\n Intent i = new Intent(this, TestActivity.class);\n i.putExtra(\"providerType\", ProviderType.PKCS15);\n startActivity(i);\n }",
"private void signIn() {\n // [START_EXCLUDE silent]\n // [END_EXCLUDE]\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"public byte[] signMessage(PrivateKey key, byte[] message) {\n\t\ttry {\n\t\t\tif (signatureEngine == null) {\n\t\t\t\tsignatureEngine = TOMUtil.getSigEngine();\n\t\t\t}\n\t\t\tbyte[] result = null;\n\n\t\t\tsignatureEngine.initSign(key);\n\t\t\tsignatureEngine.update(message);\n\t\t\tresult = signatureEngine.sign();\n\n\t\t\t// st.store(System.nanoTime() - startTime);\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Failed to sign message\", e);\n\t\t\treturn null;\n\t\t}\n\t}",
"private byte[] signData(byte[] data)\n throws CmsCadesException, GeneralSecurityException, IOException {\n CadesSignature cmsSig = new CadesSignature(data, SignedData.EXPLICIT);\n // CadesBESParameters params = new CadesBESParameters();\n CadesTParameters params = new CadesTParameters(\n \"http://tsp.iaik.tugraz.at/tsp/TspRequest\", null, null);\n params.setDigestAlgorithm(\"SHA512\");\n cmsSig.addSignerInfo(privKey_, certChain_, params);\n return cmsSig.encodeSignature();\n }",
"public static boolean createKey(String keyName, int reauthenticationTimeoutInSecs,\n boolean invalidateKeyByNewBiometricEnrollment) {\n KeyStore keyStore = getKeyStore();\n if (keyStore == null) {\n Log.e(TAG, \"createKey/cannot access keystore\");\n return false;\n }\n\n try {\n KeyGenerator keyGenerator = KeyGenerator.getInstance(KeyProperties.KEY_ALGORITHM_AES, \"AndroidKeyStore\");\n\n // Set the alias of the entry in Android KeyStore where the key will appear\n // and the constrains (purposes) in the constructor of the Builder\n KeyGenParameterSpec.Builder builder = new KeyGenParameterSpec.Builder(keyName,\n KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT)\n .setBlockModes(KeyProperties.BLOCK_MODE_CBC)\n .setUserAuthenticationRequired(true)\n // Require that the user has unlocked in the last 30 seconds\n .setUserAuthenticationValidityDurationSeconds(reauthenticationTimeoutInSecs)\n .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_PKCS7);\n if (android.os.Build.VERSION.SDK_INT >= 24) {\n builder.setInvalidatedByBiometricEnrollment(invalidateKeyByNewBiometricEnrollment);\n }\n keyGenerator.init(builder.build());\n keyGenerator.generateKey();\n return true;\n } catch (NoSuchAlgorithmException | NoSuchProviderException\n | InvalidAlgorithmParameterException e) {\n Log.e(TAG, \"Failed to create a symmetric key\", e);\n return false;\n }\n }",
"@Test\n public void testCreateSha1() throws Exception {\n MessageDigest sha1 = MessageDigest.getInstance(MASTER_KEY_GENERATION_ALG);\n byte[] sha1Result = sha1.digest(SHA_1_INPUT);\n assertFalse(Arrays.equals(SHA_1_INPUT, sha1Result));\n }",
"public static void main(String[] args) throws Exception {\n File f = new File(System.getProperty(\"test.src\", \".\"), CA);\n FileInputStream fis = new FileInputStream(f);\n CertificateFactory fac = CertificateFactory.getInstance(\"X.509\");\n Certificate cacert = fac.generateCertificate(fis);\n Certificate[] signercerts = new Certificate[4];\n signercerts[1] = cacert;\n signercerts[3] = cacert;\n\n // set signer certs\n f = new File(System.getProperty(\"test.src\", \".\"), SIGNER1);\n fis = new FileInputStream(f);\n Certificate signer1 = fac.generateCertificate(fis);\n signercerts[0] = signer1;\n\n f = new File(System.getProperty(\"test.src\", \".\"), SIGNER2);\n fis = new FileInputStream(f);\n Certificate signer2 = fac.generateCertificate(fis);\n signercerts[2] = signer2;\n\n UnresolvedPermission up = new UnresolvedPermission\n (\"type\", \"name\", \"actions\", signercerts);\n if (!up.getUnresolvedType().equals(\"type\") ||\n !up.getUnresolvedName().equals(\"name\") ||\n !up.getUnresolvedActions().equals(\"actions\")) {\n throw new SecurityException(\"Test 1 Failed\");\n }\n\n Certificate[] certs = up.getUnresolvedCerts();\n if (certs == null || certs.length != 2) {\n throw new SecurityException(\"Test 2 Failed\");\n }\n\n boolean foundSigner1 = false;\n boolean foundSigner2 = false;\n if (certs[0].equals(signer1) || certs[1].equals(signer1)) {\n foundSigner1 = true;\n }\n if (certs[0].equals(signer2) || certs[1].equals(signer2)) {\n foundSigner2 = true;\n }\n if (!foundSigner1 || !foundSigner2) {\n throw new SecurityException(\"Test 3 Failed\");\n }\n }",
"dkk mo4509g();",
"public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }",
"public void verifyAsymmetricRsa() throws IOException, GeneralSecurityException {\n String projectId = \"your-project-id\";\n String locationId = \"us-east1\";\n String keyRingId = \"my-key-ring\";\n String keyId = \"my-key\";\n String keyVersionId = \"123\";\n String message = \"my message\";\n byte[] signature = null;\n verifyAsymmetricRsa(projectId, locationId, keyRingId, keyId, keyVersionId, message, signature);\n }",
"public void onClick(View v) {\n\t\t\tsyncApkInfos();\r\n\t\t\t\r\n\t\t}",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(MyInfoActivity.this, SignSetActivity.class);\n\t\t\t\tintent.putExtra(\"sign\", back_uib.getIntro());\n\t\t\t\tstartActivity(intent);\n\t\t\t}",
"String signITRByAssesse(String PAN,String xml, DigitalSignatureWrapper digitalSignatureWrapper) throws MissingPrivateKeyException,InvalidDigitalSignatureException,Exception;",
"public static void main(String[] args) throws Exception {\n// GameConfig gameConfig = new GameConfig();\n// gameConfig.setGameDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\GameApk\\\\product_anysdk-release.apk\");\n// gameConfig.setGameOutDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\GameFolder\");\n// gameConfig.setChannelDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\ChannelApk\\\\AnySDK_haima.apk\");\n// gameConfig.setChannelOutDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\ChannelFolder\");\n// gameConfig.setUnitDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\UniteFolder\");\n// gameConfig.setUnitOutDir(\"G:\\\\amber2\\\\03_tools\\\\AndriodPackage\\\\Release\\\\UniteApk\");\n// IniConfig iniConfig = new IniConfig();\n// gameConfig.setIniConfig(iniConfig);\n// Map<String, Config> configs = new HashMap<String, Config>(8);\n// iniConfig.setConfigs();\n\n decode(gameApk, gameFolder);\n decode(channelApk, channelFolder);\n mergeFolder(channelFolder, gameFolder);\n\n encodeApk(gameFolder, UniteApk + \"\\\\new.apk\");\n signApk(UniteApk + \"\\\\new.apk\");\n if (useAndroidSigner) {\n optimizeApk(UniteApk + \"\\\\new.apk\");\n } else {\n optimizeApk(UniteApk + \"\\\\Signed.apk\");\n }\n\n }",
"private void signMessage() {\n\n String messageText = messageTextArea.getText();\n SecureCharSequence secureCharSequence = new SecureCharSequence(currentPassword.getPassword());\n String signMessage = this.address.signMessage(messageText, secureCharSequence);\n signature.setText(signMessage);\n\n }",
"private String createSignedRSAToken(String jwtToken, String clientId, String clientKeyPairs, String keyPair) throws ParseException, JOSEException {\n log.info(\"Entering createSignedRSAToken\");\n log.info(\"clientKeyPairs: {}\", clientKeyPairs);\n\n Object signingKey;\n\n // To not affect current functionality, if no clientId parameter is passed,\n // sign with the default playground's \"testing_key\"\n JSONObject parseKeyPairs = JSONObjectUtils.parse(clientKeyPairs);\n log.info(\"Parsed clientKeyPairs\");\n\n if (clientId.equals(\"none\")) {\n signingKey = parseKeyPairs.get(\"default\");\n } else {\n signingKey = parseKeyPairs.get(clientId);\n if (signingKey == null) {\n throw new OauthException(\"Client ID to private key mapping not found\", HttpStatus.BAD_REQUEST);\n }\n }\n log.info(\"signingKey: {}\", signingKey);\n\n String[] splitString = jwtToken.split(\"\\\\.\");\n\n log.info(\"Size of splitString: {}\", splitString.length);\n\n log.info(\"~~~~~~~~~ JWT Header ~~~~~~~\");\n String base64EncodedHeader = splitString[0];\n JWSHeader head = JWSHeader.parse(new Base64URL(base64EncodedHeader));\n\n\n log.info(\"~~~~~~~~~ JWT Body ~~~~~~~\");\n String base64EncodedBody = splitString[1];\n Payload payload = new Payload(new Base64URL(base64EncodedBody));\n\n // RSA signatures require a public and private RSA key pair,\n // the public key must be made known to the JWS recipient to\n // allow the signatures to be verified\n\n log.info(\"keyPair: {}\", keyPair);\n\n net.minidev.json.JSONObject parsedRsa = JSONObjectUtils.parse(keyPair);\n\n Object getSigningKey = parsedRsa.get(signingKey);\n String signingKeyToString = String.valueOf(getSigningKey);\n\n RSAKey rsaJWK = RSAKey.parse(signingKeyToString);\n RSAPrivateKey prK = (RSAPrivateKey) rsaJWK.toPrivateKey();\n RSAPublicKey puK = (RSAPublicKey) rsaJWK.toPublicKey();\n\n byte[] privateKeyEnc = prK.getEncoded();\n byte[] privateKeyPem = java.util.Base64.getEncoder().encode(privateKeyEnc);\n String privateKeyPemStr = new String(privateKeyPem);\n\n // Create RSA-signer with the private key\n JWSSigner signer = new RSASSASigner(rsaJWK);\n\n // Prepare JWS object with simple string as payload\n JWSObject jwsObject = new JWSObject(head, payload);\n\n // Compute the RSA signature\n jwsObject.sign(signer);\n\n // To serialize to compact form, produces something like\n String s = jwsObject.serialize();\n log.info(\"Signed RSA Token:\");\n log.info(s);\n\n // To parse the JWS and verify it, e.g. on client-side\n jwsObject = JWSObject.parse(s);\n\n JWSVerifier verifier = new RSASSAVerifier(puK);\n\n log.info(\"Verify: {}\", jwsObject.verify(verifier));\n\n log.info(\"In RSA we trust! --> {}\", jwsObject.getPayload().toString());\n return s;\n }",
"public final boolean zza(PackageInfo packageInfo) {\n block6: {\n block5: {\n if (packageInfo == null) break block5;\n if (zzq.zza(packageInfo, false)) {\n return true;\n }\n if (zzq.zza(packageInfo, true)) break block6;\n }\n return false;\n }\n if (zzp.zzch(this.mContext)) {\n return true;\n }\n Log.w((String)\"GoogleSignatureVerifier\", (String)\"Test-keys aren't accepted on this build.\");\n return false;\n }",
"private static void jsonWebSignatureWithRSA() {\n\t\tRSAKey rsaJWK = null;\n\t\ttry {\n\t\t\trsaJWK = new RSAKeyGenerator(2048).keyID(\"123\").generate();\n\t\t\tRSAKey rsaPublicJWK = rsaJWK.toPublicJWK();\n\n\t\t\t// Create RSA-signer with the private key\n\t\t\tJWSSigner signer = new RSASSASigner(rsaJWK);\n\n\t\t\t// Prepare JWS object with simple string as payload\n\t\t\tJWSObject jwsObject = new JWSObject(\n\t\t\t\t\tnew JWSHeader.Builder(JWSAlgorithm.RS256).keyID(rsaJWK.getKeyID()).build(),\n\t\t\t\t\tnew Payload(\"In RSA we trust!\"));\n\n\t\t\t// Compute the RSA signature\n\t\t\tjwsObject.sign(signer);\n\n\t\t\t// To serialize to compact form, produces something like\n\t\t\t// eyJhbGciOiJSUzI1NiJ9.SW4gUlNBIHdlIHRydXN0IQ.IRMQENi4nJyp4er2L\n\t\t\t// mZq3ivwoAjqa1uUkSBKFIX7ATndFF5ivnt-m8uApHO4kfIFOrW7w2Ezmlg3Qd\n\t\t\t// maXlS9DhN0nUk_hGI3amEjkKd0BWYCB8vfUbUv0XGjQip78AI4z1PrFRNidm7\n\t\t\t// -jPDm5Iq0SZnjKjCNS5Q15fokXZc8u0A\n\t\t\tString s = jwsObject.serialize();\n\n// To parse the JWS and verify it, e.g. on client-side\n\t\t\tjwsObject = JWSObject.parse(s);\n\n\t\t\tJWSVerifier verifier = new RSASSAVerifier(rsaPublicJWK);\n\n\t\t\tif (jwsObject.verify(verifier)) {\n\t\t\t\tSystem.out.println(\"jwsObject.verify(verifier)==true\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"jwsObject.verify(verifier)== false\");\n\t\t\t}\n\n\t\t\tif (jwsObject.getPayload().toString().equals(\"In RSA we trust!\")) {\n\t\t\t\tSystem.out.println(\"jwsObject.getPayload().toString().equals(\\\"In RSA we trust!\\\") == true\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"jwsObject.getPayload().toString().equals(\\\"In RSA we trust!\\\") == false\");\n\t\t\t}\n\n\t\t} catch (JOSEException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void testEncryptionSHA1Symmetric() throws Exception {\n WSSecEncrypt builder = new WSSecEncrypt();\n builder.setKeyIdentifierType(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);\n builder.setSymmetricKey(key);\n builder.setEncryptSymmKey(false);\n builder.setUseKeyIdentifier(true);\n \n LOG.info(\"Before Encrypting EncryptedKeySHA1....\");\n Document doc = unsignedEnvelope.getAsDocument();\n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc); \n Document encryptedDoc = builder.build(doc, crypto, secHeader);\n \n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Encrypted message with ENCRYPTED_KEY_SHA1_IDENTIFIER:\");\n LOG.debug(outputString);\n }\n assertTrue(outputString.indexOf(\"#EncryptedKeySHA1\") != -1);\n \n LOG.info(\"After Encrypting EncryptedKeySHA1....\");\n verify(encryptedDoc);\n }",
"public byte[] addOTK(String authkey) {\n return new byte[2*32];\n }",
"@Test\n public void correctSignIn() {\n assertEquals(true, testBase.signIn(\"testName\", \"testPassword\"));\n }",
"byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;",
"private static String sign(String data, String secretKey)\n throws NoSuchAlgorithmException, InvalidKeyException,\n IllegalStateException, UnsupportedEncodingException {\n Mac mac = Mac.getInstance(ALGORITHM);\n mac.init(new SecretKeySpec(secretKey.getBytes(CHARACTER_ENCODING),\n ALGORITHM));\n byte[] signature = mac.doFinal(data.getBytes(CHARACTER_ENCODING));\n String signatureBase64 = new String(Base64.encodeBase64(signature),\n CHARACTER_ENCODING);\n return new String(signatureBase64);\n }",
"public abstract void verify(PublicKey key, String sigProvider)\n throws CRLException, NoSuchAlgorithmException,\n InvalidKeyException, NoSuchProviderException,\n SignatureException;",
"public void testEncryptionSHA1SymmetricBytes() throws Exception {\n WSSecEncrypt builder = new WSSecEncrypt();\n builder.setKeyIdentifierType(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);\n builder.setEphemeralKey(keyData);\n builder.setEncryptSymmKey(false);\n builder.setUseKeyIdentifier(true);\n \n LOG.info(\"Before Encrypting EncryptedKeySHA1....\");\n Document doc = unsignedEnvelope.getAsDocument();\n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc); \n Document encryptedDoc = builder.build(doc, crypto, secHeader);\n \n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Encrypted message with ENCRYPTED_KEY_SHA1_IDENTIFIER:\");\n LOG.debug(outputString);\n }\n assertTrue(outputString.indexOf(\"#EncryptedKeySHA1\") != -1);\n \n LOG.info(\"After Encrypting EncryptedKeySHA1....\");\n verify(encryptedDoc);\n }",
"@NonNull\n @Override\n protected KeyGenParameterSpec.Builder getKeyGenSpecBuilder(@NonNull final String alias, @NonNull final boolean isForTesting)\n throws GeneralSecurityException {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {\n throw new KeyStoreAccessException(\"Unsupported API\" + Build.VERSION.SDK_INT + \" version detected.\");\n }\n\n final int purposes = KeyProperties.PURPOSE_DECRYPT | KeyProperties.PURPOSE_ENCRYPT;\n\n return new KeyGenParameterSpec.Builder(alias, purposes)\n .setBlockModes(BLOCK_MODE_CBC)\n .setEncryptionPaddings(PADDING_PKCS7)\n .setRandomizedEncryptionRequired(true)\n .setKeySize(ENCRYPTION_KEY_SIZE);\n }",
"public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;",
"public static X509Certificate loadAndroidKeyAttestationCertificate() {\n String certificate =\n \"-----BEGIN CERTIFICATE-----\\n\"\n + \"MIIByTCCAXCgAwIBAgIBATAKBggqhkjOPQQDAjAcMRowGAYDVQQDDBFBbmRyb2lkIE\"\n + \"tleW1hc3Rl cjAgFw03MDAxMDEwMDAwMDBaGA8yMTA2MDIwNzA2MjgxNVowGjEYMBY\"\n + \"GA1UEAwwPQSBLZXltYXN0 ZXIgS2V5MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\"\n + \"FpsFUWID9p2QPAvtfal4MRf9vJg0tNc3 vKJwoDhhSCMm7If0FljgvmroBYQyCIbnn\"\n + \"Bxh2OU9SKxI/manPwIIUqOBojCBnzALBgNVHQ8EBAMC B4AwbwYKKwYBBAHWeQIBEQ\"\n + \"RhMF8CAQEKAQACAQEKAQEEBWhlbGxvBAAwDL+FPQgCBgFWDy29GDA6 oQUxAwIBAqI\"\n + \"DAgEDowQCAgEApQUxAwIBBKoDAgEBv4N4AwIBA7+DeQQCAgEsv4U+AwIBAL+FPwIF \"\n + \"ADAfBgNVHSMEGDAWgBQ//KzWGrE6noEguNUlHMVlux6RqTAKBggqhkjOPQQDAgNHAD\"\n + \"BEAiBKzJSk 9VNauKu4dr+ZJ5jMTNlAxSI99XkKEkXSolsGSAIgCnd5T99gv3B/IqM\"\n + \"CHn0yZ7Wuu/jisU0epRRo xh8otA8=\\n\"\n + \"-----END CERTIFICATE-----\";\n return createCertificate(certificate);\n }",
"public static void getKeyHashFacebook(Context context) {\n // Add code to print out the key hash\n try {\n PackageInfo info = context.getPackageManager().getPackageInfo(\n context.getPackageName(),\n PackageManager.GET_SIGNATURES);\n for (Signature signature : info.signatures) {\n MessageDigest md = MessageDigest.getInstance(\"SHA\");\n md.update(signature.toByteArray());\n Log.d(\"KeyHash:\", Base64.encodeToString(md.digest(), Base64.DEFAULT));\n }\n } catch (PackageManager.NameNotFoundException | NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n }",
"public void setKeyInfo(PGPKeyInfo pgpKeyInfo) {\n pgpSigner.setKeyInfo(pgpKeyInfo);\n }",
"public void submit(View view) {\n new MercadoPago.StartActivityBuilder()\n .setActivity(this)\n .setPublicKey(\"444a9ef5-8a6b-429f-abdf-587639155d88\")\n .startGuessingCardActivity();\n\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }",
"private void signIn() {\n Intent signInIntent = mGoogleSignInClient.getSignInIntent();\n startActivityForResult(signInIntent, RC_SIGN_IN);\n }"
] | [
"0.611392",
"0.5966324",
"0.5629688",
"0.5567269",
"0.545231",
"0.5434539",
"0.5414986",
"0.52910054",
"0.5176844",
"0.5168163",
"0.51590633",
"0.5134598",
"0.5121925",
"0.5060901",
"0.5057051",
"0.5045046",
"0.50309855",
"0.5030504",
"0.49653932",
"0.49608994",
"0.49368516",
"0.4867102",
"0.484299",
"0.48413253",
"0.48281097",
"0.47867414",
"0.47807968",
"0.47724625",
"0.47708535",
"0.47663292",
"0.47644895",
"0.47528395",
"0.4751493",
"0.4733879",
"0.47258192",
"0.47231668",
"0.46978888",
"0.46941367",
"0.46871862",
"0.4684332",
"0.46762338",
"0.46553767",
"0.46430725",
"0.46397966",
"0.46289122",
"0.46284777",
"0.46065778",
"0.46060267",
"0.46021152",
"0.4595047",
"0.4569439",
"0.45464593",
"0.4542093",
"0.45332938",
"0.45257908",
"0.4512752",
"0.4510401",
"0.45011583",
"0.45002934",
"0.4498723",
"0.44944057",
"0.4489283",
"0.44831935",
"0.44642606",
"0.44477335",
"0.44410732",
"0.44396797",
"0.44136047",
"0.4404752",
"0.44041404",
"0.44022766",
"0.43926126",
"0.4388128",
"0.43802503",
"0.4370399",
"0.43693113",
"0.43680888",
"0.43569416",
"0.43519387",
"0.4349026",
"0.43485323",
"0.43475416",
"0.434573",
"0.4345101",
"0.43396747",
"0.4336344",
"0.4331499",
"0.4328751",
"0.4323731",
"0.43155858",
"0.43144113",
"0.43134728",
"0.4307861",
"0.4297581",
"0.42975265",
"0.42948934",
"0.42894113",
"0.428503",
"0.428503",
"0.428503"
] | 0.69117826 | 0 |
Used by server to append a message to a chat client. | void appendMessage(String message) throws RemoteException; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void internalAddToChatWindow(String message) {\n jChatConvo.append(message + \"\\n\");\n }",
"public void clientToServerChatMessage(String message){\n String chatMessage = message;\n System.out.println(\"chatmessage\" + chatID + \" \" + chatMessage);\n toServer.println(\"chatmessage\" + chatID + \" \" + chatMessage);\n toServer.flush();\n }",
"public void addMessage(String m) {\n chat.append(\"\\n\" + m);\n }",
"public void chatMsg(String msg)\n\t{\n\t\tchatArea.append(msg + \"\\n\");\n\t}",
"private synchronized void addMessage(String user, String message) {\n\t\tchatData.addElement(new ChatMessage(user, message));\n\t\tif (chatData.size() > 20)\n\t\t\tchatData.removeElementAt(0);\n\t}",
"public void appendChatBox(String s){\r\n\t\tsynchronized(msgToAppend){ // synchronized to maintain thread-safety\r\n\t\t\tmsgToAppend.append(s);\r\n\t\t\ttextArea.append(msgToAppend.toString() + \"\\n\");\r\n\t\t\tmsgToAppend.setLength(0);\r\n\t\t}\r\n\t}",
"public void addMessage(String text) {\n\t\tchatMessages.add(text);\n\t\tlstChatMessages.setItems(getChatMessages());\n\t\tlstChatMessages.scrollTo(text);\n\t}",
"public void append(String str, String sender) {\n\t\tchatView.appendText(sender + \":\" + \"\\n\");\n\t\tchatView.appendText(str + \"\\n\\n\");\n\t\tchatView.selectPositionCaret(chatView.getText().length()-1);\n\t\tchatBox.setText(\"\");\n\t}",
"private void sendMessageAndAppend(String channel, String message)\n\t{\n\t\tString time = new java.util.Date().toString();\n\n\t\tsendMessage(channel, message);\n\t\tguiInterface.appendToChat(time + \" - \" + this.getName() + \": \" + message);\n\t}",
"public void addMessage (Message message)\r\n\t{\r\n\t\tString bcast_log_text = ucast_log.getText() ;\r\n\t\tString new_text = Message.getNickname(message.getSender()) + \" : \" + message.getMessage() + \"\\n\";\r\n\t\tucast_log.setText(bcast_log_text + new_text);\r\n\t}",
"public void addMessage(ChatMessage message) {\n Log.w(TAG, \"addMessage to chat\");\n chatMessages.add(message);\n adapter.notifyDataSetChanged();\n }",
"public void sendChat(String client, String message) {\n\t\t//enqueue(\"PRIVMSG #\"+myself+\" :.w \"+client + \" imGlitch \" + message); //whisper\n\t\tenqueue(\"PRIVMSG #\"+Executable.targetChannel+\" :imGlitch (@\"+client + \") \" + message);\n\t}",
"void append(final String msg) {\n Preconditions.checkState(isOpen);\r\n\r\n message.append(msg);\r\n isDirty = true;\r\n }",
"public void writeChatServerMessage(String message) {\n\t\tSystem.out.println(\"WRITING \" + message);\n\t\tif(m_chatSession != null)\n\t\t\tm_chatSession.write(message);\n\t}",
"public void appendMessage(String response) {\n\t\tthis.append(response + newline);\n\t}",
"public void sendChat(String message) {\r\n connection.chat(message);\r\n }",
"@Override\n\tpublic void addClient(Client c, String msg) throws RemoteException {\n\t\tif(!users.contains(c)){\n\t\t\tusers.add(c);\n\t\t\tfor(int i=0;i<users.size();i++) {\t \n\t //sendMessage((Client)users.get(i),msg);\n\t\t\t\tSystem.out.println(users.get(i).getName());\n\t }\n\t //users.add(c);\n\t }\n\t}",
"public void addToChatWindow(String message) {\n SwingUtilities.invokeLater(() -> {\n this.internalAddToChatWindow(message);\n });\n }",
"public void addMessage(String username, String message) {\n messagesArea.append(\"\\n\" + \"[\" + username + \"] \" + message);\n messagesArea.setCaretPosition(messagesArea.getDocument().getLength());\n }",
"@Override\r\n\tpublic void addMessage(String ChatMessageModel) {\n\t\t\r\n\t}",
"private void sendMessageToClient(String messageToClient){\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n output.println(\"\\n\" + \"Server: \" + messageToClient);\n output.flush();\n }\n });\n }",
"public void sendChat(String message) {\n\t\tenqueue(\"PRIVMSG #\"+Executable.targetChannel+\" :imGlitch \"+message);\n\t}",
"public void addMessage(String message, String chatID) {\n if (threadName.equals(chatID)) {\n Label text = new Label(message);\n text.setWrapText(true);\n StackPane messageBox = new StackPane();\n messageBox.getChildren().addAll(new Rectangle(), text);\n if (message.split(ServerConstants.USERNAME_DELIMITER)[0].equals(accountDisplay.getUsername())) {\n messageBox.getStyleClass().add(\"current-user-message\");\n } else {\n messageBox.getStyleClass().add(\"remote-message\");\n }\n history.add(messageBox, 0, history.getRowCount());\n }\n }",
"public void chat ( String message ) {\n\t\texecute ( handle -> handle.chat ( message ) );\n\t}",
"@Override\n\tpublic void SendMessage(String message) {\n\t\t\n\t\ttry\n\t\t{\n\t\tprintWriters.get(clients.get(0)).println(message);\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n\t}",
"public void communicate(Poll poll, String message){\n poll.getChat().add(message);\n }",
"private void ReceiveFromOther(String message){\n ChatMessage chatMessage = new ChatMessage(message, false, false);\n mAdapter.add(chatMessage);\n\n }",
"private void showMessage() throws IOException {\n String msg = fromServer.readUTF();\n chatArea.append(msg + \"\\n\");\n // set the chat area always keep focus at bottom\n chatArea.setCaretPosition(chatArea.getDocument().getLength());\n }",
"@Override\r\n\t\t\tpublic void onChat(String message) {\n\r\n\t\t\t}",
"public void addMessage(String message);",
"public void addChatMessage(IChatComponent p_145747_1_)\n {\n this.field_70009_b.append(p_145747_1_.getUnformattedText());\n }",
"public void addMessage() {\n }",
"@Override\n\tpublic void newMsg(String msg) throws RemoteException {\n\t\tchathistory.add(new chatmessage<String>(msg + \"\\n\"));\n\t}",
"@Override\n public void escreverMensagem(String mensagem) {\n chat.appendText(mensagem);\n }",
"@Override\n public void add(ChatMessage object) {\n chatMessageList.add(object);\n super.add(object);\n }",
"public void requestAddUserToChat(String otherUsername){\n System.out.println(\"addtochat\" + \" \" + chatID + \" \" + otherUsername);\n toServer.println(\"addtochat\" + \" \" + chatID + \" \" + otherUsername);\n toServer.flush();\n }",
"public synchronized void broadcastMsg(String msg) {\n try (BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(\n new FileOutputStream(\"chatHistory.txt\", true)));) {\n bufferedWriter.append(msg).append(\"\\n\");\n } catch (IOException e) {\n LOG.error(\"Try save history to file\", e);\n e.printStackTrace();\n }\n\n for (ClientHandler clientHandler : clients) {\n clientHandler.sendMsg(msg);\n }\n }",
"public void sendMsgToClient() {\n\n try {\n\n writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true);\n\n Log.d(TAG, \"The transmitted data:\" + msg);\n\n writer.println(msg);\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }",
"private void addMessage(final ChatMessage chatMessage)\n\t{\n\t\tfinal SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd MMMM HH:mm:ss\", Locale.US);\n\t\tfinal Date date = chatMessage.getSentDate();\n\t\tprint(\"\\n\" + dateFormat.format(date) + \", \" + chatMessage.getAuthor() + \":\");\n\t\tprint(\"\\n\" + chatMessage.getContent() + \"\\n\");\n\t}",
"public void setChatNachricht(String msg) {\n\t\tchatArea.append(msg);\n\t}",
"@Override\r\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tchat.append(s);\r\n\t\t\t\t\t}",
"public void addChatToRoom(String username, String text)\r\n\t{\r\n\t\t// make sure we're not sending the current user's recent chat again\r\n\t\tif(!basicAvatarData.getUsername().equals(username))\r\n\t\t{\r\n\t\t\ttheGridView.addTextBubble(username, text, 100);\r\n\t\t}\r\n\t}",
"private void displayMsg(String msg) {\n //add message to chatList array\n chatList.add(msg);\n //display message in GUI\n mg.appendRoom(msg); \n }",
"public void addMessage(ChatMessage message) {\n sqLiteHandler.addMessageToDB(message, this);\n messages.add(message);\n }",
"@Override\n\tpublic void messageFromServer(String message, SimpleAttributeSet keyWord) throws RemoteException {\t\t\t\n\t\ttry { \n\t\t\t// first argument sets the position of the meesage to go in\n \tchatGUI.doc.insertString(chatGUI.doc.getLength(), message + \"\\n\", keyWord); \n }\n catch (BadLocationException e){\n \tSystem.out.print(e);\n } \n\n\t}",
"@Override\n\tpublic void onClientMessage(ClientThread client, String msg) {\n\t\ttry {\n\t\t\tlockClients.readLock().lock();\n\t\t\tLocalDateTime now = LocalDateTime.now();\n\t\t\tString toSend = \"[\"+dtf.format(now)+\"] \"+client.getClientName()+\" : \"+msg;\n\t\t\tfor (ClientThread ct : this.clients) {\n\t\t\t\tct.sendMessage(toSend);\n\t\t\t}\n\t\t\taddToHistory(toSend);\n\t\t} finally {\n\t\t\tlockClients.readLock().unlock();\n\t\t}\n\t}",
"public void addClient() throws IOException {\n BufferedReader in;\n Socket clientSocket; //pour chaque nouveau client\n System.out.println(\"New Client connected.\");\n clientSocket = serverSocket.accept();\n out = new PrintWriter(clientSocket.getOutputStream());\n in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n tabClientsout.addElement(out);\n Runnable r = new recevoir(out, in);\n // genere le Thread pour le nouveau client\n new Thread(r).start();\n }",
"public static void opChat(Player player, String message) {\n //remove the # from the message\n String replaceFirst = message.substring(1);\n \n BaseComponent[] baseComp = assembleChatMessage(createNamePredicate(player.getName(), player.getDisplayName(), ChatColor.YELLOW + \"[OP] \" + ChatColor.RESET, \":\", ChatColor.WHITE), replaceFirst);\n opBroadcast(baseComp);\n }",
"public static void append(String path, String message) {\t\r\n\t\twrite(path, read(path).concat(\"\\n\" + message));\r\n\t}",
"private void sendMessage(String message){\n try{\n output.writeObject(nickname+\" : \" + message);\n output.flush();\n showMessage(\"\\n\"+nickname+\" : \" + message);\n }catch(IOException ioException){\n chatWindow.append(\"\\n Oops! Something went wrong!\");\n }\n }",
"private synchronized void addMessage(String user, String message,\n\t\t\tString[] receivers) {\n\t\tif (receivers.length > 0)\n\t\t\tchatData.addElement(new ChatMessage(user, message, receivers));\n\t\telse\n\t\t\tchatData.addElement(new ChatMessage(user, message));\n\t\tif (chatData.size() > 20)\n\t\t\tchatData.removeElementAt(0);\n\t}",
"public void sendChatMessage(String chatMessage) throws IOException {\r\n\t\tif (chatMessage.length() > 2\r\n\t\t\t\t&& chatMessage.substring(0, 2).equals(\"/w \")) { //$NON-NLS-1$\r\n\t\t\tchatMessage = \"/w [\" + client.getUsername() + \"]: \" //$NON-NLS-1$ //$NON-NLS-2$\r\n\t\t\t\t\t+ chatMessage.substring(3);\r\n\t\t} else {\r\n\t\t\tchatMessage = \"[\" + client.getUsername() + \"]: \" + chatMessage; //$NON-NLS-1$ //$NON-NLS-2$\r\n\t\t}\r\n\t\tsendMessage(new Message(chatMessage, client.getID()));\r\n\t}",
"public void sendToServer(Message message){\n\t\ttry {\n\t\t\tSystem.out.println(message._sender+\" to \"+message._receiver+\": \"+message._message);\n\t\t\tFileUtils.writeLineInFile(message._sender+\" to \"+message._receiver+\": \"+message._message, new File(FileUtils.getSettingsProperty(\"path\")+\"/chatlog.txt\"));\n\t\t\t_outputStream.writeObject(message);\n\t\t\t_main._clientMenuController.updateChatlog();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void addMessage(TextMessagePacket messagePacket) {\n \n DefaultListModel m = (DefaultListModel) this.chatList.getModel();\n m.addElement(messagePacket);\n this.scrollDown();\n this.revalidate();\n this.repaint();\n \n }",
"@Override\n\tpublic void onClientConnection(ClientThread client) {\n\t\t//tcp.client.sendMessage(\"vous êtes connecté en tant que \" + tcp.client.getClientName());\n\t\ttry{\n\t\t\tlockHistory.readLock().lock();\n\t\t\tfor(String oldMessage : history){\n\t\t\t\tclient.sendMessage(oldMessage);\n\t\t\t}\n\t\t} finally {\n\t\t\tlockHistory.readLock().unlock();\n\t\t}\n\n\t\ttry {\n\t\t\tlockClients.writeLock().lock();\n\t\t\tthis.clients.add(client);\n\n\t\t} finally {\n\t\t\tlockClients.writeLock().unlock();\n\t\t}\n\n\t\ttry{\n\t\t\tlockClients.readLock().lock();\n\t\t\tLocalDateTime now = LocalDateTime.now();\n\t\t\tString toSend = \"[\"+dtf.format(now)+\"] \"+client.getClientName()+\" has joined the chat\";\n\t\t\tfor (ClientThread c : clients) {\n\t\t\t\tc.sendMessage(toSend);\n\t\t\t}\n\t\t\taddToHistory(toSend);\n\t\t} finally {\n\t\t\tlockClients.readLock().unlock();\n\t\t}\n\t}",
"public void newChatLine(String line) {\n\t\tSystem.out.println(line);\n\t}",
"@Override\n public void recibirMensaje(Mensaje mensaje) {\n mensajes.append(mensaje);\n }",
"public synchronized void broadcast(String message, String username)\r\n {\r\n\r\n\r\n if (username == \"server\")\r\n {\r\n\r\n }\r\n //this was for private chat\r\n else\r\n {\r\n int k = 0;\r\n while (k < clientList.size())\r\n {\r\n if(clientList.get(k).username.equals(username))\r\n {\r\n try \r\n {\r\n OutputStream os = clientList.get(k).socket.getOutputStream();\r\n OutputStreamWriter osw = new OutputStreamWriter(os);\r\n BufferedWriter bw = new BufferedWriter(osw);\r\n bw.write(message);\r\n bw.flush();\r\n }\r\n catch(IOException e)\r\n {\r\n System.out.println(\"Error setting up private chat\");\r\n }\r\n }\r\n }\r\n }\r\n String messageLf = \" \" + message + \"\\n\";\r\n\r\n\r\n System.out.print(messageLf);\r\n for(int i = clientList.size(); --i >= 0;)\r\n {\r\n ClientProcess ct = clientList.get(i);\r\n\r\n if(!ct.writeMessage(messageLf))\r\n {\r\n clientList.remove(i);\r\n displayMessage(\"Disconnected Client \" + ct.username + \" removed from list.\");\r\n }\r\n }\r\n }",
"public static void append(String text) {\n messageLogger.add(text);\n }",
"private void sendMessage(String content, String room) {\n }",
"private void createNewChat() {\n if (advertisement.getUniqueOwnerID().equals(dataModel.getUserID())) {\n view.showCanNotSendMessageToYourselfToast();\n return;\n }\n\n dataModel.createNewChat(advertisement.getUniqueOwnerID(), advertisement.getOwner(), advertisement.getUniqueID(),\n advertisement.getImageUrl(), chatID -> view.openChat(chatID));\n }",
"@Override\n public void addMessage(String message) {\n messages.add(message);\n }",
"public void addContent(String msg) {\n\t\tthis.textArea.append(msg + \"\\n\");\r\n\t}",
"private synchronized void broadcast(String message){\n //add dd-MM-yyyy HH:mm:ss to the message, each starting on a new line\n String messageLf = sdf.format(new Date()) + \" \" + message + \"\\n\";\n // display message in GUI\n displayMsg(messageLf);\n //loop in reverse order in case a client disconnects & needs to be removed\n for (int i = al.size(); --i >= 0;){\n ClientThread ct = al.get(i);\n // try to write to the client, if fail, remove client from the list\n if (!ct.writeMsg(messageLf)) {\n al.remove(i);\n displayEvent(\"Disconnected Client \" + ct.username +\n \" removed from list.\");\n }\n }\n }",
"protected void sendMessage(String msg) {\n message = msg; \n newMessage = true;\n }",
"public synchronized void write(String message) {\n\t\tcontent.add(message);\n\n\t\tnotify();\n }",
"public void writeMassege() {\n m = ChatClient.message;\n jtaChatHistory.setText(\"You : \" + m);\n //writeMassageServer();\n }",
"@Override\n\tpublic void receive(String message) {\n\t\tgetReceiveArea().append(message + \"\\n\");\n\t}",
"public Message addMessage(Message p);",
"public void requestChat(String otherUsername) {\n System.out.println(\"Requesting chat with \" + otherUsername);\n toServer.println(\"newchat\" + \" \" + username + \" \" + otherUsername);\n toServer.flush();\n }",
"public synchronized void sendMsgToClient(String message, ClientThread clientThread){\n String time = simpleDateFormat.format(new Date());\n String messageLf = time + \" | \" + message + \"\\n\";\n System.out.print(messageLf);\n\n if(!clientThread.writeMsg(messageLf)) {\n clientThreads.remove(clientThread);\n display(\"Disconnected Client \" + clientThread.username + \" removed from list.\");\n }\n\n //return true;\n }",
"static synchronized void SendMessage(String message, ClientHandler user, boolean same) throws IOException\r\n {\r\n String mes = message;\r\n if(!same)\r\n mes = user.username + \": \" + mes;\r\n //System.out.println(mes);\r\n\r\n chatLogWriter.write(mes + \"\\n\");\r\n chatLogWriter.flush();\r\n\r\n for (ClientHandler ch : users)\r\n {\r\n if(!ch.equals(user))\r\n ch.WriteCypherMessage(mes);\r\n else if(same)\r\n ch.WriteCypherMessage(message);\r\n }\r\n }",
"public void sendMessageToClient(Object message, String username) {\n\n }",
"public static void addMessage(String clientId, String msg) {\n\t\taddMessage(clientId, msg, \"\");\n\t}",
"public void sendMessage(String message) {\n\t\tsocketTextOut.println(message);\n\t\tsocketTextOut.flush();\n\t}",
"public void sendMessage() {\n String userMessage = textMessage.getText();\n if (!userMessage.isBlank()) {//проверяю а есть ли что то в текстовом поле\n textMessage.clear();//очищаю текстовое поле на форме\n\n //пока оставлю\n //sb.append(userMessage).append(\"\\n\");\n\n //в общее поле добавляю сообщение\n areaMessage.appendText(userMessage+\"\\n\");\n }\n\n }",
"public boolean addMessageToChat (Message msg) {\n Logger.write(\"VERBOSE\", \"DB\", \"addMessageToChat(...)\");\n \n try {\n boolean duplicate = false;\n \n String[][] messagesInConvo = getConversationMessages(msg.PCHATgetConversationID());\n for (int i = 0; i < messagesInConvo.length; i++)\n if (messagesInConvo[i][1].equals(Long.toString(msg.getTimestamp())) && messagesInConvo[i][2].equals(msg.PCHATgetText()))\n duplicate = true;\n \n if (!duplicate) {\n execute(DBStrings.addMessageToConvo.replace(\"__convoID__\", msg.PCHATgetConversationID())\n .replace(\"__sendersKey__\", Crypto.encodeKey(getSignatory(msg)))\n .replace(\"__msgText__\", msg.PCHATgetText())\n .replace(\"__time__\", Long.toString(msg.getTimestamp())));\n }\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n return false;\n }\n \n return true;\n }",
"@Override\n public void handleTextMessage(WebSocketSession client, TextMessage message) throws IOException {\n System.out.println(\"connecting\");\n String [] parseMessage = message.getPayload().split(\" \",2);\n boolean found = false;\n System.out.println(parseMessage[0]);\n System.out.println(parseMessage[0].equals(\"join\"));\n if (parseMessage[0].equals(\"join\")) {\n System.out.println(\"joinning\");\n for (Room room: rooms) {\n System.out.println(room.name);\n if (room.name.equals(parseMessage[1])) {\n System.out.println(\"room found\");\n room.addClient(client);\n\n found = true;\n }\n }\n if (found == false) {\n System.out.println(\"making new room\");\n Room newRoom = new Room(parseMessage[1], client);\n rooms.add(newRoom);\n }\n TextMessage newMessage;\n String json = \"{\\\"user\\\" : \\\"\" + parseMessage[0] + \"\\\", \\\"message\\\": \\\"\"\n + parseMessage[1] + \"\\\"}\";\n newMessage = new TextMessage(json);\n client.sendMessage(newMessage);\n\n }else{\n for (Room room: rooms) {\n if(room.clientInRoom(client))\n System.out.println(\"send message\");\n room.forwardMessage(message);\n }\n\n\n }\n }",
"public void getChatMessage(String text) {\n\t\tint idplayer = gamecontroller.getPlayerController().getPlayerID();\n\t\tChatM.writeChatToDatabase(idplayer, text);\n\t}",
"@Override\n public void react(@NotNull ClientConnection client) throws IOException {\n String[] params = message.getHeader().split(\" \");\n if( params.length != getMessagesSize || client.getClientID() == null )\n return ;\n int roomID = Integer.parseInt(params[1]);\n List<String> messages = UserRequests.getMessagesFromRoom(roomID, nMessage);\n if (messages == null) return;\n assert client.getStreamMessage() != null;\n client.getStreamMessage().write(\n new Message(getMessagesType + \" \" + roomID, messages));\n }",
"public void addMessage(String msg){messages.add(msg);}",
"public void serverSendMessageToUser(String username, String message) {\r\n \t\tServerCommand serverCommand = new PrivateMessageServerCommand(message, \"server\", username, null);\r\n \r\n \t\tRoMClient userClient = this.clients.getClientByUsername(username);\r\n \r\n \t\tthis.sendCommandToClient(userClient, serverCommand);\r\n \t}",
"@SuppressWarnings(\"unchecked\")\n\tpublic void addChatLine(String name, String line){\n\t\t@SuppressWarnings(\"rawtypes\")\n\t\tListBox lb = nifty.getScreen(\"hud\").findNiftyControl(\"listBoxChat\",ListBox.class);\n\t\tif (line.length() + name.length() > 55){\n\t\t\twhile (line.length() > 35){\n\t\t\t\tString splitLine = line.substring(0,35);\n\t\t\t\tlb.addItem(\"<\"+name+\">\"+\": \"+splitLine);\n\t\t\t\tline = line.substring(35);\n\t\t\t}\n\t\t}\n\t\tlb.addItem(\"<\"+name+\">\"+\": \"+line);\n\t\tlb.showItem(lb.getItems().get(lb.getItems().size()-1));\n\t}",
"public void addMessage( String buddyId, String buddyNick, String text, int type ) {\n text = \"[p]\".concat( text ).concat( \"[/p]\" );\n /** Checking for type in settings **/\n switch ( type ) {\n case TYPE_STATUS_CHANGE: {\n if ( !MidletMain.statusChange ) {\n return;\n }\n break;\n }\n case TYPE_XSTATUS_READ: {\n if ( !MidletMain.xStatusRead ) {\n return;\n }\n break;\n }\n case TYPE_MSTATUS_READ: {\n if ( !MidletMain.mStatusRead ) {\n return;\n }\n break;\n }\n case TYPE_FILETRANSFER: {\n if ( !MidletMain.fileTransfer ) {\n return;\n }\n break;\n }\n }\n /** Appending message **/\n ChatItem item = new ChatItem( MidletMain.serviceMessagesFrame.pane,\n buddyId, buddyNick, TimeUtil.getTimeString( TimeUtil.getCurrentTimeGMT(), true ),\n type == TYPE_FILETRANSFER ? ChatItem.TYPE_FILE_TRANSFER : ChatItem.TYPE_INFO_MSG, text );\n messages.push( item );\n if ( messages.size() > messagesCount ) {\n messages.removeElementAt( 0 );\n }\n /** Checking for screen exist **/\n if ( MidletMain.serviceMessagesFrame.pane.items.equals( messages )\n && MidletMain.screen.activeWindow.equals( MidletMain.serviceMessagesFrame ) ) {\n MidletMain.serviceMessagesFrame.updateItemsLocation( true );\n }\n }",
"@Override\n\t\t\t\t\tpublic void sendMessage(String message) {\n\t\t\t\t\t\tString toSend = \"<append><topic>\" + xmlData.get(\"topic\") +\"</topic><user>\" + username + \"</user><msg>\" + message + \"</msg></append>\";\n\t\t\t\t\t\tsendData(toSend);\n\t\t\t\t\t}",
"private void joinNewClient() {\r\n\t\t\tString clientName = _clientView.getUserName();\r\n\t\t\tif(clientName == null)\r\n\t\t\t\treturn;\r\n\t\t\t_clientModel.connectToServer();\r\n\t\t\t_clientModel.joinChat(clientName);\r\n\t\t}",
"abstract void addMessage(Message message);",
"public void sendMessage2Client(String msg){\n\t\t\t\n\t\t\toutPrintStream.println(msg);\n\t\t\t\n\t\t}",
"private void sendMessageToClient(String message) {\n try {\n outputStream.writeObject(message);\n outputStream.flush();\n } catch (IOException e) {\n System.out.println(\"Erreur lors de l'envoi du message au client\");\n }\n }",
"private void sendMessage(String message){\n\t\ttry{\n\t\t\toutput.writeObject(\"Punk Ass Server: \" + message);\n\t\t\toutput.flush();\n\t\t\tshowMessage(\"\\nPunk Ass Server: \" + message); \n\t\t}catch(IOException ioe){\n\t\t\tchatWindow.append(\"\\n Message not sent, try again or typing something else\");\n\t\t\t\n\t\t}\n\t\t\n\t}",
"private synchronized void sendToClient(PrintWriter pw, String message)\n {\n pw.write(message + \"\\n\");\n pw.flush();\n }",
"public void sendMessage(String message) {\n try {\n bos.write(message);\n bos.newLine();\n bos.flush();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void write(String message) {\n System.out.println(\"Sent \" + message + \" to client \" + client + \".\");\n out.println(message);\n }",
"public void enter_chat_room(String line) {\n int start = line.indexOf(\" \") +1;\n String chat_name = line.substring(start);\n HashMap new_chat_room = null;\n\n try{\n if(chat_room.containsKey(chat_name)) {\n \n synchronized(chat_room) {\n cur_chat_room.remove(client_ID);\n new_chat_room = (HashMap)chat_room.get(chat_name);\n cur_chat_room = new_chat_room;\n new_chat_room.put(client_ID,client_PW);\n }\n \n clearScreen(client_PW);\n client_PW.println(\"Entered to \" + chat_name);\n readchat(chat_name);\n client_PW.flush();\n } else {\n client_PW.println(\"Invalid chat room\");\n client_PW.flush();\n }\n } catch (Exception e) {\n client_PW.println(e);\n }\n }",
"public void addMessage() throws IOException {\r\n\t\tSystem.out.println(\"Enter the message to be decrypted\");\r\n\t\tmessage = this.readStringFromCmd();\r\n\t}",
"@Override\n public boolean sendMessage(ChatMessage chatMessage){\n return true;\n }",
"public void recieveMessage( final String message ) {\r\n messages.add( message );\r\n }",
"@Override\r\n \tpublic void clientConnectedCallback(RoMClient newClient) {\r\n \t\t// Add new client and start listening to this one\r\n \t\tthis.clients.addClient(newClient);\r\n \r\n \t\t// Create the ReceiveClientCommandThread for this client\r\n \t\tReceiveClientCommandThread receiveCommandThread = new ReceiveClientCommandThread(newClient, this, this);\r\n \t\treceiveCommandThread.start();\r\n \r\n \t\t// Create the CommandQueue Thread for this client\r\n \t\tClientCommandQueueThread commandQueueThread = new ClientCommandQueueThread(newClient);\r\n \t\tcommandQueueThread.start();\r\n \t}",
"public abstract void newChatMembersMessage(Message m);",
"private void sendMessage(String message) {\n if (mChatService.getState() != BluetoothChatService.STATE_CONNECTED) {\n // Toast.makeText(this, R.string.not_connected, Toast.LENGTH_SHORT).show();\n return;\n }\n\n if (message.length() > 0) {\n byte[] send = message.getBytes();\n mChatService.write(send);\n mOutStringBuffer.setLength(0);\n\n }\n }"
] | [
"0.72294194",
"0.721611",
"0.70931756",
"0.6970372",
"0.6701666",
"0.669321",
"0.66673934",
"0.66618866",
"0.66391265",
"0.6625869",
"0.662208",
"0.6608538",
"0.66023326",
"0.65966684",
"0.6560429",
"0.6544175",
"0.65143985",
"0.6485376",
"0.6472667",
"0.64673257",
"0.6459025",
"0.645021",
"0.6447748",
"0.64411235",
"0.64296925",
"0.6413175",
"0.64095765",
"0.63898313",
"0.6361592",
"0.6351578",
"0.6342507",
"0.6331737",
"0.6281831",
"0.62794584",
"0.62721354",
"0.62720877",
"0.626842",
"0.62302417",
"0.62244403",
"0.62059206",
"0.61810195",
"0.617957",
"0.6170253",
"0.61702293",
"0.6160637",
"0.6158251",
"0.6143388",
"0.61328125",
"0.6125667",
"0.6096502",
"0.6092526",
"0.60556406",
"0.60531175",
"0.6050685",
"0.60413265",
"0.6039454",
"0.603634",
"0.5996826",
"0.5982306",
"0.5970037",
"0.5957755",
"0.5956048",
"0.5955967",
"0.5955221",
"0.59518653",
"0.59508336",
"0.5946733",
"0.59297156",
"0.59275055",
"0.59241134",
"0.59216166",
"0.5919393",
"0.5916927",
"0.5907129",
"0.59024954",
"0.5900033",
"0.5892848",
"0.5891206",
"0.5889922",
"0.58895427",
"0.58817035",
"0.5881531",
"0.5876989",
"0.5869717",
"0.5869591",
"0.5869552",
"0.58650845",
"0.58575195",
"0.5839631",
"0.5836938",
"0.58355033",
"0.58334637",
"0.58262366",
"0.5826174",
"0.5806156",
"0.5804793",
"0.5797743",
"0.5796427",
"0.57953525",
"0.57918257"
] | 0.66914386 | 6 |
TODO Autogenerated method stub | public void start() {
System.out.println("开启系统1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public void stop() {
System.out.println("结束系统1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
lockScreenImageView.setAlpha(1.0f); /lockScreenImageView.animate() .alpha(1.0f) .translationX(0) .setDuration(getResources().getInteger(android.R.integer.config_mediumAnimTime)); shouldHide = true; shouldClick = true; hideIcon(); /if (params.x + iconWidth/2 <= screenWidth / 2) leftToRightAnimator.start(); else rightToLeftAnimator.start(); alphaAnimator.start(); | public void showIcon(){
lockScreenImageView.animate()
.alpha(1.0f)
.setDuration(iconHidingAnimationTime);
shiftIconToScreenSide(2, -delta/2,
screenWidth - iconWidth - delta/2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onClick(View view) {\n if(view.getId() == R.id.icon1){\n if(iconId == 1){\n iconId = 0;\n findViewById(R.id.icon1).setAlpha(1);\n } else {\n iconId = 1;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon1).setAlpha(1);\n }\n if(view.getId() == R.id.icon2){\n if(iconId == 2){\n iconId = 0;\n findViewById(R.id.icon2).setAlpha(1);\n } else {\n iconId = 2;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon2).setAlpha(1);\n }\n if(view.getId() == R.id.icon3){\n if(iconId == 3){\n iconId = 0;\n findViewById(R.id.icon3).setAlpha(1);\n } else {\n iconId = 3;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon3).setAlpha(1);\n }\n if(view.getId() == R.id.icon4){\n if(iconId == 4){\n iconId = 0;\n findViewById(R.id.icon4).setAlpha(1);\n } else {\n iconId = 4;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon4).setAlpha(1);\n }\n if(view.getId() == R.id.icon5){\n if(iconId == 5) {\n iconId = 0;\n findViewById(R.id.icon5).setAlpha(1);\n } else {\n iconId = 5;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon5).setAlpha(1);\n }\n if(view.getId() == R.id.icon6){\n if(iconId == 6){\n iconId = 0;\n findViewById(R.id.icon6).setAlpha(1);\n } else {\n iconId = 6;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon6).setAlpha(1);\n }\n if(view.getId() == R.id.icon7){\n if(iconId == 7){\n iconId = 0;\n findViewById(R.id.icon7).setAlpha(1);\n } else {\n iconId = 7;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon7).setAlpha(1);\n }\n if(view.getId() == R.id.icon8){\n if(iconId == 8){\n iconId = 0;\n findViewById(R.id.icon8).setAlpha(1);\n } else {\n iconId = 8;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon8).setAlpha(1);\n }\n if(view.getId() == R.id.icon9 ){\n if(iconId == 9){\n iconId = 0;\n findViewById(R.id.icon9).setAlpha(1);\n } else {\n iconId = 9;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon9).setAlpha(1);\n }\n if(view.getId() == R.id.icon10){\n if(iconId == 10){\n iconId = 0;\n findViewById(R.id.icon10).setAlpha(1);\n } else {\n iconId = 10;\n view.setAlpha(0.5f);\n }\n } else {\n findViewById(R.id.icon10).setAlpha(1);\n }\n // close the keyboard\n InputMethodManager inputMethodManager =(InputMethodManager)getSystemService(Activity.INPUT_METHOD_SERVICE);\n inputMethodManager.hideSoftInputFromWindow(title.getRootView().getWindowToken(), 0);\n }",
"public void blueTapped(View view){\n ImageView blue = (ImageView)findViewById(R.id.bluebulb);\n\n ImageView green = (ImageView)findViewById(R.id.greenbulb);\n //the above two lines is nothing but the visibility of image\n\n\n /* animation is avialble in blue . animate property, and i can set the alpha to zero, and i can set the duration\n that it should go from 1 to 0, here 1000 means 1 second\n\n */\n blue.animate().alpha(1).setDuration(1000);//alpha of blue should be one becuase blue is tapped\n green.animate().alpha(0).setDuration(1000);//alpha of green should be zero becuase blue is tapped\n }",
"public void applyFadingEffectInHideseat() {\n final Drawable drawable = getIconDrawable();\n if (drawable == null) return;\n /* YUNOS BEGIN */\n //## modules(Home Shell)\n //## date: 2015/12/25 ## author: wangye.wy\n //## BugID: 7721715: set alpha of whole layer\n Paint paint = new Paint();\n paint.setColorFilter(FADING_EFFECT_FILTER);\n paint.setAlpha(FADING_EFFECT_ALPHA);\n setLayerType(LAYER_TYPE_HARDWARE, paint);\n /*\n if (drawable instanceof FancyDrawable) {\n // for fancy icon, turn into gray immediately\n Paint paint = new Paint();\n paint.setColorFilter(FADING_EFFECT_FILTER);\n paint.setAlpha(FADING_EFFECT_ALPHA);\n setLayerType(LAYER_TYPE_HARDWARE, paint);\n return;\n }\n // for normal bitmap icon, play a transition animation\n final AnimatorSet as = new AnimatorSet();\n final ValueAnimator va = ValueAnimator.ofFloat(1f, 0f);\n va.setDuration(350);\n final ColorMatrix matrix = new ColorMatrix();\n va.addUpdateListener(new AnimatorUpdateListener(){\n @Override\n public void onAnimationUpdate(ValueAnimator animation) {\n float value = ((Float) animation.getAnimatedValue()).floatValue();\n matrix.setSaturation(value);\n mAnimatedIconFadingFilter = new ColorMatrixColorFilter(matrix);\n drawable.setAlpha(255 - (int) ((255 - FADING_EFFECT_ALPHA) * (1 - value)));\n invalidate();\n }\n });\n va.addListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator arg0) {\n mAnimatedIconFadingFilter = null;\n drawable.setAlpha(FADING_EFFECT_ALPHA);\n invalidate();\n }\n @Override\n public void onAnimationCancel(Animator arg0) {\n onAnimationEnd(arg0);\n }\n });\n as.play(va);\n as.setStartDelay(400);\n matrix.setSaturation(1);\n mAnimatedIconFadingFilter = new ColorMatrixColorFilter(matrix);\n drawable.setAlpha(255);\n invalidate();\n as.start();\n */\n /* YUNOS END */\n }",
"public void mo84055a() {\n if (getVisibility() == 0) {\n animate().cancel();\n setLayerType(2, null);\n animate().alpha(0.0f).setListener(new Animator.AnimatorListener() {\n /* class com.zhihu.android.article.widget.ArticleFloatingTipsView.C172711 */\n\n public void onAnimationCancel(Animator animator) {\n }\n\n public void onAnimationRepeat(Animator animator) {\n }\n\n public void onAnimationStart(Animator animator) {\n }\n\n public void onAnimationEnd(Animator animator) {\n ArticleFloatingTipsView.this.setVisibility(4);\n ArticleFloatingTipsView.this.setLayerType(0, null);\n }\n }).start();\n }\n }",
"public void mo5967d() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{-((float) C1413m.f5711i.getHeight()), 0.0f}).setDuration(240);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{0.0f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f}).setDuration(240);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.0f}).setDuration(j).start();\n LinearLayout linearLayout = this.f5438qa;\n ObjectAnimator.ofFloat(linearLayout, \"translationY\", new float[]{0.0f, (float) ((linearLayout.getMeasuredHeight() - this.f5384D.getmImageViewHeight()) - C1413m.m6828a(27, this.f5389I))}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5438qa, \"alpha\", new float[]{1.0f, 0.0f}).setDuration(j).start();\n duration.addListener(new C1304Ya(this));\n }",
"private void animateIcon(final boolean enable) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n ImageView myImageView = findViewById(R.id.loading_image);\n if (enable) {\n Animation myFadeInAnimation = AnimationUtils.loadAnimation(LoadingActivity.this, R.anim.loading_animation);\n myImageView.startAnimation(myFadeInAnimation);\n } else {\n myImageView.clearAnimation();\n //Show the icon in distress since we aren't fully loaded.\n }\n }\n });\n }",
"@Override\n public void onAnimationStart(Animator animation) {\n findViewById(R.id.btn_sticker1).setVisibility(View.GONE);\n findViewById(R.id.btn_sticker2).setVisibility(View.GONE);\n findViewById(R.id.btn_sticker3).setVisibility(View.GONE);\n findViewById(R.id.btn_camera_sticker_album).setVisibility(View.VISIBLE);\n findViewById(R.id.btn_camera_filter_album).setVisibility(View.VISIBLE);\n findViewById(R.id.btn_return).setVisibility(View.VISIBLE);\n\n\n\n //瞬间隐藏掉面板上的东西\n mStickerLayout.setVisibility(View.GONE);\n }",
"void animation() {\n LinearLayout linearLayout = findViewById(R.id.loginLinear);\n animationDrawable = (AnimationDrawable)linearLayout.getBackground();\n animationDrawable.setEnterFadeDuration(5000);\n animationDrawable.setExitFadeDuration(5000);\n\n }",
"private void crossFade() {\n robotIv.setAlpha(0f);\n robotIv.setVisibility(View.VISIBLE);\n\n // Animate the content view to 100% opacity, and clear any animation\n // listener set on the view.\n robotIv.animate()\n .alpha(1f)\n .setDuration(1800)\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n welcomeTv.setVisibility(View.VISIBLE);\n }\n });\n\n }",
"private final void m75344c(int i) {\n ((FrameLayout) mo78146a(R.id.selectorLayout)).animate().alpha(i < 0 ? 1.0f : 0.0f).start();\n }",
"private void setAlphaAnimation() {\n\n AlphaAnimation alphaAnim = new AlphaAnimation(1.0f,0.0f);\n alphaAnim.setStartOffset(5000); // start in 5 seconds\n alphaAnim.setDuration(400);\n alphaAnim.setAnimationListener(new Animation.AnimationListener()\n {\n @Override\n public void onAnimationStart(Animation animation) {\n\n }\n\n public void onAnimationEnd(Animation animation)\n {\n // make invisible when animation completes, you could also remove the view from the layout\n txtNotifications.setVisibility(View.INVISIBLE);\n imgNotifications.setImageResource(0);\n }\n\n @Override\n public void onAnimationRepeat(Animation animation) {\n\n }\n });\n txtNotifications.setAnimation(alphaAnim);\n imgNotifications.setAnimation(alphaAnim);\n }",
"public void mo5969f() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{0.0f, -((float) C1413m.f5711i.getHeight())}).setDuration(350);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.55f, 0.35f, 0.2f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}).setDuration(350);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5386F, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5384D, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5385E, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n this.f5384D.getTexView().setText(getResources().getString(R.string.pause));\n duration.addListener(new C1298Va(this));\n }",
"public void mo5964b() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{0.0f, -((float) C1413m.f5711i.getHeight())}).setDuration(350);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.55f, 0.35f, 0.2f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}).setDuration(350);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{0.0f, 0.3f, 0.5f, 0.7f, 0.9f, 1.0f}).setDuration(j).start();\n this.f5438qa.getMeasuredHeight();\n this.f5384D.getmImageViewHeight();\n C1413m.m6828a(27, this.f5389I);\n ObjectAnimator.ofFloat(this.f5386F, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5384D, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5385E, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n this.f5384D.getTexView().setText(getResources().getString(R.string.pause));\n this.f5384D.getmImageView().setImageResource(R.drawable.iqoo_buttonanimation);\n this.f5393M = (AnimationDrawable) this.f5384D.getmImageView().getDrawable();\n this.f5393M.start();\n duration.addListener(new C1300Wa(this));\n }",
"public void mo5968e() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{-((float) C1413m.f5711i.getHeight()), 0.0f}).setDuration(240);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{0.0f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f}).setDuration(240);\n duration.start();\n duration2.start();\n long j = (long) 160;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5438qa, \"alpha\", new float[]{1.0f, 0.0f}).setDuration(j).start();\n duration.addListener(new C1302Xa(this));\n }",
"private void crossFadeThumbnail() {\n if (m_thumbnail.getVisibility() == View.VISIBLE)\n return;\n\n m_thumbnail.setAlpha(0f);\n m_thumbnail.setVisibility(View.VISIBLE);\n m_thumbnail.animate()\n .alpha(1f)\n .setDuration(getResources().getInteger(\n android.R.integer.config_shortAnimTime))\n .setListener(null);\n\n m_spinner.animate()\n .alpha(0f)\n .setDuration(getResources().getInteger(\n android.R.integer.config_shortAnimTime))\n .setListener(new AnimatorListenerAdapter() {\n @Override\n public void onAnimationEnd(Animator animation) {\n m_spinner.setVisibility(View.GONE);\n }\n });\n }",
"public void toggleAnim(boolean show) {\n if (animatorSet != null) {\n if (preAnimationEndAlpha == (show ? 1f : 0f)) {\n return;\n } else {\n animatorSet.cancel();\n }\n }\n if (show) {\n toogleVisible(mContainer, 0f, 1f, SmoothImageView.ANIMATION_DURATION);\n /* boolean needShow = false;\n for (View control : mControlsVisible.keySet()) {\n //[BUGFIX]-Modify by TCTNJ, dongliang.feng, 2015-06-23, PR1027856 begin\n Boolean prevVisibility = mControlsVisible.get(control);\n needShow = needShow || prevVisibility;\n if (!prevVisibility) {\n continue;\n }\n //[BUGFIX]-Modify by TCTNJ, dongliang.feng, 2015-06-23, PR1027856 end\n toogleVisible(control, 0f, 1f, SmoothImageView.ANIMATION_DURATION);\n }\n if (needShow) {\n toogleVisible(mContainer, 0f, 1f, SmoothImageView.ANIMATION_DURATION);\n }*/\n preAnimationEndAlpha = 1f;\n } else {\n toogleVisible(mContainer, 1f, 0f, SmoothImageView.ANIMATION_DURATION);\n /* for (View control : mControlsVisible.keySet()) {\n //[BUGFIX]-Modify by TCTNJ, dongliang.feng, 2015-06-23, PR1027856 begin\n Boolean prevVisibility = mControlsVisible.get(control);\n if (!prevVisibility) {\n continue;\n }\n //[BUGFIX]-Modify by TCTNJ, dongliang.feng, 2015-06-23, PR1027856 end\n toogleVisible(control, 1f, 0f, SmoothImageView.ANIMATION_DURATION);\n }*/\n preAnimationEndAlpha = 0f;\n }\n if (animatorSet != null) {\n animatorSet.start();\n }\n }",
"private void AnimateandSlideShow() {\n\n\t\tslidingimage = (ImageView) findViewById(R.id.ImageView3_Left);\n\t\t// Log.i(\"bitarray\", Integer.toString(bit_array.length));\n\t\tslidingimage.setImageBitmap(bit_array[currentimageindex\n\t\t\t\t% bit_array.length]);\n\n\t\tcurrentimageindex++;\n\n\t\tAnimation rotateimage = AnimationUtils.loadAnimation(this,\n\t\t\t\tR.anim.custom_anim);\n\n\t\tslidingimage.startAnimation(rotateimage);\n\n\t}",
"public void splash(){\n ImageView splash = (ImageView) findViewById(R.id.mekslogo);\n Animation animation1 =\n AnimationUtils.loadAnimation(getApplicationContext(),\n R.anim.clockwise);\n animation1.setDuration(5000);\n splash.startAnimation(animation1);\n animation1.setAnimationListener(new Animation.AnimationListener() {\n @Override\n public void onAnimationStart(Animation animation) {\n\n }\n\n @Override\n public void onAnimationEnd(Animation animation) {\n // Toast.makeText(getApplicationContext(),\"Animation ended\",Toast.LENGTH_SHORT).show();\n Intent intent=new Intent(MainActivity.this, sign_up.class);\n startActivity(intent);\n }\n\n @Override\n public void onAnimationRepeat(Animation animation) {\n\n }\n });\n }",
"@Override\n public void run() {\n Picasso.with(SplashActivity.this).load(mSplashInfo.getImageUri())\n .into(mStartupImageView);\n mImageSrcTextView.setText(mSplashInfo.getImageSrcInfo());\n // start the animation\n mStartupImageView.startAnimation(mAnimationZoomIn);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n mStartupImageView.startAnimation(mAnimationFadeOut);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n Intent intent = new Intent(SplashActivity.this, MainActivity.class);\n //Add Flags to prevent BACK touch to a wrong activity\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n }\n }, 500);\n }\n }, 3000);\n }",
"@SuppressLint({\"NewApi\"})\n /* renamed from: a */\n public void m20062a(final ImageView imageView, final ImageView imageView2, int i) {\n imageView.clearAnimation();\n imageView2.clearAnimation();\n Animation loadAnimation = AnimationUtils.loadAnimation(this, R.anim.anime_fadeout);\n AnimationSet animationSet = new AnimationSet(false);\n animationSet.addAnimation(loadAnimation);\n Animation loadAnimation2 = AnimationUtils.loadAnimation(this, i);\n AnimationSet animationSet2 = new AnimationSet(false);\n animationSet2.addAnimation(loadAnimation2);\n imageView.setAlpha(255.0f);\n imageView.setVisibility(0);\n imageView.startAnimation(animationSet);\n imageView2.setVisibility(0);\n imageView2.startAnimation(animationSet2);\n animationSet.setAnimationListener(new C5297a() {\n public void onAnimationEnd(Animation animation) {\n imageView.clearAnimation();\n }\n });\n animationSet2.setAnimationListener(new C5297a() {\n public void onAnimationEnd(Animation animation) {\n imageView2.clearAnimation();\n imageView2.setVisibility(0);\n }\n });\n }",
"@Override\n\t public void onClick(View v) {\n \t\tsmia.setVisibility(View.VISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t dancea.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t\t plaa.setVisibility(View.INVISIBLE);\n \t\t\tstarteres.setVisibility(View.INVISIBLE);\n \t \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t\t diz4.setVisibility(View.INVISIBLE);\n \t\t\ttjza.setVisibility(View.INVISIBLE);\n \t startAnimationsmi();\n \t b = 0 ;\n \t }",
"public void fade(View view)\n {\n\n ImageView iv1=findViewById(R.id.iv1);\n ImageView iv2=findViewById(R.id.iv2);\n /*alpha value ranges between 0 to 1\n 0 to make image invisible\n in between value changes visibility\n 1 to make image visible*/\n iv1.animate().alpha(0).setDuration(2000);\n iv2.animate().alpha(1).setDuration(2000);\n iv2.bringToFront();//it brings iv2 front\n iv1.invalidate();//it makes iv1 invalidate\n }",
"public void greenTapped(View view){\n ImageView blue = (ImageView)findViewById(R.id.bluebulb);\n ImageView green = (ImageView)findViewById(R.id.greenbulb);\n /* animation is avialble in blue . animate property, and i can set the alpha to zero, and i can set the duration\n that it should go from 1 to 0, here 1000 means 1 second\n\n */\n blue.animate().alpha(0).setDuration(1000);\n green.animate().alpha(1).setDuration(1000);\n\n }",
"@Override\n public void onClick(View v) {\n animMove = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.fade_out);\n m_rad_DA1.startAnimation(animMove);\n m_rad_DA3.startAnimation(animMove);\n btnFiftyPercen.setEnabled(false);\n btnFiftyPercen.setBackgroundResource(R.drawable.button_black);\n }",
"public void animateKeyguardStatusBarIn(long j) {\n this.mKeyguardStatusBar.setVisibility(0);\n this.mKeyguardStatusBar.setAlpha(0.0f);\n ValueAnimator ofFloat = ValueAnimator.ofFloat(new float[]{0.0f, 1.0f});\n ofFloat.addUpdateListener(this.mStatusBarAnimateAlphaListener);\n ofFloat.setDuration(j);\n ofFloat.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);\n ofFloat.start();\n }",
"public void runEnterAnimation() {\n final long duration = (long) (ANIM_DURATION * PenndotApplication.sAnimatorScale);\n\n // Set starting values for properties we're going to animate. These\n // values scale and position the full size version down to the thumbnail\n // size/location, from which we'll animate it back up\n mImageView.setPivotX(0);\n mImageView.setPivotY(0);\n mImageView.setScaleX(mWidthScale);\n mImageView.setScaleY(mHeightScale);\n mImageView.setTranslationX(mLeftDelta);\n mImageView.setTranslationY(mTopDelta);\n\n // We'll fade the text in later\n mTextView.setAlpha(0);\n\n // Animate scale and translation to go from thumbnail to full size\n mImageView.animate().setDuration(duration).scaleX(1).scaleY(1).translationX(0)\n .translationY(0).setInterpolator(sDecelerator).withEndAction(new Runnable() {\n public void run() {\n // Animate the description in after the image animation\n // is done. Slide and fade the text in from underneath\n // the picture.\n mTextView.setTranslationY(-mTextView.getHeight());\n mTextView.animate().setDuration(duration / 2).translationY(0).alpha(1)\n .setInterpolator(sDecelerator);\n }\n });\n // Fade in the black background\n ObjectAnimator bgAnim = ObjectAnimator.ofInt(mBackground, \"alpha\", 0, 255);\n bgAnim.setDuration(duration);\n bgAnim.start();\n\n // Animate a color filter to take the image from grayscale to full\n // color.\n // This happens in parallel with the image scaling and moving into\n // place.\n ObjectAnimator colorizer = ObjectAnimator.ofFloat(FullImageActivity.this, \"saturation\", 0,\n 1);\n colorizer.setDuration(duration);\n colorizer.start();\n\n // Animate a drop-shadow of the image\n // ObjectAnimator shadowAnim = ObjectAnimator.ofFloat(mShadowLayout,\n // \"shadowDepth\", 0, 1);\n // shadowAnim.setDuration(duration);\n // shadowAnim.start();\n }",
"@Override\n public void run() {\n\n mShimmerViewContainer.setBaseAlpha(1);\n\n Animation animation2 = AnimationUtils.loadAnimation(Splash_Activity.this, R.anim.alpha);\n\n mShimmerViewContainer.setAnimation(animation2);\n\n }",
"@Override\n public void onAnimationStart(Animator animation) {\n findViewById(R.id.btn_camera_sticker_album).setVisibility(View.VISIBLE);\n findViewById(R.id.btn_camera_filter_album).setVisibility(View.VISIBLE);\n findViewById(R.id.btn_return).setVisibility(View.VISIBLE);\n\n //瞬间隐藏掉面板上的东西\n findViewById(R.id.btn_camera_beauty).setVisibility(View.GONE);\n findViewById(R.id.btn_camera_filter1).setVisibility(View.GONE);\n findViewById(R.id.btn_camera_lip).setVisibility(View.GONE);\n mFilterLayout.setVisibility(View.GONE);\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_x);\n TampilGambar.startAnimation(animScale);\n suaraX.start();\n }",
"public void hideProgress() {\n search_progress.setVisibility(View.GONE);\n img_left_action.setAlpha(0.0f);\n img_left_action.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(img_left_action, \"alpha\", 0.0f, 1.0f).start();\n }",
"private void showSplash() {\n \t\tthis.splashInfoContainer.setVisibility( View.VISIBLE );\n \t}",
"public void mo60894a() {\n int i;\n this.f61656f = new SmartAvatarImageView(getContext());\n if (C6399b.m19946v()) {\n ((C13438a) this.f61656f.getHierarchy()).mo32891a((int) R.color.a5q, C13423b.f35599g);\n }\n addView(this.f61656f, getAvatarLayoutParams());\n LayoutParams a = m76775a(getVerifyIconSize());\n this.f61651a = new ImageView(getContext());\n int i2 = R.drawable.amq;\n try {\n this.f61651a.setImageDrawable(getResources().getDrawable(R.drawable.amq));\n } catch (NotFoundException unused) {\n }\n this.f61651a.setVisibility(8);\n LayoutParams a2 = m76775a(getVerifyIconSize());\n this.f61652b = new ImageView(getContext());\n try {\n this.f61652b.setImageDrawable(getResources().getDrawable(R.drawable.amq));\n } catch (NotFoundException unused2) {\n }\n this.f61652b.setVisibility(8);\n this.f61653c = new ImageView(getContext());\n try {\n ImageView imageView = this.f61653c;\n Resources resources = getResources();\n if (C6399b.m19944t()) {\n i = R.drawable.amp;\n } else {\n i = R.drawable.amq;\n }\n imageView.setImageDrawable(resources.getDrawable(i));\n } catch (NotFoundException unused3) {\n }\n this.f61653c.setVisibility(8);\n this.f61654d = new ImageView(getContext());\n try {\n this.f61654d.setImageDrawable(getResources().getDrawable(R.drawable.amm));\n } catch (NotFoundException unused4) {\n }\n this.f61654d.setVisibility(8);\n this.f61655e = new ImageView(getContext());\n try {\n ImageView imageView2 = this.f61655e;\n Resources resources2 = getResources();\n if (C6399b.m19944t()) {\n i2 = R.drawable.amp;\n }\n imageView2.setImageDrawable(resources2.getDrawable(i2));\n } catch (NotFoundException unused5) {\n }\n this.f61655e.setVisibility(8);\n addView(this.f61651a, a);\n addView(this.f61652b, a2);\n addView(this.f61653c, a2);\n addView(this.f61654d, a2);\n addView(this.f61655e, a2);\n }",
"private void m125730y() {\n this.f90219I.set(false);\n View view = this.f90216F;\n if (view != null && view.getVisibility() == 0 && !this.f90218H.get()) {\n this.f90216F.clearAnimation();\n AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);\n alphaAnimation.setDuration(500);\n alphaAnimation.setAnimationListener(new Animation.AnimationListener() {\n /* class com.zhihu.android.topic.platfrom.TopicFragment.animationAnimation$AnimationListenerC258283 */\n\n public void onAnimationRepeat(Animation animation) {\n }\n\n public void onAnimationStart(Animation animation) {\n TopicFragment.this.f90218H.set(true);\n }\n\n public void onAnimationEnd(Animation animation) {\n TopicFragment.this.f90216F.setVisibility(8);\n TopicFragment.this.f90218H.set(false);\n if (TopicFragment.this.f90219I.get()) {\n TopicFragment.this.m125731z();\n }\n }\n });\n this.f90216F.startAnimation(alphaAnimation);\n }\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_h);\n TampilGambar.startAnimation(animScale);\n suaraH.start();\n }",
"private void fadeOutAndHideView(final MaterialCardView img)\n {\n Animation fadeOut = new AlphaAnimation(1, 0);\n fadeOut.setInterpolator(new AccelerateInterpolator());\n fadeOut.setDuration(50);\n\n fadeOut.setAnimationListener(new Animation.AnimationListener()\n {\n public void onAnimationEnd(Animation animation)\n {\n img.setVisibility(View.GONE);\n }\n public void onAnimationRepeat(Animation animation) {}\n public void onAnimationStart(Animation animation) {}\n });\n\n img.startAnimation(fadeOut);\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_hitam);\n TampilGambar.startAnimation(animScale);\n suara12.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_w);\n TampilGambar.startAnimation(animScale);\n suaraW.start();\n }",
"public void fade1(View view)\n {\n ImageView iv1=findViewById(R.id.iv1);\n ImageView iv2=findViewById(R.id.iv2);\n iv2.animate().alpha(0).setDuration(2000);\n iv1.animate().alpha(1).setDuration(2000);\n iv1.bringToFront();\n iv2.invalidate();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_i);\n TampilGambar.startAnimation(animScale);\n suaraI.start();\n }",
"private final void m75360j() {\n ((FrameLayout) mo78146a(R.id.selectorLayout)).animate().cancel();\n FrameLayout frameLayout = (FrameLayout) mo78146a(R.id.selectorLayout);\n C32569u.m150513a((Object) frameLayout, C6969H.m41409d(\"G7A86D91FBC24A43BCA0F8947E7F1\"));\n frameLayout.setAlpha(1.0f);\n FrameLayout frameLayout2 = (FrameLayout) mo78146a(R.id.selectorLayout);\n C32569u.m150513a((Object) frameLayout2, C6969H.m41409d(\"G7A86D91FBC24A43BCA0F8947E7F1\"));\n frameLayout2.setTranslationY(0.0f);\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_z);\n TampilGambar.startAnimation(animScale);\n suaraZ.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_y);\n TampilGambar.startAnimation(animScale);\n suaraY.start();\n }",
"@Override\n\t public void onClick(View v) {\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t dancea.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t plaa.setVisibility(View.VISIBLE);\n \t\tstarteres.setVisibility(View.INVISIBLE);\n\t\t diz3.setVisibility(View.INVISIBLE); \n\t\t diz4.setVisibility(View.INVISIBLE);\n\t\t tjza.setVisibility(View.INVISIBLE);\n \t startAnimationbas();\n \t b = 1 ;\n \t player.stop();\n \t }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_ungu);\n TampilGambar.startAnimation(animScale);\n suara7.start();\n }",
"public void onAnimationEnd(Animation animation)\n {\n txtNotifications.setVisibility(View.INVISIBLE);\n imgNotifications.setImageResource(0);\n }",
"@Override\n\t public void onClick(View v) {\n\t\t tjza.setVisibility(View.VISIBLE);\n\t\t smia.setVisibility(View.INVISIBLE);\n\t\t kfja.setVisibility(View.INVISIBLE);\n\t\t croa.setVisibility(View.INVISIBLE);\n\t\t dancea.setVisibility(View.INVISIBLE);\n\t\t starters.setVisibility(View.INVISIBLE);\n\t\t diz1.setVisibility(View.INVISIBLE); \n\t\t\t diz2.setVisibility(View.INVISIBLE);\n\t\t\t plaa.setVisibility(View.INVISIBLE);\n\t\t\tstarteres.setVisibility(View.INVISIBLE);\n\t \t\t diz3.setVisibility(View.INVISIBLE); \n\t\t\t diz4.setVisibility(View.INVISIBLE);\n\t startAnimationtjz();\n\t b = 0 ;\n\t }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_f);\n TampilGambar.startAnimation(animScale);\n suaraF.start();\n }",
"private void m125731z() {\n View view = this.f90216F;\n if (view != null && view.getVisibility() == 8 && !this.f90218H.get()) {\n this.f90216F.clearAnimation();\n AnimationSet animationSet = new AnimationSet(true);\n AlphaAnimation alphaAnimation = new AlphaAnimation(0.0f, 1.0f);\n TranslateAnimation translateAnimation = new TranslateAnimation(2, 0.0f, 2, 0.0f, 2, 1.0f, 2, 0.0f);\n animationSet.addAnimation(alphaAnimation);\n animationSet.addAnimation(translateAnimation);\n animationSet.setDuration(800);\n animationSet.setInterpolator(new DecelerateInterpolator());\n animationSet.setAnimationListener(new Animation.AnimationListener() {\n /* class com.zhihu.android.topic.platfrom.TopicFragment.animationAnimation$AnimationListenerC258294 */\n\n public void onAnimationRepeat(Animation animation) {\n }\n\n public void onAnimationStart(Animation animation) {\n TopicFragment.this.f90216F.setVisibility(0);\n TopicFragment.this.f90218H.set(true);\n }\n\n public void onAnimationEnd(Animation animation) {\n TopicFragment.this.f90216F.setVisibility(0);\n TopicFragment.this.f90218H.set(false);\n }\n });\n this.f90216F.startAnimation(animationSet);\n }\n }",
"public void show(int delayTime) {\n\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n switch (mType) {\n case TYPE_First:\n mNewbieGuide.addIndicateImg(R.mipmap.guide_right,\n ScreenUtils.dpToPx(mActivity, -50),\n ScreenUtils.dpToPx(mActivity, 110))\n .addMessage(mActivity.getString(R.string.switch_map),\n ScreenUtils.dpToPx(mActivity, -40)\n ,ScreenUtils.dpToPx(mActivity, 130))\n .addIndicateImg(R.mipmap.guide_left,\n ScreenUtils.dpToPx(mActivity,60),\n ScreenUtils.dpToPx(mActivity,40))\n .addMessage(mActivity.getString(R.string.open_menu),\n ScreenUtils.dpToPx(mActivity,85),\n ScreenUtils.dpToPx(mActivity,60)).show();\n\n break;\n\n case TYPE_TWICE:\n mNewbieGuide.addIndicateImg(R.mipmap.guide_right2,\n ScreenUtils.dpToPx(mActivity, -50),\n ScreenUtils.dpToPx(mActivity, -170))\n\n .addMessage(mActivity.getString(R.string.see_the_history),\n ScreenUtils.dpToPx(mActivity, -50),\n ScreenUtils.dpToPx(mActivity,-185)).\n\n addIndicateImg(R.mipmap.guide_down,\n ScreenUtils.dpToPx(mActivity,-105),\n ScreenUtils.dpToPx(mActivity,-135))\n\n .addMessage(mActivity.getString(R.string.navigate_to_the_watch),\n ScreenUtils.dpToPx(mActivity,-115),\n ScreenUtils.dpToPx(mActivity,-160)).show();\n break;\n\n case TYPE_THIRD:\n mNewbieGuide.addIndicateImg(R.mipmap.guide_right2,\n ScreenUtils.dpToPx(mActivity, -50),\n ScreenUtils.dpToPx(mActivity,-230))\n .addMessage(\"设置安全区域\",\n ScreenUtils.dpToPx(mActivity,-50),\n ScreenUtils.dpToPx(mActivity,-250))\n .addIndicateImg(R.mipmap.guide_down,\n ScreenUtils.dpToPx(mActivity, -50),\n ScreenUtils.dpToPx(mActivity, -130))\n .addMessage(\"立即刷新位置\",\n ScreenUtils.dpToPx(mActivity, -50),\n ScreenUtils.dpToPx(mActivity,-155))\n .show();\n }\n }\n }, delayTime);\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_n);\n TampilGambar.startAnimation(animScale);\n suaraN.start();\n }",
"@Override\n\t\t\tpublic void onAnimationEnd(Animator animation) {\n\t\t\t\trefreshDrawableState();\n\n\t\t\t\tmRevealView.setVisibility(View.GONE);\n\t\t\t}",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_m);\n TampilGambar.startAnimation(animScale);\n suaraM.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_hijau);\n TampilGambar.startAnimation(animScale);\n suara3.start();\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t mImgLayout.setVisibility(View.GONE);\n\t\t\t\t \n\t\t\t}",
"public boolean updateAntiThiefView(ImageView iv_main, ImageView iv_icon, TextView textView,\n boolean isTurnOnAntiThief) {\n// if (event.getAction() == MotionEvent.ACTION_DOWN) {\n if (isTurnOnAntiThief) {\n isTurnOnAntiThief = false;\n iv_main.setImageResource(R.mipmap.ic_btn_normal);\n iv_icon.setImageResource(R.mipmap.ic_turn_on_anti_thief);\n textView.setText(R.string.tv_turn_on_anti_thief);\n } else {\n isTurnOnAntiThief = true;\n iv_main.setImageResource(R.mipmap.ic_btn_turn_off);\n iv_icon.setImageResource(R.mipmap.ic_turn_off_anti_thief);\n textView.setText(R.string.tv_turn_off_anti_thief);\n }\n// }\n\n return isTurnOnAntiThief;\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_d);\n TampilGambar.startAnimation(animScale);\n suaraD.start();\n }",
"public void mo64133a() {\n float f;\n if (!mo64139e()) {\n setVisibility(0);\n }\n ((IReadLaterFloatView) InstanceProvider.m107964b(IReadLaterFloatView.class)).setFloatViewVisible(false);\n float[] fArr = new float[2];\n if (this.f41196l) {\n f = (float) this.f41185a.getTop();\n } else {\n int i = this.f41188d;\n if (i == 0) {\n i = DisplayUtils.m87171b(getContext(), (float) this.f41193i);\n }\n f = (float) (-i);\n }\n fArr[0] = f;\n fArr[1] = (float) this.f41191g;\n ValueAnimator ofFloat = ValueAnimator.ofFloat(fArr);\n ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n /* class com.zhihu.android.app.p1011ad.pushad.$$Lambda$AbstractNotificationView$kK7LzkwRlcW_mdmTTuQsBcPOpc */\n\n public final void onAnimationUpdate(ValueAnimator valueAnimator) {\n AbstractNotificationView.m155975lambda$kK7LzkwRlcW_mdmTTuQsBcPOpc(AbstractNotificationView.this, valueAnimator);\n }\n });\n ofFloat.addListener(new Animator.AnimatorListener() {\n /* class com.zhihu.android.app.p1011ad.pushad.AbstractNotificationView.C104821 */\n\n public void onAnimationCancel(Animator animator) {\n }\n\n public void onAnimationRepeat(Animator animator) {\n }\n\n public void onAnimationStart(Animator animator) {\n AbstractNotificationView.this.f41185a.setVisibility(0);\n }\n\n public void onAnimationEnd(Animator animator) {\n AbstractNotificationView abstractNotificationView = AbstractNotificationView.this;\n abstractNotificationView.f41189e = false;\n abstractNotificationView.mo64138d();\n }\n });\n ofFloat.setInterpolator(new OvershootInterpolator());\n ofFloat.setDuration(500L);\n if (!mo64139e()) {\n ofFloat.setStartDelay(500);\n }\n ofFloat.start();\n this.f41196l = true;\n }",
"@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tAnimation alpha=AnimationUtils.loadAnimation(MainActivity.this,\n\t\t\t\t\t\tR.anim.alpha_animation);\n\t\t\t\ttv.startAnimation(alpha);\n\t\t\t}",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_pink);\n TampilGambar.startAnimation(animScale);\n suara6.start();\n }",
"@Override\r\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tshuaxin.setVisibility(8);\r\n\t\t\t}",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_l);\n TampilGambar.startAnimation(animScale);\n suaraL.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_j);\n TampilGambar.startAnimation(animScale);\n suaraJ.start();\n }",
"private void hideSplash() {\n \t\tthis.splashInfoContainer.startAnimation( this.splashFadeOut );\n \t}",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_merah);\n TampilGambar.startAnimation(animScale);\n suara1.start();\n }",
"private void setTvSplashTextDesapiarAnimator() {\n ValueAnimator valueAnimator = ValueAnimator.ofFloat(0f, 1f);\n valueAnimator.setDuration(2500);\n valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n @Override\n public void onAnimationUpdate(ValueAnimator animation) {\n float alpha = (float) animation.getAnimatedValue();\n tvSplashDesc.setAlpha(alpha);\n tvSplashTitle.setAlpha(alpha);\n }\n });\n valueAnimator.start();\n }",
"public void expandNoAnim() {\n if (getVisibility() == View.VISIBLE) {\n return;\n }\n setVisibility(View.VISIBLE);\n mAnimatorExpand.setDuration(0);\n mAnimatorExpand.start();\n }",
"@Override\n public void onPause()\n {\n super.onPause();\n \n // Stop all animations, they will be resumed in onResume()\n // when the user returns to this activity.\n blue_jay_animation.stop();\n\n ImageView butterfly_icon = (ImageView) findViewById( R.id.butterfly_icon );\n ((AnimationDrawable) butterfly_icon.getBackground()).stop();\n\n ImageView caterpillar_icon = (ImageView) findViewById( R.id.caterpillar_icon );\n caterpillar_icon_animation.cancel();\n caterpillar_icon.clearAnimation();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_a);\n TampilGambar.startAnimation(animScale);\n suaraA.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_e);\n TampilGambar.startAnimation(animScale);\n suaraE.start();\n }",
"private void animateViews(int duration) {\n if (headerText.getVisibility() == View.VISIBLE) {\n headerText.setVisibility(View.GONE);\n }\n if (spaconIcon.getVisibility() == View.VISIBLE) {\n spaconIcon.setVisibility(View.GONE);\n }\n final Handler handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //Do something after 1 second\n headerText.startAnimation(AnimationUtils.loadAnimation(Home.this, R.anim.view_fallingfromsky));\n headerText.setVisibility(View.VISIBLE);\n\n spaconIcon.startAnimation(AnimationUtils.loadAnimation(Home.this, R.anim.view_fadein_long));\n spaconIcon.setVisibility(View.VISIBLE);\n\n if (fillableLoader.getVisibility() == View.GONE) {\n fillableLoader.setVisibility(View.VISIBLE);\n }\n fillableLoader.start();\n }\n }, duration);\n\n\n }",
"@Override\n\tpublic void onAnimationStart(Animator arg0) {\n\t\tif (mState.getState() != 0) {\n\t\t\tGBTools.GBsetAlpha(bv, 0.0F);\n\t\t\tbv.setState(mState.getState());\n\t\t\tbv.setPressed(false);\n\t\t}\n\t\tbv.bringToFront();\n\t\tmBoardView.invalidate();\n\t}",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_coklat);\n TampilGambar.startAnimation(animScale);\n suara11.start();\n }",
"private void ensureVisibility(ImageView image) {\n\n if(image==tweenAnimation){\n\n frameAnimation.setVisibility(View.GONE);\n tweenAnimation.setVisibility(View.VISIBLE);\n }\n else if(image==frameAnimation){\n\n tweenAnimation.setVisibility(View.GONE);\n frameAnimation.setVisibility(View.VISIBLE);\n\n }\n\n }",
"public void animationIconoMorir(ImageView m){\n animation = AnimationUtils.loadAnimation(context,R.anim.aim_transparencia_icono_morir);\n\n\n animation.setAnimationListener(new Animation.AnimationListener() {\n @Override\n public void onAnimationStart(Animation animation) {\n\n }\n\n @Override\n public void onAnimationEnd(Animation animation) {\n\n\n }\n\n @Override\n public void onAnimationRepeat(Animation animation) {\n TextView texto = null;\n texto.setText(\"yeeei\");\n texto.startAnimation(animation);\n }\n });\n\n m.startAnimation(animation);\n\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_abu);\n TampilGambar.startAnimation(animScale);\n suara0.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_r);\n TampilGambar.startAnimation(animScale);\n suaraR.start();\n }",
"@Override\n\t public void onClick(View v) {\n \t\t \n \t\tdancea.setVisibility(View.VISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t kfja.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t\t plaa.setVisibility(View.INVISIBLE);\n \t\t\tstarteres.setVisibility(View.INVISIBLE);\n \t \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t\t diz4.setVisibility(View.INVISIBLE);\n \t\t\ttjza.setVisibility(View.INVISIBLE);\n \t startAnimationdan();\n \t b = 0 ;\n \t \t \n \t }",
"public void mo64136c() {\n if (mo64139e()) {\n ((IReadLaterFloatView) InstanceProvider.m107964b(IReadLaterFloatView.class)).setFloatViewVisible(true);\n ValueAnimator ofFloat = ValueAnimator.ofFloat((float) this.f41185a.getTop(), (float) (-this.f41188d));\n ofFloat.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {\n /* class com.zhihu.android.app.p1011ad.pushad.$$Lambda$AbstractNotificationView$wXI6SvYUdl6E9e8C3K2h_AQOQfw */\n\n public final void onAnimationUpdate(ValueAnimator valueAnimator) {\n AbstractNotificationView.lambda$wXI6SvYUdl6E9e8C3K2h_AQOQfw(AbstractNotificationView.this, valueAnimator);\n }\n });\n ofFloat.addListener(new Animator.AnimatorListener() {\n /* class com.zhihu.android.app.p1011ad.pushad.AbstractNotificationView.C104832 */\n\n public void onAnimationCancel(Animator animator) {\n }\n\n public void onAnimationRepeat(Animator animator) {\n }\n\n public void onAnimationStart(Animator animator) {\n }\n\n public void onAnimationEnd(Animator animator) {\n AbstractNotificationView.this.f41185a.setVisibility(4);\n AbstractNotificationView.this.setVisibility(8);\n if (AbstractNotificationView.this.mo64135b() && (AbstractNotificationView.this.getContext() instanceof Activity)) {\n StatusBarUtil.m87236c((Activity) AbstractNotificationView.this.getContext());\n }\n if (AbstractNotificationView.this.f41195k != null) {\n AbstractNotificationView.this.f41195k.mo64153a(false);\n }\n }\n });\n ofFloat.setDuration(300L);\n ofFloat.start();\n this.f41196l = false;\n }\n }",
"@Override\r\n public void run() {\n\r\n leftMenuView.setVisibility(View.VISIBLE);\r\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_oren);\n TampilGambar.startAnimation(animScale);\n suara8.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_k);\n TampilGambar.startAnimation(animScale);\n suaraK.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_q);\n TampilGambar.startAnimation(animScale);\n suaraQ.start();\n }",
"private void SplashScreen() {\n// if (!mSettings.getBoolean(\"PlayedBefore\", false)) {\n// mSolitaireView.DisplaySplash();\n// }\n splas.setVisibility(View.VISIBLE);\n Handler h = new Handler(Looper.getMainLooper());\n h.postDelayed(new Runnable() {\n @Override\n public void run() {\n splas.setVisibility(View.GONE);\n }\n }, 3000);\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_kuning);\n TampilGambar.startAnimation(animScale);\n suara2.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_birutua);\n TampilGambar.startAnimation(animScale);\n suara9.start();\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_biru);\n TampilGambar.startAnimation(animScale);\n suara4.start();\n }",
"public void setKeyguardStatusViewVisibility(int i, boolean z, boolean z2) {\n this.mKeyguardStatusView.animate().cancel();\n this.mKeyguardStatusViewAnimating = false;\n if ((!z && this.mBarState == 1 && i != 1) || z2) {\n this.mKeyguardStatusViewAnimating = true;\n this.mKeyguardStatusView.animate().alpha(0.0f).setStartDelay(0).setDuration(160).setInterpolator(Interpolators.ALPHA_OUT).withEndAction(this.mAnimateKeyguardStatusViewGoneEndRunnable);\n if (z) {\n this.mKeyguardStatusView.animate().setStartDelay(this.mKeyguardStateController.getKeyguardFadingAwayDelay()).setDuration(this.mKeyguardStateController.getShortenedFadingAwayDuration()).start();\n }\n } else if (this.mBarState == 2 && i == 1) {\n this.mKeyguardStatusView.setVisibility(0);\n this.mKeyguardStatusViewAnimating = true;\n this.mKeyguardStatusView.setAlpha(0.0f);\n this.mKeyguardStatusView.animate().alpha(1.0f).setStartDelay(0).setDuration(320).setInterpolator(Interpolators.ALPHA_IN).withEndAction(this.mAnimateKeyguardStatusViewVisibleEndRunnable);\n } else if (i != 1) {\n this.mKeyguardStatusView.setVisibility(8);\n this.mKeyguardStatusView.setAlpha(1.0f);\n } else if (z) {\n this.mKeyguardStatusViewAnimating = true;\n this.mKeyguardStatusView.animate().alpha(0.0f).translationYBy(((float) (-getHeight())) * 0.05f).setInterpolator(Interpolators.FAST_OUT_LINEAR_IN).setDuration(125).setStartDelay(0).withEndAction(this.mAnimateKeyguardStatusViewInvisibleEndRunnable).start();\n } else {\n this.mKeyguardStatusView.setVisibility(0);\n this.mKeyguardStatusView.setAlpha(1.0f);\n }\n }",
"public void startActivity(final Intent intent) {\n Bitmap screenBitmap = this.getScreenBitmap(this.container);\n\n this.container.addView(this.createBackground());\n\n int width = DeviceUtil.getScreenWidth(activity);\n int height = DeviceUtil.getScreenHeight(activity);\n\n createLeftMask(screenBitmap, width, height);\n createRightMask(screenBitmap, width, height);\n screenBitmap.recycle();//Has to be after createLeftMaskImageView and createRightMaskImageView\n\n startLeftMaskAnimation(intent, width);\n startRightMaskAnimation(width);\n }",
"@Override\n\t\t\t\t\t\t\tpublic void onAnimationEnd(Animator arg0) {\n\t\t\t\t\t\t\t\tLog.v(\"Main activity\",\"animation ended\");\n\t\t\t\t\t\t\t\tisLeft=!isLeft;\n\t\t\t\t\t\t\t}",
"@Override\n\t\tpublic void onClick(View v) {\n\t\t\ttextView.setVisibility(View.GONE);\n\t\t\tbar.setVisibility(View.GONE);\n\t\t\tlookButton.setVisibility(View.GONE);\n\t\t\texitButton.setVisibility(View.GONE);\n\n\t\t\tmyImageView.setVisibility(View.VISIBLE);\n\t\t\tmyImageView2.setVisibility(View.VISIBLE);\n\t\t\tmyImageView3.setVisibility(View.VISIBLE);\n\t\t\tmyImageView4.setVisibility(View.VISIBLE);\n\t\t}",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_s);\n TampilGambar.startAnimation(animScale);\n suaraS.start();\n }",
"private void prepareAnimations() {\n scaleTo0Overshot = AnimationUtils.loadAnimation(this, R.anim.scale_100_to_0_anticipate);\n scaleTo0Overshot.setAnimationListener(new Animation.AnimationListener() {\n @Override\n public void onAnimationStart(Animation animation) {\n //do nothing\n }\n\n @Override\n public void onAnimationEnd(Animation animation) {\n fab.setVisibility(View.GONE);\n }\n\n @Override\n public void onAnimationRepeat(Animation animation) {\n //do nothing\n }\n });\n\n scaleTo100Overshot = AnimationUtils.loadAnimation(this, R.anim.scale_0_to_100_overshot);\n scaleTo100Overshot.setAnimationListener(new Animation.AnimationListener() {\n @Override\n public void onAnimationStart(Animation animation) {\n fab.setVisibility(View.VISIBLE);\n }\n\n @Override\n public void onAnimationEnd(Animation animation) {\n //do nothing\n }\n\n @Override\n public void onAnimationRepeat(Animation animation) {\n //do nothing\n }\n });\n }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_g);\n TampilGambar.startAnimation(animScale);\n suaraG.start();\n }",
"public void mapImageProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapImageBinding.tourMapImageProgress.getVisibility() != View.GONE) {\n tabTourMapImageBinding.tourMapImageProgress.setVisibility(View.GONE);\n }\n if (tabTourMapImageBinding.tourMapImageLayout.getVisibility() != View.VISIBLE) {\n tabTourMapImageBinding.tourMapImageLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }",
"public void e()\n/* */ {\n/* 193 */ if (!this.g) {\n/* 194 */ AnimatorSet localAnimatorSet = new AnimatorSet();\n/* 195 */ localAnimatorSet.play(a(this.b)).with(b(this.c));\n/* 196 */ localAnimatorSet.setDuration(this.f).start();\n/* 197 */ this.c.setVisibility(View.VISIBLE);\n/* 198 */ this.g = true;\n/* */ }\n/* */ }",
"@Override\n public void onClick(View v) {\n TampilGambar.setImageResource(R.drawable.pop_c);\n TampilGambar.startAnimation(animScale);\n suaraC.start();\n }",
"public void animationTakeHit(ImageView m){\n animation = AnimationUtils.loadAnimation(context,R.anim.anim_recibir_golpe);\n m.startAnimation(animation);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmImg.startAnimation(mAnimation);\n\t\t\t}",
"public void showProgress() {\n img_left_action.setVisibility(View.GONE);\n search_progress.setAlpha(0.0f);\n search_progress.setVisibility(View.VISIBLE);\n ObjectAnimator.ofFloat(search_progress, \"alpha\", 0.0f, 1.0f).start();\n }",
"@Override\n\t public void onClick(View v) {\n \t\tkfja.setVisibility(View.VISIBLE);\n \t\t croa.setVisibility(View.INVISIBLE);\n \t\t dancea.setVisibility(View.INVISIBLE);\n \t\t starters.setVisibility(View.INVISIBLE);\n \t\t smia.setVisibility(View.INVISIBLE);\n \t\t diz1.setVisibility(View.INVISIBLE); \n \t\t\t diz2.setVisibility(View.INVISIBLE);\n \t\t\t plaa.setVisibility(View.INVISIBLE);\n \t\t\tstarteres.setVisibility(View.INVISIBLE);\n \t \t\t diz3.setVisibility(View.INVISIBLE); \n \t\t\t diz4.setVisibility(View.INVISIBLE);\n \t\t\ttjza.setVisibility(View.INVISIBLE);\n \t startAnimationkfj();\n \t b = 0 ;\n \t player.stop();\n \t }"
] | [
"0.65333456",
"0.6519225",
"0.649921",
"0.6463469",
"0.64318717",
"0.63530797",
"0.628581",
"0.62765765",
"0.6239319",
"0.6231104",
"0.6223954",
"0.6191322",
"0.6176798",
"0.6147191",
"0.6124933",
"0.61165166",
"0.60839444",
"0.599561",
"0.5983472",
"0.59533364",
"0.5939821",
"0.5938453",
"0.59068036",
"0.5899751",
"0.5878969",
"0.5874684",
"0.5870302",
"0.58398354",
"0.5833067",
"0.58325094",
"0.5811228",
"0.58089596",
"0.58040935",
"0.57922447",
"0.5790168",
"0.57898694",
"0.578362",
"0.5774714",
"0.5758837",
"0.57541263",
"0.5751193",
"0.5748421",
"0.5743994",
"0.5729151",
"0.5719496",
"0.57173747",
"0.5714522",
"0.571093",
"0.5710387",
"0.5710196",
"0.57093817",
"0.5704923",
"0.5698715",
"0.56950575",
"0.5690613",
"0.56847686",
"0.5681123",
"0.5680859",
"0.5679296",
"0.5677836",
"0.56686866",
"0.56636775",
"0.5662026",
"0.56558615",
"0.56533736",
"0.56524646",
"0.56501555",
"0.5646528",
"0.5644288",
"0.56417966",
"0.5640064",
"0.5638944",
"0.56329566",
"0.5630003",
"0.5629174",
"0.5626509",
"0.5623985",
"0.5622876",
"0.5621742",
"0.56179947",
"0.56166095",
"0.56159663",
"0.5615261",
"0.5615127",
"0.5610785",
"0.5608274",
"0.5605904",
"0.56053513",
"0.5603141",
"0.5598837",
"0.55854213",
"0.55824995",
"0.55794907",
"0.5573311",
"0.55717856",
"0.5571137",
"0.5569968",
"0.55670923",
"0.5566909",
"0.5557054"
] | 0.7594674 | 0 |
Inflate the menu; this adds items to the action bar if it is present. | @Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}",
"public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}",
"@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}",
"public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}",
"@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}",
"@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}",
"@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}",
"@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }",
"@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }"
] | [
"0.72473437",
"0.7202402",
"0.71960324",
"0.7177793",
"0.7108265",
"0.7040525",
"0.70388484",
"0.70126176",
"0.70101976",
"0.6981143",
"0.69461405",
"0.694",
"0.69346833",
"0.69183874",
"0.69183874",
"0.6891571",
"0.6884306",
"0.68758994",
"0.687534",
"0.68627334",
"0.68627334",
"0.68627334",
"0.68627334",
"0.6853258",
"0.6847784",
"0.6820167",
"0.68177783",
"0.68134266",
"0.68132955",
"0.68132955",
"0.6806282",
"0.68011856",
"0.6798178",
"0.67916524",
"0.67897713",
"0.6788724",
"0.6783952",
"0.6759952",
"0.6757919",
"0.6748738",
"0.67445415",
"0.67445415",
"0.6741439",
"0.67401767",
"0.6726359",
"0.6724678",
"0.6723058",
"0.6723058",
"0.6721303",
"0.67123276",
"0.670777",
"0.67050874",
"0.670039",
"0.66992784",
"0.6697299",
"0.6695259",
"0.6686728",
"0.668404",
"0.668404",
"0.6683142",
"0.668091",
"0.66799283",
"0.6677784",
"0.6669004",
"0.66677624",
"0.66630834",
"0.66577506",
"0.66577506",
"0.66577506",
"0.6656902",
"0.66553235",
"0.66553235",
"0.66553235",
"0.66530025",
"0.66522014",
"0.6650771",
"0.66497517",
"0.6647805",
"0.66470283",
"0.66469866",
"0.6646818",
"0.6645723",
"0.66454786",
"0.66439635",
"0.66434425",
"0.6642393",
"0.6639529",
"0.6635146",
"0.6634077",
"0.6632954",
"0.66327274",
"0.66327274",
"0.66327274",
"0.66297686",
"0.66288346",
"0.66275346",
"0.66271275",
"0.6625066",
"0.6621276",
"0.6619167",
"0.6619167"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.