JS: removed unused JsContext methods
This commit is contained in:
@@ -12,16 +12,11 @@ import org.jetbrains.annotations.Nullable;
|
|||||||
* node.
|
* node.
|
||||||
*/
|
*/
|
||||||
public abstract class JsContext<T extends JsNode> {
|
public abstract class JsContext<T extends JsNode> {
|
||||||
public abstract boolean canInsert();
|
|
||||||
|
|
||||||
public abstract boolean canRemove();
|
|
||||||
|
|
||||||
public abstract <R extends T> void insertAfter(R node);
|
public abstract <R extends T> void insertAfter(R node);
|
||||||
|
|
||||||
public abstract <R extends T> void insertBefore(R node);
|
public abstract <R extends T> void insertBefore(R node);
|
||||||
|
|
||||||
public abstract boolean isLvalue();
|
|
||||||
|
|
||||||
public abstract void removeMe();
|
public abstract void removeMe();
|
||||||
|
|
||||||
public abstract <R extends T> void replaceMe(R node);
|
public abstract <R extends T> void replaceMe(R node);
|
||||||
|
|||||||
-34
@@ -40,16 +40,6 @@ public class JsVisitorWithContextImpl extends JsVisitorWithContext {
|
|||||||
private List<T> collection;
|
private List<T> collection;
|
||||||
private int index;
|
private int index;
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInsert() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canRemove() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <R extends T> void insertAfter(R node) {
|
public <R extends T> void insertAfter(R node) {
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
@@ -62,11 +52,6 @@ public class JsVisitorWithContextImpl extends JsVisitorWithContext {
|
|||||||
collection.add(index++, (T) node);
|
collection.add(index++, (T) node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isLvalue() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeMe() {
|
public void removeMe() {
|
||||||
collection.remove(index--);
|
collection.remove(index--);
|
||||||
@@ -98,25 +83,11 @@ public class JsVisitorWithContextImpl extends JsVisitorWithContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class LvalueContext extends NodeContext<JsExpression> {
|
private class LvalueContext extends NodeContext<JsExpression> {
|
||||||
@Override
|
|
||||||
public boolean isLvalue() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class NodeContext<T extends JsNode> extends JsContext<T> {
|
private class NodeContext<T extends JsNode> extends JsContext<T> {
|
||||||
protected T node;
|
protected T node;
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canInsert() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canRemove() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <R extends T> void insertAfter(R node) {
|
public <R extends T> void insertAfter(R node) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
@@ -127,11 +98,6 @@ public class JsVisitorWithContextImpl extends JsVisitorWithContext {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isLvalue() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeMe() {
|
public void removeMe() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
|||||||
Reference in New Issue
Block a user