Top Fields Constructors Methods
org.jabref.logic.util.io

public Class FileHistory

extends ModifiableObservableListBase<Path>
Class Inheritance
Imports
java.nio.file.Path, java.util.ArrayList, .List, javafx.collections.ModifiableObservableListBase

Field Summary

Modifier and TypeField and Description
private final List<Path>
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected void
doAdd(int
the position where to add the element
index
,
Path
the element that will be added
element
)

Implements abstract javafx.collections.ModifiableObservableListBase.doAdd.

Adds the element to the List at the position of index.

protected Path
doRemove(int
the index of the removed element
index
)

Implements abstract javafx.collections.ModifiableObservableListBase.doRemove.

Removes the element at position of index.

protected Path
doSet(int
the position where to set the element
index
,
Path
the element that will be set at the specified position
element
)

Implements abstract javafx.collections.ModifiableObservableListBase.doSet.

Sets the element in the List at the position of index.

public Path
get(int
index of the element to return
index
)

Implements abstract javafx.collections.ModifiableObservableListBase.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.

public void
newFile(Path file)

Adds the file to the top of the list.

public static FileHistory
of(List<Path>
the single element
list
)

Hides java.util.List.of.

Returns an unmodifiable list containing one element.

public void
public int
size()

Implements abstract javafx.collections.ModifiableObservableListBase.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.

Inherited from javafx.collections.ModifiableObservableListBase:
addaddAlladdAllremoveremoveremoveAllremoveRangeretainAllsetsetAllsubList

Field Detail

historyback to summary
private final List<Path> history
HISTORY_SIZEback to summary
private static final int HISTORY_SIZE

Constructor Detail

FileHistoryback to summary
private FileHistory(List<Path> list)

Method Detail

doAddback to summary
protected void doAdd(int index, Path element)

Implements abstract javafx.collections.ModifiableObservableListBase.doAdd.

Doc from javafx.collections.ModifiableObservableListBase.doAdd.

Adds the element to the List at the position of index.

For the description of possible exceptions, please refer to the documentation of add(java.lang.Object) method.

Parameters
index:int

the position where to add the element

element:Path

the element that will be added

Annotations
@Override
doRemoveback to summary
protected Path doRemove(int index)

Implements abstract javafx.collections.ModifiableObservableListBase.doRemove.

Doc from javafx.collections.ModifiableObservableListBase.doRemove.

Removes the element at position of index.

Parameters
index:int

the index of the removed element

Returns:Path

the removed element

Annotations
@Override
doSetback to summary
protected Path doSet(int index, Path element)

Implements abstract javafx.collections.ModifiableObservableListBase.doSet.

Doc from javafx.collections.ModifiableObservableListBase.doSet.

Sets the element in the List at the position of index.

For the description of possible exceptions, please refer to the documentation of set(int, java.lang.Object) method.

Parameters
index:int

the position where to set the element

element:Path

the element that will be set at the specified position

Returns:Path

the old element at the specified position

Annotations
@Override
getback to summary
public Path get(int index)

Implements abstract javafx.collections.ModifiableObservableListBase.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:Path

the element at the specified position in this list

Annotations
@Override
newFileback to summary
public void newFile(Path file)

Adds the file to the top of the list. If it already is in the list, it is merely moved to the top.

ofback to summary
public static FileHistory of(List<Path> list)

Hides java.util.List.of.

Doc from java.util.List.of.

Returns an unmodifiable list containing one element. See Unmodifiable Lists for details.

Parameters
list:List<Path>

the single element

Returns:FileHistory

a List containing the specified element

removeItemback to summary
public void removeItem(Path file)
sizeback to summary
public int size()

Implements abstract javafx.collections.ModifiableObservableListBase.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list