/*
 * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Mateusz Parzonka - initial API and implementation
 */
package prm4j.indexing.realtime;

import javax.naming.OperationNotSupportedException;

import prm4j.indexing.BaseMonitor;
import prm4j.indexing.staticdata.MetaNode;

public class NullNode implements Node {

    public final static Node instance = new NullNode();
    private final static MonitorSet EMPTY_MONITOR_SET = new MonitorSet();
    private final static MonitorSet[] EMPTY_MONITOR_SETS = new MonitorSet[0];

    @Override
    public LowLevelBinding getKey() {
	return null;
    }

    public Node instance() {
	return instance;
    }

    @Override
    public Node next() {
	throw new RuntimeException(new OperationNotSupportedException());
    }

    @Override
    public void setNext(Node nextEntry) {
	throw new RuntimeException(new OperationNotSupportedException());
    }

    @Override
    public MetaNode getMetaNode() {
	return null;
    }

    @Override
    public BaseMonitor getMonitor() {
	return null;
    }

    @Override
    public void setMonitor(BaseMonitor monitor) {
	throw new RuntimeException(new OperationNotSupportedException());
    }

    @Override
    public Node getNode(LowLevelBinding binding) {
	return null;
    }

    @Override
    public Node getNodeNonCreative(LowLevelBinding binding) {
	return null;
    }

    @Override
    public void remove(LowLevelBinding binding) {
	throw new RuntimeException(new OperationNotSupportedException());
    }

    @Override
    public MonitorSet getMonitorSet(int monitorSetId) {
	return EMPTY_MONITOR_SET;
    }

    @Override
    public MonitorSet[] getMonitorSets() {
	return EMPTY_MONITOR_SETS;
    }

}

@@ -409,61 +409,8 @@
 e;%0A%0A
-import javax.naming.OperationNotSupportedException;%0A%0A
 impo
@@ -915,50 +915,28 @@
 new 
-RuntimeException(new OperationNotSupported
+UnsupportedOperation
 Exce
@@ -934,33 +934,32 @@
 ationException()
-)
 ;%0A    %7D%0A%0A    @Ov
@@ -1022,50 +1022,28 @@
 new 
-RuntimeException(new OperationNotSupported
+UnsupportedOperation
 Exce
@@ -1041,33 +1041,32 @@
 ationException()
-)
 ;%0A    %7D%0A%0A    @Ov
@@ -1281,50 +1281,28 @@
 new 
-RuntimeException(new OperationNotSupported
+UnsupportedOperation
 Exce
@@ -1300,33 +1300,32 @@
 ationException()
-)
 ;%0A    %7D%0A%0A    @Ov
@@ -1579,50 +1579,28 @@
 new 
-RuntimeException(new OperationNotSupported
+UnsupportedOperation
 Exce
@@ -1606,17 +1606,16 @@
 eption()
-)
 ;%0A    %7D%0A

Switch for more suitable exception in NullNode