InputProvider.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package me.hammerle.snuviscript.code;
  2. import me.hammerle.snuviscript.variable.Variable;
  3. public abstract class InputProvider
  4. {
  5. public Object get(Script sc) throws Exception
  6. {
  7. throw new ClassCastException();
  8. }
  9. public byte getByte(Script sc) throws Exception
  10. {
  11. return (byte) getDouble(sc);
  12. }
  13. public short getShort(Script sc) throws Exception
  14. {
  15. return (short) getDouble(sc);
  16. }
  17. public int getInt(Script sc) throws Exception
  18. {
  19. return (int) getDouble(sc);
  20. }
  21. public long getLong(Script sc) throws Exception
  22. {
  23. return (long) getDouble(sc);
  24. }
  25. public float getFloat(Script sc) throws Exception
  26. {
  27. return (float) getDouble(sc);
  28. }
  29. public double getDouble(Script sc) throws Exception
  30. {
  31. throw new ClassCastException();
  32. }
  33. public String getString(Script sc) throws Exception
  34. {
  35. throw new ClassCastException();
  36. }
  37. public boolean getBoolean(Script sc) throws Exception
  38. {
  39. throw new ClassCastException();
  40. }
  41. public Variable getVariable(Script sc) throws Exception
  42. {
  43. throw new ClassCastException();
  44. }
  45. public void set(Script sc, Object o) throws Exception
  46. {
  47. throw new ClassCastException();
  48. }
  49. public Object getArray(Script sc) throws Exception
  50. {
  51. return null;
  52. }
  53. public boolean isArray(Script sc)
  54. {
  55. return false;
  56. }
  57. }