ExpLength.java

Go to the documentation of this file.
00001 package plp.expressions1.expression;
00002 
00003 import plp.expressions1.util.Tipo;
00004 
00008 public class ExpLength extends ExpUnaria {
00009 
00015         public ExpLength(Expressao exp) {
00016                 super(exp, "length");
00017         }
00018 
00022         public Valor avaliar(){
00023                 return new ValorInteiro (((ValorString)getExp().avaliar()).valor().length());
00024         }
00025 
00032         protected boolean checaTipoElementoTerminal() {
00033                 return (getExp().getTipo().eString());
00034         }
00035 
00041         public Tipo getTipo() {
00042                 return Tipo.TIPO_INTEIRO;
00043         }
00044 
00045 }

Generated on Tue Sep 12 21:51:57 2006 for PLP by  doxygen 1.4.7