Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TODOs after the reshuffle package merge. #123

Merged
merged 5 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Rename the Feature.remove() method in invalidate().
  • Loading branch information
tinevez committed Sep 30, 2020
commit 639a371605e899052ad457ec10121129002ea328
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void set( final O o, final double value )
}

@Override
public void remove( final O o )
public void invalidate( final O o )
{
values.remove( o );
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/mastodon/feature/Feature.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ public interface Feature< T >
public FeatureSpec< ? extends Feature<T>, T > getSpec();

/**
* Removes the specified object from this feature storage.
* Invalidates the value of this feature for the specified object.
* <p>
* This method is used to invalidate a feature value when an object has been
* modified under it.
*
* @param obj
* the object to remove.
*/
// TODO: Would invalidate() be a better name for this method?
public void remove( T obj );
public void invalidate( T obj );
}
2 changes: 1 addition & 1 deletion src/main/java/org/mastodon/feature/IntScalarFeature.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void set( final O o, final int value )
}

@Override
public void remove( final O o )
public void invalidate( final O o )
{
values.remove( o );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public MyVertexPropertyChangeListener( final FeatureModel featureModel, final Cl
@Override
public void propertyChanged( final V v )
{
featuresOfTarget( featureModel, vertexClass ).forEach( f -> f.remove( v ) );
featuresOfTarget( featureModel, vertexClass ).forEach( f -> f.invalidate( v ) );
for ( final Feature< E > f : featuresOfTarget( featureModel, edgeClass ) )
v.edges().forEach( e -> f.remove( e ) );
v.edges().forEach( e -> f.invalidate( e ) );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Spec getSpec()
}

@Override
public void remove( final Link link )
public void invalidate( final Link link )
{
map.remove( link );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Spec getSpec()
}

@Override
public void remove( final Link link )
public void invalidate( final Link link )
{
map.remove( link );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Spec getSpec()
}

@Override
public void remove( final Spot spot )
public void invalidate( final Spot spot )
{}

private static final class MyProjection implements IntFeatureProjection< Spot >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public Spec getSpec()
}

@Override
public void remove( final Spot spot )
public void invalidate( final Spot spot )
{
for ( final DoublePropertyMap< Spot > map : means )
map.remove( spot );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ public Spec getSpec()
}

@Override
public void remove( final Spot spot )
public void invalidate( final Spot spot )
{}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Spec getSpec()
}

@Override
public void remove( final Spot spot )
public void invalidate( final Spot spot )
{
map.remove( spot );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Spec getSpec()
}

@Override
public void remove( final Spot spot )
public void invalidate( final Spot spot )
{
map.remove( spot );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Set< FeatureProjection< O > > projections()
}

@Override
public void remove( final O obj )
public void invalidate( final O obj )
{
for ( final DoublePropertyMap< O > map : doublePropertyMapMap.values() )
map.remove( obj );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Spec getSpec()
}

@Override
public void remove( final ExampleSpot obj )
public void invalidate( final ExampleSpot obj )
{}
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public Spec getSpec()
}

@Override
public void remove( final ExampleSpot obj )
public void invalidate( final ExampleSpot obj )
{}
}

Expand Down Expand Up @@ -135,7 +135,7 @@ public Spec getSpec()
}

@Override
public void remove( final ExampleSpot obj )
public void invalidate( final ExampleSpot obj )
{}
}

Expand Down Expand Up @@ -176,7 +176,7 @@ public Spec getSpec()
}

@Override
public void remove( final ExampleSpot obj )
public void invalidate( final ExampleSpot obj )
{}
}

Expand Down