InputProvider.java 978 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package me.hammerle.snuviscript.inputprovider;
  2. import me.hammerle.snuviscript.code.Script;
  3. public abstract class InputProvider {
  4. public Object get(Script sc) {
  5. throw new ClassCastException();
  6. }
  7. public byte getByte(Script sc) {
  8. return (byte) getDouble(sc);
  9. }
  10. public short getShort(Script sc) {
  11. return (short) getDouble(sc);
  12. }
  13. public int getInt(Script sc) {
  14. return (int) getDouble(sc);
  15. }
  16. public long getLong(Script sc) {
  17. return (long) getDouble(sc);
  18. }
  19. public float getFloat(Script sc) {
  20. return (float) getDouble(sc);
  21. }
  22. public double getDouble(Script sc) {
  23. throw new ClassCastException();
  24. }
  25. public String getString(Script sc) {
  26. throw new ClassCastException();
  27. }
  28. public boolean getBoolean(Script sc) {
  29. throw new ClassCastException();
  30. }
  31. public void set(Script sc, Object o) {
  32. throw new ClassCastException();
  33. }
  34. }