public class TriplesList extends Object implements TempTriples
| Modifier and Type | Class and Description |
|---|---|
static class |
TriplesList.TriplesListIterator
Iterator implementation to iterate over a TriplesList object
|
| Constructor and Description |
|---|
TriplesList(HDTOptions specification)
Constructor, given an order to sort by
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear all triples, resulting in an empty triples section.
|
void |
close() |
void |
generateIndex(ProgressListener listener)
Generates the associated Index
|
long |
getNumberOfElements() |
TripleComponentOrder |
getOrder()
Gets the currently set order(TripleComponentOrder)
|
String |
getType() |
boolean |
insert(long subject,
long predicate,
long object)
Add one triple
|
boolean |
insert(TripleID... triples)
Adds one or more triples
|
void |
load(InputStream input,
ControlInfo controlInformation,
ProgressListener listener)
Loads the structure from an InputStream
|
void |
load(TempTriples input,
ProgressListener listener)
Loads triples from another Triples Structure
|
void |
load(Triples triples,
ProgressListener listener)
Load triples from another instance.
|
void |
loadIndex(InputStream input,
ControlInfo ci,
ProgressListener listener)
Loads the associated Index from an InputStream
|
void |
mapFromFile(CountInputStream in,
File f,
ProgressListener listener) |
void |
mapIndex(CountInputStream input,
File f,
ControlInfo ci,
ProgressListener listener)
Loads the associated Index from an InputStream
|
void |
populateHeader(Header header,
String rootNode) |
boolean |
reallocateIfEmpty(int numTriples)
A method for setting the size of the arrayList (so no reallocation occurs).
|
boolean |
remove(TripleID... patterns)
Deletes one or more triples according to a pattern
|
void |
removeDuplicates(ProgressListener listener)
If called while triples not sorted nothing will happen!
|
void |
replaceAllIds(DictionaryIDMapping mapSubj,
DictionaryIDMapping mapPred,
DictionaryIDMapping mapObj) |
void |
save(OutputStream output,
ControlInfo controlInformation,
ProgressListener listener)
Serializes the triples to an OutputStream
|
void |
saveIndex(OutputStream output,
ControlInfo ci,
ProgressListener listener)
Saves the associated Index to an OutputStream
|
IteratorTripleID |
search(TripleID pattern) |
IteratorTripleID |
searchAll() |
void |
setOrder(TripleComponentOrder order)
Sets a type of order(TripleComponentOrder)
|
long |
size() |
void |
sort(ProgressListener listener)
Sorts the triples based on the order(TripleComponentOrder) of the
triples.
|
String |
toString() |
public TriplesList(HDTOptions specification)
order - The order to sort bypublic boolean reallocateIfEmpty(int numTriples)
public IteratorTripleID search(TripleID pattern)
public IteratorTripleID searchAll()
public long getNumberOfElements()
getNumberOfElements in interface Triplespublic void save(OutputStream output, ControlInfo controlInformation, ProgressListener listener) throws IOException
TriplesPrivatesave in interface TriplesPrivateoutput - The OutputStream to save the triples toIOExceptionpublic void load(InputStream input, ControlInfo controlInformation, ProgressListener listener) throws IOException
TriplesPrivateload in interface TriplesPrivateinput - The InputStream to load the file fromIOExceptionpublic void load(TempTriples input, ProgressListener listener)
TriplesPrivateload in interface TriplesPrivateinput - The TempTriples input to load frompublic void setOrder(TripleComponentOrder order)
TempTriplessetOrder in interface TempTriplesorder - the order to setpublic TripleComponentOrder getOrder()
TempTriplesgetOrder in interface TempTriplespublic boolean insert(TripleID... triples)
TempTriplesinsert in interface TempTriplestriples - The triples to be insertedpublic boolean insert(long subject,
long predicate,
long object)
TempTriplesinsert in interface TempTriplespublic boolean remove(TripleID... patterns)
TempTriplesremove in interface TempTriplespatterns - The pattern to match againstpublic void sort(ProgressListener listener)
TempTriplessort in interface TempTriplespublic void removeDuplicates(ProgressListener listener)
removeDuplicates in interface TempTriplespublic void populateHeader(Header header, String rootNode)
populateHeader in interface Triplespublic void generateIndex(ProgressListener listener)
TriplesPrivategenerateIndex in interface TriplesPrivatepublic void loadIndex(InputStream input, ControlInfo ci, ProgressListener listener) throws IOException
TriplesPrivateloadIndex in interface TriplesPrivateinput - The InputStream to load the index fromIOExceptionpublic void saveIndex(OutputStream output, ControlInfo ci, ProgressListener listener) throws IOException
TriplesPrivatesaveIndex in interface TriplesPrivateoutput - The OutputStream to save the indexIOExceptionpublic void clear()
TempTriplesclear in interface TempTriplespublic void load(Triples triples, ProgressListener listener)
TempTriplesload in interface TempTriplespublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void mapFromFile(CountInputStream in, File f, ProgressListener listener) throws IOException
mapFromFile in interface TriplesPrivateIOExceptionpublic void mapIndex(CountInputStream input, File f, ControlInfo ci, ProgressListener listener) throws IOException
TriplesPrivatemapIndex in interface TriplesPrivateinput - The InputStream to load the index fromIOExceptionpublic void replaceAllIds(DictionaryIDMapping mapSubj, DictionaryIDMapping mapPred, DictionaryIDMapping mapObj)
replaceAllIds in interface TempTriplesCopyright © 2018 DataWeb Research. All rights reserved.