Class Line<D extends Data,​A extends Address>

  • Type Parameters:
    D - the data type.
    A - the address type.
    All Implemented Interfaces:
    Buffer<D,​A>

    public final class Line<D extends Data,​A extends Address>
    extends java.lang.Object
    implements Buffer<D,​A>
    This is an abstract representation of a cache line.
    • Constructor Summary

      Constructors 
      Constructor Description
      Line​(Matcher<D,​A> matcher)
      Constructs a default (invalid) line.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      D getData​(A address)
      Returns the data associated with the given address.
      boolean isHit​(A address)
      Checks whether the given address causes a hit.
      ru.ispras.fortress.util.Pair<ru.ispras.fortress.data.types.bitvector.BitVector,​ru.ispras.fortress.data.types.bitvector.BitVector> seeData​(ru.ispras.fortress.data.types.bitvector.BitVector index, ru.ispras.fortress.data.types.bitvector.BitVector way)
      Returns data and associated address without changing the state.
      D setData​(A address, D newData)
      Updates the data associated with the given address.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Line

        public Line​(Matcher<D,​A> matcher)
        Constructs a default (invalid) line.
        Parameters:
        matcher - the data-address matcher.
    • Method Detail

      • isHit

        public boolean isHit​(A address)
        Description copied from interface: Buffer
        Checks whether the given address causes a hit.
        Specified by:
        isHit in interface Buffer<D extends Data,​A extends Address>
        Parameters:
        address - the data address.
        Returns:
        true if the address causes a hit; false otherwise.
      • getData

        public D getData​(A address)
        Description copied from interface: Buffer
        Returns the data associated with the given address.
        Specified by:
        getData in interface Buffer<D extends Data,​A extends Address>
        Parameters:
        address - the data address.
        Returns:
        the data object if the address causes a hit; null otherwise.
      • setData

        public D setData​(A address,
                         D newData)
        Description copied from interface: Buffer
        Updates the data associated with the given address.
        Specified by:
        setData in interface Buffer<D extends Data,​A extends Address>
        Parameters:
        address - the data address.
        newData - the new data.
        Returns:
        the old data if they exist; null otherwise.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • seeData

        public ru.ispras.fortress.util.Pair<ru.ispras.fortress.data.types.bitvector.BitVector,​ru.ispras.fortress.data.types.bitvector.BitVector> seeData​(ru.ispras.fortress.data.types.bitvector.BitVector index,
                                                                                                                                                               ru.ispras.fortress.data.types.bitvector.BitVector way)
        Description copied from interface: Buffer
        Returns data and associated address without changing the state.
        Specified by:
        seeData in interface Buffer<D extends Data,​A extends Address>
        Parameters:
        index - Set index.
        way - Line index.
        Returns:
        Pair(Address, Data) or null if it is not found.