RefreshQ

owly

闇の伝説
Staff member
戦闘 コーダー
@fukurou
Java:
public class RefreshQ extends UniqueItemSizeLimitedPriorityQueue{
    public void removeItem(String item){
        super.elements.remove(item);
    }

    @Override
    public void add(String item) {
        // FILO
        if (super.contains(item)){
            removeItem(item);
        }
        super.add(item);
    }
}

 

fukurou

the supreme coder
ADMIN
Python:
class RefreshQ(UniqueItemSizeLimitedPriorityQueue):
    def __init__(self, limit: int):
        super().__init__(limit)

    def removeItem(self,item:str):
        super().getAsList().remove(item)

    def insert(self, data):
        # FILO 1st in last out
        if super().contains(data):
            self.removeItem(data)
        super().insert(data)


team fuki doesn't fuck around!
 

fukurou

the supreme coder
ADMIN
Python:
class RefreshQ(UniqueItemSizeLimitedPriorityQueue):
    def __init__(self, limit: int):
        super().__init__(limit)

    def removeItem(self, item: str):
        super().getAsList().remove(item)

    def insert(self, data):
        # FILO 1st in last out
        if super().contains(data):
            self.removeItem(data)
        super().insert(data)
 

fukurou

the supreme coder
ADMIN
Swift:
class RefreshQ:UniqueItemsPriorityQue{
    func removeItem(item:String) {
        super.p1.elements.removeAll(where: { $0 == item })
    }
    override func input(in1: String) {
        // FILO
        if super.contains(str: in1){
            removeItem(item: in1)
        }
        super.input(in1: in1)
    }
}
 
Top