I have a serious disconnect when I try to use class methods (of which both classes implement interfaces) that also contain generics. I have an interface SetInterfacethat contains methods for my class Set. The same is true for my interface ProfileInterfaceand class Profile. In my class Profile, I have the following listing type related to the class Set:
private Set<ProfileInterface> followBag = new Set<ProfileInterface>();
We mainly study Array Bags, Linked Bagsetc. in my Data Structures class. My problem is that I want to use the methods of the SetData Structure class in the class Profilethrough Composition. The only problem I am facing is that I need to create a method in my class Profilethat cross-references the elements in the given array to see if this object is Profile“next” different Profileand, if not, recommends that the object performed (the purpose is to perform something similar to that of Twitter or Facebook with a Data Structure). Here is the method that I have created so far, and the error I cannot get (third line above):
public ProfileInterface recommend(){
ProfileInterface recommended;
ProfileInterface thisProfile = new Profile();
for(int index = 0; index < followBag.getCurrentSize(); index++){
ProfileInterface follows = followBag[index];
for(int followedFollowers = 0; followedFollowers < follows.getCurrentSize(); followedFollowers++) {
}
}
return recommended;
}
, , , . , , , , ( ).
Java, . , 5- , . , Profile "" (Composition) Set. , , followBag , ProfileInterface Set. , , , Set ? (thisProfile ) . , :
A) , :
ProfileInterface thisProfile = new Profile();
, , ? , Profile(), thisProfile; ?
B) ProfileInterface thisProfile, thisProfile for?
C) : IntelliJ , "cannot resolve method getCurrentSize()". , follows . , ProfileInterface follows = followBag[index] Profile , , . . , , , , .
, !