Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MH-Tree
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
disa
public
Hulls
MH-Tree
Commits
451fae7e
There was an error fetching the commit references. Please try again later.
Verified
Commit
451fae7e
authored
3 years ago
by
David Procházka
Browse files
Options
Downloads
Patches
Plain Diff
FIX: moved java docs to abstract methods
parent
b5168746
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mhtree/InternalNode.java
+0
-25
0 additions, 25 deletions
src/mhtree/InternalNode.java
src/mhtree/LeafNode.java
+6
-32
6 additions, 32 deletions
src/mhtree/LeafNode.java
src/mhtree/Node.java
+26
-0
26 additions, 0 deletions
src/mhtree/Node.java
with
32 additions
and
57 deletions
src/mhtree/InternalNode.java
+
0
−
25
View file @
451fae7e
...
...
@@ -51,21 +51,11 @@ class InternalNode extends Node implements Serializable {
return
nearestChild
.
orElseThrow
(()
->
new
IllegalStateException
(
"Internal node has no children"
));
}
/**
* Adds {@code object} into this node.
*
* @param object object to be added
*/
@Override
protected
void
addObject
(
LocalAbstractObject
object
)
{
addObjectIntoHull
(
object
);
}
/**
* Returns the list of objects stored in node's descendants.
*
* @return the list of objects stored in node's descendants
*/
@Override
protected
List
<
LocalAbstractObject
>
getObjects
()
{
return
children
...
...
@@ -75,11 +65,6 @@ class InternalNode extends Node implements Serializable {
.
collect
(
Collectors
.
toList
());
}
/**
* Returns the height of this node.
*
* @return the height of this node
*/
@Override
protected
int
getHeight
()
{
return
children
...
...
@@ -89,22 +74,12 @@ class InternalNode extends Node implements Serializable {
.
getMax
()
+
1
;
}
/**
* Adds this node and this node's descendants into {@code nodes}.
*
* @param nodes list of nodes
*/
@Override
protected
void
gatherNodes
(
List
<
Node
>
nodes
)
{
nodes
.
add
(
this
);
children
.
forEach
(
child
->
child
.
gatherNodes
(
nodes
));
}
/**
* Calls {@code gatherLeafNodes} on every child.
*
* @param leafNodes list of leaf nodes
*/
@Override
protected
void
gatherLeafNodes
(
List
<
LeafNode
>
leafNodes
)
{
children
.
forEach
(
child
->
child
.
gatherLeafNodes
(
leafNodes
));
...
...
This diff is collapsed.
Click to expand it.
src/mhtree/LeafNode.java
+
6
−
32
View file @
451fae7e
...
...
@@ -33,22 +33,20 @@ public class LeafNode extends Node implements Serializable {
}
/**
*
Adds {@code object} to the
node's bucket.
*
Returns the number of objects stored in
node's bucket.
*
* @param object object to be added
* @throws BucketStorageException addition of object into bucket exception
* @return the number of objects stored in node's bucket
*/
protected
int
getObjectCount
()
{
return
bucket
.
getObjectCount
();
}
@Override
protected
void
addObject
(
LocalAbstractObject
object
)
throws
BucketStorageException
{
bucket
.
addObject
(
object
);
addObjectIntoHull
(
object
);
}
/**
* Returns a list of objects in node's bucket.
*
* @return a list of objects in node's bucket
*/
@Override
public
List
<
LocalAbstractObject
>
getObjects
()
{
List
<
LocalAbstractObject
>
objects
=
new
ArrayList
<>(
bucket
.
getObjectCount
());
...
...
@@ -60,40 +58,16 @@ public class LeafNode extends Node implements Serializable {
return
objects
;
}
/**
* Returns the number of objects stored in node's bucket.
*
* @return the number of objects stored in node's bucket
*/
protected
int
getObjectCount
()
{
return
bucket
.
getObjectCount
();
}
/**
* Returns the height of this node.
*
* @return the height of this node
*/
@Override
protected
int
getHeight
()
{
return
0
;
}
/**
* Adds this node into {@code nodes}.
*
* @param nodes list of nodes
*/
@Override
protected
void
gatherNodes
(
List
<
Node
>
nodes
)
{
nodes
.
add
(
this
);
}
/**
* Adds this node into {@code leafNodes}.
*
* @param leafNodes list of leaf nodes
*/
@Override
protected
void
gatherLeafNodes
(
List
<
LeafNode
>
leafNodes
)
{
leafNodes
.
add
(
this
);
...
...
This diff is collapsed.
Click to expand it.
src/mhtree/Node.java
+
26
−
0
View file @
451fae7e
...
...
@@ -99,14 +99,40 @@ public abstract class Node implements Serializable {
}
}
/**
* Adds {@code object} into this node, possibly adding {@code object} to the bucket.
*
* @param object object to be added
* @throws BucketStorageException bucket exception
*/
protected
abstract
void
addObject
(
LocalAbstractObject
object
)
throws
BucketStorageException
;
/**
* Returns objects from buckets, such that the leaf node is descendants of the current node.
*
* @return objects from buckets, such that the leaf node is descendants of the current node.
*/
protected
abstract
List
<
LocalAbstractObject
>
getObjects
();
/**
* Returns the height of this node.
*
* @return the height of this node
*/
protected
abstract
int
getHeight
();
/**
* Adds this node and descendants into {@code nodes}.
*
* @param nodes list of nodes
*/
protected
abstract
void
gatherNodes
(
List
<
Node
>
nodes
);
/**
* Adds every descendant leaf node into {@code leafNodes}.
*
* @param leafNodes list of leaf nodes
*/
protected
abstract
void
gatherLeafNodes
(
List
<
LeafNode
>
leafNodes
);
private
void
insertGreedy
(
LocalAbstractObject
object
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment