Class DiskLruCache.Editor

  • Enclosing class:
    DiskLruCache

    public final class DiskLruCache.Editor
    extends java.lang.Object
    Edits the values for an entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void abort()
      Aborts this edit.
      void abortUnlessCommitted()  
      void commit()
      Commits this edit so it is visible to readers.
      java.io.File getFile​(int index)  
      java.lang.String getString​(int index)
      Returns the last committed value as a string, or null if no value has been committed.
      void set​(int index, java.lang.String value)
      Sets the value at index to value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getString

        public java.lang.String getString​(int index)
                                   throws java.io.IOException
        Returns the last committed value as a string, or null if no value has been committed.
        Throws:
        java.io.IOException
      • getFile

        public java.io.File getFile​(int index)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • set

        public void set​(int index,
                        java.lang.String value)
                 throws java.io.IOException
        Sets the value at index to value.
        Throws:
        java.io.IOException
      • commit

        public void commit()
                    throws java.io.IOException
        Commits this edit so it is visible to readers. This releases the edit lock so another edit may be started on the same key.
        Throws:
        java.io.IOException
      • abort

        public void abort()
                   throws java.io.IOException
        Aborts this edit. This releases the edit lock so another edit may be started on the same key.
        Throws:
        java.io.IOException
      • abortUnlessCommitted

        public void abortUnlessCommitted()